The Five-Qubit Code
The Shor code uses nine physical qubits to protect one logical qubit against an arbitrary single-qubit error. Can we do better? The five-qubit code, discovered by Laflamme, Miquel, Paz, and Zurek in 1996, is the answer: it is the smallest possible code that corrects any single-qubit error. No four-qubit code can.
The quantum Hamming bound
To correct any single-qubit Pauli error on qubits encoding logical qubits, the distinct error syndromes must fit into the available syndrome space. There are single-qubit Pauli errors (, , on each of qubits) plus the identity, and the code uses stabilizer generators giving syndromes. The quantum Hamming bound requires
For this reads . The smallest satisfying it is , where holds with equality. A code meeting the bound with equality is called perfect: every syndrome corresponds to exactly one correctable error, with none wasted. The five-qubit code is the unique smallest perfect code — denoted : five physical qubits, one logical qubit, distance three.
Its stabilizers
The code is defined by four stabilizer generators. A common choice is the cyclic set
each obtained from the previous one by a cyclic shift of the five qubit positions. The logical codewords are the simultaneous eigenstates of all four. Because the generators mix and on the same qubits, the code is not a CSS code (unlike Steane's, in the next lesson) — its -type and -type checks are entangled together.
Why it matters
- Optimality. It proves a hard floor: you cannot protect a qubit against arbitrary single-qubit noise with fewer than five qubits.
- Density of syndromes. All syndromes are used — one for "no error" and one each for the single-qubit Pauli errors. The decoder is a clean bijection.
- A benchmark. Its compactness makes it a favorite test bed for demonstrating full QEC cycles on early hardware with few qubits.
The trade-off
Perfection in qubit count comes at a price. The five-qubit code lacks the transversal-gate structure that makes CSS codes (Steane, surface) convenient for fault-tolerant computation: most of its logical gates require more elaborate constructions. In practice, codes are chosen for their fault-tolerant gate set and high threshold, not minimal qubit count — which is why the surface code, despite using far more qubits, dominates real devices. Still, as the provably smallest code that does the job, the five-qubit code marks the exact boundary of what quantum error correction can achieve.
Sign in on the full site to ask questions and join the discussion.