Two qubits and CNOT
Use control and target correctly and read Qiskit bit ordering.
Intuition
Two qubits need four basis labels: 00, 01, 10, 11. CNOT flips the target when the control is 1. On a superposition it acts coherently on every basis component.
We write |q1 q0⟩ to match Qiskit. For CX(0,1), |01⟩ becomes |11⟩ and |11⟩ becomes |01⟩; |00⟩ and |10⟩ stay unchanged. Control and target must be different wires.
The mathematics
Look a little deeper
The two-qubit space is a tensor product of two two-dimensional spaces. For product states, expand (a|0⟩+b|1⟩)⊗(c|0⟩+d|1⟩) to obtain four amplitudes. Not every four-component state factors this way.
Use it
Prepare the Bell state using H and CX in at most two gates. Select control q0 and target q1 for CX(0,1).
This exercise uses the same server-side state and circuit checks as its linked practice problem.
Build your circuit
Click a gate to append it, or drag it onto a wire. CX uses the selected control; SWAP uses it as the second operand. Basis order: |qₙ … q₀⟩.
Returned logical circuit · before transpilation · q0 on top
Connect to code
qc.h(0) qc.cx(0, 1)
These operations go inside a circuit-building program. Practice problems provide a complete solve() template.
Check your understanding
First complete the circuit exercise successfully.