Same code. Two valid schedules. Six faults versus three.
Every valid depth-7 schedule measures the exact same [[72, 12, 6]] checks, yet hook errors halve distance. Lean 4's kernel catches them directly from .stim.
Left (L) and Right (R) 6×6 data tori. Highlighted: 3 late-cycle X-ancilla hooks at (0,0), (2,2), (4,4).
LEAN 4 KERNEL PASS · EXACT d_circ = 6
3 late hooks caught by 12 Z-checks
Under IBM's pinned fa77e33 schedule, late-cycle X-ancilla hooks on (0,0), (2,2), and (4,4) fire 0 detectors in cycle 0 and 12 Z-checks on cycle 1 readout. Lean 4 excludes every silent logical failure of weight 5 or less across both bases (R = 6 .stim bridge) and proves d_circ(R) ≥ 6 for all R on the DSL.
- Noiseless ancilla flow
- Valid (isValidCnotFlow = true)
- Proved circuit distance
- d_circ = 6 (X & Z sectors)
- Z-checks triggered
- 12 / 36 detectors
- Logical Z observable
- Protected (0 silent flips ≤ 5)
| Layer | t0 | t1 | t2 | t3 | t4 | t5 | t6 |
|---|
Kernel theorem: bb72_stim_Z_memory_silent_is_stabilizer and bb72_stim_Z_memory_witness_weight_6. Zero sorry, zero native_decide, zero custom axioms.
Why noiseless check tests miss both hook collapse and crossing leaks
A Bivariate Bicycle code's static distance (d = 6 for BB72, [[72, 12, 6]]) counts data-qubit flips. Real hardware measures each weight-6 parity check with six sequential CNOT gates. If a single two-qubit fault strikes an X-ancilla near the end of the cycle, the remaining CNOTs copy that error onto two data qubits at once.
Failure mode A: valid reorder drops distance from 6 to 3
In comparisonD3Schedule (sX = [0, 3, 1, 4, 2, 5], sZ = [2, 5, 1, 4, 0, 3]), every noiseless cycle measures the exact check matrices H_X and H_Z with zero cross-ancilla leakage. Yet three joint XX faults in cycle 0, slot 5 (operations 396, 410, and 424 on X-ancillas 0, 14, and 28) spread into six data errors along the torus diagonal.
Result: 3 faults, 0 of 288 detectors fired across all cycles, logical Z observables 3 and 8 flipped. Lean 4 proves both that weight-3 witness (comparison_schedule_witness_weight_3) and the matching lower bound excluding all silent logical failures of weight 1 or 2 (ScheduleSuite.CompD3_X.distance_ge_3).
Failure mode B: swapping two X layers leaks ancillas while data checks stay green
In our deliberately constructed regression test astraSwappedSlotSchedule, swapping only X-check slots 1 and 5 of IBM's standard schedule ([1, 4, 3, 5, 0, 2] to [0, 4, 3, 5, 1, 2]) still preserves all 72 single-qubit data-error images identically. Naive data-only noiseless tests stay green.
Full ancilla-flow verification traces X-ancilla 0 onto six Z-checks (4, 7, 13, 21, 24, 30) and rejects the schedule immediately inside Lean 4 (neg_control_astra_swapped_slot_rejected).
Verified directly on raw .stim text, with zero Python in the trust base
Unverified translation scripts between a circuit generator, a detector error model (DEM), and an external solver are where real sign, offset, and detector-binding bugs hide. StimParser.lean parses our verbatim pinned 65,568-byte Z-memory (599 lines) and 65,536-byte X-memory (600 lines) .stim exports directly inside Lean 4's kernel, resolving every chronological rec[-k] detector target against the complete measurement log.
parseAndCompileStimLines = some ops (UTF-8 byte identity checked in Lean; SHA-256 320081c6... verified by ci_audit.sh)
All 599 lines, 288 chronological rec[-k] detector bindings, positive decimal noise literals, disjoint CX/DEPOLARIZE2 batches, and 12 terminal OBSERVABLE_INCLUDE masks compile identically to the certified BB72 op stream.
Proving distance at least 6 for every round count R, not just one fixed run
Finite-round SAT and MIP solvers certify one fixed round count R at a time. While our verbatim .stim text bridge is pinned at R = 6, AllRoundsPersistence.lean proves on the straight-line circuit DSL (repeated standard BB72 schedule with two noiseless closing cycles, checked in 56.1s) that no silent logical failure of weight 5 or less exists for any R in N (with matching weight-6 upper witnesses proved at R = 3, 6, 12), under both two-sector reset clearing (execFwd) and IBM's basis-specific reset (execFwdIBM).
Every single-cycle fault has 2-cycle sparsified detector locality (d_0 = 0 or d_2 = 0). Any 5 faults without a 2-cycle gap fit inside a 6-round window and shift by -c_min directly into the certified R = 6 theorem.
Measured verification cost, Stim comparison, and scaling boundaries
All measurements below were recorded on a single local Apple M5 Ultra workstation at $0 cloud spend using Lean v4.36.0 and Stim 1.16.0. Fresh parallel clean build (lake build) across all 16 modules finishes in 18m 41s (10.03 GiB peak RSS); scripts/ci_audit.sh verifies manifest SHA-256 digests, scripts/audit_axioms.lean checks UTF-8 byte identity and all 2,045 module-owned theorem entries (75 headline theorems), and standalone leanchecker replays the kernel.
| BB72 Schedule (R = 6, Z-mem) | Flow check | Stim graphlike | Stim heur (cap 4) | Stim heur (cap 5) | Lean 4 exact d_circ |
|---|---|---|---|---|---|
| ibmStandardSchedule | valid | No graphlike logical | 6 (UB) | 6 (UB) | = 6 at R = 3, 6, 12 (≥ 6 ∀ R DSL) |
| altGoodD6Schedule | valid | No graphlike logical | 6 (UB) | 6 (UB) | = 6 (LB + UB) |
| hookD5Schedule | valid | No graphlike logical | 6 (missed wt-5) | 5 (UB) | = 5 (LB + wt-5 wit.) |
| hookD4Schedule | valid | No graphlike logical | 6 (missed wt-4) | 4 (UB) | = 4 (LB + wt-4 wit.) |
| comparisonD3Schedule | valid | No graphlike logical | 3 (UB) | 3 (UB) | = 3 (LB + wt-3 wit.) |
| astraSwappedSlotSchedule | rejected | N/A (invalid flow) | N/A | N/A | Rejected (ancilla leak) |
Stim settings: shortest_graphlike_error(ignore_ungraphlike_errors=True) found no graphlike logical error; search_for_undetectable_logical_errors ran with dont_explore_edges_with_degree_above=9999, dont_explore_edges_increasing_symptom_degree=False, and dont_explore_detection_event_sets_with_size_above set to 4 or 5. Stim also provides shortest_error_sat_problem() for exporting WDIMACS to an external MaxSAT solver, and unverified exact tools like tropidist (all 8,496 uniform depth-7 one-ancilla BB72 schedules) and codeDistance compute fixed-round distances numerically. RS9's distinction is an independently replayable Lean 4 kernel lower bound tied directly to .stim semantics, plus universal ∀ R DSL persistence.
| System / Paper (2026) | Target scope | Trusted base | Exact distinction of RS9 BB72 |
|---|---|---|---|
| QECLean (arXiv:2611.21236) & Lean-QEC (arXiv:2605.16523) | Static code-capacity [[n, k, d]] (through BB90 and 360-qubit d = 24) | Lean 4 kernel (+ compiler in Lean-QEC) | Certifies static check matrices; RS9 certifies noisy multi-round extraction circuits and separates 5 schedules on the same static code (d = 3 to 6) with zero native_decide. |
| PC-QEC (arXiv:2611.12985v2) | Parametric surface/toric + finite BB [[18,4,4]] & HGP benchmarks | Lean 4 metatheory + trusted OCaml checker | Uses single-wire fault charging and an external OCaml checker; RS9 verifies IBM's BB72 detector contract under joint 15-Pauli CNOT faults purely inside Lean's kernel. |
| tropidist (arXiv:2611.08247) & codeDistance (arXiv:2603.22532) | Exact circuit distance at finite R (Python / C+OpenMP / Gurobi / SAT) | Unverified solver + DEM compiler stack | Fast numerical discovery at fixed R; RS9 provides kernel-checked lower bounds, verified .stim parsing, and universal ∀ R persistence. |
BB72CircuitDistance.MainTheorems
Top-level theorems combining verified .stim parsing, exact R = 6 lower/upper bounds, sector-wise InRowSpan stabilizer membership, 15 negative controls, and IBM reset equivalence.
Kernel wall time
113.24 s
Peak RSS
3.13 GiB
.olean artifact
0.63 MiB
Book a fixed-fee QEC verification sprint
BB72 is our public, independently auditable proof artifact. RS9 Systems runs focused, fixed-fee verification sprints for QEC architecture, compiler, and hardware teams facing a topology freeze, flagship paper submission, DARPA QBI review, or compiler handover. Everything is scoped and delivered asynchronously as a self-contained repository your team runs locally.
Schedule and circuit audit
$15,000 USD · 2 weeks · Fixed fee
- Qualify a representative
.stimexport before quoting; pin one circuit revision, memory basis, round count, closing cycles, and fault model. - Detector/observable binding audit and full ancilla-flow schedule verification against your intended check matrices.
- Bounded physical-witness search with exact replay instructions for any hook or logical failure found, plus a standalone regression fixture your engineers run locally.
Lean-checked property and standalone CI check
$30,000 USD · 3 weeks · Fixed fee
- Everything in the 2-week audit, scoped after preflight confirms the formal proof path for your code family and wire layout.
- Machine-checked Lean 4 lower-bound or invariant theorem (zero
sorry, zero custom axioms) over your pinned circuit semantics. - Self-contained Lean 4 verification repository delivered asynchronously under mutual NDA that your engineers drop into CI, verified by reproducing both a passing baseline and a failing seeded mutation.
Explicit trust boundary and scaling scope: The public BB72 parser fixes 72 data qubits, 144 wires, and 12 logical masks under discrete Pauli-frame noise (coherent errors, leakage, and decoder latency sit outside circuit distance). For larger codes such as BB90 (replayed d ≤ 8), BB108 (d ≤ 8), and Gross [[144, 12, 12]] (replayed d ≤ 10, where materialized half-tables grow 42,721x), kernel-checked lower bounds require LRAT or cutting-plane refutation scoping during preflight. We never quote a kernel lower bound until preflight confirms feasibility.