Multi-Qubit Circuit Patterns
CX copies a definite 0/1 into a fresh qubit and computes parity, but applied to a superposition it entangles rather than clones — no circuit can copy an unknown quantum state. SWAP moves a state between wires and is usually built from three CX gates.
What do multi-qubit patterns buy you?
Multi-qubit circuits move data and create correlations. Three structures appear constantly, and recognising them on sight makes larger circuits readable:
- Fan-out: writing a known bit's value onto additional qubits.
- Parity: recording whether a group of bits contains an even or odd number of 1s — computed reversibly, without erasing the inputs.
- SWAP: exchanging the complete states of two qubits, usually so data can reach a gate that only exists between neighbouring qubits on real hardware.
All three are built from the controlled-NOT, CX: the gate that flips its target qubit exactly in the part of the state where its control qubit is 1.
You’ve read the opening of chapter 4 — 8 more sections follow, with worked examples and circuits you can run on the page. A free account unlocks every chapter of every course (paid plans aren’t live yet — early readers get everything free).