RS9 Systems Pty Ltd, Sydney

2 December 2026 · RS9 Systems Research · Lean 4.36.0

Three qLDPC codes. One proof checker. Exact circuit-level distance 6, 8 and 10.

A parity check is a smoke alarm for quantum data. This page builds that idea up to three exact certificates: BB72 at d_circ = (6,6), BB90 at (8,8), and C63 at (10,10). Lean 4 checks each finite circuit certificate. Stim and external scripts check the world around it.

BB72 [[72,12,6]] BB90 [[90,8,10]] C63 [[126,12,10]] 0 sorry · 0 native_decide · 0 custom axioms 20 min read

Hover, tap or keyboard-focus any dotted-underlined term for a short definition. Switch between Plain and Expert reading levels in the left rail.

01 · The basic idea

Start with a smoke alarm

Imagine two wires that should always carry the same bit. You could read both wires to check, but reading an unknown quantum state destroys the information you are trying to protect. A qubit has no spare copy you can peek at.

A parity check takes a different route. It asks one question: do these two bits differ? The answer is 0 when they agree and 1 when they disagree. It says nothing about whether the shared bit is 0 or 1. That single bit of parity is enough to raise the alarm when one wire flips.

Quantum error correction builds smoke alarms out of stabilizer checks. Each check is a joint measurement on a small group of qubits, and every valid codeword answers it the same way. A qLDPC code keeps those groups small and local: each check touches only a few qubits, and each qubit joins only a few checks.

Repeating the checks is the job of a memory circuit. The data qubits hold the encoded state. Helper qubits called ancillas collect the parity answers. A detector compares one parity answer with the next. In a quiet circuit the detector stays 0. A fault makes it fire.

A CSS stabilizer code is the joint +1 eigenspace of commuting Pauli checks. A stabilizer measurement reports a parity bit without reading the encoded logical state. In a qLDPC family each check acts on O(1) qubits and each qubit enters O(1) checks, so the same sparse structure survives as the code grows.

The memory circuit couples data qubits to ancilla qubits, measures the ancillas, and resets them. A detector is a parity combination of measurement outcomes that is deterministically 0 in the noiseless circuit. A detector error model records which fault locations flip each detector and each terminal logical observable. Exact certification works on that detector and observable contract.

ONE NOISY SYNDROME-EXTRACTION ROUND data 1 ancilla data 2 prepare CNOTs measure reset compare M R Detector = parity this round XOR parity last round. A single silent logical fault must fool every comparison.

A circuit-level fault is a fault at a place and a time. One bad CNOT can touch two data qubits, and a late hook can survive to the next round. The certificate counts these locations directly.

02 · What distance counts

Distance counts the faults that can fool every alarm

A code that stores k logical qubits in n physical qubits has a code distance d. It is the smallest number of physical qubit errors that can change the stored logical answer while leaving every stabilizer check satisfied. The notation [[n,k,d]] packs those three numbers together.

Real hardware adds a second layer. Gates take time, qubits idle, measurements and resets can fail, and one bad two-qubit gate can spread an error to two data qubits. The circuit-level distance d_circ counts faulty locations in that whole noisy circuit, not just errors sitting on data qubits at the end. A hook error is the classic example: one ancilla fault part-way through a check round hooks onto several data qubits as the round finishes.

The three certificates on this page pin exact .stim circuit files and prove both directions. A lower-bound argument rules out every detector-silent logical failure below the claimed weight. A replayable physical witness shows the claimed weight is reachable. The pair gives an exact value, written (Z, X) for the two memory bases.

For a fixed noisy circuit, circuit-level distance is the minimum number of faulty circuit locations, including gates, idles, resets and measurements, whose combined effect is a detector-silent logical failure. The pinned fault model charges unit cost per location under DEPOLARIZE2. The schedule and the noise model are part of the statement.

Each certificate pairs a lower bound with a distinct-location physical witness. Sector-wise terminal stabilizer membership rules out every detector-silent logical failure below the claimed weight, and a Nodup location-key witness replays at that weight. The exact value is written (Z, X) for the two memory bases. A hook error is why this value can sit below the static distance even when every noiseless round measures the intended checks.

