Intuition
Two bits have four labels. Two qubits also use four basis labels, with a complex amplitude at each label. This register convention puts q0 on the left, so exciting q0 in a two-wire register gives |10⟩.
CNOT applies X to the target for the part of the state with control value one. The control remains part of the state and evolves coherently with the target.
Learning objectives
- Compute tensor-product coordinates
- Read controls in a circuit
- Trace CNOT, CZ, and SWAP
Interactive exploration
Use the controls to change the state and see its calculated readout. You can return to this experiment as you work through the derivation.
Circuit composer
q0 = leftmost bit- CX q1 · q0
- CX q0 · q1
- CX q1 · q0
State at step 3
4 amplitudesEach shot independently prepares this step’s state. A dense simulator stores 2ⁿ complex amplitudes for n wires. The composer is capped at six wires.
Mathematical foundation
The tensor product lists all pairwise products in binary order. The first factor supplies the leftmost bit.
CNOT preserves the control bit and XORs it into the target. CZ changes the sign of |11⟩. A SWAP exchanges the two basis labels and can be built from three CNOTs with alternating controls.
Worked example
Prepare |+⟩⊗|0⟩, which places weight at 00 and 10. Under CNOT with q0 as control, 00 stays fixed and 10 becomes 11. Linearity gives equal amplitudes at 00 and 11.
Guided experiment
Inspect the three-CNOT SWAP example. Change the basis input between |01⟩ and |10⟩, and compare intermediate and final labels.
Go to the controlsCompare with the expected result
An operation can have an equivalent implementation using a different gate sequence.
Understanding check
Next steps
Want to keep your results? Start your learning journey
Open Circuit Composer