Skip to main content
KetQat

Appearance

Topic · intermediate

Quantum Error Correction

How quantum information is encoded in a subspace so that noise can be detected and undone without learning the encoded state, the exact conditions for this to work, and the bounds any code must obey.

ExpositionMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

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: α∣0⟩+β∣1⟩\alpha\ket{0} + \beta\ket{1} becomes α∣000⟩+β∣111⟩\alpha\ket{000} + \beta\ket{111}, 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 Z1Z2Z_1 Z_2 and Z2Z3Z_2 Z_3, which have the same value on ∣000⟩\ket{000} and ∣111⟩\ket{111} and so reveal nothing about α\alpha and β\beta.
  • Errors form a continuum. Any single-qubit error is a linear combination of II, XX, YY and ZZ. 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

DefinitionQuantum error-correcting codeEstablished definition

Let H\mathcal{H} be a finite-dimensional Hilbert space. A quantum code is a subspace C⊆HC \subseteq \mathcal{H}, the code space; write PP for the orthogonal projector onto it.

Let E(ρ)=∑aEaρEa†\mathcal{E}(\rho) = \sum_a E_a \rho E_a\dagg be a completely positive map with ∑aEa†Ea≤I\sum_a E_a\dagg E_a \le I, the noise. The code corrects E\mathcal{E} if there is a trace-preserving completely positive map R\mathcal{R}, the recovery, such that

(R∘E)(ρ)  ∝  ρfor every state ρ with PρP=ρ.(\mathcal{R} \circ \mathcal{E})(\rho) \;\propto\; \rho \qquad \text{for every state } \rho \text{ with } P \rho P = \rho .

The proportionality constant is Tr⁡E(ρ)\tr \mathcal{E}(\rho); it equals 1 when the noise is trace preserving on the code space. A set of operators {Ea}\{E_a\} is called a correctable set of errors for CC when the code corrects the map they define.

The distance dd of a code is the smallest number of systems on which some operator EE acts with PEP∝̸PP E P \not\propto P. For nn physical systems of dimension qq, H=(Cq)⊗n\mathcal{H} = (\C^q)^{\otimes n}, a code of dimension KK and distance dd is written ((n,K,d))q((n, K, d))_q. When K=qkK = q^k it encodes kk logical systems and is written [[n,k,d]]q[[n, k, d]]_q; the subscript is dropped for qubits.

A code is non-degenerate for a set of errors {Ea}\{E_a\} if the matrix cabc_{ab} 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

TheoremKnill–Laflamme error-correction conditionsEstablished result

Let CC be a quantum code with projector PP and let E\mathcal{E} be a noise map with operation elements {Ea}\{E_a\}. A recovery channel R\mathcal{R} correcting E\mathcal{E} on CC exists if and only if

P Ea†Eb P  =  cab Pfor all a,b,P\, E_a\dagg E_b\, P \;=\; c_{ab}\, P \qquad \text{for all } a, b,

for some complex numbers cabc_{ab}. The matrix c=(cab)c = (c_{ab}) is then Hermitian and positive semidefinite.

Equivalently, for an orthonormal basis {∣i⟩}\{\ket{i}\} of CC: ⟨i∣Ea†Eb∣j⟩=cab δij\bra{i} E_a\dagg E_b \ket{j} = c_{ab}\, \delta_{ij}, with cabc_{ab} independent of ii and jj.

The same recovery then corrects every map whose operation elements are linear combinations of the EaE_a. 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.

Holds when
  • Finite-dimensional Hilbert space H\mathcal{H} and code space C⊆HC \subseteq \mathcal{H} with projector PP.
  • Exact recovery is required; approximate recovery obeys a different, weaker condition.
Proof · Proof of the Knill–Laflamme conditions

The matrix cc is Hermitian and positive semidefinite. Taking the adjoint of PEa†EbP=cabPP E_a\dagg E_b P = c_{ab} P gives cab∗=cbac_{ab}^* = c_{ba}. For any vector vv, with F=∑avaEaF = \sum_a v_a E_a, we get ∑abva∗cabvb P=PF†FP≥0\sum_{ab} v_a^* c_{ab} v_b\, P = P F\dagg F P \ge 0.

