Repetition codes for quantum errors
A repetition code protects a quantum encoding against one selected Pauli error type by redundantly storing parity information across several physical qubits.
On this page
Explanation and significance
Repetition codes make error correction concrete because their parity checks resemble classical redundancy. Their limitation is equally instructive: protecting against bit flips does not also protect phase coherence. The unknown amplitudes are not copied into separately readable qubits. They reside in an entangled state whose components are constrained by repeated parity checks. Rotating all qubits with Hadamard gates converts the bit-flip construction into a phase-flip construction, but neither alone protects arbitrary single-qubit errors.
Mechanism and mathematical structure
For odd n, define |0_L>=|0>^tensor n and |1_L>=|1>^tensor n, with stabilizers Z_j Z_(j+1). X errors flip adjacent parity signs. A minimum-weight or majority recovery corrects up to (n-1)/2 bit flips if all checks are perfect. The logical X is X^tensor n; a logical Z can be any single Z_j. Thus the X-error distance is n while the Z-error distance is one. Under independent bit flips with probability p, the ideal logical bit-flip probability is the upper tail of a binomial distribution.
Fully worked reference example
For n=3, the failure patterns contain two or three flips. Their total probability is 3p²(1-p)+p³=3p²-2p³. At p=0.1, p_L=0.028, below the raw probability 0.1. At p=0.4, p_L=0.352; at p=0.6, p_L=0.648. The ideal classical-majority threshold is p=1/2, not a threshold for a noisy quantum computing circuit. For a phase error Z1 on alpha|000>+beta|111>, the state becomes alpha|000>-beta|111>. Both parity checks remain +1, so this error is undetected and acts as logical Z. This explicit counterexample prevents overclaiming the code protection.
Limits and misconceptions
Repetition-code demonstrations can establish repeated parity extraction or suppression of one error channel. They cannot alone establish correction of arbitrary quantum errors or a universal logical processor. If readout is noisy, a one-round majority calculation no longer describes the full task; repeated syndrome extraction and a temporal decoder are needed. Use the phrase bit-flip repetition memory or phase-flip repetition memory when that is the measured experiment.
Scientific relationships
Is a precursor to Shor-code construction and an explanatory example of syndrome decoding. Is distinct from a fully quantum distance-three code such as the Steane code.
Exact repetition-memory channel under bit-flip noise
For odd n, majority recovery fails when more than half the data qubits flip during one ideal interval. The logical channel is then a binary mixture of identity and logical X, with p_L=sum_(k=(n+1)/2)^n C(n,k)p^k(1-p)^(n-k). This formula assumes independent identical X faults, perfect syndrome extraction and a decoder matched to p<1/2. It says nothing about phase errors or faulty gates used to implement the code.
For n=3 and p=0.02, p_L=3(0.02)²-2(0.02)³=0.001184. For n=5, p_L=10(0.02)³(0.98)²+5(0.02)^4(0.98)+(0.02)^5=0.0000776192. The longer code reduces this restricted logical bit-flip probability by about 15.25 relative to the three-qubit case. The physical data count rises from three to five, and the number of parity checks rises from two to four. No hardware threshold is implied because the checks were ideal.
At p=1/2, every bit string is equally likely and majority conveys no useful information about the original bit; p_L=1/2 for every odd length. For p>1/2, the assumed decoder is mismatched: flipping the interpretation of all bits can exploit knowledge that errors are more likely than no error. This illustrates why a quoted threshold belongs to an error model and a recovery convention, not merely a codeword list.
Why phase-flip protection requires a different basis
Apply H to every physical qubit. The bit-repetition code becomes |0_L>=|+++> and |1_L>=|--->, with checks X0X1 and X1X2. Now Z faults change the check signs and can be diagnosed, while a single X acts logically. The transformation has exchanged which error type is protected. It has not added protection against both. A general state alpha|+++>+beta|---> remains vulnerable to the complementary logical error.
Combining complementary repetition structures leads to the Shor construction, but the extra structure matters. One cannot protect both X and Z simply by measuring all pairwise XX and ZZ checks on the same three-qubit chain because those checks may anticommute. For example, X0X1 and Z1Z2 overlap on one position and anticommute. Attempting to treat them as simultaneous stabilizer constraints gives inconsistent measurement behavior. This is a concrete reason quantum coding is more than duplicating a classical parity-check scheme twice.
A Hadamard on each qubit exchanges Z checks with X checks and swaps which single-Pauli errors the repetition code detects. The anticommutation in the example prevents simply combining both repetition constructions. Simultaneous protection requires a larger compatible code.
Correlated flips impose a different large-size limit
An independent-noise calculation can be extended to expose a correlated failure mechanism. Suppose each interval has a common-mode event with probability c that flips every data qubit. With probability 1-c, the interval instead contains independent bit flips of probability p. A majority decoder then has logical failure probability p_L=c+(1-c)B_n(p), where B_n is the upper binomial tail for odd length n. The common-mode branch is exactly logical X for the repetition encoding, so increasing n cannot correct it from the parity syndrome.
For c=0.0001 and p=0.02, the three-qubit result is 0.0001+0.9999 times 0.001184=0.0012838816. The five-qubit result is 0.0001+0.9999 times 0.0000776192=0.00017761143808. In the independent model the larger code had a factor about fifteen advantage over the smaller one. Here the improvement is about seven, and continued enlargement eventually approaches the floor c. The assumed global flip is intentionally extreme; finite-range correlated clusters require a spatial model and can produce different scaling.
Syndrome frequency alone can miss this mechanism because a flip of every data qubit commutes with every ZZ check. A memory initialized in |0_L> and destructively read in Z detects the final logical change, whereas the check record can remain entirely quiet. This is a concrete example of why low detector rates do not establish low logical failure, and why comparing measured logical outcomes with decoding predictions matters.
Unprotected phase noise grows with block size
Let each physical qubit independently undergo a Z error with probability q during the same interval. Every individual Z acts as logical Z, while a product of two Z operators is a stabilizer. The logical phase error is therefore determined by whether the total number of physical Z errors is odd. Its probability is q_L=[1-(1-2q)^n]/2. This identity follows by subtracting the odd and even binomial sums: their difference is the expansion of [(1-q)-q]^n.
At q=0.001, n=3 gives q_L=0.002994004, n=5 gives approximately 0.004980040, and n=11 gives approximately 0.010890657. These phase-error probabilities increase with n even as the independent bit-flip tail decreases. Thus choosing a longer bit-repetition block can improve one memory basis while worsening preservation of a general quantum state. When X and Z noise are independently generated, the effective logical channel has separate bit and phase components; a test of only one logical basis cannot characterize both.
For the synthetic p=0.02, q=0.001 model, a three-qubit block has bit failure 0.001184 and phase failure 0.002994004. A five-qubit block lowers the former to 0.0000776192 but raises the latter to about 0.004980040. If the application weights both errors similarly, the larger block can be worse overall. This does not establish a universal optimum; it demonstrates why the objective and noise bias must be declared before optimizing code length.
The decoding rule is a likelihood ratio
For a perfectly measured repetition syndrome, exactly two binary error strings are compatible with the syndrome: a candidate e and its bitwise complement. Under independent but nonidentical flip probabilities p_j, their likelihood ratio is the product over j of [p_j/(1-p_j)] raised to 2e_j-1. Taking the logarithm turns this into a sum of signed local log-odds. Hamming weight is sufficient only when the p_j are equal and below one-half.
For three qubits with p0=0.40 and p1=p2=0.01, compare candidate X0 with X1X2. Their probabilities are 0.40 times 0.99 squared=0.39204 and 0.60 times 0.01 squared=0.00006. The one-flip explanation is overwhelmingly favored. If instead a diagnosed defect gives p0=0.999 while p1=p2=0.20, the same comparison is 0.63936 against 0.00004. A hardware-dependent decoder can exploit heterogeneous information; blindly using a global average conceals the structure of the evidence.
An even more instructive reversal uses p0=0.01 and p1=p2=0.40. The single-flip explanation has probability 0.0036, whereas the double-flip explanation has probability 0.1584. A minimum-Hamming-weight rule chooses the less likely logical class by a factor of forty-four. The code and syndrome are unchanged. The inference problem changes because the data-qubit reliabilities are known to differ.
Sources
Verification scope
Stabilizer Codes and Quantum Error Correction
Daniel Gottesman · · Thesis · Preprint recorded · arXivCitation identity checked ·
Stabilizer algebra and fault-tolerance foundations; no current experimental ranking.
Verification scope
Citation identity checked ·
Architecture and surface-code tutorial; numerical thresholds remain model-specific.