Editorial
The objective is to prepare a uniform superposition of the two computational basis states and .
First, observe that applying the Hadamard gate to the first (and leftmost) qubit of effects the transformation
Since the target state is , our goal is achieved if we can somehow transition the computational basis state in Equation to .
Such a transition is achieved by using a controlled gate. These can apply a quantum gate upon only the desired computational basis state(s) in the superposition state.
The controlled gate operates upon two qubits. One is called the "control qubit" and the other is the "target qubit". The controlled gate modifies the state of the target qubit only when the control qubit is in state , but does nothing if it is .
In this problem, we can apply a controlled-NOT gate (concisely notated as ) upon the plus state, treating the first (leftmost) qubit as the control qubit, and the second (rightmost) qubit as the target qubit. This effects the Pauli gate upon the target qubit, flipping its classical bit in all computational basis states where the control qubit has classical bit . Basis state is unmodified, but state becomes .
Sample Code
Below is a sample program:
from qiskit import QuantumCircuit
def solve() -> QuantumCircuit:
qc = QuantumCircuit(2)
qc.h(0)
# qc.cx(control qubit, target qubit)
qc.cx(0, 1)
return qc
Supplementary Information
- The state is known as the Bell state.
- Measuring either qubit in the Bell state 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 .