Quantum computers make mistakes — a lot of them. A typical superconducting qubit gate has a 0.1–1% error rate. Run a 1000-gate circuit and you're essentially guaranteed to get a wrong answer. This isn't a bug in current hardware; it's a fundamental challenge. Quantum error correction (QEC) is the solution — and understanding it is key to understanding where quantum computing is headed.
Why Quantum Errors Are Different
Classical computers have errors too, but they're easy to handle: copy the bit three times, and take a majority vote. If one copy flips, the other two outvote it.
Qubits can't be copied — the no-cloning theorem forbids it. You cannot measure a qubit to check for errors without collapsing its superposition. And quantum errors aren't just bit flips: there are also phase errors (where the relative phase between |0⟩ and |1⟩ shifts) and combinations of both.
The Three Types of Quantum Errors
Every quantum error can be decomposed into combinations of three Pauli operators:
- X error (bit flip): |0⟩ → |1⟩ and |1⟩ → |0⟩. Like a classical bit flip.
- Z error (phase flip): |0⟩ → |0⟩, |1⟩ → −|1⟩. No classical analog — affects the phase.
- Y error: Combined X and Z error simultaneously.
Any error on a qubit can be expressed as a linear combination of X, Y, Z (and identity). This means if we can correct X and Z errors independently, we can correct any error — a key insight for QEC.
The Big Idea: Redundancy Without Copying
QEC encodes one logical qubit across many physical qubits. The idea is similar to classical repetition codes, but adapted for quantum mechanics.
The simplest example is the 3-qubit bit-flip code: encode |0⟩ as |000⟩ and |1⟩ as |111⟩. If one qubit flips, you detect it by measuring parity between pairs of qubits (without measuring their actual values) and correct it:
Logical |0⟩ = |000⟩
Logical |1⟩ = |111⟩
If qubit 1 flips: |100⟩ or |011⟩
Parity check: measure (q0 ⊕ q1) and (q1 ⊕ q2)
→ 10 → qubit 0 flipped → apply X to correct
The parity measurements use ancilla qubits — helper qubits that absorb the error information without disturbing the data qubits. This is the magic: you can detect errors without collapsing the encoded state.
The Surface Code: Today's Leading Approach
The surface code is the most promising QEC code for near-term hardware. It encodes one logical qubit in a 2D grid of physical qubits arranged like this:
● — ● — ● — ●
| | | |
● — ● — ● — ●
| | | |
● — ● — ● — ●
| | | |
● — ● — ● — ●
Data qubits (●) hold the quantum information. Ancilla qubits between them continuously measure parity. A 7×7 grid (49 physical qubits) encodes 1 logical qubit with error rate ~p² — if physical gate error rate is 1%, the logical error rate drops to ~0.01%.
The surface code's threshold is ~1%: if hardware gate errors are below this, adding more physical qubits makes the logical error rate arbitrarily small. IBM's best systems are approaching this threshold.
How Many Physical Qubits Do You Need?
To run Shor's algorithm to break RSA-2048 error-free, estimates suggest:
- ~20 million physical qubits
- Each logical qubit needs ~1000–10,000 physical qubits
- Gate error rates must be below 0.1%
Current hardware: ~1000 qubits, ~0.1–1% gate errors. The gap is real — we're roughly 10–15 years from fault-tolerant RSA-breaking quantum computers.
For near-term quantum advantage in chemistry or optimization, the requirements are much lower: ~100 logical qubits might be sufficient for molecules beyond classical reach.
What This Means for NISQ Devices Today
Current NISQ devices don't have QEC. Every gate adds noise. The approach instead is:
- Keep circuits shallow — fewer gates = less accumulated noise
- Use error mitigation (not correction) — post-processing techniques like Zero Noise Extrapolation (ZNE) that reduce the effect of errors statistically without extra qubits
- Design noise-tolerant algorithms — VQE, QAOA, and other variational methods are designed to be robust to moderate noise
HLQuantum includes built-in error mitigation that can be applied to any circuit:
result = hlq.run(
qc,
backend="qiskit",
device="ibm_sherbrooke",
error_mitigation="zne", # Zero Noise Extrapolation
shots=8192
)
ZNE amplifies the noise intentionally at multiple levels and extrapolates back to the zero-noise limit. It's not QEC — it's a statistical trick — but it works remarkably well for short circuits.
The Near-Term Milestones to Watch
Error correction demonstration at scale — IBM, Google, and Microsoft are racing to demonstrate that surface code logical qubits outperform physical qubits (error rate below the threshold). Google claimed a below-threshold demonstration in late 2024.
Magic state distillation — Non-Clifford gates (like T gates) require special distillation protocols in fault-tolerant architectures. This is currently extremely expensive in qubit overhead.
Logical gate speed — Logical gates in surface codes are much slower than physical gates. Speeding them up is a key hardware challenge for 2026–2030.
For a deeper dive into how error correction interacts with specific SDKs, see the quantum error correction glossary entry and the NISQ era guide.