Computing Library › Quantum Error Correction
Quantum Error Correction

The Five-Qubit Perfect Code

The [[5,1,3]] code is the smallest possible code correcting an arbitrary single-qubit error, saturating the quantum Hamming bound.

The smallest full code

The five-qubit code encodes one logical qubit in five physical qubits with distance 3, written [[5,1,3]]. No code with fewer than five physical qubits can correct an arbitrary single-qubit error, so this code is optimal in size. It is called perfect because it saturates the quantum Hamming bound: its syndromes exactly enumerate the correctable errors with none wasted.

The counting argument

Kronos motion — error correction

For n physical qubits and k logical qubits correcting all single-qubit errors, there are 3n single-qubit Paulis plus the identity, so 3n+1 error classes, each needing a distinct syndrome for the 2^k encoded dimensions. The bound is (3n+1) 2^k <= 2^n. For k=1, n=5: (15+1)*2 = 32 = 2^5, an exact equality. This is why five qubits is the minimum and why the code is perfect.

Its four stabilizer generators are cyclic permutations of X Z Z X I:

Trade-offs

Unlike the Steane code, the five-qubit code is not a CSS code, because its stabilizers mix X and Z on the same qubits. As a consequence its logical Clifford gates are not simply transversal, which makes fault-tolerant operation more awkward despite its minimal size.

The five-qubit code is important theoretically as the extremal example that pins down the quantum Hamming bound, and it appears in experiments precisely because five qubits is a reachable scale. For scalable fault tolerance, however, codes with geometrically local checks such as the surface code are preferred over these small dense codes.