Skip to main content

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 REPEAT blocks 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 ldpc library's arithmetic bit for bit, and belief-matching equal to the beliefmatching package's.
  • BP+OSD (OSD-0, OSD-E, OSD-CS), whose corrections equal ldpc's BpOsdDecoder'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.
  • Stim's whole circuit language (every gate, all three bases, MPP, SPP, correlated and heralded noise, measurement feedback, instruction tags, Pauli-target observables), checked against Stim on random circuits that use every gate.
  • 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.
  • A sinter adapter for threshold sweeps, and objects that pickle for multiprocessing.
import stabilizer_qec as sq

circuit = sq.memory_circuit(distance=5, rounds=5, p=0.004)               # a d = 5 SD6 memory
dets, obs = circuit.compile_detector_sampler(seed=1).sample(100_000, separate_observables=True, threads=0)
dem = circuit.detector_error_model(decompose_errors=True)
pred = sq.Matching(dem, enable_correlations=True).decode_batch(dets, threads=0)
print((pred != obs).any(axis=1).mean())                                  # logical error rate

The gross code, decoded by BP+OSD:

gross = sq.BivariateBicycleCode("gross")                                 # [[144, 12, 12]], 12 cycles
c = gross.memory_circuit(12, 0.003)
dets, obs = c.compile_detector_sampler(seed=2).sample(2_000, separate_observables=True)
pred = sq.BpOsd(c.detector_error_model()).decode_batch(dets, threads=0)
print((pred != obs).any(axis=1).mean())                                  # any of the 12 logicals wrong

In sinter's sweeps (pip install "stabilizer-qec[sinter]"):

import sinter
from stabilizer_qec import sinter as sq_sinter

stats = sinter.collect(tasks=tasks, decoders=["sq_matching", "sq_belief_matching", "pymatching"],
                       custom_decoders=sq_sinter.sinter_decoders(), num_workers=8, max_shots=100_000)

The names follow Stim (Circuit, compile_detector_sampler, separate_observables), PyMatching (Matching, decode_batch, enable_correlations) and ldpc (BpDecoder, BpOsdDecoder, error_channel). A seed gives the same shots on any machine and thread count. See the changelog.

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 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stabilizer-qec 1.3.0
File Size Uploaded Provenance
stabilizer_qec-1.3.0.tar.gz 341.7 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for stabilizer-qec 1.3.0
File
stabilizer_qec-1.3.0-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details
stabilizer_qec-1.3.0-cp314-cp314t-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 Details
stabilizer_qec-1.3.0-cp314-cp314t-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 Details
stabilizer_qec-1.3.0-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64 Details
stabilizer_qec-1.3.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
stabilizer_qec-1.3.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
stabilizer_qec-1.3.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
stabilizer_qec-1.3.0-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
stabilizer_qec-1.3.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-1.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
stabilizer_qec-1.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.9 abi3 macOS 10.12+ x86-64, macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64) Details

Total release size: 15.4 MB

Release files / stabilizer_qec-1.3.0.tar.gz

Download URL stabilizer_qec-1.3.0.tar.gz
Size 341.7 kB
Tags Source
SHA-256 checksum
How to use checksums
82c99ef280352e1a68548d8ad971df8e5bdb9b6098b0f7a0f7c56f54d49f4221
BLAKE2b-256 checksum
How to use checksums
367f471ba40d7acbb1bc75007867e499ea6e6aecb4407f6bb8b14dcf5e7f06e3
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 4, 2026.

Transparency log

Release files / stabilizer_qec-1.3.0-cp314-cp314t-win_amd64.whl

Download URL stabilizer_qec-1.3.0-cp314-cp314t-win_amd64.whl
Size 883.5 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
f1d0e70d1719c01a5677f00264c899817c997a408ef4defc679d23e98bbc4e4b
BLAKE2b-256 checksum
How to use checksums
6de7042a52ddcb884c2044bbe76739470f233c6ee8dbe7e914f00a36935c0a60
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 4, 2026.

Transparency log

Release files / stabilizer_qec-1.3.0-cp314-cp314t-manylinux_2_28_x86_64.whl

Download URL stabilizer_qec-1.3.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Size 1.4 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3fb650e1af996d0c1fa6ae6119f7ae01ee137baff68a00a4de27c24a7ed5d746
BLAKE2b-256 checksum
How to use checksums
a77f216449c79a4195dc269ed178432be2dedc8aac31328c2da9253ffbf8ab7c
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 4, 2026.