03 · Three generations

The ladder: exact distance 6, then 8, then 10

Three generations of certificates share one architecture: parse the verbatim .stim circuit inside Lean, check its structure, prove a lower bound, and replay a physical witness. Each rung raises the exact d_circ while the raw search space grows by orders of magnitude.

All three packages parse their pinned .stim manifests inside Lean 4.36.0, check well-formedness and CSS determinism, prove sector-wise lower bounds, and replay distinct-location witnesses. BB72 and BB90 use 6 noisy rounds plus 2 noiseless closing rounds. C63 uses 10 fully noisy rounds with 0 noiseless closing rounds.

Ladder chart · choose a measured quantity

Raw search space is C(K, d-1) with K = 180, 225 and 315. Peak RSS mixes published measurements: BB72 is a cold parallel lake build reference because its standalone leanchecker run logged exit 0 without wall or RSS; BB90 and C63 are empty-environment leanchecker --fresh runs. Circuit and certificate representations differ, so these are observed implementation measurements.

Code Pinned circuit Exact d_circ (Z, X) Kernel replay
BB72 [[72,12,6]]
Z_6 x Z_6
IBM fa77e33, 6 noisy + 2 noiseless closing rounds. 144 qubits, 648 measurements, 288 detectors, 12 observables, 65 ticks. (6, 6) Cold parallel lake build 18.69 min / 10.03 GiB. leanchecker exit 0, RSS unlogged.
BB90 [[90,8,10]]
Z_15 x Z_3
IBM fa77e33, 6 noisy + 2 noiseless closing rounds. 180 qubits, 810 measurements, 360 detectors, 8 observables, 65 ticks. (8, 8) leanchecker --fresh: 8.00 min / 7.11 GiB (Z), 19.03 min / 7.16 GiB (X).
C63 [[126,12,10]]
cyclic C_63
10 fully noisy rounds, 0 noiseless closing rounds. 252 qubits, 1,386 measurements, 1,260 detectors, 12 observables, 81 ticks. (10, 10) leanchecker --fresh: 27.43 min / 3.74 GiB (Z), 25.36 min / 3.78 GiB (X).

04 · Generation 1

BB72: the same checks in a different order can halve the distance

BB72 is IBM's [[72,12,6]] bivariate bicycle code on a Z_6 x Z_6 torus. The standard fa77e33 depth-7 schedule gives exact d_circ = (6,6) on 6 noisy rounds plus 2 noiseless closing rounds. The pinned manifests carry 144 qubits, 648 measurements, 288 detectors, 12 observables and 65 executed ticks.

The schedule is part of the code's protection. Five valid depth-7 schedules measure the same checks, and their exact distances are d ∈ {6,6,5,4,3}. Changing the order changes where a hook lands. The lab below lets you scrub through the CNOT slots and watch a late hook reach the readout.

BB72 has 72 data qubits, 36 X-ancillas and 36 Z-ancillas on Z_6 x Z_6. The 2 Dec paper certifies the standard fa77e33 schedule at exact d_circ = (6,6) on the byte-bound 6-noisy + 2-noiseless-closing .stim manifests, and audits five valid depth-7 schedules at d ∈ {6,6,5,4,3} in both sectors on the formal circuit DSL. Three manifests carry the byte-bound bridge: standard Z, standard X and comparison d = 3 Z. The other schedules are certified on the DSL.

The audit uses full ancilla-flow validity, isValidCnotFlow, rather than data-qubit readout alone. A deliberately swapped-slot regression keeps all 72 single-qubit data-error images intact and is rejected by the flow check. The same package proves reset equivalence between full ancilla clearing execFwd and IBM's basis-specific reset execFwdIBM modulo stabilizers.

BB72 depth-7 schedule lab · 72 data qubits, 36 X-ancillas, 36 Z-ancillas

Left (L) and Right (R) 6×6 data tori. Highlighted: 3 late-cycle X-ancilla hooks at (0,0), (2,2), (4,4).

