Editorial
The objective is to prepare a uniform superposition state of the two computational basis states and .
First, apply a Hadamard gate to the st qubit:
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, apply a controlled (controlled-X; ) gate with the st qubit as the control qubit and the nd as the target qubit. The gate flips the target qubit only in the computational basis state , where the st qubit is .
Sample Code
Below is a sample program:
from qiskit import QuantumCircuit
def solve() -> QuantumCircuit:
qc = QuantumCircuit(2)
qc.h(0)
# qc.cx(制御ビットのインデックス, 標的ビットのインデックス)
qc.cx(0, 1)
return qcSupplementary 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 .