Skip to main content
Sandbox Physics

Q045 · Detect, decode and repair

Quantum Error Correction

Can you find an error without reading the encoded message? Yes. Auxiliary checks reveal how an error changed relations between encoded qubits, leaving the logical message unread. Their combined result, the syndrome, selects a repair for the errors the code can correct. Ideal repetition checks repair bit flips; the five-qubit code corrects any single-qubit error.

Move an error between encoded qubits, read the auxiliary checks and test the repair. Compare bit-flip protection with a five-qubit code.

Interactive modelQuantum Error Correction
Recorded trials00
From the current records—\text{—}
One message encoded in several data qubits
Inspect the check operators

Only the auxiliary qubit is read here

Ideal circuit protocol. The lines are registers, not atom trajectories. One auxiliary qubit is reset and reused for each check.

  1. Encode + noise
  2. Read checks
  3. Decode
  4. Correct
  5. Verify

Ready. Nothing recorded yet.

02 / What the records say

A quiet check can still miss an error.

Ideal target-state verification, with pointwise 95% Wilson intervals. The unencoded comparator is an independent qubit exposed to the same memory channel and forced error.

—\text{—}

—\text{—}

03 / The decoder sees only the checks

The same syndrome always gets the same suggested repair.

Multiple errors can imitate one correctable error. A flipped syndrome can trigger the wrong repair. The final target projection consumes the encoded state and is kept separate from the syndrome measurement.

04 / Save the evidence

Compare complete recorded samples.

Most recent twelve trials shown. Export keeps every zero and every failed outcome. Save up to six samples, then restore their settings and records.

Code, fault model & scientific sources

Generators are measured through a fresh auxiliary qubit: Hadamard, controlled Pauli factors, Hadamard, readout. After each controlled gate the touched data qubit may receive a uniform Pauli fault. Ancilla propagation faults, leakage, correlated noise, encoding faults and verification faults are omitted. Memory noise acts independently on each data qubit before extraction. Correction gates are ideal.

—\text{—}

The repetition code protects against bit flips only. The five-qubit code corrects any single-qubit error when the checks are perfect. The random error rates belong to one assumed noise model; they are not a hardware error breakdown or a fault-tolerance threshold. Resource counts cover the checks only, not encoding or verification circuits.

IBM · Stabilizer codes · Laflamme et al. · Perfect quantum code

Physics tutorial

Quantum Error Correction

BackgroundMove an error between encoded qubits, read the auxiliary checks and test the repair. Compare bit-flip protection with a five-qubit code.

Why it mattersPredict from what you can actually observe, then check the prediction separately.

Start with the essentials

Focus question
Can you find an error without reading the encoded message?
One-sentence intuition
A stabilizer check reveals the error syndrome and leaves the logical superposition intact. The final target measurement asks a different question, and it destroys the state.

Core mathematical model

The encoded message stays a superposition

∣ψL⟩=α∣0L⟩+β∣1L⟩,Sj∣ψL⟩=∣ψL⟩|\psi_L\rangle=\alpha|0_L\rangle+\beta|1_L\rangle,\qquad S_j|\psi_L\rangle=|\psi_L\rangle

Encoding spreads the superposition over the code space. It does not clone the input into independent copies.

Syndrome check with an auxiliary qubit

Mb=I+(−1)bSj2M_b=\frac{I+(-1)^b S_j}{2}

A Hadamard on the auxiliary qubit, a controlled stabilizer and a final Hadamard carry out these projectors. The syndrome on screen is the classical readout, including any readout flips you selected.

When the repetition code fails

Pfail=3p2(1−p)+p3P_{\rm fail}=3p^2(1-p)+p^3

For an encoded zero state with independent bit-flip errors in memory and perfect syndrome extraction, the code fails only when two or three bits flip. It does not protect against phase errors, and it does not establish a fault-tolerant threshold.

Final check against the known state

Ppass=∣⟨ψL∣ψrecovered⟩∣2P_{\rm pass}=|\langle\psi_L|\psi_{\rm recovered}\rangle|^2

The ideal projection onto the target state is sampled into pass or fail records. It is not a syndrome measurement, and it is not a general measure of logical error.

Common difficulties

What was measured?

Typical misconceptionThe syndrome is the logical message.

Better mental modelThe decoder sees only the auxiliary check bits. The final projection onto the known target is a separate test that destroys the state.

What a simulation can show

Typical misconceptionA successful simulated run certifies a device.

Better mental modelThe small register is simulated exactly, with one auxiliary qubit that is reused. Pauli faults in memory, faults after controlled gates that hit only data qubits and classical flips of the syndrome readout are set separately. Encoding and the final verification are ideal. A single round of syndrome extraction is not fault tolerant and does not establish a threshold.

Run the experiment

  1. 01

    Choose a comparison

    Repair a bit flip with the repetition code. Then keep the code and switch to a phase-sensitive input with a phase error.

    What to observe: The phase error can leave every check silent and still fail the final verification.
  2. 02

    Run the full protocol

    Repeat the phase-error experiment with the five-qubit code. Follow syndrome extraction, decoding, correction and final verification one step at a time.

    What to observe: The syndrome from the auxiliary qubit picks the repair without reading the logical amplitudes.
  3. 03

    Push the assumptions

    Remove the forced error and raise the gate or readout errors. Compare how often encoded and unencoded qubits survive, alongside the resources the checks use.

    What to observe: Noisy correction can make things worse. One round of these unprotected checks is not fault tolerant.

Related experiments and articles

Quantum evidence · Reading path

Clocks, traps and single-quantum control

Articles on this path that use this experiment, followed by the other experiments they suggest.

  1. ArticleKeeping a chosen number of photons in a cavity
  2. LabCavity Photon Counting & FeedbackCompare a limited feedback model with fresh verification data
  3. LabDecoherence Channels & Information LossCompare loss and dephasing
  4. LabQuantum State & Process TomographyDistinguish an estimated state from verification data

Quantum evidence · Reading path

Bell tests and photon information

Articles on this path that use this experiment, followed by the other experiments they suggest.

  1. ArticleHow Bell tests distinguish quantum correlations
  2. LabBell Correlations & CHSHSee how sampling and detector efficiency affect a Bell test
  3. LabQuantum State & Process TomographyReconstruct a quantum state from measurements
FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy