Quantum Error Correction for production clouds
From stabilizer algebra to fault-tolerant certification — validated on the QCOS CPU state-vector simulator.
A complete QEC middleware that implements generalized bicycle QLDPC codes targeting sub-10⁻¹² logical error rates, BP+OSD decoding, Pauli-based computation compilation, and SHA-256-sealed fault-tolerant isolation certificates — all tested end-to-end on the QCOS CPU state-vector simulator.
Validated on
A QEC layer between quantum backends and fault-tolerant computing
Raw qubit access does not include the QEC middleware needed for fault tolerance. Without it, there is no tenant isolation, no transparent error correction, and no verifiable certification that a computation ran within FT guarantees.
No tenant isolation
Errors in one logical computation can propagate to another tenant's qubits on shared hardware.
No transparent QEC
Application developers shouldn't need to manage syndrome extraction, decoding, and correction manually.
No certification
No sealed record of the conditions under which a computation executed.
Six modules. One integrated stack.
~4,200 lines of Python covering the full pipeline from symplectic Pauli algebra to SHA-256-sealed fault-tolerant certificate records.
Stabilizer Algebra
stabilizer.py — 803 lines
Symplectic Pauli operator representation over GF(2). CHP-style stabilizer tableau for efficient state simulation. Commutation checking, tensor products, and GF(2) row reduction — no external finite-field libraries.
- PauliOperator (frozen, symplectic)
- StabilizerGroup (commutativity validation)
- StabilizerTableau (CHP simulation)
- GF(2) row reduction & null-space
Code Library
codes.py — 721 lines
Repetition, Surface, generalized bicycle (GB) and bivariate bicycle (BB) QLDPC codes — a code family targeting logical error rates below 10⁻¹² (analytical design target, not a hardware measurement). Catalog includes codes up to [[288, 12, 18]].
- RepetitionCode [[n, 1, n]]
- SurfaceCode [[d², 1, d]]
- GeneralizedBicycleCode (QLDPC)
- BB catalog: [[72,12,6]] → [[288,12,18]] (Bravyi et al., 2024)
BP+OSD Decoder
decoder.py — 621 lines
Two-stage decoder pipeline: belief propagation (min-sum or sum-product) on the Tanner graph, with ordered-statistics decoding (OSD-0/w) fallback. Converges in 1–2 iterations for all tested codes.
- Min-sum & sum-product BP
- OSD-0 and OSD-w fallback
- 1–2 iteration convergence
- Tanner-graph message passing
Syndrome Extraction
syndrome.py — 347 lines
Automated Qiskit circuit synthesis for any QuantumCode. Builds X-check and Z-check sub-circuits with ancilla allocation, measurement, and majority-vote syndrome decoding from shot statistics.
- Automatic circuit synthesis
- X/Z check sub-circuits
- Ancilla management
- Majority-vote decoding
PBC Compiler
pbc.py — 865 lines
Pauli-based computation compiler that separates Clifford operations (tracked classically via symplectic frame) from non-Clifford T gates (requiring quantum execution).
- Clifford frame tracking (Sp(2n,F₂))
- Magic state injection
- Classical Clifford tracking
- T-count preservation (100%)
FT Isolation Certifier
ft_isolation.py — 762 lines
Fault-tolerant isolation certification with 6 levels (physical → logical → sealed). Issues a certificate record per execution, sealed with a SHA-256 content hash, with syndrome leakage rates and logical error bounds.
- 6 isolation levels
- SHA-256 content hash
- Syndrome leakage tracking
- Tamper-evident seal
Module dependency graph
stabilizer.py ──▶ codes.py ──▶ syndrome.py ──▶ decoder.py
│ │
▼ ▼
pbc.py ft_isolation.pyBicycle QLDPC Codes
Generalized bicycle (GB) and bivariate bicycle (BB) codes are quantum low-density parity-check codes; the BB codes in the catalog are those of Bravyi et al., Nature 627, 778 (2024), including the [[144, 12, 12]] gross code. They target logical error rates below 10⁻¹² with fewer physical qubits than traditional surface codes. These are analytical design targets, not hardware measurements.
The surface code bottleneck
- Surface codes require d² physical qubits per logical qubit — 1,000+ for useful error rates
- No built-in Clifford optimization — every gate runs on hardware
- No cryptographic certification of fault-tolerant execution
The QCOS QEC approach
- Bicycle QLDPC codes encode k logical qubits in one block: [[144, 12, 12]] holds 12 at distance 12
- BP+OSD decoder: belief propagation with an ordered-statistics fallback
- PBC compiler tracks Cliffords classically — only non-Clifford T gates need quantum execution
- Every execution receives a fault-tolerance certificate record sealed with a SHA-256 content hash
| Capability | Traditional Approach | QCOS QEC Stack | Advantage |
|---|---|---|---|
| Code family | Surface codes (high overhead) | GB QLDPC (low-density parity-check) | Up to 10× fewer physical qubits |
| Qubit overhead | d² physical per logical qubit | 2m physical for k logical qubits | Sub-linear scaling with distance |
| Logical error rate | ~10⁻⁶ at d=5 | Target <10⁻¹² at [[144,12,12]] (analytical, not measured) | Up to 6 orders of magnitude lower, as a design target |
| Clifford execution | Run on quantum hardware | Tracked classically via PBC | Only non-Clifford T gates need quantum execution |
| FT certification | Not provided | SHA-256 content hash per execution | Audit-ready records built in |
QCOS QLDPC Code Catalog
| Code | Parameters | n/2 | Qubits (+ anc) | Status |
|---|---|---|---|---|
| gb_8_2_2 | [[8, 2, 2]] | 4 | 16 | Simulator validated (test fixture) |
| gb_10_2_3 | [[10, 2, 3]] | 5 | 20 | Simulator validated (test fixture) |
| bb_72_12_6 | [[72, 12, 6]] | 36 | 144 | Unit tested |
| bb_144_12_12 | [[144, 12, 12]] | 72 | 288 | Unit tested |
| bb_288_12_18 | [[288, 12, 18]] | 144 | 576 | Unit tested |
Bicycle codes take H_X = [A | B] and H_Z = [Bᵀ | Aᵀ] with A, B in a commutative group algebra: F₂[Z_m] for GB codes, F₂[Z_ℓ × Z_m] for BB codes. Then H_X · H_Zᵀ = AB + BA = 0, so the CSS condition holds by construction.
End-to-end simulator validation
The full pipeline — circuit synthesis → CPU state-vector execution → syndrome extraction → BP decoding → PBC compilation → FT certification — runs on the QCOS CPU state-vector simulator (≤ 24 qubits).
Simulation Setup
- Platform
- QCOS
- Backend
- CPU state-vector simulator
- Qubit limit
- ≤ 24 qubits
- Circuit SDK
- Qiskit
Execution Paths
CPU state-vector
≤ 24 qubits
Trapped-ion
BYO credentials
Superconducting
BYO credentials
Neutral-atom
BYO credentials
Simulator results — Illustrative sample, not a real execution record
| Code | Params | Qubits | Syndrome | Decoder | FT Cert |
|---|---|---|---|---|---|
| Repetition-3 | [[3, 1, 3]] | 5 | Clean | BP (1 iter) | Verified |
| Surface-3 | [[9, 1, 3]] | 18 | Clean | BP (1 iter) | Verified |
| GB [[8,2,2]] | [[8, 2, 2]] | 16 | Clean | BP (1 iter) | Verified |
Error Injection & Correction Validation
Rep-3
Rep-5
GB-8
GB-10
Six levels of fault-tolerant isolation
From individual qubit separation to SHA-256-sealed logical isolation records. Each execution produces a certificate record with a SHA-256 content hash.
Individual qubit spatial separation
Guard qubits between tenant zones
Separate cryostats / ion traps
QEC active, bounded error rate
Syndrome verification passed
SHA-256 sealed, tamper-evident
Sample certificate records — Illustrative sample, not real execution records
Cliffords tracked classically, T gates executed
The PBC compiler tracks Clifford operations classically via a symplectic frame — only T gates and measurements require actual quantum execution. In FTQC architectures, Clifford gates are "free" but T gates cost magic state distillation. Our compiler makes this explicit.
T-count preservation
No T-count overhead
Measurement depth
All T gates parallelized
Pauli-Based Computation Pipeline
Input Circuit
H, CNOT, S, T gates
Clifford Frame Tracking
Classical Sp(2n,F₂) simulation
Magic State Injection
T gates → distillation circuits
PBC Program Output
Only measurements + corrections
Built for QCOS integration
The QEC stack plugs directly into the QCOS operating system as the error correction middleware layer.
Multi-Tenant Isolation
Each tenant gets an isolated logical zone with guaranteed physical qubit separation and an FT certificate record with a SHA-256 content hash.
Transparent QEC
Applications submit logical circuits. Code selection, syndrome scheduling, decoding, and correction happen automatically.
Pricing Metrics
T-count, Clifford savings and measurement depth are reported as resource metrics for each run.
Fault-tolerant quantum computing starts here
The QEC stack is built for fault-tolerant workflows. Validated on the QCOS CPU state-vector simulator (≤ 24 qubits).
Technical resources:
Stay updated on QCOS QEC
Get the latest on QEC stack releases, simulator validation results, and fault-tolerant computing research.