Cycle 1 readout (t = 7)
Slot01234567

LEAN 4 KERNEL PASS · EXACT d_circ = 6

3 late hooks fire 0 detectors in cycle 0, 12 in cycle 1

Noiseless ancilla flow
Proved circuit distance
Z-checks triggered
Logical Z observable

Follow one fault to the readout

Step through the same IBM schedule one stage at a time. The three faults land late in cycle 0, after the Z-checks have already been measured. They spread to six data qubits and stay invisible until the next cycle's readout.

The five-schedule hook audit

All five schedules below pass the full ancilla-flow check and measure the same code. Pick one to see its exact distance and the certificate route used in the 2 Dec paper.

Ancilla flow
Exact d_circ
Certificate route
Witness and bound

The audit set is d ∈ {6,6,5,4,3} in both sectors. The 2 Dec paper carries the byte-bound .stim bridge on standard Z, standard X and comparison d = 3 Z manifests; the alternative d = 6, hook-degraded d = 5 and d = 4, and comparison d = 3 X schedules are certified on the formal circuit DSL.

05 · Generation 1, continued

Proving distance at least 6 for every round count R, not just one fixed run

A finite search can certify one round count at a time. BB72 goes further on the formal circuit DSL. Its all-rounds theorem says that no silent logical failure of weight 5 or less exists for any natural number R, with matching weight-6 witnesses at R ∈ {3,6,12}.

The argument uses locality in time. A single-cycle fault touches detectors in a two-cycle stencil. Five faults either have a quiet gap of at least two cycles, which splits them into smaller independent clusters, or they fit inside a six-round window that shifts directly into the certified R = 6 theorem. The slider below draws both cases.

AllRoundsPersistence.lean elaborates in 56.05 s at 3.73 GiB peak RSS. A single R = 1 stencil check, checkOneCycleStencil, verifies 2-cycle sparsified detector support. Any silent weight-≤5 history either splits across a temporal gap of at least 2 cycles into disjoint weight-≤4 clusters, excluded by checkPairTrie, or fits inside a 6-cycle window that time-translates into the certified R = 6 theorem. The result holds under both execFwd and execFwdIBM.

The pinned byte-bound .stim bridge is at R = 6. Exact DSL instances are proved at R ∈ {3,6,12}, and d_circ(R) ≥ 6 persists for all R ∈ ℕ on the DSL. This all-rounds result is specific to BB72; BB90 and C63 are finite-manifest certificates.

06 · Generation 2

BB90: 90 data qubits, exact circuit distance 8

BB90 is a [[90,8,10]] bivariate bicycle code on Z_15 x Z_3. Its static distance is 10, yet the pinned IBM fa77e33 circuit has exact d_circ = (8,8). The circuit runs 6 noisy rounds plus 2 noiseless closing rounds, with 180 qubits, 810 measurements, 360 detectors, 8 observables and 65 ticks.

Generation 2 also hardened the shared .stim frontend. Differential fuzzing ran 12,011 cases with 0 unexpected accepts and 5,541 of 5,541 exact detector and observable response matches. A compiler-CI test on a Steane-BB72 lattice-surgery circuit caught a single bridge-CNOT swap that lifted canonical weight-2 undetectable pairs from 9 to 11 while leaving the noiseless truth table intact. Both are external checks, outside Lean's kernel.

BB90 replays through leanchecker --fresh in 8.00 min / 7.11 GiB for Z and 19.03 min / 7.16 GiB for X. The package has 114 Lean files and 32,729 lines, 69 axiom-audited declarations and 8 type-pinned headline propositions. Its raw coarse space is C(225,7) = 5,271,289,966,800, 3,541 times BB72's.

External parity checks report 0 mismatches across 105,840 FlipSim single-Pauli outcomes and 78,840 DEM explanations. Track A fuzzing records 0 unexpected accepts in 12,011 cases, with 5,541 of 5,541 jointly DEM-eligible responses matched. Track C compiles a 212-qubit Steane-BB72 circuit and catches the bridge-CNOT swap as canonical weight-2 pairs move from 9 to 11 in 0.07 s.

