stabilizer-qec
A surface-code simulator and decoder written in Rust, with Python bindings.
- Circuits and detector error models in Stim's text formats, and error models built by walking a circuit backwards, identical to Stim's on every circuit checked.
- Exact minimum-weight matching by sparse blossom, and correlated matching, agreeing with PyMatching shot for shot except for ties.
- A bit-parallel sampler, 64 shots per machine word, that runs
REPEATblocks without flattening. - Raw measurements to detection events, reproducing Google's Willow and Sycamore files bit for bit.
- Sliding and parallel window decoders for real-time decoding.
- Belief propagation reproducing the
ldpclibrary's arithmetic bit for bit, and belief-matching equal to thebeliefmatchingpackage's. - BP+OSD (OSD-0, OSD-E, OSD-CS), whose corrections equal
ldpc'sBpOsdDecoder's, and IBM's bivariate bicycle codes: the gross code [[144, 12, 12]] and [[72, 12, 6]], with the depth-8 syndrome cycle of Bravyi et al. (Nature 627, 778, 2024). - On the gross code, every automorphism's action on the logical qubits, and the gauging measurement of a logical operator as a circuit, its error model equal to Stim's.
- Lattice surgery as single circuits, their error models equal to Stim's: Z⊗Z and X⊗X merges, a logical CNOT, merges in a row, and lines of patches merged at once.
import numpy as np, stabilizer_qec as sq
text = sq.generate_circuit("rotated", 5, 5, "sd6", 0.004) # Stim-format circuit
dets, obs, _ = sq.sample_b8_batch(text, 100_000, seed=1) # b8 rows
pred, _, errors, seconds = sq.decode_b8_own(text, dets, 100_000, threads=0, correlated=True)
failures = ((np.frombuffer(pred, "<u8") & 1) != (np.frombuffer(obs, np.uint8) & 1)).sum()
The gross code, decoded by BP+OSD:
circuit = sq.bb_memory_circuit("gross", 12, 0.003) # [[144, 12, 12]], 12 cycles
dem = sq.dem_from_circuit(circuit) # each fault its own column
dets, obs, _ = sq.sample_b8_batch(circuit, 2_000, seed=1)
pred, converged, seconds = sq.decode_b8_bposd(dem, dets, 2_000) # BP+OSD-CS, order 7
truth = np.frombuffer(obs, np.uint8).reshape(-1, 2).view("<u2")[:, 0]
failures = (np.frombuffer(pred, "<u8") != truth).sum() # any of the 12 logicals wrong
The explainer, its figures running the engine in the browser, is at https://qcompiler.jaspersands.com, with a technical report. The source and the full write-up are at https://github.com/Jaspersands/quantum-simulator-qec.
Metadata
Release files for stabilizer-qec 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| stabilizer_qec-0.4.0.tar.gz | 263.8 kB | With provenance | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| stabilizer_qec-0.4.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| stabilizer_qec-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| stabilizer_qec-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| stabilizer_qec-0.4.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64 | Details |
Total release size: 5.0 MB
Release files / stabilizer_qec-0.4.0.tar.gz
| Download URL | stabilizer_qec-0.4.0.tar.gz |
|---|---|
| Size | 263.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba6f478953b588df541074ee5482db13342e1da404ebb0763cb0eca3edec05c2
|
|
BLAKE2b-256 checksum How to use checksums |
9bf1ac5e98e80e1d112197f10cbe182b4096bee2abd01109c6017721be6d94f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / stabilizer_qec-0.4.0-cp39-abi3-win_amd64.whl
| Download URL | stabilizer_qec-0.4.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 715.8 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b119d96d2dd1a55b8e218fcf08810ad5d0dc9c9cc3d068d46bbfda6f0ffbd155
|
|
BLAKE2b-256 checksum How to use checksums |
5373f992fabcaffaa308182c0319106d0c61a46a976b1b32570abe6f7bcc6285
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / stabilizer_qec-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | stabilizer_qec-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
bab551f823454c7dfe77e82830282487fbd1fc8c1ca1f46606d43819fb6e1514
|
|
BLAKE2b-256 checksum How to use checksums |
a2c96085ec62b98492aeefc4d0b736fae099153f2dea6e5f2744567ccf0fd177
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / stabilizer_qec-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | stabilizer_qec-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d473b3cbefdfefcb6a97429c80d9bbdf60f9127333c5f19876af0c411564c83a
|
|
BLAKE2b-256 checksum How to use checksums |
91b3c2dd13a604e3f0b3fd56ddcb5a53ae5af198d755f6ba190127b41ff58236
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / stabilizer_qec-0.4.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | stabilizer_qec-0.4.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3237d719d6d8a3125c7f5a82f5d4fb9cb750692728f430122b722a8551f121e5
|
|
BLAKE2b-256 checksum How to use checksums |
54fbf3dc35d16c3da8c26f1475074c62d40025b65f97744c588e04844672318c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logSecurity for stabilizer-qec 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for stabilizer_qec-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.