6.4.3 Error Correction#

Prompts

  • What is the no-cloning theorem? Why does it prevent classical repetition codes but not quantum error correction?

  • Walk through the 3-qubit bit-flip code: how does syndrome measurement identify the error without collapsing the logical qubit?

  • What is a stabilizer code? How do the stabilizer generators (parity checks) define the code space and enable error detection?

  • How does the toric code (§2.3.3) implement quantum error correction topologically? What are the anyonic error syndromes?

  • What does the threshold theorem guarantee, and why does it mean quantum computation is scalable in principle?

Lecture Notes#

Decoherence destroys quantum information. But quantum mechanics itself provides the tools to fight back. By encoding a logical qubit in the entangled state of many physical qubits, errors can be detected and corrected — without ever measuring the logical state. This is the central miracle of quantum error correction, and it relies on a distinction that has no classical analog: measuring what error occurred without measuring what state the qubit is in.

Overview#

The no-cloning theorem rules out the simplest fix (backup copies), but entanglement enables something better: redundant encoding in a code subspace. Error syndromes — measured via stabilizer operators — reveal which physical qubit was corrupted, without disturbing the logical superposition. General stabilizer codes and topological codes (the toric code of §2.3.3) make this idea robust. The threshold theorem guarantees that below a critical error rate, arbitrarily reliable quantum computation is achievable by concatenating codes.

No-Cloning Theorem#

No-Cloning Theorem

There is no universal unitary operator that can copy an arbitrary unknown quantum state:

\[U(\vert\psi\rangle \otimes \vert 0\rangle) = \vert\psi\rangle \otimes \vert\psi\rangle\]

for all \(\vert\psi\rangle\). This is a direct consequence of the linearity of quantum mechanics.

Consequence for error correction: Classical repetition codes fail because you cannot clone \(\vert\psi\rangle\). Quantum error correction must use a different strategy: distribute the information of \(\vert\psi\rangle\) across multiple physical qubits without ever concentrating it in a single copyable form.

Quantum Error Correction: 3-Qubit Bit-Flip Code#

Goal: Protect one logical qubit from single-qubit bit-flip errors using 3 physical qubits.

3-Qubit Bit-Flip Code

Encode the two logical basis states as:

(163)#\[\vert 0\rangle_L = \vert 000\rangle, \quad \vert 1\rangle_L = \vert 111\rangle\]

A general logical state encodes as \(\vert\psi\rangle_L = \alpha\vert 000\rangle + \beta\vert 111\rangle\). This is not a copy of \(\vert\psi\rangle\) — the superposition is preserved but distributed.

Key idea: Measure what error occurred (syndrome), not what state the qubit is in.

Error Scenarios#

A single bit-flip (\(\hat{\sigma}^x\) on qubit \(j\)) maps:

  • Qubit 1: \(\alpha\vert 000\rangle + \beta\vert 111\rangle \to \alpha\vert 100\rangle + \beta\vert 011\rangle\)

  • Qubit 2: \(\to \alpha\vert 010\rangle + \beta\vert 101\rangle\)

  • Qubit 3: \(\to \alpha\vert 001\rangle + \beta\vert 110\rangle\)

Each corrupted state is orthogonal to all others — errors land in distinct subspaces.

Syndrome Measurement#

Measure parity checks without measuring the logical data:

(164)#\[\hat{P}_1 = \hat{Z}_1 \hat{Z}_2 \quad \text{(parity of qubits 1 and 2)}\]
\[\hat{P}_2 = \hat{Z}_2 \hat{Z}_3 \quad \text{(parity of qubits 2 and 3)}\]

Error Location

\(\hat{P}_1\)

\(\hat{P}_2\)

Syndrome \((s_1, s_2)\)

None

\(+1\)

\(+1\)

\((0,0)\)

Qubit 1

\(-1\)

\(+1\)

\((1,0)\)

Qubit 2

\(-1\)

\(-1\)

\((1,1)\)

Qubit 3

\(+1\)

\(-1\)

\((0,1)\)

Recovery: Apply \(\hat{\sigma}^x\) to the identified qubit. The logical state \(\alpha\vert 000\rangle + \beta\vert 111\rangle\) is restored.

Why syndrome measurement is non-destructive: \(\hat{P}_1\) and \(\hat{P}_2\) measure parity (even/odd), not individual qubits. The superposition \(\alpha\vert 000\rangle + \beta\vert 111\rangle\) is an eigenstate of \(\hat{P}_1\) and \(\hat{P}_2\) with eigenvalue \(+1\) — measuring them reveals nothing about \(\alpha\) or \(\beta\).