Sufficiency. Diagonalise c=u d u†c = u\, d\, u\dagg with uu unitary and d=diag⁡(dk)d = \operatorname{diag}(d_k), dk≥0d_k \ge 0. Define Fk=∑auakEaF_k = \sum_a u_{ak} E_a. The FkF_k are operation elements of the same map E\mathcal{E}, and

PFk†FlP=∑abuak∗ cab ubl P=dk δkl P.P F_k\dagg F_l P = \sum_{ab} u_{ak}^*\, c_{ab}\, u_{bl}\, P = d_k\, \delta_{kl}\, P .

If dk=0d_k = 0 then FkP=0F_k P = 0. If dk>0d_k > 0, the polar decomposition gives a unitary UkU_k with FkP=dk UkPF_k P = \sqrt{d_k}\, U_k P. Put Pk=UkPUk†P_k = U_k P U_k\dagg. For k≠lk \ne l,

PkPl=1dkdl  Uk(PFk†FlP)Ul†=0,P_k P_l = \frac{1}{\sqrt{d_k d_l}}\; U_k \left( P F_k\dagg F_l P \right) U_l\dagg = 0 ,

so the PkP_k are mutually orthogonal projectors: distinct errors FkF_k move the code space to orthogonal subspaces. Define

R(σ)=∑k: dk>0Uk†Pk σ PkUk  +  Π σ Π,Π=I−∑k: dk>0Pk.\mathcal{R}(\sigma) = \sum_{k:\, d_k > 0} U_k\dagg P_k\, \sigma\, P_k U_k \;+\; \Pi\, \sigma\, \Pi , \qquad \Pi = I - \sum_{k:\, d_k>0} P_k .

It is trace preserving because ∑kPkUkUk†Pk+Π2=I\sum_k P_k U_k U_k\dagg P_k + \Pi^2 = I. For a state with ρ=PρP\rho = P \rho P, using PUk†=PFk†/dkP U_k\dagg = P F_k\dagg / \sqrt{d_k},

Uk†PkFlP=PUk†FlP=PFk†FlPdk=dk δkl P,U_k\dagg P_k F_l P = P U_k\dagg F_l P = \frac{P F_k\dagg F_l P}{\sqrt{d_k}} = \sqrt{d_k}\, \delta_{kl}\, P ,

and ΠFlP=FlP−PlFlP=0\Pi F_l P = F_l P - P_l F_l P = 0 because PlFlP=dl UlP=FlPP_l F_l P = \sqrt{d_l}\, U_l P = F_l P. Therefore

R(E(ρ))=∑k,lUk†PkFl ρ Fl†PkUk=(∑kdk)ρ=(Tr⁡c) ρ,\mathcal{R}(\mathcal{E}(\rho)) = \sum_{k,l} U_k\dagg P_k F_l\, \rho\, F_l\dagg P_k U_k = \Big(\sum_k d_k\Big) \rho = (\tr c)\, \rho ,

and Tr⁡c=1\tr c = 1 when E\mathcal{E} is trace preserving on CC. A map with operation elements ∑amjaEa\sum_a m_{ja} E_a satisfies the same condition with cc replaced by m∗c mTm^* c\, m^{T} and has the same subspaces PkP_k, so R\mathcal{R} corrects it too.

Necessity. Suppose R\mathcal{R} with operation elements {Rj}\{R_j\} satisfies R(E(PρP))=λ PρP\mathcal{R}(\mathcal{E}(P \rho P)) = \lambda\, P \rho P for all ρ\rho. The left side is a completely positive map with operation elements {RjEaP}\{R_j E_a P\} and the right side one with the single element λP\sqrt{\lambda} P. Two operator-sum representations of the same map are related by an isometry, so RjEaP=γjaPR_j E_a P = \gamma_{ja} P for some complex numbers γja\gamma_{ja}. Then

PEa†Rj†RjEbP=γja∗γjb P,P E_a\dagg R_j\dagg R_j E_b P = \gamma_{ja}^* \gamma_{jb}\, P ,

