Sign in
← Atlas
Strong empiricalOperatorsQuantum error correction

Shor nine-qubit error-correction code

A foundational code record that compares quantum protection with the narrower classical repetition-code idea.

error correctionstabilizerfault tolerantsyndrome

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.

Shor's code encodes one logical qubit into nine physical qubits and combines protection against bit-flip and phase-flip errors. It is a teaching and architecture reference, not a claim that adding qubits automatically improves a current device.

Circuit & simulation
Logical fidelity90%
What this takes and returns
TakesNothingWhat joins here

No input port, deliberately. You measure a state with this entry; you do not apply it and pass a register on.

Nothing in the Atlas meets this end.

ReturnsNothingWhat joins here

No output port, deliberately. An observable is measured with, never applied, so there is no register to hand on.

Nothing in the Atlas meets this end.

Not a stage. You measure a state with this; you do not apply it and pass a register on. It has a width and deliberately no ports. See all 60 →

How it works

Shor's nine-qubit code protects one logical qubit against an arbitrary single-qubit Pauli error by nesting two three-qubit repetition codes in complementary bases. First, ψ=α0+β1|\psi\rangle=\alpha|0\rangle+\beta|1\rangle is encoded phase-flip-style into α++++β\alpha|{+}{+}{+}\rangle+\beta|{-}{-}{-}\rangle using HH and CNOTs, then each of those three qubits is bit-flip-encoded via 0000|0\rangle\to|000\rangle, 1111|1\rangle\to|111\rangle, giving nine physical qubits. Ancilla-assisted stabilizer measurements (ZiZjZ_iZ_j within each triple, and XX-type parity across triples) identify which error class occurred — bit flip, phase flip, or both — without collapsing the encoded logical amplitudes α,β\alpha,\beta, and a decoder applies the matching Pauli correction. This record documents that stabilizer structure as a code-level reference, matching its own caveat: whether encoding nine noisy physical qubits actually beats one bare qubit depends on the calibrated noise model, since encoding, syndrome extraction, and ancilla errors can outweigh the protection on small noisy devices.

Implementation
Native
shor_code_reference.py
from qiskit import QuantumCircuit

qc = QuantumCircuit(9)
# Encode a logical qubit with bit- and phase-flip repetition blocks.
qc.cx(0, 1)
qc.cx(0, 2)
qc.h([0, 1, 2])
# Syndrome extraction and recovery depend on the chosen decoder.

FINAL_CIRCUIT = qc

The construction is intentionally a code-level reference; a useful benchmark must add a calibrated noise channel and decoder.

Quantum vs classical

Classical baseline

A three-bit classical repetition code can correct a bit flip under an independent noise model, but it does not protect an unknown qubit phase.

Quantum claim

Uses redundant quantum degrees of freedom and syndrome information to protect against a single-qubit Pauli error in the idealized code model.

How to compare

Compare logical error rate with and without encoding under the same calibrated noise, including all syndrome and recovery operations.

Declared gaps

Nobody has reviewed this record for gaps yet.

Literature & references
Scheme for reducing decoherence in quantum computer memory1995 · Peter W. Shor

Introduces an early quantum error-correction scheme for reducing decoherence in memory.

doi.org/10.1103/physreva.52.r2493
Good Quantum Error-Correcting Codes Exist1995 · A. R. Calderbank, Peter W. Shor

Places quantum codes in a broader rate and distance framework.

arxiv.org/abs/quant-ph/9512032