Overview
Quantum error correction protects quantum information by storing it in a carefully chosen subspace of a larger system, the code space, so that the errors expected from the environment move the state in ways that can be detected and reversed. The first codes were found by Shor and Steane; the general theory, including the exact condition for a set of errors to be correctable, is due to Knill and Laflamme and Bennett, DiVincenzo, Smolin and Wootters.
This page states that theory at the level of arbitrary codes. The stabilizer formalism, which describes most codes used in practice, and the question of performing operations fault-tolerantly are separate topics.
Intuition
Three facts seem to rule out correcting quantum errors the way classical data is protected, and each has an answer.
- A state cannot be copied. Redundancy is obtained by entangling, not copying: becomes , which is not three copies of the state.
- Measuring destroys superpositions. One measures only which error happened, never the encoded amplitudes. In the three-qubit example one measures the parities and , which have the same value on and and so reveal nothing about and .
- Errors form a continuum. Any single-qubit error is a linear combination of , , and . Measuring the syndrome projects the state onto one of the discrete cases, so a code that corrects those four corrects every single-qubit error. This is the last sentence of the theorem below.
The lesson Why quantum error correction is possible works through these three points with explicit calculations.
Prerequisites
Density operators and completely positive maps (operator-sum representations), the Pauli group, and the tensor-product structure of multi-qubit systems. The Foundations lessons cover what is needed; the repetition code is the gentlest worked example.
Mathematical Definitions
Let be a finite-dimensional Hilbert space. A quantum code is a subspace , the code space; write for the orthogonal projector onto it.
Let be a completely positive map with , the noise. The code corrects if there is a trace-preserving completely positive map , the recovery, such that
The proportionality constant is ; it equals 1 when the noise is trace preserving on the code space. A set of operators is called a correctable set of errors for when the code corrects the map they define.
The distance of a code is the smallest number of systems on which some operator acts with . For physical systems of dimension , , a code of dimension and distance is written . When it encodes logical systems and is written ; the subscript is dropped for qubits.
A code is non-degenerate for a set of errors if the matrix in the correction condition has full rank, so that linearly independent errors take the code space to linearly independent subspaces. It is degenerate otherwise: distinct errors then act identically on the code space and need not be told apart.
Theorems
Let be a quantum code with projector and let be a noise map with operation elements . A recovery channel correcting on exists if and only if
for some complex numbers . The matrix is then Hermitian and positive semidefinite.
Equivalently, for an orthonormal basis of : , with independent of and .
The same recovery then corrects every map whose operation elements are linear combinations of the . This was established independently by Knill and Laflamme and by Bennett, DiVincenzo, Smolin and Wootters; a textbook statement is Theorem 10.1 of Nielsen and Chuang.
- Finite-dimensional Hilbert space and code space with projector .
- Exact recovery is required; approximate recovery obeys a different, weaker condition.
Proof · Proof of the Knill–Laflamme conditions
The matrix is Hermitian and positive semidefinite. Taking the adjoint of gives . For any vector , with , we get .
Sufficiency. Diagonalise with unitary and , . Define . The are operation elements of the same map , and
If then . If , the polar decomposition gives a unitary with . Put . For ,
so the are mutually orthogonal projectors: distinct errors move the code space to orthogonal subspaces. Define
It is trace preserving because . For a state with , using ,
and because . Therefore
and when is trace preserving on . A map with operation elements satisfies the same condition with replaced by and has the same subspaces , so corrects it too.
Necessity. Suppose with operation elements satisfies for all . The left side is a completely positive map with operation elements and the right side one with the single element . Two operator-sum representations of the same map are related by an isometry, so for some complex numbers . Then
and summing over with gives with .
This follows the argument of Knill and Laflamme in the form given in section 10.3 of Nielsen and Chuang.
Two consequences are used constantly.
Detection. An operator is detectable by when . A code has distance exactly when every operator acting on fewer than systems is detectable and some operator on systems is not. A code of distance corrects all errors on systems, because a product of two such errors acts on at most systems.
Erasure. A code of distance corrects the loss of any systems whose positions are known: the relevant products are then supported on those positions.
Any quantum code obeys this inequality. Knill and Laflamme stated it for qubit codes correcting errors, in the form . The code meets it with equality: . The classical Singleton bound is ; the factor of 2 reflects that a code of distance recovers from the erasure of any systems, and by no-cloning the erased systems cannot themselves hold a copy of the encoded state.
- Holds for every quantum code, degenerate or not, with physical systems of equal dimension and .
There are Pauli errors of weight on qubits. In a non-degenerate code each of them, applied to the -dimensional code space, must produce a subspace orthogonal to all the others, and these subspaces must fit in the -dimensional space. Counting dimensions gives the inequality. For and it reads , first satisfied at , where the code meets it with equality (Gottesman).
- Qubit codes ().
- Non-degenerate codes only: distinct Pauli errors of weight at most must have distinct syndromes. The bound is not proved for degenerate codes in general.
Worked Examples
The three-qubit code corrects bit flips and nothing else
Take and the errors , for . For both nonzero, flips two qubits, sending to a weight-2 string and to a weight-1 string, both orthogonal to ; likewise alone. Hence
the condition holds with , and the code is non-degenerate for bit flips.
Now add . Since and ,
which is not a multiple of . A single phase flip acts as the logical operator, so no recovery can undo it: the code has distance 1.
Shor's code is degenerate
In the nine-qubit code of Shor, and act identically on the code space, because is one of the parity checks and fixes every code state. So : the matrix has an off-diagonal entry equal to 1 and is singular. The condition is satisfied, and the recovery never needs to decide which of the two happened.
The smallest code correcting one error
For one logical qubit and the Singleton bound requires and the Hamming bound, for non-degenerate codes, requires , again first true at . The five-qubit code of Laflamme, Miquel, Paz and Zurek achieves it.
Limitations and Common Pitfalls
- The condition is about a specified set of errors. A code "corrects one error" only relative to a noise model in which errors act on single systems. Correlated errors, leakage out of the qubit subspace and loss must be put into the set explicitly.
- Exact correction is stronger than necessary. Requiring on the code space excludes codes that recover with small error. Leung, Nielsen, Chuang and Yamamoto gave a four-qubit code for amplitude damping that violates the exact conditions and still recovers to high fidelity; Bény and Oreshkov give general conditions for approximate correction.
- The Hamming bound is not a bound on all codes. It is proved for non-degenerate codes. The Singleton bound holds for every code.
- Existence of a recovery says nothing about its cost. The theorem guarantees a recovery channel; finding the correction from a measured syndrome is the decoding problem, and doing so with faulty operations is the subject of fault tolerance.
State of the Art
As of 2026-11, repeated error correction that improves as the code grows has been demonstrated in hardware: Google Quantum AI reported surface-code memories of distance 5 and 7 on superconducting qubits whose logical error per cycle falls by a factor of about two for each increase of the distance by two. This statement summarises that one publication; it is not a survey of the experimental literature, which this page does not yet cover.