Science Score: 57.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 3 DOI reference(s) in README -
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.7%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A fast stabilizer circuit library.
Basic Info
Statistics
- Stars: 529
- Watchers: 14
- Forks: 155
- Open Issues: 64
- Releases: 19
Topics
Metadata Files
README.md
Stim
High-performance simulation of quantum stabilizer circuits for quantum error correction.
◼︎︎ What is Stim?
◼︎︎ How do I use Stim?
◼︎ How does Stim work?
◼︎ How do I cite Stim?
◼︎ Subproject: Sinter decoding sampler
◼︎ Subproject: Crumble interactive editor
What is Stim?
Stim is a tool for high performance simulation and analysis of quantum stabilizer circuits,
especially quantum error correction (QEC) circuits.
Typically Stim is used as a Python package (pip install stim), though Stim can also be used as
a command-line tool or a C++ library.
- Watch the 15 minute lightning talk presenting Stim at QPL2021
- Watch Stim being used to estimate the threshold of the honeycomb code over a weekend
Stim's key features:
Really fast simulation of stabilizer circuits. Have a circuit with thousands of qubits and millions of operations?
stim.Circuit.compile_sampler()will perform a few seconds of analysis and then produce an object that can sample shots at kilohertz rates.Semi-automatic decoder configuration.
stim.Circuit.detector_error_model()converts a noisy circuit into a detector error model (a Tanner graph) which can be used to configure decoders. Adding the optiondecompose_operations=Truewill additionally suggest how hyper errors can be decomposed into graphlike errors, making it easier to configure matching-based decoders.Useful building blocks for working with stabilizers, such as
stim.PauliString,stim.Tableau, andstim.TableauSimulator.
Stim's main limitations are:
There is no support for non-Clifford operations, such as T gates and Toffoli gates. Only stabilizer operations are supported.
stim.Circuitonly supports Pauli noise channels (eg. no amplitude decay). For more complex noise you must manually drive astim.TableauSimulator.stim.Circuitonly supports single-control Pauli feedback. For multi-control feedback, or non-Pauli feedback, you must manually drive astim.TableauSimulator.
Stim's design philosophy:
Performance is king. The goal is not to be fast enough, it is to be fast in an absolute sense. Think of it this way. The difference between doing one thing per second (human speeds) and doing ten billion things per second (computer speeds) is 100 decibels (100 factors of 1.26). Because software slowdowns tend to compound exponentially, the choices we make can be thought of multiplicatively; they can be thought of as spending or saving decibels. For example, under default usage, Python is 100 times slower than C++. That's 20dB of the 100dB budget! A fifth of the multiplicative performance budget allocated to language choice! Too expensive! Although Stim will never achieve the glory of 30 GiB per second of FizzBuzz, it at least wishes it could.
Bottom up. Stim is intended to be like an assembly language: a mostly straightforward layer upon which more complex layers can be built. The user may define QEC constructions at some high level, perhaps as a set of stabilizers or as a parity check matrix, but these concepts are explained to Stim at a low level (e.g., as circuits). Stim is not necessarily the abstraction that the user wants, but Stim wants to implement low-level pieces simple enough and fast enough that the high-level pieces that the user wants can be built on top.
Backwards compatibility. Stim's Python package uses semantic versioning. Within a major version (1.X), Stim guarantees backwards compatibility of its Python API and of its command-line API. Note Stim DOESN'T guarantee backwards compatibility of the underlying C++ API.
How do I use Stim?
See the Getting Started Notebook.
Stuck?
Get help on the quantum computing stack exchange
and use the stim tag.
See the reference documentation:
- Stim Python API Reference
- Stim Supported Gates Reference
- Stim Command Line Reference
- Stim Circuit File Format (.stim)
- Stim Detector Error model Format (.dem)
- Stim Results Format Reference
- Stim Internal Developer Reference
How does Stim work?
See the paper describing Stim. Stim makes three core improvements over previous stabilizer simulators:
Vectorized code. Stim's hot loops are heavily vectorized, using 256 bit wide AVX instructions. This makes them very fast. For example, Stim can multiply Pauli strings with 100 billion terms in one second.
Reference Frame Sampling. When bulk sampling, Stim only uses a general stabilizer simulator for an initial reference sample. After that, it cheaply derives as many samples as needed by propagating simulated errors diffed against the reference. This simple trick is ridiculously cheaper than the alternative: constant cost per gate, instead of linear cost or even quadratic cost.
Inverted Stabilizer Tableau. When doing general stabilizer simulation, Stim tracks the inverse of the stabilizer tableau that was historically used. This has the unexpected benefit of making measurements that commute with the current stabilizers take linear time instead of quadratic time. This is beneficial in error correcting codes, because the measurements they perform are usually redundant and so commute with the current stabilizers.
How do I cite Stim?
When using Stim for research, please cite:
latex
@article{gidney2021stim,
doi = {10.22331/q-2021-07-06-497},
url = {https://doi.org/10.22331/q-2021-07-06-497},
title = {Stim: a fast stabilizer circuit simulator},
author = {Gidney, Craig},
journal = {{Quantum}},
issn = {2521-327X},
publisher = {{Verein zur F{\"{o}}rderung des Open Access Publizierens
in den Quantenwissenschaften}},
volume = 5,
pages = 497,
month = jul,
year = 2021
}
Contact
For any questions or concerns not addressed here, please email quantum-oss-maintainers@google.com.
Disclaimer
This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.
Copyright 2025 Google LLC.
Owner
- Name: quantumlib
- Login: quantumlib
- Kind: organization
- Website: quantumai.google
- Repositories: 15
- Profile: https://github.com/quantumlib
Google's open source code library for the quantum world
Citation (CITATION.cff)
# Citation information for this repository. -*- yaml -*-
#
# CITATION.cff files provide human- & machine-readable citation information for
# software and datasets. GitHub, Zenodo, and the Zotero browser plugin all use
# CFF files automatically if provided. https://citation-file-format.github.io/.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cff-version: 1.2.0
message: If you use Stim, please cite it using this metadata.
# CITATION.cff files describe how to cite software or datasets, with the goal of
# making software and data be citable in their own right. However, sometimes
# projects want citations to go to a paper instead. 'Preferred-citation' serves
# to communicate that. The distinction matters in different situations. If this
# field is present, GitHub uses the value for the "cite this repository" button
# and ignores the rest of this file; conversely, the Zenodo-GitHub integration
# ignores this field when creating an entry for a new software release because
# the Zenodo entry is specifically about the software in this repository.
preferred-citation:
type: article
authors:
- family-names: Gidney
given-names: Craig
title: 'Stim: a fast stabilizer circuit simulator'
journal: Quantum
year: 2021
month: 7
volume: 5
start: 497
issn: 2521-327X
url: https://doi.org/10.22331/q-2021-07-06-497
publisher:
name: >-
Verein zur Förderung des Open Access Publizierens in den
Quantenwissenschaften
# The remaining metadata in this file describes the current software release.
title: Stim
abstract: >-
Stim is a tool for high performance simulation and analysis of quantum
stabilizer circuits, especially quantum error correction (QEC) circuits.
authors:
- family-names: Gidney
given-names: Craig
version: 1.14.0
date-released: 2024-09-24
url: https://github.com/quantumlib/stim
repository-code: https://github.com/quantumlib/stim
license: Apache-2.0
type: software
identifiers:
- description: The GitHub repository for Stim
value: https://github.com/quantumlib/Stim
type: url
- description: PyPI project for Stim
value: https://pypi.org/project/Stim
type: url
- description: Publication about Stim
value: 10.22331/q-2021-07-06-497
type: doi
keywords:
- algorithms
- API
- application programming interface
- C++
- Clifford gates
- Clifford operations
- high performance
- open-source software
- physics
- Python
- QEC
- quantum
- quantum algorithms
- quantum circuits
- quantum computing
- quantum error correction
- quantum error decoder
- quantum gates
- quantum programming
- quantum simulation
- quantum state
- qubit
- science
- SDK
- simulation
- simulator
- software
- software development toolkit
- stabilizer circuits
GitHub Events
Total
- Create event: 44
- Release event: 1
- Issues event: 123
- Watch event: 175
- Delete event: 38
- Member event: 1
- Issue comment event: 99
- Push event: 187
- Pull request review comment event: 42
- Pull request review event: 68
- Pull request event: 134
- Fork event: 51
Last Year
- Create event: 44
- Release event: 1
- Issues event: 123
- Watch event: 175
- Delete event: 38
- Member event: 1
- Issue comment event: 99
- Push event: 187
- Pull request review comment event: 42
- Pull request review event: 68
- Pull request event: 134
- Fork event: 51
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 459
- Total Committers: 17
- Avg Commits per committer: 27.0
- Development Distribution Score (DDS): 0.203
Top Committers
| Name | Commits | |
|---|---|---|
| Craig Gidney | c****y@g****m | 366 |
| Craig Gidney | c****y@g****m | 32 |
| Craig Gidney | C****y@g****m | 22 |
| Adam Zalcman | 4****r@u****m | 14 |
| Daniel Barter | d****r@u****m | 5 |
| Matthew McEwen | 3****g@u****m | 4 |
| Matthew Neeley | m****o@g****m | 3 |
| Alexandre Bourassa | A****a@u****m | 3 |
| Noah Shutty | n****u@u****m | 2 |
| Chris Pattison | c****n@l****m | 1 |
| Eric Peterson | p****c@g****m | 1 |
| Doug Strain | d****n@g****m | 1 |
| Cody Wang | s****6@g****m | 1 |
| Scott P. Jones | S****s@u****m | 1 |
| Matthew Neeley | m****y@g****m | 1 |
| Michael Newman | 6****g@u****m | 1 |
| oon3m0oo | o****o@u****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 235
- Total pull requests: 332
- Average time to close issues: 2 months
- Average time to close pull requests: 7 days
- Total issue authors: 60
- Total pull request authors: 41
- Average comments per issue: 0.8
- Average comments per pull request: 0.52
- Merged pull requests: 264
- Bot issues: 0
- Bot pull requests: 3
Past Year
- Issues: 64
- Pull requests: 133
- Average time to close issues: about 1 month
- Average time to close pull requests: 8 days
- Issue authors: 36
- Pull request authors: 20
- Average comments per issue: 0.8
- Average comments per pull request: 0.43
- Merged pull requests: 101
- Bot issues: 0
- Bot pull requests: 3
Top Authors
Issue Authors
- Strilanc (137)
- mmcewen-g (9)
- oscarhiggott (6)
- m-mcewen (5)
- mhucka (4)
- ghost (4)
- AlexBourassa (3)
- nelimee (3)
- The193thDoctor (2)
- markturner289 (2)
- BrunoLiegiBastonLiegi (2)
- qodesign (2)
- AlMrvn (2)
- RefatIsmail96 (2)
- nathlacroix (1)
Pull Request Authors
- Strilanc (270)
- mhucka (38)
- markturner289 (9)
- AlexBourassa (7)
- inmzhang (6)
- folded (6)
- fdmalone (6)
- viathor (5)
- yuewuo (4)
- qu-tan-um (4)
- dougthor42 (4)
- qec-pconner (3)
- nickdgardner (3)
- dependabot[bot] (3)
- cesarBLG (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 5
-
Total downloads:
- pypi 138,236 last-month
-
Total dependent packages: 17
(may contain duplicates) -
Total dependent repositories: 10
(may contain duplicates) - Total versions: 1,165
- Total maintainers: 4
pypi.org: stim
A fast library for analyzing with quantum stabilizer circuits.
- Homepage: https://github.com/quantumlib/stim
- Documentation: https://stim.readthedocs.io/
- License: Apache 2
-
Latest release: 1.15.0
published 8 months ago
Rankings
pypi.org: stimcirq
Implements a cirq.Sampler backed by stim.
- Homepage: https://github.com/quantumlib/stim
- Documentation: https://stimcirq.readthedocs.io/
- License: Apache 2
-
Latest release: 1.15.0
published 8 months ago
Rankings
proxy.golang.org: github.com/quantumlib/Stim
- Documentation: https://pkg.go.dev/github.com/quantumlib/Stim#section-documentation
- License: apache-2.0
-
Latest release: v1.15.0
published 8 months ago
Rankings
proxy.golang.org: github.com/quantumlib/stim
- Documentation: https://pkg.go.dev/github.com/quantumlib/stim#section-documentation
- License: apache-2.0
-
Latest release: v1.15.0
published 8 months ago
Rankings
pypi.org: sinter
Samples stim circuits and decodes them using pymatching.
- Documentation: https://sinter.readthedocs.io/
- License: Apache 2
-
Latest release: 1.14.0
published over 1 year ago
Rankings
Dependencies
- puppeteer ^5.3.0 development
- cirq-core *
- stim *
- matplotlib *
- networkx *
- numpy *
- pandas *
- pymatching *
- pytest *
- stim *
- networkx *
- stim *
- numpy *
- actions/checkout v3 composite
- actions/checkout v1 composite
- actions/download-artifact v2 composite
- actions/setup-node v3 composite
- actions/setup-node v1 composite
- actions/setup-python v3 composite
- actions/upload-artifact v3 composite
- bazelbuild/setup-bazelisk v1 composite
- egor-tensin/setup-clang v1 composite
- microsoft/setup-msbuild v1.0.2 composite
- mymindstorm/setup-emsdk v9 composite
- pypa/gh-action-pypi-publish release/v1 composite