--- id: stim version: "1.16.0" license: Apache 2 license_treatment: permissive maintenance: active --- # stim — A fast library for analyzing with quantum stabilizer circuits. License: permissive · Maintenance: active · Downloads: 345.6K/mo ## 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 above — 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 pip install stim uv add stim poetry add stim ## Installing 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_current - Install friction: medium - Maintenance: active - Downloads: 345.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags quantum circuit simulator, stabilizer code simulation, quantum state sampling, quantum error correction, tableau simulator, pauli string operations, quantum circuit analysis, quantum-computing, error-correction, simulation [View on SkillFed](https://skillfed.io/packages/stim) · [View on PyPI](https://pypi.org/project/stim/)