A2: Generate State 12(10+01)\frac{1}{\sqrt{2}}\lparen\ket{10}+\ket{01}\rparen

Time Limit: 3 sec

Memory Limit: 512 MiB

Score: 200

Writer: ST12

Editorial

To begin with, we demonstrate the necessary gate operations in the following quantum circuit.

First, we apply a Hadamard (HH) gate to the first qubit.

00H(0)12(00+10)\begin{equation} \ket{00} \xrightarrow{H(0)} \frac{1}{\sqrt{2}} \lparen \ket{00} + \ket{10} \rparen \end{equation}

By applying the Hadamard gate in this way, we can bring the qubit into a superposition state.

Next, we need an operation that transforms 10\ket{10} to 11\ket{11}. For this, we can use a controlled-XX (controlled-X; CXCX) gate with the first qubit as the control and the second qubit as the target. The controlled-XX gate applies an XX gate to the second qubit only when the first qubit is in state 1\ket{1}, acting on 10\ket{10} in particular.

12(00+10)CX(0,1)12(00+11)\begin{equation} \frac{1}{\sqrt{2}} \lparen \ket{00} + \ket{10} \rparen \xrightarrow{CX(0,1)} \frac{1}{\sqrt{2}} \lparen \ket{00} + \ket{11} \rparen \end{equation}

Finally, by applying an XX gate to the first qubit, we arrive at the solution.

12(00+11)X(0)12(10+01)\begin{equation} \frac{1}{\sqrt{2}} \lparen \ket{00} + \ket{11} \rparen \xrightarrow{X(0)} \frac{1}{\sqrt{2}} \lparen \ket{10} + \ket{01} \rparen \end{equation}

Sample Code

Below is a sample program:

from qiskit import QuantumCircuit
 
 
def solve() -> QuantumCircuit:
    qc = QuantumCircuit(2)
 
    qc.h(0)
    qc.cx(0, 1)
    qc.x(0)
 
    return qc

Supplementary Information

  • Measuring either qubit in the state 12(10+01)\frac{1}{\sqrt{2}} (\ket{10} + \ket{01}) will determine the outcome of the other qubit. This phenomenon is known as quantum entanglement.
  • The controlled gate can be generalized to the multi-controlled gate which operates upon multiple control qubits. This modifies computational basis states wherein all control qubits are in the state 1\ket{1}.