General Framework: Stabilizer Codes#

Stabilizer Code

A stabilizer code is defined by a set of commuting Hermitian operators \(\{\hat{S}_1, \hat{S}_2, \ldots, \hat{S}_k\}\) (stabilizers) with eigenvalues \(\pm 1\). The code space is the common \(+1\) eigenspace:

\[\hat{S}_i\vert\psi\rangle_L = +\vert\psi\rangle_L \quad \forall\, i\]

Error detection: An error \(\hat{E}\) takes \(\vert\psi\rangle_L\) out of the code space if \(\hat{E}\hat{S}_i \neq \hat{S}_iE\) (anticommutes with some stabilizer). Measuring \(\hat{S}_i\) after the error yields \(-1\) — revealing the syndrome without disturbing the logical information.

Code parameters: An \([[n, k, d]]\) code uses \(n\) physical qubits to encode \(k\) logical qubits with distance \(d\) (minimum weight of an undetectable logical error), correcting up to \(\lfloor(d-1)/2\rfloor\) errors.

Knill-Laflamme Conditions

A code with projector \(\hat{\Pi}\) onto the code space can correct a set of errors \(\{\hat{E}_a\}\) if and only if:

(165)#\[\hat{\Pi} \hat{E}_a^\dagger \hat{E}_b \hat{\Pi} = C_{ab}\,\hat{\Pi}\]

for all errors \(\hat{E}_a, \hat{E}_b\), where \(C_{ab}\) is a constant independent of the code state. This ensures that error information is encoded in the syndrome, not in the logical state.

Examples of stabilizer codes:

  • 3-qubit bit-flip: \([[3,1,1]]\); stabilizers \(\{\hat{Z}_1\hat{Z}_2, \hat{Z}_2\hat{Z}_3\}\).

  • Steane code: \([[7,1,3]]\); corrects any single-qubit error.

  • Surface code: \([[n,1,\sqrt{n}]]\); local 2D interactions; leading hardware candidate.

Connection to the Toric Code (§2.3.3)#

The toric code — introduced in Ch2 as a topological model for anyons — is a quantum error correcting code in disguise. The stabilizers are the vertex operators \(\hat{A}_v = \prod_{j\in v}\hat{\sigma}^x_j\) and plaquette operators \(\hat{B}_p = \prod_{j\in p}\hat{\sigma}^z_j\) on a 2D lattice.

Errors are anyons: A bit-flip error \(\hat{\sigma}^z\) on an edge anticommutes with the two vertex operators at its endpoints — creating a pair of anyonic \(e\)-excitations. The error syndrome is precisely the anyon locations, detectable by measuring \(\hat{A}_v\).

Topological protection: Logical operators (undetectable errors) must traverse the entire torus. The code distance \(d = L\) (system size), giving exponential suppression of logical errors with system size.

Full circle: The anyons of Ch2 are the error syndromes of Ch6. Topological quantum computing uses anyon braiding for fault-tolerant logic gates — connecting the course’s two great themes: topology and quantum information.

Threshold Theorem#

If the physical error rate per gate \(p\) is below a critical threshold \(p_{\mathrm{th}}\), then by using sufficiently large quantum error correcting codes, the logical error rate can be made arbitrarily small. Quantum computation is scalable in principle.

Threshold Theorem

For a distance-\(d\) code (such as the surface code), the logical error rate scales as

(166)#\[ p_{\mathrm{logical}} \sim \left(\frac{p}{p_{\mathrm{th}}}\right)^{(d+1)/2} \]

If \(p < p_{\mathrm{th}}\), increasing \(d\) suppresses the logical error exponentially. If \(p > p_{\mathrm{th}}\), increasing \(d\) makes the logical qubit worse.

For the surface code, \(p_{\mathrm{th}} \approx 1\%\); current superconducting qubits achieve \(p \sim 10^{-3}\), placing the ratio \(p/p_{\mathrm{th}} \approx 0.1\).

Why the threshold works: Error correction introduces new errors (from imperfect syndrome measurements), but at rate \(\sim p^2/p_{\mathrm{th}}\). When \(p < p_{\mathrm{th}}\), error correction removes errors faster than it introduces them. Increasing the code distance \(d\) suppresses logical errors exponentially in \(d\).

