# Quantum Error Correction **Quantum error correction (QEC)** is the set of techniques for protecting fragile quantum information by spreading it across many [[Qubit|qubits]], so that errors can be detected and reversed *without* reading — and thereby destroying — the data. ## The core problem Quantum states are delicate ([[Coherence Time|coherence]] decays, [[Gate Fidelity|gates]] misfire), and three classical tricks are forbidden: - You **cannot copy** an unknown quantum state (the no-cloning theorem), so you can't just keep backups. - You **cannot look** at the state to check it — measurement collapses the superposition. - Errors are **continuous**, not just bit-flips; a qubit can drift by any small angle. QEC solves all three at once. ## First principles 1. **Encode, don't copy.** One [[Physical vs Logical Qubits|logical qubit]] is stored in the *collective entangled state* of many physical qubits. The information lives in the relationships between them, not in any single one. 2. **Measure the symptom, not the data.** Instead of measuring the qubits, you measure cleverly chosen *parity checks* — "is qubit A the same as qubit B?" — which reveal whether an error occurred and where, while revealing nothing about the encoded value. This is [[Syndrome Extraction]], and the checks are defined by [[Stabilizer Codes]]. 3. **Digitize the error.** The act of measuring a parity check forces a continuous error to collapse into a discrete "flip / no-flip" answer, turning an infinite problem into a finite, correctable one. 4. **Correct.** Knowing which checks fired, you infer the most likely error and undo it. > [!intuition] Reading the alarms, not the safe > Imagine valuables spread across many safes, wired to alarms that only report "two adjacent safes disagree." You learn where a break-in happened and fix it — without ever opening a safe to look at what's inside. ## What it buys you When the physical error rate is below a critical [[Code Distance and Threshold Theorem|threshold]], adding more physical qubits *lowers* the logical error rate. Reliable computation of any length becomes possible — this is **fault tolerance**. Codes differ in how efficiently they do this: [[Toric Code]], [[Surface Code]], [[qLDPC Codes]], and [[Permutation-Invariant Codes]]. ## Related - [[Physical vs Logical Qubits]] - [[Stabilizer Codes]] - [[Syndrome Extraction]] - [[Code Distance and Threshold Theorem]] - [[Surface Code]] - [[Mid-Circuit Measurement]]