and summing over jj with ∑jRj†Rj=I\sum_j R_j\dagg R_j = I gives PEa†EbP=cabPP E_a\dagg E_b P = c_{ab} P with cab=∑jγja∗γjbc_{ab} = \sum_j \gamma_{ja}^* \gamma_{jb}.

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 EE is detectable by CC when PEP=cEPP E P = c_E P. A code has distance dd exactly when every operator acting on fewer than dd systems is detectable and some operator on dd systems is not. A code of distance dd corrects all errors on t=⌊(d−1)/2⌋t = \lfloor (d-1)/2 \rfloor systems, because a product Ea†EbE_a\dagg E_b of two such errors acts on at most 2t≤d−12t \le d - 1 systems.

Erasure. A code of distance dd corrects the loss of any d−1d - 1 systems whose positions are known: the relevant products Ea†EbE_a\dagg E_b are then supported on those d−1d - 1 positions.

EquationQuantum Singleton boundEstablished result
n−k  ≥  2 (d−1)n - k \;\ge\; 2\,(d - 1)

Any [[n,k,d]][[n, k, d]] quantum code obeys this inequality. Knill and Laflamme stated it for qubit codes correcting tt errors, in the form n−k≥4tn - k \ge 4t. The [[5,1,3]][[5, 1, 3]] code meets it with equality: 5−1=2⋅25 - 1 = 2 \cdot 2. The classical Singleton bound is n−k≥d−1n - k \ge d - 1; the factor of 2 reflects that a code of distance dd recovers from the erasure of any d−1d - 1 systems, and by no-cloning the erased systems cannot themselves hold a copy of the encoded state.

Holds when
  • Holds for every quantum code, degenerate or not, with nn physical systems of equal dimension qq and K=qkK = q^k.
EquationQuantum Hamming boundEstablished result
∑j=0t(nj) 3j  ≤  2 n−k\sum_{j=0}^{t} \binom{n}{j}\, 3^{j} \;\le\; 2^{\,n-k}

There are (nj)3j\binom{n}{j} 3^j Pauli errors of weight jj on nn qubits. In a non-degenerate code each of them, applied to the 2k2^k-dimensional code space, must produce a subspace orthogonal to all the others, and these subspaces must fit in the 2n2^n-dimensional space. Counting dimensions gives the inequality. For t=1t = 1 and k=1k = 1 it reads 1+3n≤2n−11 + 3n \le 2^{n-1}, first satisfied at n=5n = 5, where the [[5,1,3]][[5,1,3]] code meets it with equality (Gottesman).

Holds when
  • Qubit codes (q=2q = 2).
  • Non-degenerate codes only: distinct Pauli errors of weight at most tt 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 C=span⁡{∣000⟩,∣111⟩}C = \operatorname{span}\{\ket{000}, \ket{111}\} and the errors E0=IE_0 = I, Ea=XaE_a = X_a for a=1,2,3a = 1, 2, 3. For a≠ba \ne b both nonzero, XaXbX_a X_b flips two qubits, sending ∣000⟩\ket{000} to a weight-2 string and ∣111⟩\ket{111} to a weight-1 string, both orthogonal to CC; likewise XaX_a alone. Hence

P Ea†Eb P=δab P,P\, E_a\dagg E_b\, P = \delta_{ab}\, P ,

the condition holds with c=Ic = I, and the code is non-degenerate for bit flips.

Now add E4=Z1E_4 = Z_1. Since Z1∣000⟩=∣000⟩Z_1\ket{000} = \ket{000} and Z1∣111⟩=−∣111⟩Z_1\ket{111} = -\ket{111},

P E0†E4 P=∣000⟩⟨000∣−∣111⟩⟨111∣,P\, E_0\dagg E_4\, P = \ketbra{000}{000} - \ketbra{111}{111} ,

which is not a multiple of PP. A single phase flip acts as the logical ZZ operator, so no recovery can undo it: the code has distance 1.

Shor's code is degenerate

