ELLIS: Extremely Fast Quantum Circuit Simulation under Qubit Loss and Leakage
ELLIS (Efficient Loss and Leakage Invariant-reference Simulation) samples Clifford circuits with qubit loss and leakage exactly. It uses a masked Pauli frame and one shared reference record, so each shot does not need its own tableau reference.
- One sampling API.
ellis.compile_samplercertifies the circuit. When one reference is proven exact, it samples with the C++ masked frameellis._core.MaskFrameSampler, built on Stim'sFrameSimulator. Otherwise it samples with Clifft's noncomputational sampler in online mode. Both drop a lost qubit's later gates and read its measurements as heralded fair coins. - Common-reference certificates.
ellis.certifyproves that one reference is exact for every loss pattern by frame-CSS relabelling or closed S/CZ blocks, or returns a signed-parity contradiction that shows no such reference exists. Pass the circuit with its noise injected: losses and reloads happen at itsI_ERROR[loss]andI_ERROR[reload]markers. A circuit with neither marker is certified underPESSIMISTIC(loss after every operation, |0> reload anywhere), so its reference holds under every loss model. An explicitLossModeloverrides both.frame_cssdecides frame-CSS exactly; a circuit outside the assumptions that make the decision exact (classical feedback, multi-qubit measurements, a prefix with too many open frame choices) gets verdict"outside-assumptions"instead.
Loss instructions
ELLIS reads Stim circuits and adds two tagged I_ERROR instructions. Stim parses both and ignores them.
| Instruction | Meaning |
|---|---|
I_ERROR[loss](p) q... |
Each atom q is lost with probability p. Its later gates are dropped and its readouts become fair coins. |
I_ERROR[reload](p) q... |
Each empty slot q gets a fresh atom in |0> with probability p (default 1). A present atom is left alone. |
A reload happens only where its marker stands. To reload at a reset, write the marker just before it:
CX 0 1
I_ERROR[loss](0.001) 0 1
M 1
I_ERROR[reload] 1
R 1
Sampling performance
Install
uv add ellis-qec # or: pip install ellis-qec
uv add "ellis-qec[sinter]" # also sinter, for ellis.sinter
The distribution is ellis-qec and the import name is ellis. It installs Stim and Clifft with it. Wheels are
available for CPython 3.12, 3.13, and 3.14 on Linux x86-64 (manylinux_2_28) and macOS arm64 (macOS 15 or later, as
for Clifft). An x86-64 wheel contains two builds of the C++ core, one for CPUs with AVX2 and one for CPUs without it.
import ellis loads the faster build that the CPU runs, and ellis._core.VARIANT names it.
Build from source
uv sync # builds ellis._core with CMake (fetches Stim 1.16.0 once)
uv sync --extra sinter # also sinter, for ellis.sinter
The build needs a C++20 compiler: GCC 10 or newer, or Apple clang. A source build compiles one variant of the core,
the best one for the machine that runs the build (AVX2, SSE2, or 64-bit words on arm64). To build both x86-64 wheel
variants, run uv sync -C cmake.define.ELLIS_SIMD="avx2;sse2", and then use uv run --no-sync, because a plain
uv run rebuilds with the default settings. To build
without network access, add -C cmake.define.FETCHCONTENT_SOURCE_DIR_STIM=/path/to/Stim-1.16.0. On Perlmutter,
CMake selects the gcc-native module's g++ automatically. On a shared cluster, run the first build and the tests on
a compute node.
Use
import ellis
from ellis.noise import surface_memory
circuit = surface_memory(d=5, rounds=5, p=1e-3, p_loss=1e-3) # I_ERROR[loss](p) marks loss sites
sampler = ellis.compile_sampler(circuit, seed=1) # certifies: verdict "proven", method "frame-css"
sampler.method # "frame"
r = sampler.sample(10**4) # r.measurements, r.detectors, r.observables, r.heralds
r = sampler.sample(10**6, bit_packed=True, threads=8) # the same fields, bit-packed, on 8 threads
compile_sampler route |
Sampler |
|---|---|
method="auto", certificate proven without gauge Paulis |
C++ masked frame with the certified reference |
method="auto", any other certificate |
Clifft online |
method="frame" |
C++ masked frame; Stim's reference (unverified) unless a proven certificate is given |
method="clifft" |
Clifft online |
method="auto" certifies with ellis.certify.certify(circuit, model=MARKED, **certify_options) unless
certificate= is given: sampling loses atoms only at the markers.
sample returns a SampleResult with all four fields from one simulation pass; bit_packed=True uses Stim's
layout. Detection events are relative to the noiseless reference sample, as in Stim.
docs/sampling.md is the full reference: supported operations, loss semantics, routing, result
layout, heralds, and performance.
The sinter adapter ellis.sinter is under development.
Layout
| Path | Contents |
|---|---|
src/ellis/frame/ |
C++ masked frame: program compilation, stim::FrameSimulator with alive masks, batched sampler |
src/python/ |
bindings.cc (the ellis._core_<variant> modules), cpu.cc (ellis._cpu, which picks the variant) |
src/python/ellis/ |
sampler (compile_sampler), _clifft (Clifft route), frame (loss semantics), certify/ (frame_css, blocks, constraints), noise, sinter, gf2, check_exact |
tests/python/ |
tests against Stim on explicit lossy circuits and between the frame and Clifft routes; fixtures in tests/fixtures/ |
tools/ |
bench/bench_frame.py (masked frame and Stim speed), classify_lightstim.py (certify each LightStim protocol), fixture exporters |
cmake/ |
Stim fetch, compiler selection, SIMD variants |
.github/workflows/ |
test.yml (the tests on both x86-64 variants), wheels.yml (sdist and wheels; publishes to TestPyPI and PyPI on a v* tag, see RELEASING.md) |
Test
uv run pytest -n 8
uv run python -m ellis.check_exact 'tests/fixtures/lightstim/*.stim' # sampler vs Stim on random loss patterns
uv run python tools/classify_lightstim.py --benchmark # paper App. C classification
License
Apache-2.0. ELLIS includes Stim, which is also Apache-2.0.
Citation
If you find ELLIS useful in your work, please cite our paper:
@misc{hou2026ellis,
title={Ellis: Extremely Fast Quantum Circuit Simulation under Qubit Loss and Leakage},
author={Yuewen Hou and Gokul Subramanian Ravi},
year={2026},
eprint={2611.26173},
archivePrefix={arXiv},
primaryClass={quant-ph},
url={https://arxiv.org/abs/2611.26173},
}
Metadata
Release files for ellis-qec 0.1.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 | Actions |
|---|---|---|---|---|
| ellis_qec-0.1.0.tar.gz | 152.4 kB | With provenance | Details for ellis_qec-0.1.0.tar.gz |
Built distributions (wheels)
Total release size: 3.8 MB
Release files / ellis_qec-0.1.0.tar.gz
| Download URL | ellis_qec-0.1.0.tar.gz |
|---|---|
| Size | 152.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3fd255711a6c59934faf5e121e7ecdbfe7f515d3c74e35f86fbf09d9ea6872fc
|
|
BLAKE2b-256 checksum How to use checksums |
53474f846e1e39eb0782fb59c501f91860fb51b2a29c721bd96378d83c4446fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 24, 2026.
Transparency logRelease files / ellis_qec-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ellis_qec-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 865.0 kB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
0ec12f67a0e9885b67beaf7541c19b89a2f22342fb4694658d92d47e60371f2f
|
|
BLAKE2b-256 checksum How to use checksums |
e6f20d888cefc48687e6112a563a7ac0bcc0ac2c8eaa30250f119730c344d01c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 24, 2026.
Transparency logRelease files / ellis_qec-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | ellis_qec-0.1.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 343.8 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
54b1159b66cc6320137cc76d9a29a18cc329e3bf4fd0cba8d2205bfe72ada0df
|
|
BLAKE2b-256 checksum How to use checksums |
4f67e6feb5025d62b96ec446f67474451c950b0eedb2d35c5f78a7fbb4618cab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 24, 2026.
Transparency logRelease files / ellis_qec-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ellis_qec-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 865.0 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
67ebce8931d895c961a875ccce69f5469a14fcd6b6a477ed0fa3e7d3e743a738
|
|
BLAKE2b-256 checksum How to use checksums |
211528895af4ab6833a9ece4e67d34b8a95189ef2a6eac27324e01dd0c737c33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 24, 2026.
Transparency logRelease files / ellis_qec-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | ellis_qec-0.1.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 343.2 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
14cbb6789313e4b681a3c3e817247b26e6e158009b5cf28d29ff419e970a2924
|
|
BLAKE2b-256 checksum How to use checksums |
14f3a9bdf923d89a49c7df37b269b3e896cf6dc7d43e094de007cde1c87082cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 24, 2026.
Transparency logRelease files / ellis_qec-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | ellis_qec-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 864.5 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
38227ddbd889c2025085664620f5c091e375f6b44d544308cfc8e1f00e7b7676
|
|
BLAKE2b-256 checksum How to use checksums |
1e456da8a38e34f690ee98fa8745b46a4b7c2c54fadf9b12c3795b52039e62a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 24, 2026.
Transparency logRelease files / ellis_qec-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | ellis_qec-0.1.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 343.1 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
92d60c2e5d94a5650e2a3466788a13c3460cc233bc2fabac12efdb2b3189fe06
|
|
BLAKE2b-256 checksum How to use checksums |
860c3c90520da1c9cb1e8149a710ad495aa550b8fce627b56be67c78d855991b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 24, 2026.
Transparency logSecurity for ellis-qec 0.1.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 7 files in this release have been uploaded with provenance metadata.
Attestation for ellis_qec-0.1.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 Nov 24, 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.