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.5.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.5.0
File Size Uploaded Provenance
stabilizer_qec-1.5.0.tar.gz 375.9 kB With provenance Details

Built distributions (wheels)

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

Total release size: 17.5 MB

Release files / stabilizer_qec-1.5.0.tar.gz

Download URL stabilizer_qec-1.5.0.tar.gz
Size 375.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6f500375a4dae3b8ba0cfd01373c4f23c69fbda0761c51573bd9bdc60004d98d
BLAKE2b-256 checksum
How to use checksums
ed5407b81f5fc548d5891005ea6563c9411c568d1378daa968cc8d3be5b7d236
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.5.0-cp314-cp314t-win_amd64.whl

Download URL stabilizer_qec-1.5.0-cp314-cp314t-win_amd64.whl
Size 1.1 MB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
95ef097c7536577e910959e43c2dd4ead8f4b75384697455932e5bea2a9128e8
BLAKE2b-256 checksum
How to use checksums
5dfe5e78e1afc62dc075a8737e442e962dfdcf7743666392940f9b1767336da7
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.5.0-cp314-cp314t-manylinux_2_28_x86_64.whl

Download URL stabilizer_qec-1.5.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
57c6add5df3ddca0c8ac870194846641052cdb3e33d5a82e48ad2a0a8bef7c86
BLAKE2b-256 checksum
How to use checksums
3a156fb8e321e7aa8b4310a3d801c779bc9852c19f20c7f8d9544224e932dec5
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.5.0-cp314-cp314t-manylinux_2_28_aarch64.whl

Download URL stabilizer_qec-1.5.0-cp314-cp314t-manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
ce55eb696cbb57a4b58896e9e05e7420fc4db558074a0249d8e5aaca0bd96db4
BLAKE2b-256 checksum
How to use checksums
4d4fbdaaefc7e11b20085b7ef32a463f8bb2505ac6084fce3812bbafc20ee6da
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.5.0-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL stabilizer_qec-1.5.0-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.2 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
7643b8de5feafe161d10ad005623a0c6a747fa4fa03e8aefdae5fc0849e15eb3
BLAKE2b-256 checksum
How to use checksums
04f30caff4de3d0729cfa9a7dcb591a4091323d98ead48dd276a6ad19cc1b898
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.5.0-cp39-abi3-win_arm64.whl

Download URL stabilizer_qec-1.5.0-cp39-abi3-win_arm64.whl
Size 977.8 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
b56ae3ffe0d1e30ca364dcce3d964709b6ba4265c4edf8b9284f7aa989a042ed
BLAKE2b-256 checksum
How to use checksums
fdc9dbacafef454531544bf7f8e75b3734291c08402c383cb8f8b4af15cf6f4f
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.5.0-cp39-abi3-win_amd64.whl

Download URL stabilizer_qec-1.5.0-cp39-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a2e619258889d44ffc2ad9a72c93efc160f7ddca6217b44f356c36edf1de42c7
BLAKE2b-256 checksum
How to use checksums
3a9160ec0921f72d54add6534da86ea87c45c03e7ed05b44cc80346099e190c5
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.5.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL stabilizer_qec-1.5.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 1.8 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
585bd295c62cb9e2b9b2dc642bb4d8b578732e0bad0a83c943fe54cf1270df3a
BLAKE2b-256 checksum
How to use checksums
ed0babd2b92e74daa959b6e39870d7203bbc79e83868117d714a6a36714c150f
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.5.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL stabilizer_qec-1.5.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 1.7 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
df2351ccb3ac46188ff94af534e71a2eee38edcf31373263365c165ba8d25119
BLAKE2b-256 checksum
How to use checksums
08985122997a46d34eda5500509bb1cc50c025b5ae7ccf144a0cddc6d937898d
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.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL stabilizer_qec-1.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.6 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
bccab95730a9b6be8d6aeccaf15e7b6035a580c8575b2082ad92aadad37ed437
BLAKE2b-256 checksum
How to use checksums
574c815b875ead9c2df63ffda5bd7283cb25e076fbf2e528a992f88c4a065d96
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.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL stabilizer_qec-1.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.5 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
d2f281cc94aa0a09fae43858c60bfceb675dff0294bc944bb86fbbfbee2be6eb
BLAKE2b-256 checksum
How to use checksums
590f41d1982242dc73951eacb3aa980b1dc1d6722ad8fdd8b6db44ff9a6a4eac
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.5.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL stabilizer_qec-1.5.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.2 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
c72e3528294b1d4ffa71db1fe58ffb3c857d05d0df5beff2a18279ea417764d5
BLAKE2b-256 checksum
How to use checksums
7acde57b3f7a6d16c4070c53a7a6951c430d8119ae0e5f87c666fe6f1ebbc709
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.5.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.5.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