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.
Here the number of errors means the number of affected physical qubits: assume that all errors supported on at most qubits are jointly correctable. It does not mean the cardinality of an arbitrary selected error list. Let be any Pauli operator of weight at most . Split its support into disjoint sets , each of size at most , and write . Each Pauli factor is Hermitian, so take , to get , up to an irrelevant scalar phase if different Pauli representatives are used. The Knill--Laflamme condition gives
This is precisely quantum error detection: a projective measurement with outcomes either detects departure from the code or leaves the accepted logical state unchanged up to a scalar. Some errors can be harmless scalars on the code, particularly for degenerate correction; detection is not required to flag such an error with certainty.
Any linear operator supported on at most qubits is a linear combination of Pauli operators on those qubits, so its code compression is scalar by linearity. Thus
This is correction implies detection at twice the weight. The premise about all locations and all error types is essential: merely correcting one selected operator gives no universal statement about every operator of twice its weight.
The physical space of qubits is . An error operator is a linear operator on this space, for example one Kraus operator of a noise quantum channel. The usual channel description assumes initially uncorrelated system and environment, with the environment subsequently ignored; more general initial correlations need not define a channel on arbitrary system inputs. Finite dimension and the tensor decomposition into identifiable qubits allow an exact Pauli expansion of a quantum error. No independence between errors on different qubits is assumed by this expansion.
The tensor products of form an orthogonal basis of the operator space under the Hilbert-Schmidt inner product. Equivalently, absorbing phases into coefficients, every error has an expansion
For a computational basis vector labelled by , this gives
where addition and the dot product in the exponent are modulo two. Thus changes a bit, changes its phase, and performs both up to a scalar phase. A general error is a coherent linear combination of such actions; it need not be a classical random choice of Pauli operators. A restriction to at most faulty qubits is an additional locality assumption, expressed by the span of Pauli operators of weight at most .
The weight of a Pauli operator is the number of tensor factors different from , ignoring global phase. Let be the orthogonal projector onto a -dimensional code . Quantum error detection means
Indeed, a projective measurement of flags departure from the code, while its code-space outcome acts as the scalar on every encoded state and hence does not change logical information. Harmless scalar actions are included in this criterion. The quantum code distance is
Thus every Pauli operator of weight at most is detectable. The condition is linear in , so it holds for any error in their span. This proves detection of arbitrary errors affecting at most qubits, including coherent errors.
For correction, put and take all phase-free Pauli operators of weight at most . Their pairwise products satisfy
These are the Knill--Laflamme conditions. Here is their recovery construction, rather than merely using the criterion's name. For any normalized code state , the matrix is a Gram matrix, since , and is therefore positive semidefinite. Choose linear combinations of the errors diagonalizing this matrix, so that
For , the operators are isometries from the code into mutually orthogonal error-image subspaces: . Measure the projectors and, on outcome , apply . Complete this recovery arbitrarily on the remaining orthogonal subspace to make a trace-preserving quantum channel.
For an error and any encoded density operator , the recovered contribution is
Terms with annihilate the code. For a physical noise channel whose Kraus operators belong to this span, summing the displayed scalar over those operators gives one by trace preservation. The resulting recovered state is exactly . This proves the constructive recovery from the Knill-Laflamme condition and the requested guarantee
This argument allows degenerate codes; distinct physical errors may have identical actions on the code.
For the Shor code, define . Its two normalized basis codewords are
Six stabilizer generators are ; the two phase checks are
All eight have eigenvalue on both basis codewords. A phase error commutes with the six checks and anticommutes with both and . Their projective measurements therefore return
The two negative phase checks identify the middle three-qubit block. Apply the Pauli Z gate to restore the state, since . This procedure acts identically on every logical superposition, and the checks reveal no logical amplitudes. The syndrome cannot distinguish from or , but all three have the same action on the code: their pairwise products lie in the stabilizer group. Correcting with any one of them is sufficient. Thus the degeneracy in the syndrome is harmless.
The -qubit Pauli group is
A stabilizer group is an abelian subgroup of excluding . Its associated stabilizer code is the common positive eigenspace
The exclusion of is necessary for a nonzero code, since no nonzero vector has eigenvalue under .
Every is a signed Hermitian tensor product of Pauli matrices. An imaginary-phase Pauli element would have , contradicting closure of and exclusion of ; hence and . If , it cannot be a nontrivial scalar Pauli element, and at least one of its local factors is or . Each of these has trace zero. Using gives .
The spectral theorem for Hermitian operators and show that all eigenvalues are or . If their multiplicities are and , then
Thus the balanced spectrum of a nonidentity stabilizer is
This concerns a nonidentity stabilizer acting on the entire physical space; on the code every stabilizer acts with eigenvalue .
Because all elements commute and square to , is a vector space over under multiplication. Its independent stabilizer generators satisfy that no nonempty product is ; all products are distinct. The stabilizer-projector formula is
To verify it, group multiplication gives , Hermiticity gives , and for every . Conversely every code vector is fixed by this average, so its range is exactly . All nonidentity stabilizers have trace zero by the preceding proof. Therefore
For a code of dimension , the number of independent generators is consequently . One can list additional redundant generators, but an independent generating set has exactly this size.
For a correctable Pauli error , define the syndrome bit to be zero when commutes with and one when it anticommutes. On an encoded state,
Measure the commuting stabilizer generators; their eigenvalues reveal the error syndrome without revealing logical amplitudes. In a nondegenerate quantum code, the distinct specified correctable errors have orthogonal images of the code and distinct syndromes. A syndrome therefore identifies the error representative, and applying the inverse Pauli operator restores the encoded state.
If an actual error operator is a coherent linear combination of the specified errors, its state is a sum of these orthogonal syndrome components. Syndrome measurement selects one component, followed by the same inverse operation. The linearity of coherent quantum error correction ensures the logical state is recovered in every outcome. The same procedure handles noise Kraus operators in that error span; it does not require a probabilistic Pauli-noise assumption.
A Pauli error commuting with every stabilizer has the all-zero syndrome and preserves the code space. If it is a stabilizer up to global phase, this silent action is harmless. If it lies in the centralizer of a stabilizer group but is not a stabilizer up to phase, it acts as a nontrivial logical operator, and syndrome measurements cannot detect it. More generally, a non-scalar component of an error is an undetectable logical action. This distinguishes harmful undetected errors from scalar actions that satisfy quantum error detection algebraically.
The three-qubit bit-flip repetition code has basis and generators
A single phase flip commutes with both and has zero syndrome, but
It is a nontrivial logical phase operation. In particular, is not scalar, so the error set violates the Knill--Laflamme condition and cannot be corrected. Thus the code corrects single bit flips but not single phase flips; its distance against arbitrary quantum errors is one.