07 · Generation 3

C63: ten fully noisy rounds, exact circuit distance 10

C63 is a cyclic weight-6 [[126,12,10]] code. Its certificate runs 10 fully noisy rounds with 0 noiseless closing rounds: 252 qubits, 1,386 measurements, 1,260 detectors, 12 observables and 81 executed ticks. Exact d_circ = (10,10) holds on that full noisy manifest.

The code is isomorphic to Table 4 of Lin et al. (arXiv:2502.19406v3). External exact integer enumeration also shows it is non-isomorphic, even as a stabilizer code, to their Table 1 GB63. That matters because GB63's reported d_C = 10* came from statistical search. The non-isomorphism result is an external analysis and sits outside Lean's kernel.

C63 uses 12-lane 128-bit SWAR shift maps, 6-bit chunk-skipping colXor126, a 32-slice checkpointed BackState, chunked FoldNode exclusion, separate observable bits, and an append lemma that stays inside the default recursion depth. The raw coarse space is C(315,9) = 74,980,055,027,883,005, 14,224 times BB90's 5.27 × 10^12. Empty-environment replay uses 3.74 GiB (Z) and 3.78 GiB (X), down 47.36% and 47.24% from BB90.

The C63 package has 120 Lean files and 86,893 lines, 12 type-pinned headline propositions, and Gate 4's decide +kernel collision test over 1,281 detectors. External checks report 0 mismatches across 247,464 FlipSim outcomes, 96,894 DEM supports and 81,648 live Lean StimEval tuple checks, with 64 of 64 witness replays.

C63 reduction stageZ-memoryX-memory
Raw 9-column combinations74,980,055,027,883,005
Anchored supports of weight ≤ 3108,681
Canonical TripleTable keys73,442
Branch-and-bound subtree nodes370,138343,508
Frontier tasks8,7638,239
FoldNode nodes at weights 8 and 96,46510,678
Bad weight-8 orbits16
Bad weight-9 orbits78210
Surviving logical lifts at weight ≤ 900
Weight-10 witness observable mask0xcf10xfc8

The funnel is a finite exclusion argument. Zero surviving lifts at weight 9 or below gives the lower bound; the weight-10 Nodup witnesses give the matching upper bound.

08 · External timing analysis

Merging measurement and reset saves a tick in the model

A standard cycle measures the ancilla on one tick and resets it on the next. A merged measurement-reset operation, MR, does both in a single tick. Under a single-tick t(MR) = 1 timing model, the steady-state C63 cycle drops from 8 ticks to 7, a 12.50% reduction. Over 10 rounds the pinned circuit drops from 81 ticks to 72, an 11.11% reduction.

Exact d_circ = (10,10) survives the compression, including simultaneous single-location correlated-MR faults. This is an external finite-circuit Stim 1.16.0 and exact FoldNode/MITM analysis. It sits outside Lean's kernel, and the 12.50% figure is a timing-model result. A real machine's gain depends on its actual measurement-reset latency compared with separate measurement and reset.

In the 8-tick cycle, tick t = 7 executes MX on X-ancillas and R on Z-ancillas while all 126 data qubits idle. Merging MX/RX into MRX at t = 0 and M/R into MR at t = 6 deletes t = 7. The external audit finds identical standard-noise DEM support sets (48,447 = 48,447, with 3,591 probability-changed columns), 32 of 32 compressed weight-10 witness replays, and 0 nonzero coarse columns across 3,591 correlated-MR events. Both FoldNode and exact MITM exclude the weight-8 orbits.

C63 steady-state cycle · 8-tick Lean certificate vs external T_MR(7)

Single-tick t(MR) = 1 model. Physical hardware latency depends on the actual t(MR) against t(M) + t(R). The merged-MR analysis is external and is not yet formalized in Lean; StimParser.lean does not yet include MR/MRX constructors.

09 · Scope

What this shows, and what it does not show

A proof checker is only as good as its boundary. Lean's kernel replays every inference step of the certificates. It does not vouch for the Python scripts, the simulator, or the claim that a file on disk is the file you meant to check. Those get separate, explicit treatment.

All audited headline theorems use Lean 4.36.0 with zero sorry, zero native_decide, and zero custom axioms. Their transitive axiom dependencies stay inside [propext, Classical.choice, Quot.sound], the three standard axioms of Lean's logic.

Inside Lean's kernel

  • Verbatim .stim parsing, well-formedness and CSS determinism for each pinned manifest.
  • Exact lower bounds by sector-wise terminal stabilizer membership, and distinct-location physical witnesses replayed under unit-cost DEPOLARIZE2 charging.
  • BB72 exact d_circ = (6,6), the five-schedule DSL audit, exact R ∈ {3,6,12} instances, and ∀ R all-rounds persistence on the DSL.
  • BB90 exact d_circ = (8,8) and C63 exact d_circ = (10,10), both replayed with leanchecker --fresh.
  • C63 Gate 4's decide +kernel collision test over 1,281 detectors.

Outside the kernel

  • Disk-to-Lean byte and SHA-256 manifest pins, checked by an external snapshot script.
  • Stim 1.16.0 FlipSimulator, detector error model and live Lean evaluator parity: 27,216 BB72 per-location checks, 105,840 plus 78,840 BB90 checks, and 247,464 plus 96,894 plus 81,648 C63 checks, all with 0 mismatches.
  • Track A differential .stim fuzzing and Track C Steane-BB72 compiler CI.
  • Exact integer enumeration of the C63 and GB63 non-isomorphism.
  • The merged-MR T_MR(7) timing and correlated-fault analysis, including the 12.50% steady-state tick reduction.

The codes and schedules are prior work. The contribution here is the Lean 4.36.0 verification architecture and the exact finite-manifest certificates. All-rounds persistence is proved for BB72 on the circuit DSL only. The RSS comparison is an observed implementation difference, with no per-primitive scaling law claimed.

What this page does not claim

  • No hardware threshold, decoder latency or coherent-noise result. The certificates are exact for their pinned discrete fault models.
  • No all-rounds theorem for BB90 or C63. Their exact values apply to the pinned finite manifests.
  • No Lean-checked merged-MR schedule. T_MR(7) is external, under the stated single-tick timing model.
  • No claim that a smaller peak RSS at a larger raw search space isolates one kernel primitive. Circuit and certificate representations both differ across the ladder.

10 · Sources

Read and cite the paper

The 2 Dec paper is archived on Zenodo with a permanent DOI. The 13-page PDF is served here. The earlier 29 Nov BB72-only preprint remains available below, together with its public Lean source.

Dale Richards-Smith. Machine-Checked Circuit-Level Distance Certification for qLDPC Codes at d_circ ∈ {6, 8, 10}. RS9 Systems, 2 December 2026. Zenodo. https://doi.org/10.5281/zenodo.24743740.

Download the 2 Dec paper (PDF) Zenodo record 24743740

Download the earlier 29 Nov BB72-only preprint (PDF) BB72 Lean 4 source on GitHub (pinned commit 55d6ee8)

Dale Richards-Smith. Machine-Checked Circuit-Level Distance Certification for qLDPC Codes at d_circ in {6, 8, 10}. RS9 Systems, 2 December 2026. Zenodo. https://doi.org/10.5281/zenodo.24743740

@misc{richards_smith_2026_qldpc_lean_d6_to_d10,
  author    = {Dale Richards-Smith},
  title     = {Machine-Checked Circuit-Level Distance Certification
               for qLDPC Codes at d_circ in {6, 8, 10}},
  year      = {2026},
  month     = dec,
  publisher = {RS9 Systems},
  doi       = {10.5281/zenodo.24743740},
  url       = {https://doi.org/10.5281/zenodo.24743740}
}

Companion packages qec-bb90-stim-auditor and rs9-c63-lean-d10 are bundled with the unified archival release. Generative AI tools assisted with developing the Lean formalizations, reviewing the implementation, and drafting and revising the manuscript.