Transparency log

Release files / stabilizer_qec-1.3.0-cp314-cp314t-manylinux_2_28_aarch64.whl

Download URL stabilizer_qec-1.3.0-cp314-cp314t-manylinux_2_28_aarch64.whl
Size 1.3 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
842134305bc321e28c447d214a250a2d00d872ba03434af09783ff2895ccebaf
BLAKE2b-256 checksum
How to use checksums
696320964447edd03f57aaf6abc80d7cd6088c9a9d012477bad401c5cecb59fb
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 4, 2026.

Transparency log

Release files / stabilizer_qec-1.3.0-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL stabilizer_qec-1.3.0-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 1.8 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fe22a18e18a40ec98741a5c24c0fd8b4d0605087a609a5f591b0e7bedbf19831
BLAKE2b-256 checksum
How to use checksums
fdd07f031be871830f420e519b28bc5df8ea52f94f04fe1de061e2b090f82c0e
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 4, 2026.

Transparency log

Release files / stabilizer_qec-1.3.0-cp39-abi3-win_arm64.whl

Download URL stabilizer_qec-1.3.0-cp39-abi3-win_arm64.whl
Size 828.5 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
467df8e285377b81274ff2cb8e4e713e6f2fc28499b4763c5245be2dfa7d5ef6
BLAKE2b-256 checksum
How to use checksums
beee361e056336aefafd3300c1dc8f9c71cba0097529998082c033344e74aca3
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 4, 2026.

Transparency log

Release files / stabilizer_qec-1.3.0-cp39-abi3-win_amd64.whl

Download URL stabilizer_qec-1.3.0-cp39-abi3-win_amd64.whl
Size 902.7 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
55ab77b99ae860e79a8851cf3fa675efb25bbe911110896d376ddb176752e30c
BLAKE2b-256 checksum
How to use checksums
429db676e8b2a3aa779b890712b7168af3359cee1d8ca968deb193b33b756dbe
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 4, 2026.

Transparency log

Release files / stabilizer_qec-1.3.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL stabilizer_qec-1.3.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 1.6 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
9b1de2cd811f886e6473ab9a151d630f3c39d31b1a2af058cbfe81a44de481e2
BLAKE2b-256 checksum
How to use checksums
d70bc99b019f13ca9851c980e4ef9ec1ddb88d259cbe40553b8c7a8bdc252626
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 4, 2026.

Transparency log

Release files / stabilizer_qec-1.3.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL stabilizer_qec-1.3.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 1.5 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
35672a065ec8c9b8af071980d21221789ed393ad5d15000e7074bc4fc92a2314
BLAKE2b-256 checksum
How to use checksums
daf44a7abf3441eb3294e73bbf2d90604d45c73075de742741f1797cfd1a96d6
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 4, 2026.

Transparency log

Release files / stabilizer_qec-1.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL stabilizer_qec-1.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
345bfea208dab55f9987782fb8a27b9ca0e3bb85271d04042d9df87817ea018c
BLAKE2b-256 checksum
How to use checksums
8c977d61f2282f0fa9ba2971e24894a0178a1f6b85ba3be60ab8e6cd5b6d4c32
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 4, 2026.

Transparency log

Release files / stabilizer_qec-1.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL stabilizer_qec-1.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
9859624e22345200c34b88a184106af6e580754d5fa76f787969f00ddfb5c111
BLAKE2b-256 checksum
How to use checksums
3c86d3bc40ebe7d3faad4352206af023a96fd7cb87760f9179ca794af1aacd3b
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 4, 2026.

Transparency log

Release files / stabilizer_qec-1.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL stabilizer_qec-1.3.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 1.9 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
7f093c7adfc1cbf1e73246e46e129f509e97c7c089432ef08b2526faa837f768
BLAKE2b-256 checksum
How to use checksums
6d33e934ac4761cfd239d14cddf84a793ba35bbe50225e7e15ccab0bf22cffd3
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 4, 2026.

Transparency log

Security for stabilizer-qec 1.3.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 12 files in this release have been uploaded with provenance metadata.

Select from 12 files

Attestation for stabilizer_qec-1.3.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 4, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page