Quantum error correction protects a logical qubit by encoding its quantum state into a larger Hilbert space, where a specified family of physical errors can be diagnosed and reversed by a common recovery quantum channel. The requirement is to restore every encoded quantum superposition, including its relative phase, rather than only the computational basis states. A quantum error-correcting code specifies which errors have this protection; it does not promise recovery from every possible disturbance.
The beautiful idea is to measure relations between physical qubits that reveal an error syndrome while revealing nothing about the protected logical qubit. For example, the bit-flip repetition code compares neighboring qubits without reading their individual values. Its parity checks can locate one Pauli X gate error while leaving the unknown coefficients intact. Encoding is a linear isometry, consistent with the no-cloning theorem: redundancy in a shared quantum state supplies protection without making independent copies of the unknown input.
Peter W. Shor's 1995 paper [ref]
https://journals.aps.org/pra/abstract/10.1103/PhysRevA.52.R2493. Scheme for reducing decoherence in quantum computer memory
, published on 1 October, introduced the nine-qubit Shor code to reduce quantum decoherence in memory. Andrew M. Steane's [ref]https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.77.793. Error Correcting Codes in Quantum Theory
, published on 29 July 1996 and [ref], connected quantum error correction to classical linear codes; the seven-qubit Steane code protects against arbitrary errors on one physical qubit. These constructions protect relative phase as well as computational basis values, going beyond the elementary bit-flip repetition code.For an authored account of the mechanism, see John Preskill's [ref], especially section 7.1 on collective parity measurements and section 7.9 on stabilizer codes. Andrew Steane's A tutorial on quantum error correction develops the distinction between correcting a stored quantum state and operating with imperfect quantum gates.
A quantum error-correcting code is a subspace encoding a logical Hilbert space, together with a specified family of noise operators that a common recovery quantum channel reverses on every encoded state. A K-dimensional code carries logical qubits. For a code projector , correctability is characterized by the Knill--Laflamme condition; code distance is defined by the smallest undetectable operator weight, not merely by the number of generators.
A logical qubit is a two-dimensional encoded quantum subsystem with chosen orthonormal logical basis states . An encoding linear isometry sends to . In a concatenated quantum error-correcting code, one level's logical qubit supplies one qubit of the next outer code.
A concatenated quantum code replaces each physical qubit of an outer code by a logical qubit of an inner code. Correction proceeds from inner blocks to outer blocks. For independent errors and ideal correction, a logical-error map iterates as . This recursion describes the code/channel model and does not by itself include errors in encoding and recovery gates.
// Target: quantum-error-correction.bigb
Assume independent physical-error probability , correction of zero or one errors, and failure on every block with at least two errors. The failure map is . Factoring gives . The unique interior threshold is the root of . Below it concatenation decreases the failure probability toward zero. Two levels give , compared with at one level.
// Target: quantum-information-theory.bigb
The five-qubit code encodes one logical qubit into five physical qubits and corrects an arbitrary error on one physical qubit. In a nondegenerate realization, the identity and fifteen one-qubit Pauli operators take the two-dimensional code into sixteen mutually orthogonal syndrome subspaces, filling the 32-dimensional physical Hilbert space.
// Target: quantum-error-correction.bigb
The four commuting independent stabilizer generators define a two-dimensional stabilizer code. The identity and fifteen single-site Pauli errors have sixteen distinct four-bit error syndromes, so their two-dimensional images form an orthogonal direct sum of the physical space. This proves nondegenerate single-site correction and the perfect quantum error-correcting code property. The operators and commute with the stabilizer and anticommute with each other. Multiplying by gives, up to phase, , a nontrivial weight-three logical operator, proving distance exactly three.
A code with orthogonal projector detects an error when its compression to the code is scalar. A projective measurement of then either flags departure from the code or, on a successful code-space outcome, leaves the logical state unchanged up to normalization. This includes harmless scalar errors, even though they need not produce a nonzero error syndrome. Detectability extends by linearity to the span of a set of errors. Every Pauli operator of weight less than the quantum code distance is detectable.
Split the support of a Pauli operator of weight at most into two sets of size at most . It is, up to a scalar phase, for two errors in the correctable family. The Knill--Laflamme condition makes its compression to the code scalar, which is quantum error detection. Expansion in the Pauli basis extends the assertion to every operator supported on at most qubits. The number counts affected qubits, not the cardinality of an arbitrary selected family of errors.
For a specified correctable set of distinct Pauli operators modulo phase, a nondegenerate code has mutually orthogonal error images . Equivalently, the matrix in the Knill--Laflamme condition is diagonal for that Pauli error set. Each error therefore requires a separate syndrome subspace of dimension equal to the logical code dimension. Degenerate codes can have distinct errors with the same action on the code and do not satisfy this orthogonality counting argument.
For unknown-location Pauli operators of weight at most , there are physically distinct errors modulo phase, including the identity. A nondegenerate quantum code assigns them mutually orthogonal error-image subspaces, each of dimension , within the -dimensional physical Hilbert space. Hence . The hypothesis of nondegeneracy is essential to this dimension count.
A nondegenerate quantum code is perfect at correction radius if its distinct correctable Pauli error images exhaust the physical Hilbert space. Each image has dimension , and their orthogonal direct sum is the whole -dimensional space precisely when the quantum Hamming bound is an equality. This perfectness concerns unknown-location errors of weight at most ; it does not imply correction of every higher-weight error.
An quantum error correction code is a -dimensional subspace of qubits. Its distance is the minimum weight of a Pauli operator for which is not a scalar multiple of the code projector . Thus every operator supported on fewer than qubits has scalar compression to the code, by expansion in the Pauli basis. This definition includes degenerate codes; a low-weight operator acting as a scalar does not reduce the distance.
The guaranteed radius is the largest integer for which all unknown-location Pauli operators of weight at most can be corrected together. Pairwise products have weight at most , so suffices by the Knill--Laflamme condition. Conversely, split a minimum-weight undetectable Pauli operator between two subsets of its support. If , this gives two errors of weight at most whose pairwise product violates that condition. Consequently is either or ; parity cannot be recovered from alone.
For a code carrying logical qubits, two disjoint subsets of physical qubits are each correctable erasures. Purify the maximally mixed logical input using a reference , and call the remaining physical subsystem . Erasure decoupling gives and . Purity and Subadditivity of Von Neumann entropy imply , hence . If two such disjoint subsets would not fit, partition the entire physical system into two correctable subsets; purity and decoupling then force , a contradiction. Thus the partition used in the proof is justified independently of the bound.
Errors on a known subset of qubits are correctable by a distance- code whenever . Every product of errors supported on that subset still has support in the same subset, so its compression is scalar. The Knill--Laflamme condition therefore supplies one recovery for every channel on that subset. Equivalently, erasing the subset leaks no logical information to it: if a reference is maximally entangled with the encoded logical system, its joint density operator with the erased subsystem is a product state.
Suppose fixed unitary encoding and recovery correct each error by mapping every logical input to . The syndrome vector can be taken independent of the logical input: applying linearity to basis inputs and their equal superposition forces their syndrome vectors to agree. Hence an error is mapped to . If is unitary, this final syndrome vector is normalized and the circuit corrects . Orthogonality of the syndrome states is not needed for the linear-span argument; it is a separate condition concerning distinguishability of errors.
If a common recovery quantum channel with Kraus operators restores every pure code state after each error , then each vector is parallel to . Linearity on basis vectors and their pairwise superpositions forces , with the scalar independent of the logical state. Insert between two error operators to obtain the displayed Knill--Laflamme condition. This proves necessity without presuming an orthogonal syndrome description of recovery.
The matrix in the Knill--Laflamme condition is positive semidefinite, since is the squared norm of for any normalized code state. Diagonalizing it gives linear combinations with . For , is an isometry of the code into an error-image subspace, and these subspaces are orthogonal. Measuring their projectors and applying recovers the logical state. Complete the operation arbitrarily on the orthogonal complement to obtain a quantum channel. This construction corrects every noise map whose Kraus operators lie in the specified error span, including coherent superpositions of error operators.
A stabilizer code is the common eigenspace of a stabilizer group , an abelian subgroup of the Pauli group excluding . Choose independent stabilizer generators on physical qubits. They are commuting Hermitian operators, each squaring to . The stabilizer subspace and its orthogonal projector areThe stabilizer-projector formula gives , so logical qubits remain. Independent here means that no nonempty product of the chosen stabilizer generators is . Excluding is necessary: a vector cannot simultaneously be fixed by and unless it is zero.
For the three-qubit bit-flip repetition code, take and , with the Pauli Z gate on site and identities elsewhere. The stabilizer group is . Both stabilizer generators have eigenvalue exactly on the span of and , giving dimensions for one logical qubit. A projective measurement of these checks distinguishes four orthogonal two-dimensional sectors rather than eight individual computational basis states.
A Pauli error that anticommutes with a stabilizer generator changes that check's sign, producing an error syndrome. A Pauli operator commuting with every check can still act on the logical qubits; the centralizer of a stabilizer group describes these possibilities. Thus the number of checks determines the encoded dimension, while the quantum code distance determines protection against arbitrary local errors. The five-qubit error correcting code, for instance, has four stabilizer generators and quantum code distance three; the three-qubit bit-flip repetition code has two checks but quantum code distance one because a single phase flip is unflagged. [ref]
https://www.preskill.caltech.edu/ph229/notes/chap7.pdf. Preskill, §7.9.1: stabilizers, syndromes and logical operators
.A stabilizer group with independent generators maps injectively to an r-dimensional isotropic subspace of the binary symplectic space of Pauli labels. For generator rows , commutation is over . Its stabilizer subspace has dimension . The labels of the centralizer of a stabilizer group form ; labels in act as nontrivial logical Pauli operators.
For binary linear codes , the CSS code has basis for . Its X stabilizers come from and its Z stabilizers from the dual code ; their commutation follows from orthogonality. For positive logical dimension, and , with quantum code distance . Thus arbitrary errors on at most qubits are correctable. Stabilizer errors are harmless even if their weight is small; the distances exclude them.
For binary linear codes , the coset superpositions of the CSS code have checks labelled by and checks by . A bit-error pattern gives the classical syndrome for , and a phase-error pattern gives the syndrome for the dual code . Errors with and are jointly correctable. Every pairwise Pauli-error product either anticommutes with a check, giving zero code compression, or its low-weight components belong to the stabilizer and give scalar compression. Thus the Knill--Laflamme condition covers coherent superpositions and quantum channels as well as definite bit and phase errors.
The Pauli centralizer consists of Pauli operators commuting with every stabilizer. Elements of , modulo stabilizers and phases, are the nontrivial logical Pauli operators.
If every pairwise product has weight below the code distance, it cannot be a nontrivial logical operator. The Knill--Laflamme conditions then hold for the whole error set.
Let exclude , let be its Pauli centralizer, and let . A set of Pauli errors is jointly correctable exactly when every product belongs to or lies outside . Outside the centralizer its code compression is zero by anticommutation; in it acts as a scalar. A centralizing operator outside has zero trace on the code but is unitary there, so cannot be scalar. This gives precisely the Knill--Laflamme condition. Scalar phases must be retained when formulating the group criterion.
Quasi-adiabatic continuation carries each stabilizer to a quasi-local conserved operator for the perturbed low-energy space. Bare Pauli errors are then only approximately correctable because the dressed operators have exponentially small non-Pauli tails.
The distance is the minimum weight of a Pauli operator that preserves the code space but acts nontrivially on its logical information.
An error syndrome is the list of outcomes obtained by measuring a chosen ordered family of stabilizer generators. Write for eigenvalue and for eigenvalue . For a definite Pauli error on a code state, the rule isThe commuting checks admit joint orthogonal projectorsFor density operator , the Born rule gives outcome probability and conditional state when that probability is nonzero. A definite Pauli error has one deterministic error syndrome independent of the encoded amplitudes. A coherent linear combination of Pauli errors may occupy several sectors, so measuring the error syndrome selects a sector; recovery preserves the logical qubit when the entire error family is jointly correctable. [ref].
An error syndrome locates an error only relative to an assumed family and a recovery rule. Two Pauli errors differing by a logical operator can share an error syndrome; see stabilizer-syndrome coset. In the three-qubit bit-flip syndrome table, and both give . Recovering with corrects the first but converts the second into the logical operator . Likewise, has error syndrome yet changes the encoded relative phase.
Two Pauli errors have the same stabilizer syndrome exactly when their product lies in the centralizer of the stabilizer group. Thus a syndrome identifies a coset , while logical operators inside that coset remain indistinguishable.
The -qubit phase-flip repetition code is stabilized by and has codewords and . It has logical operators and , so its distance against phase flips is .
The codewords have residual logical Pauli X gate after an uncorrectable two- or three-site phase error. Precede their encoding by a logical Hadamard gate and follow decoding by its inverse. Since , the same error now acts as a logical Pauli Z gate. Explicitly the encoded coefficients are and for an input . This convention matters when translating physical phase errors into a claimed decoded phase-error channel.
The phase-flip repetition code with codewords corrects any one physical Pauli Z gate error. Its two adjacent-pair error syndromes cannot distinguish an error pattern from its three-bit complement. Minimum-weight recovery therefore leaves no residual error at weight zero or one, and leaves at weight two or three. This residual operator exchanges the codewords, so inverse encoding gives a logical Pauli X gate. For independent physical phase errors of probability , the decoded quantum channel is , where . For , .
Insert Hadamard gates on every data qubit immediately after encoding by a bit-flip repetition code and immediately before its bit-flip detection and recovery. The intervening physical error is thereby conjugated by , and turns a single Pauli Z gate error into a single bit flip for the original correction circuit. The encoded logical codewords are now and . The syndrome ancillas and the final inverse encoding stay unchanged. This protects against phase flips in the new basis; it does not simultaneously correct arbitrary bit flips in the physical basis.
For independent errors of probability , maximum-likelihood decoding of a repetition code chooses the lower-weight error compatible with the syndrome. This is majority voting, with threshold and exponentially vanishing logical-error probability below threshold.
The -qubit bit-flip repetition code stores one logical qubit in and . Its stabilizer generators are for , and its logical operators are and . Interchanging the Pauli X gate and Pauli Z gate gives the phase-flip repetition code. For odd , majority-vote decoding of a repetition code corrects up to physical Pauli X gate errors, assuming ideal operations and a noise family containing only these bit flips.
For , prepare two quantum ancillas in and apply controlled-NOT gates from the input qubit to each of them. By linearity, encoding sendsThis does not produce , which would contain cross terms. For example, encoding produces , whereas three independent copies would have eight equal computational basis amplitudes. The encoding creates quantum entanglement when both coefficients are nonzero and respects the no-cloning theorem.
The three-qubit bit-flip syndrome table corrects the family and its entire linear span, as specified by the Knill--Laflamme condition. It cannot correct arbitrary errors on one physical qubit: the phase flipcommutes with both checks and acts as logical . In particular, it takes the encoded to the orthogonal encoded with error syndrome . Thus its full quantum code distance is one, despite correcting one error of the restricted Pauli X gate type. The Shor code, Steane code and five-qubit error correcting code provide protection against arbitrary one-qubit errors.
Measure the commuting stabilizer generators and in that order. Use error syndrome bit for eigenvalue and bit for eigenvalue . For the Pauli X gate on physical qubit , every row holds for arbitrary normalized . This ordered parity-check convention follows [ref]
https://www.preskill.caltech.edu/ph229/notes/chap7.pdf. Preskill, §7.1
:| Error | State before recovery | eigenvalues | Error syndrome | Recovery |
|---|---|---|---|---|
Each pair of computational basis words within a row has the same two parities. Consequently the projective measurement reveals the row without distinguishing its two amplitudes. For example, becomes under . Both checks give with probability one, and applying restores both coefficients exactly, including the relative phase .
One implementation uses two quantum ancillas initialized to . Two controlled-NOT gates from data qubits 1 and 2 to the first quantum ancilla write their parity; two more from data qubits 2 and 3 to the second quantum ancilla write the other parity. Measuring only the quantum ancillas in the computational basis gives . Measuring the individual data qubits instead would reveal the encoded computational basis value and destroy the unknown quantum superposition. The existing coherent syndrome extraction for the three-qubit repetition code uses the alternative ordered checks , so its bit labels differ from this table.
The recovery also handles coherent errors. Put . Their images of the code are mutually orthogonal, giving , the Knill--Laflamme condition for this family. For any linear combination , its component in sector is . Measuring that error syndrome has probability on the normalized erroneous state, and recovery returns . More generally one recovery quantum channel corrects every noise quantum channel whose Kraus operators belong to this span. The assumption concerns the whole jointly correctable family; it does not extend to the span of arbitrary single-site Pauli errors. [ref]
https://www.preskill.caltech.edu/ph229/notes/chap7.pdf. Preskill, §7.2: correction of an error span
.A fully computed coherent example is the unitary operator . At it givesThe error syndromes and occur with probabilities and , independently of . Doing nothing for and applying for restores the same logical qubit in both branches; the scalar in the second branch is an irrelevant global phase. This is an example of linearity of coherent quantum error correction, rather than an assumption that the original error was a classical random bit flip.
Assume that each physical qubit undergoes an independent quantum bit-flip channel with probability during one storage interval, and that encoding, error syndrome extraction, recovery and decoding are all ideal. Use the three-qubit bit-flip syndrome table to apply the indicated minimum-weight recovery. Zero or one bit flips are corrected. Two bit flips have the same error syndrome as the complementary one-site error: for example, gives , so recovery leaves . Three bit flips give and also leave . This exchanges and , and therefore acts as a logical Pauli X gate after decoding.
The number of physical bit flips has a binomial distribution with three trials, hence the logical-error probability isFor a logical density operator , the decoded quantum channel is exactly . Here logical failure means a nontrivial logical Pauli X gate error; a particular input such as can be invariant under that error. At , exactly two flips have probability and three flips have probability , giving . The block succeeds with probability compared with for an unencoded qubit. At , , illustrating the quadratic suppression of rare independent bit flips.
Factoring the improvement givesThus one level reduces logical-error probability for , is equal at , and makes it worse for under this same decoder. The suppression arises because a logical error requires at least two physical bit flips. With independent disjoint inner blocks, the same noise model and ideal correction at every level, a concatenated quantum error-correcting code has , with . At , two levels use nine data qubits and give .
This calculation describes ideal correction of stored information with the specified quantum bit-flip channel. Repeated correction in time additionally requires a fresh specified noise model for each interval; imperfect quantum gates, faulty measurements and correlated errors change the calculation. The timed bit flip during repetition-code syndrome extraction and exact encoded-state failure with a faulty parity check show concretely why this storage calculation alone is not a fault-tolerance result.
Encode as . Four controlled-NOT gates copy the displayed two data parities into initially zero quantum ancillas. No logical amplitude is measured. The error syndromes correspond respectively to no bit flip and bit flips on data qubits . Conditional Toffoli gates, with temporary Pauli X gates implementing zero-valued controls, undo the indicated error. Inverse encoding yields the original logical state and a separate syndrome state. A phase flip has zero bit-flip syndrome and remains as a logical phase error; this three-qubit code is not a general single-qubit-error code.
Suppose the first ancilla records parity , then a fault of value flips , and the second ancilla records parity . For incoming bit-error pattern , the observed error syndrome is the displayed pair, while the final data error before recovery is . When , the observed syndrome differs from the actual data syndrome by . Applying the usual minimum-weight recovery leaves a nonzero syndrome, so the state is outside the code space even when the channel itself made no error. This is a timing-dependent failure of this simple extraction circuit, not a general obstruction to fault-tolerant quantum error correction.
For independent channel bit flips of probability and the specified extraction fault of probability , require recovery of an arbitrary input in the original encoded subspace. Every extraction-fault event leaves nonzero error syndrome; without that fault, channel errors are corrected exactly at weight zero or one. Thus success probability is . Compared with a single unencoded bit-flip channel, strict improvement for requires . A different decoder or an added later ideal recovery changes the performance criterion and must be specified separately.
Replacing every qubit of an -qubit phase-flip repetition code by an -qubit bit-flip repetition code gives a code with logical - and -operator weights and , respectively, and hence distance .
The nine-qubit Shor code encodes one logical qubit with basis vectors and , where . Six adjacent -pair stabilizer generators locate a single bit flip within a block, while and diagnose which block has had its relative phase changed. Together they correct every single-qubit Pauli operator, hence every single-qubit error by the Pauli expansion of a quantum error.
A Pauli Z gate on qubit four has phase-check eigenvalues and leaves all six -pair checks positive. Applying restores the state. The same phase syndrome arises from or ; these have the same action on the code since their pairwise products are stabilizers. This is a degeneracy, not a failure of correction.
Group the nine physical qubits into three blocks and write for the product of three Pauli X gates in block . The commuting stabilizer generators and have eigenvalue on both logical codewords. A Pauli Z gate in blocks one, two or three gives syndromes , or respectively. Apply a Z gate to any one qubit of the indicated block to recover the logical state. Z errors at distinct locations within a block act identically on the code, so this correction is degenerate.
The Steane code is a seven-qubit CSS stabilizer code encoding one logical qubit with distance three.
Write the Steane code basis as uniform quantum superpositions over a binary linear code and a disjoint coset , where is the even-weight part of the length-seven Hamming code. For , diagonal Pauli Z gates cannot connect the two cosets. Within coset , the overlap isIf , translation by a word with negates this sum, so it vanishes. Since the dual code is the length-seven Hamming code of minimum Hamming distance three, every nonzero of Hamming weight one or two has vanishing overlap. Taking from proves the displayed identity. The eight two-dimensional error images are orthogonal, so their projective measurement determines the error syndrome without revealing the logical state; applying the identified phase flip again recovers every code state. This proves nondegenerate quantum error-correcting code behaviour for the identity and all single-site phase flips, including their coherent linear span.
A color code places qubits on a three-colorable lattice and assigns X-type and Z-type stabilizers to each colored plaquette.
A string operator creates excitations at its endpoints. Multiplying by a successive segment moves an endpoint because the shared intermediate excitation is toggled twice.
The surface code is a topological stabilizer code whose electric and magnetic excitations are bosons with mutual-semion braiding.
Join spheres pole to pole and draw longitude edges on each sphere. Qubits on edges, two-edge face stabilizers, and vertex stabilizers realize the concatenated phase-and-bit-flip repetition code. A pole-to-pole path has weight , while a dual equatorial cut has weight .
For independent bit flips, summing the probabilities of all error chains in one syndrome and logical class equals, up to a class-independent factor, the partition function of a random-bond Ising model. A reference error fixes bond signs and products of star stabilizers become Ising spin configurations.
On a cylinder with equal anyon-condensing boundaries, the two topological ground states split only through a virtual string implementing a logical operator. A perturbation of strength produces a splitting of order times a path-counting factor times , where is the shortest supported logical-string length.
The toric code has commuting star and plaquette stabilizers. Its electric and magnetic excitations are bosons with mutual-semion statistics, and their fusion is a fermion.
The surface-code anyons are . They obey ; and are bosons with mutual full-braiding phase , while their composite is a fermion.
Articles by others on the same topic
Quantum error correction (QEC) is a crucial aspect of quantum computing that aims to protect quantum information from errors due to decoherence, noise, and operational imperfections. Quantum bits, or qubits, are the fundamental units of quantum information. Unlike classical bits, which can be either 0 or 1, qubits can exist in superpositions of both states. This property makes quantum systems particularly susceptible to errors, as even small interactions with the environment can lead to significant loss of information.
Technique that uses multiple non-ideal qubits (physical qubits) to simulate/produce one perfect qubit (logical).
One is philosophically reminded of classical error correction codes, where we also have multiple input bits per actual information bit.
TODO understand in detail. This appears to be a fundamental technique since all physical systems we can manufacture are imperfect.
Part of the fundamental interest of this technique is due to the quantum threshold theorem.
For example, when PsiQuantum raised 215M in 2020, they announced that they intended to reach 1 million physical qubits, which would achieve between 100 and 300 logical qubits.
Video "Jeremy O'Brien: "Quantum Technologies" by GoogleTechTalks (2014)" youtu.be/7wCBkAQYBZA?t=2778 describes an error correction approach for a photonic quantum computer.
Bibliography:

