|q⟩ Bad Qubits

intermediate · Programming · Quantum Error Detection (Intro)

Classical Error Correction

Every physical communication channel and every real storage medium introduces noise. Without error correction, the accumulated bit-flip errors in a hard drive, a network packet, or a quantum processor would quickly render computation meaningless. Understanding the classical strategies first is essential, because quantum error correction inherits both their logic and their limitations — while having to overcome obstacles that have no classical analogue.

What can go wrong

Think of transmitting a single bit b{0,1}b \in \{0, 1\} across a noisy channel. A bit-flip error occurs whenever the channel maps b1bb \mapsto 1 - b. If each use of the channel flips the bit with probability pp (the error rate), then a single unprotected bit arrives correctly with probability 1p1 - p. For p=0.01p = 0.01 that sounds fine, but running 10610^6 bits through the channel will corrupt roughly 1000010\,000 of them — enough to corrupt a typical data block.

The repetition code

The simplest countermeasure is sheer redundancy. Instead of sending one copy of bb, send three:

b    bbbcodeword.b \;\longrightarrow\; \underbrace{b\, b\, b}_{\text{codeword}}.

The three-bit strings 000000 and 111111 are the only valid codewords. Any other string — 001001, 010010, 100100, 011011, 101101, 110110 — is a detected error.

Decoding by majority vote: the receiver takes whichever bit value appears at least twice. If at most one bit flips, the majority is still correct:

The code fails only when two or more bits flip. Assuming each bit flips independently with probability pp, the probability of a logical error (incorrect majority outcome) is

Pfail=(32)p2(1p)+(33)p3=3p22p3.P_{\text{fail}} = \binom{3}{2}p^{2}(1-p) + \binom{3}{3}p^{3} = 3p^{2} - 2p^{3}.

For small pp this scales as 3p23p^{2}, a dramatic improvement over the bare pp of a single bit. For example, with p=0.01p = 0.01 the failure probability drops from 1%1\% to roughly 0.03%0.03\%.

Syndrome measurement

Rather than examining all three received bits directly, classical decoders often compute a parity check (the syndrome):

The pair of agreement/disagreement answers identifies which (if any) single bit was flipped, without revealing the value of bb itself. This separation — "where is the error?" versus "what is the data?" — turns out to be the right conceptual frame for quantum error correction too.

Distance and the Hamming bound

The number of bit positions in which two codewords differ is their Hamming distance. The repetition code has distance d=3d = 3: the codewords 000000 and 111111 differ in all three positions.

A code with minimum distance dd can:

For d=3d = 3: detect up to 2 flips, correct up to 1 flip.

The limits of the classical strategy

Classical bits can be copied freely: encoding bb as bbbbbb is straightforward. For qubits this breaks down immediately. The no-cloning theorem forbids copying an unknown quantum state, so the quantum repetition code must be built differently — using entanglement rather than literal duplication. Furthermore, qubits can suffer not just bit-flip errors but also phase-flip errors and arbitrary rotations on the Bloch sphere. The next lessons in this module show how the quantum world forces a more sophisticated approach, while retaining the key ideas developed here: redundancy, syndrome measurement, and majority-vote-style correction.

Sign in on the full site to ask questions and join the discussion.