Computing Library › Quantum Error Correction
Quantum Error Correction

The Quantum Hamming Bound and Perfect Codes

A counting argument limits how many logical qubits a distance-d code can protect, and codes that meet it with equality are called perfect.

Counting correctable errors

For a nondegenerate code on n qubits correcting t errors, every distinct correctable error must map the code space to a distinct orthogonal subspace. Each qubit admits three nontrivial Pauli errors (X, Y, Z), so the number of weight-up-to-t Pauli errors is the sum over j from 0 to t of C(n,j) times 3^j. Multiplying by the code-space dimension 2^k and requiring the total to fit inside 2^n gives the quantum Hamming bound.

The bound

Kronos motion — error correction

Written compactly, a nondegenerate [[n,k,d]] code with t = floor((d-1)/2) must satisfy 2^k times the sum of C(n,j) 3^j for j=0..t, at most 2^n. Codes achieving equality pack the Hilbert space exactly and are called perfect quantum codes.

Five-qubit code parameters (n,k,d)
513-

The quantum Hamming bound is a first sanity check on any proposed code and explains why the five-qubit code is the smallest possible single-error-correcting code. It also highlights a genuinely quantum feature: degenerate codes, including the surface code, can and do exceed the nondegenerate bound because several errors can share a syndrome and correction.

Other bounds, such as the quantum Singleton bound d at most (n-k)/2 + 1, constrain distance directly. Codes meeting the Singleton bound are called quantum MDS codes. Together these bounds map the feasible region of code parameters.