Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A fast stabilizer circuit library.

License

NotificationsYou must be signed in to change notification settings

quantumlib/Stim

Logo

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 asa command line tool or a C++ library.

Stim's key features:

  1. 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.

  2. Semi-automatic decoder configuration.stim.Circuit.detector_error_model()converts a noisy circuit into a detector error model (aTanner graph) which can be used to configure decoders.Adding the optiondecompose_operations=True will additionally suggest how hyper errors can be decomposedinto graphlike errors, making it easier to configure matching-based decoders.

  3. Useful building blocks for working with stabilizers, such asstim.PauliString,stim.Tableau,andstim.TableauSimulator.

Stim's main limitations are:

  1. There is no support for non-Clifford operations, such as T gates and Toffoli gates. Only stabilizer operations are supported.
  2. stim.Circuit only supports Pauli noise channels (eg. no amplitude decay). For more complex noise you must manually drive astim.TableauSimulator.
  3. stim.Circuit only 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 fastenough, 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 thingsper 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!Afifth of the multiplicative performance budget allocated tolanguage choice!Too expensive!Although stim will never achieve the glory of30 GiB per second of FizzBuzz,it at leastwishes 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-levelpieces 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 theGetting Started Notebook.

Stuck?Get help on the quantum computing stack exchangeand use thestim tag.

See the reference documentation:

How does Stim work?

Seethe paper describing Stim.Stim makes three core improvements over previous stabilizer simulators:

  1. 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.
  2. 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 isridiculously cheaper than the alternative: constant cost per gate, instead of linear cost or even quadratic cost.
  3. 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 takelinear time instead of quadratic time. This is beneficial in error correcting codes, because the measurementsthey perform are usually redundant and so commute with the current stabilizers.

How do I cite Stim?

When using Stim for research,please cite:

@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}}

[8]ページ先頭

©2009-2025 Movatter.jp