stim
A fast library for analyzing with quantum stabilizer circuits.
What it is and what it does
Stim is a specialized library for simulating and analyzing quantum stabilizer circuits—a restricted but practically important class of quantum computations used in quantum error correction and related research. It provides three main interfaces: TableauSimulator for step-by-step interactive simulation with state inspection, a Circuit compiler that generates high-performance samplers for batch measurement outcomes, and standalone Tableau and PauliString types for algebraic manipulation of stabilizer states and Pauli operators. The library depends only on numpy and is built with compiled extensions for speed, supporting Python 3.6 and later across major platforms.
Stim is designed for researchers and engineers working with quantum error correction, quantum simulation benchmarks, and stabilizer-based quantum algorithms. It trades generality for speed—it cannot simulate arbitrary quantum circuits, only those within the stabilizer formalism—but within that domain it enables fast sampling and analysis. The package is actively maintained, has no known security vulnerabilities, and is permissively licensed.
Use it for:
- Simulate quantum error correction codes and measure detection event statistics to validate code performance.
- Generate large batches of measurement samples from stabilizer circuits for statistical analysis and benchmarking.
- Explore Pauli operator algebra and tableau transformations for theoretical quantum computing research.
- Test quantum algorithms that use only Clifford gates and measurements before running on real quantum hardware.
- Analyze noise effects in stabilizer circuits by sampling from circuits with depolarization and error channels.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Stim is a fast simulator for quantum stabilizer circuits, providing interactive simulation, high-speed sampling, and independent exploration of quantum states through TableauSimulator, Circuit compilation, and Pauli/Tableau data types.
Yes, if you work with quantum stabilizer circuits, error correction codes, or Clifford-based quantum algorithms. The package is actively maintained, has no security issues, installs easily on modern Python versions, and provides specialized tools that are difficult to replicate elsewhere. Not relevant for general-purpose quantum simulation beyond the stabilizer formalism.
Install
stim on PyPI
pip
pip install stimuv
uv add stimpoetry
poetry add stimInstalling stim
Before you install
Precompiled wheels available for Python 3.10–3.14 on macOS, Linux, and Windows reduce install friction to medium. Active maintenance with recent releases (84 days since last update) and 803 GitHub stars indicate ongoing development and community use.
License in practice
Licensed under Apache 2 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for academic, commercial, and derivative work without license compatibility concerns.
Quickstart
pip install stim
import stim
# Interactive simulation
s = stim.TableauSimulator()
s.h(0)
s.cnot(0, 1)
print(s.measure_many(0, 1))
# High-speed sampling
c = stim.Circuit()
c.append("H", [0])
for k in range(1, 10):
c.append("CNOT", [0, k])
sampler = c.compile_sampler()
batch = sampler.sample(1024)
Verify before relying
- Performance characteristics (e.g., throughput in samples/second or simulation speed relative to other simulators) not quantified in the fact sheet.
- Scalability limits for circuit size, qubit count, or noise model complexity are not specified.
- Whether the package includes error correction code analysis tools beyond basic tableau operations.
Package facts
| License | Apache 2 (permissive) |
| Python support | supports the current Python release (>=3.6.0) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 84 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 345,646/month — #7,361 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: stim-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl; stim-1.16.0-cp310-cp310-macosx_11_0_arm64.whl; stim-1.16.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; stim-1.16.0-cp310-cp310-win_amd64.whl; stim-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl; stim-1.16.0-cp311-cp311-macosx_11_0_arm64.whl; stim-1.16.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; stim-1.16.0-cp311-cp311-win_amd64.whl; stim-1.16.0-cp312-cp312-macosx_10_13_x86_64.whl; stim-1.16.0-cp312-cp312-macosx_11_0_arm64.whl; stim-1.16.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; stim-1.16.0-cp312-cp312-win_amd64.whl; stim-1.16.0-cp313-cp313-macosx_10_13_x86_64.whl; stim-1.16.0-cp313-cp313-macosx_11_0_arm64.whl; stim-1.16.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; stim-1.16.0-cp313-cp313-win_amd64.whl; stim-1.16.0-cp314-cp314-macosx_10_15_x86_64.whl; stim-1.16.0-cp314-cp314-macosx_11_0_arm64.whl; stim-1.16.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; stim-1.16.0-cp314-cp314-win_amd64.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
sinterSinter performs fast Monte Carlo sampling of…
permissive · top 15,000 on PyPI
samplomaticSamplomatic generates randomized variants of…
permissive · top 15,000 on PyPI
qiskitQiskit is an open-source SDK for building and…
permissive · top 5,000 on PyPI
cirqCirq is a Python framework for writing,…
permissive · top 15,000 on PyPI
cirq-coreCirq-core provides the foundational framework…
permissive · top 15,000 on PyPI
cirq-aqtCirq-AQT provides a Cirq integration that lets…
permissive · top 15,000 on PyPI
qiskit-terraQiskit Terra provides the core SDK for building…
permissive · top 15,000 on PyPI
qiskit-aerAer is a high-performance quantum circuit…
permissive · top 5,000 on PyPI
cirq-ionqIntegrates Cirq quantum circuits with IonQ…
permissive · top 15,000 on PyPI
amazon-braket-default-simulatorProvides a local quantum circuit simulator for…
permissive · top 15,000 on PyPI