In the nine-qubit code of Shor, Z1Z_1 and Z2Z_2 act identically on the code space, because Z1Z2Z_1 Z_2 is one of the parity checks and fixes every code state. So PZ1†Z2P=PP Z_1\dagg Z_2 P = P: the matrix cc 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 d=3d = 3 the Singleton bound requires n≥1+4=5n \ge 1 + 4 = 5 and the Hamming bound, for non-degenerate codes, requires 1+3n≤2n−11 + 3n \le 2^{n-1}, again first true at n=5n = 5. 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 {Ea}\{E_a\} explicitly.
  • Exact correction is stronger than necessary. Requiring R∘E=id\mathcal{R} \circ \mathcal{E} = \mathrm{id} 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.

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. Peter W. Shor (1995). Scheme for reducing decoherence in quantum computer memory. Physical Review A 52, R2493-R2496. doi:10.1103/PhysRevA.52.R2493
  2. Andrew M. Steane (1996). Error Correcting Codes in Quantum Theory. Physical Review Letters 77, 793-797. doi:10.1103/PhysRevLett.77.793
  3. Emanuel Knill, Raymond Laflamme (1997). Theory of quantum error-correcting codes. Physical Review A 55, 900-911. doi:10.1103/PhysRevA.55.900
  4. Charles H. Bennett, David P. DiVincenzo, John A. Smolin, William K. Wootters (1996). Mixed-state entanglement and quantum error correction. Physical Review A 54, 3824-3851. doi:10.1103/PhysRevA.54.3824
  5. Raymond Laflamme, Cesar Miquel, Juan Pablo Paz, Wojciech H. Zurek (1996). Perfect Quantum Error Correcting Code. Physical Review Letters 77, 198-201. doi:10.1103/PhysRevLett.77.198arXiv:quant-ph/9602019
  6. Daniel Gottesman (1997). Stabilizer Codes and Quantum Error Correction. PhD thesis, California Institute of Technology. arXiv:quant-ph/9705052
  7. Michael A. Nielsen, Isaac L. Chuang (2010). Quantum Computation and Quantum Information (10th Anniversary Edition). Cambridge University Press. doi:10.1017/CBO9780511976667
  8. Debbie W. Leung, M. A. Nielsen, Isaac L. Chuang, Yoshihisa Yamamoto (1997). Approximate quantum error correction can lead to better codes. Physical Review A 56, 2567-2573. doi:10.1103/PhysRevA.56.2567arXiv:quant-ph/9704002
  9. Cédric Bény, Ognyan Oreshkov (2010). General conditions for approximate quantum error correction and near-optimal recovery channels. Physical Review Letters 104, 120501. doi:10.1103/PhysRevLett.104.120501arXiv:0907.5391
  10. Google Quantum AI and Collaborators (2025). Quantum error correction below the surface code threshold. Nature 638, 920-926. doi:10.1038/s41586-024-08449-yarXiv:2408.13687
  11. Daniel Gottesman (1996). Class of quantum error-correcting codes saturating the quantum Hamming bound. Physical Review A 54, 1862-1868. doi:10.1103/PhysRevA.54.1862arXiv:quant-ph/9604038

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    Topic's own text checked (embedded records carry their own review states): non-degeneracy definition, detection/distance and erasure consequences re-derived from the Knill-Laflamme conditions; worked examples recomputed (three-qubit code with c = I for bit flips, Z_1 giving |000><000| - |111><111|; Shor code P Z_1 Z_2 P = P making c singular; n >= 5 from the Singleton and Hamming bounds, cf. Gottesman quant-ph/9604038); approximate-QEC claims compared with Leung-Nielsen-Chuang-Yamamoto, arXiv quant-ph/9704002 abstract (four-qubit amplitude-damping code violating the usual conditions) and the Beny-Oreshkov title/metadata; state-of-the-art sentence compared with Google Quantum AI, arXiv 2408.13687 abstract (distance-5 and distance-7 memories, Lambda = 2.14 per distance step of two); Crossref metadata of these references checked.

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
  2. 2026-11-30KetQat Commons: free learning paths, knowledge records, research problems, literature intake (#14)571c9b10

Current revision d8f053212033fecb. Source file knowledge/records/topic/quantum-error-correction.md in the content repository (readable there once it is public).