For an -qubit quantum code with projector , the quantum code distance is
Here the weight counts nonidentity tensor factors. Thus every error supported on fewer than qubits is detectable, by the Pauli expansion of a quantum error. A scalar action on the code, including a nonidentity stabilizer, is harmless and does not reduce this distance. For a stabilizer code, the equivalent definition minimizes weight among Pauli operators which commute with every stabilizer generator but act nontrivially on the logical information. The Knill--Laflamme condition then guarantees correction of all errors of weight at most , since each pairwise product has weight at most .
Suppose the code encodes logical qubits and is nondegenerate for all errors through weight . There are
distinct Pauli errors modulo phase: choose the affected positions and choose or at each. Each error is unitary, so its image of the code has dimension . Nondegeneracy makes these images mutually orthogonal, equivalently the combined vectors are orthonormal. They all lie in the physical Hilbert space of dimension . Counting dimensions proves the quantum Hamming bound
This dimension argument requires nondegeneracy. For a degenerate code, different errors can share an image, as in the Shor code, and this counting proof cannot be applied unchanged.
For a binary classical code of words, the Hamming bound is : disjoint Hamming balls around the words must fit into all binary strings. The quantum factor is needed because at each erroneous qubit there are three linearly independent nonidentity Pauli operators, not just a classical bit flip. A phase flip is invisible to a computational-basis classical record but changes a quantum superposition. A error combines bit and phase effects, and the identity with spans every one-qubit operator. Quantum correction must protect amplitudes and coherences, and consequently count whole orthogonal logical subspaces rather than just classical words.
For parameters , , and
Thus a nondegenerate such code saturates the bound: the sixteen two-dimensional error images exhaust the physical space. It is a perfect quantum error-correcting code for single-qubit errors. It also has the smallest possible length for nondegenerate single-error protection of one logical qubit: for , the required inequality fails.
Here is an explicit realization and its five-qubit stabilizer syndrome table. Write tensor products without multiplication symbols and use
Each pair has an even number of anticommuting single-site factors, so the four stabilizer generators commute. Their binary Pauli labels are independent: no nonempty product has identity label. For example, the -support at site three fixes the exponent of in such a product to zero, site five then fixes that of , site one fixes that of , and site two fixes that of . Thus their group has sixteen elements and excludes . The common eigenspace has projector and dimension , since all nonidentity Pauli strings have zero trace.
Record a syndrome bit as one when an error anticommutes with the corresponding generator, in order . Direct local commutation gives
These are all fifteen nonzero four-bit error syndromes; the identity has . Distinct errors in this list have a product with nonzero syndrome, so it anticommutes with some . Inserting on both sides gives . The diagonal product is the identity. Hence the Knill--Laflamme condition is exactly , proving nondegenerate correction. Measure the four commuting checks, apply the unique indicated Pauli error again, and every logical state is recovered. The Pauli expansion of a quantum error extends this recovery to an arbitrary one-qubit noise channel, not just the fifteen discrete errors.
The table also proves that every Pauli operator of weight one or two has nonzero syndrome: a weight-two operator is the product of distinct single-site errors, whose syndromes differ. Therefore the distance is at least three. The operators and commute with all four generators and anticommute with each other. They are nontrivial logical Pauli operators. Multiplication of by gives , a weight-three operator with the same logical action; it cannot be scalar on the code because it anticommutes with the invertible logical operator . This proves exactly.
The code consequently detects every two-qubit error and corrects two known-location erasures by the quantum erasure correction criterion, but it cannot correct all two-qubit errors of unknown location. A nontrivial weight-three logical operator can be split into a weight-one and a weight-two error, whose pairwise product violates the correction condition. It also saturates the quantum Singleton bound, since . These properties distinguish single-error perfectness from unrestricted protection against larger errors.
For a classical error-correcting code of length , alphabet size , minimum Hamming distance and codewords, the Singleton bound is
For a linear code this is . Deleting any coordinates is injective on the codewords, since two words agreeing on the remaining coordinates would differ in fewer than positions; this also explains the classical bound.
For an n-qubit quantum code carrying logical qubits and having quantum code distance , the quantum Singleton bound is
More generally replace by for code dimension . The proof applies to degenerate codes too.
Let . Purify the maximally mixed encoded input by a reference of dimension :
Distance makes erasure of any subset of at most qubits correctable. The allowed quantum erasure correction condition says that a correctable erased set is decoupled from :
This is the matrix-element correction condition in another form: all operators on have constant diagonal matrix elements and zero off-diagonal matrix elements in the logical basis, so tracing the other physical qubits in yields the displayed product.
First justify the sizes needed for the partition. If , partition all physical qubits into , both of size at most . Both sets are correctable. Purity of and the Schmidt decomposition give
Adding forces , a contradiction. Thus , without assuming the bound we aim to prove.
Choose disjoint sets of size , and let contain the remaining qubits. The joint state is pure, so decoupling and Subadditivity of Von Neumann entropy give
Adding and cancelling gives . The Von Neumann entropy of -dimensional states is at most : for positive eigenvalues , concavity of the logarithm gives . Here , so , proving the quantum bound. The code is assumed to encode information (); a one-dimensional code requires a separate distance convention, since simply re-preparing a known state makes its erasure-correction condition vacuous.
Use base-two logarithms, so Von Neumann entropy is measured in bits. Take an orthonormal basis of the code and purify its maximally mixed logical state as
Only a -dimensional reference support is needed; it can be embedded in the larger reference Hilbert space in the hint. Its reduced density matrix is maximally mixed on that support, so .
For any correctable erased subsystem , the Knill--Laflamme condition gives for every operator . Taking its matrix elements in the logical basis shows that for , and that the diagonal reductions are all the same state . Thus
In particular, the reference is decoupled from every set of at most erased qubits.
For an information-carrying code , first justify that two disjoint sets of size fit. If , partition all the physical qubits into sets each of size at most . Both are correctable. Additivity of Von Neumann entropy for a product state, and equality of complementary entropies for the pure state on , give
Adding yields , contradicting . Hence .
Now choose disjoint of size , and let contain the remaining qubits. The state on is pure. Product-state entropy additivity, equality of complementary entropies, and Subadditivity of Von Neumann entropy give
and
Adding and cancelling proves . Finally use the maximum entropy of a quantum state bound . Therefore the quantum Singleton bound is
This proof uses quantum erasure correction, not nondegeneracy, so it applies to degenerate codes as well. A code encoding no logical information requires a separate distance convention; the argument above concerns the usual coding problem.