Summary#

  • The no-cloning theorem rules out backup copies of quantum states; quantum error correction encodes logical information in entangled states of many physical qubits instead.

  • The 3-qubit bit-flip code detects and corrects single-qubit errors via syndrome measurement (parity checks \(\hat{P}_1 = \hat{Z}_1\hat{Z}_2\), \(\hat{P}_2 = \hat{Z}_2\hat{Z}_3\)) without measuring the logical state.

  • Stabilizer codes generalize this framework: stabilizers define the code space, syndrome measurements identify errors, and the Knill-Laflamme conditions characterize correctable errors.

  • The toric code (§2.3.3) is a topological stabilizer code — its anyonic excitations are error syndromes, and topological protection gives distance \(d = L\) (system size).

  • The threshold theorem guarantees fault-tolerant quantum computation when \(p < p_{\mathrm{th}} \approx 1\%\); for the surface code, \(p_{\mathrm{logical}} \sim (p/p_{\mathrm{th}})^{(d+1)/2}\) — exponential suppression with code distance \(d\).

  • Course comes full circle: from qubits and their measurement (Ch1) to identical particles and anyons (Ch2) to the toric code protecting quantum information (Ch6). Quantum mechanics supports both the fragility of coherence and the tools to preserve it.

See Also

Homework#

1. Three-Qubit Bit-Flip Code: Encoding and Basis

The 3-qubit bit-flip code encodes logical qubits as:

\[\vert 0\rangle_L = \vert 000\rangle, \quad \vert 1\rangle_L = \vert 111\rangle\]

(a) Write the general logical state \(\vert\psi\rangle_L = \alpha\vert 0\rangle_L + \beta\vert 1\rangle_L\) explicitly in terms of the physical qubits. Verify that this state lies in the 2-dimensional code subspace of \(\mathbb{C}^8\).

(b) Show that a single bit-flip error \(\hat{\sigma}^x_j\) on qubit \(j\) maps both \(\vert 0\rangle_L\) and \(\vert 1\rangle_L\) to orthogonal states outside the code subspace.

(c) Explain why the syndrome measurement (parity checks \(\hat{P}_1 = \hat{Z}_1 \hat{Z}_2\) and \(\hat{P}_2 = \hat{Z}_2 \hat{Z}_3\)) does not collapse the logical state but does reveal which qubit flipped.

2. Syndrome Measurement and Error Diagnosis

Consider the 3-qubit bit-flip code. Suppose the error channel acts on qubit 2, applying \(\hat{\sigma}^x_2\) to the encoded state \(\vert\psi\rangle_L = \alpha\vert 000\rangle + \beta\vert 111\rangle\).

(a) Write the corrupted state after the error occurs.

(b) Calculate the eigenvalues of the corrupted state under the two parity operators \(\hat{P}_1 = \hat{Z}_1 \hat{Z}_2\) and \(\hat{P}_2 = \hat{Z}_2 \hat{Z}_3\). Verify that the syndrome is \((s_1, s_2) = (1,1)\).

(c) Based on the syndrome table in the lecture notes, which qubit should be corrected? Apply the correction and verify that the original logical state is recovered.

3. Three-Qubit Phase-Flip Code

Now consider protection against phase-flip errors. Define the 3-qubit phase-flip code as:

\[\vert 0\rangle_L = \vert+++\rangle = \frac{1}{2\sqrt{2}}(\vert 000\rangle + \vert 001\rangle + \vert 010\rangle + \vert 011\rangle + \vert 100\rangle + \vert 101\rangle + \vert 110\rangle + \vert 111\rangle)\]
\[\vert 1\rangle_L = \vert---\rangle = \frac{1}{2\sqrt{2}}(\vert 000\rangle - \vert 001\rangle - \vert 010\rangle + \vert 011\rangle - \vert 100\rangle + \vert 101\rangle + \vert 110\rangle - \vert 111\rangle)\]

(a) Show that \(\vert+\rangle_L\) and \(\vert-\rangle_L\) are eigenstates of \(\hat{Z}_1 \hat{Z}_2\) and \(\hat{Z}_2 \hat{Z}_3\) with eigenvalue \(+1\) and \(-1\), respectively.

(b) Explain why a phase-flip error \(\hat{\sigma}^z\) on any single qubit can be detected via the same parity checks.

(c) The phase-flip code can be understood as the bit-flip code applied in the Hadamard basis. How does the relationship \(\hat{H} \hat{\sigma}^x \hat{H} = \hat{\sigma}^z\) connect the two codes?

