Stim is a high-performance Python and C++ library for simulating and analyzing quantum stabilizer circuits. It is designed for quantum error correction (QEC) research, enabling researchers to simulate large circuits with thousands of qubits and millions of operations at kilohertz sampling rates using vectorized AVX instructions.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/quantumlib/Stim/llms.txt
Use this file to discover all available pages before exploring further.
Quickstart
Get Stim installed and run your first stabilizer circuit simulation in minutes.
Installation
Install Stim via pip, build from source as a C++ library, or use the CLI binary.
Core Concepts
Learn about stabilizer circuits, Pauli strings, tableaus, and detector error models.
Python API Reference
Full reference for stim.Circuit, stim.Tableau, stim.PauliString, and all simulators.
Why Stim?
Stim makes three core algorithmic improvements over prior stabilizer simulators that make it exceptionally fast:Vectorized Code
Hot loops use 256-bit AVX instructions. Stim can multiply Pauli strings with 100 billion terms per second.
Reference Frame Sampling
Bulk sampling uses a single reference run, then derives additional samples by propagating simulated errors — constant cost per gate.
Inverted Tableau
Tracking the inverse stabilizer tableau makes redundant measurements (common in QEC) run in linear time instead of quadratic.
Get started
Explore the documentation
Sampling guide
Learn measurement sampling, detector sampling, and bulk data collection workflows.
Detector error models
Convert noisy circuits into Tanner graphs for configuring decoders.
Sinter: QEC sampling
Run parallel Monte Carlo sampling across CPU cores with the Sinter companion tool.
Gate reference
Browse all supported Clifford gates, noise channels, and measurement operations.
Command line
Use Stim’s CLI for scripting, pipeline integration, and quick analysis.
File formats
Understand the .stim circuit format and .dem detector error model format.
Stim only supports Clifford (stabilizer) operations. There is no support for non-Clifford gates like T gates or Toffoli gates. For non-Pauli noise, drive a
stim.TableauSimulator manually.