Curriculum / Noise & Error Correction / The Steane Code

Lesson 9 of 14Code challengePro+150 XP

The Steane Code

CSS codes and syndrome measurement, more efficient error correction.

The Steane [[7,1,3]] Code

The Steane code, introduced by Andrew Steane in 1996, encodes 1 logical qubit in 7 physical qubits using a beautifully symmetric construction based on the classical [7,4,3] Hamming code. It is one of the most studied and practically relevant quantum error correcting codes. Everything here is the stabilizer formalism from the previous lesson at work: the code is defined by six stabilizer generators, and errors reveal themselves by anticommuting with some of them.

The [[n,k,d]] notation:

Quantum codes are described by three parameters:

  • n = physical qubits used
  • k = logical qubits encoded
  • d = code distance (minimum weight of undetectable error)

The Steane code: [[7,1,3]], 7 physical qubits encode 1 logical qubit, distance 3 (corrects any 1-qubit error).

CSS code structure:

The Steane code is a CSS code (Calderbank-Shor-Steane), which means it uses the same classical code for both X and Z stabilizers. The [7,4,3] Hamming code has parity check matrix:

H = [ 0 0 0 1 1 1 1 ]  ← X stabilizer generators
    [ 0 1 1 0 0 1 1 ]
    [ 1 0 1 0 1 0 1 ]

The 3 rows give 3 X-type stabilizers and 3 Z-type stabilizers (6 total syndrome bits), leaving 4 bits of information but encoding only 1 logical qubit (3 additional bits go to error syndromes).

The Steane code and the [7,4,3] Hamming code

The [7,4,3] Hamming code is a classical [n=7, k=4, d=3] code: 7-bit codewords, 4 information bits, minimum Hamming distance 3. The Steane code uses the dual code, the 3-dimensional subspace orthogonal to the Hamming code, as the X and Z stabilizers. This CSS construction guarantees that X and Z errors are independently correctable. Any [n,k,d] classical code where C⊥ ⊆ C yields a valid CSS quantum code.

The 7 codeword qubits:

The logical codewords are:

|0̄⟩ = (1/√8) ∑_{x ∈ C⊥} |x⟩ (sum over the 8 dual-code codewords; C⊥ is the even-weight subcode, weights {0, 4}) |1̄⟩ = (1/√8) ∑_{x ∈ C⊥} |x ⊕ 1111111⟩ (each dual codeword complemented)

This is the opening of the lesson. The full walkthrough, the interactive circuit, and the graded challenge continue inside myqubit.

How this lesson works

A hands-on coding challenge. You write Qiskit-compatible Python in the browser editor, run it instantly via WebAssembly, watch the circuit and Bloch sphere react, and pass automatic output checks. The AI tutor Qubitus gives Socratic hints if you get stuck.

Part of: Noise & Error Correction

Understand quantum noise and build error correction codes to protect quantum information.

This lesson is part of Pro

Unlock Noise & Error Correction and all 10 tracks with Pro: $12.99/month, $79/year, or $97 lifetime. Start with the free track first if you are new.