4. Shor Code: Combining Bit-Flip and Phase-Flip Protection

The 9-qubit Shor code encodes one logical qubit into 9 physical qubits, protecting against both bit-flip and phase-flip errors on any single qubit. The encoding is:

\[\vert 0\rangle_L = \frac{1}{2\sqrt{2}}(\vert 000\rangle + \vert 111\rangle) \otimes (\vert 000\rangle + \vert 111\rangle) \otimes (\vert 000\rangle + \vert 111\rangle)\]
\[\vert 1\rangle_L = \frac{1}{2\sqrt{2}}(\vert 000\rangle - \vert 111\rangle) \otimes (\vert 000\rangle - \vert 111\rangle) \otimes (\vert 000\rangle - \vert 111\rangle)\]

Here each \((\vert 000\rangle + \vert 111\rangle)\) is a 3-qubit phase-flip protected block, and three such blocks protect against bit-flip errors.

(a) How many independent stabilizer generators (parity checks) are required to uniquely identify errors for the Shor code? Explain your reasoning.

(b) Write down two of the stabilizer generators explicitly, and explain what error type(s) each detects.

(c) Explain briefly how the Shor code achieves protection against both bit-flip and phase-flip errors with only 9 qubits. Why is this better than naively using two separate 3-qubit codes (which would require 6 qubits)?

5. Knill-Laflamme Conditions and Code Characterization

The Knill-Laflamme conditions state that a quantum error correction code can correct errors in set \(\mathcal{E}\) if and only if:

\[\langle \psi \vert \hat{E}_i^\dagger \hat{E}_j \vert \phi \rangle = \delta_{ij} f(i,j)\]

for all \(\vert\psi\rangle, \vert\phi\rangle\) in the code subspace and all error operators \(\hat{E}_i, \hat{E}_j \in \mathcal{E}\), where \(f(i,j)\) is independent of \(\vert\psi\rangle\) and \(\vert\phi\rangle\).

(a) For the 3-qubit bit-flip code, verify the Knill-Laflamme conditions for errors \(E \in \{I, \hat{\sigma}^x_1, \hat{\sigma}^x_2, \hat{\sigma}^x_3\}\).

(b) Explain in physical terms why \(\hat{E}_i^\dagger \hat{E}_j\) must satisfy this orthogonality structure for error correction to work.

(c) Why do the Knill-Laflamme conditions not allow the 3-qubit bit-flip code to correct two or more simultaneous bit-flip errors?

6. No-Cloning and Why Quantum Error Correction Is Non-Trivial

The no-cloning theorem states that an unknown quantum state cannot be universally copied. This creates a fundamental tension with error correction: how can you protect quantum information if you cannot make backup copies?

(a) Explain how the 3-qubit bit-flip code avoids cloning by distributing information across three physical qubits without copying the original state.

(b) Suppose you attempted to store a backup copy of a logical qubit by trying to create a second independent copy of the entire encoded state. Show that this would violate the no-cloning theorem.

(c) Quantum error correction requires measuring the error syndrome without measuring the logical data. Use the no-cloning theorem to argue why this is necessary: if you could measure logical data without destroying it, what would that imply about copying quantum states?

7. Threshold Theorem and Fault Tolerance (Conceptual)

The threshold theorem states: If the physical error rate per qubit is below a critical threshold \(p_{\text{th}}\), then quantum error correction codes can be concatenated recursively, with the logical error rate decreasing exponentially in the number of concatenation layers, enabling arbitrarily large quantum computations.

(a) In simple terms, explain what “concatenation” of codes means and why it helps reduce errors.

(b) Current superconducting qubits have single-qubit gate errors around \(10^{-3}\) to \(10^{-4}\). Estimate what threshold \(p_{\text{th}}\) would need to be achieved for practical fault-tolerant quantum computers. (Current estimates are \(p_{\text{th}} \sim 10^{-3}\) to \(10^{-4}\).)

(c) The threshold theorem shows that quantum computing can be scalable in principle. What are the remaining practical challenges—beyond just meeting the threshold—that would still stand in the way of a useful large-scale quantum computer?

(d) Surface codes are a leading candidate for fault-tolerant quantum computing. Without working through detailed calculations, explain why a 2D array of qubits (as in the surface code) might be more practical than fully connected qubits for building a large quantum computer, especially regarding error correction overhead.