GithubHelp home page GithubHelp logo

elondormancy / stim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from quantumlib/stim

0.0 1.0 0.0 2.21 MB

A fast stabilizer circuit simulator

License: Apache License 2.0

Starlark 0.19% CMake 0.44% Python 10.52% C++ 87.72% C 0.26% Shell 0.11% JavaScript 0.78%

stim's Introduction

What is Stim?

Stim is a tool for high performance simulation and analysis of quantum stabilizer circuits, intended to help with research into quantum error correcting codes. Stim can be used as a python package (pip install stim), as a command line tool (built from source in this repo), or as a C++ library (also built from source in this repo).

Important Stim features include:

  1. Really fast simulation of stabilizer circuits. As in thousands of times faster than what came before. Stim can pull thousands of full shots out of circuits with millions of operations in seconds.
  2. Support for annotating noise, detection events, and logical observables directly into circuits.
  3. The ability to convert circuits into detector error models, which is a convenient format for configuring syndrome decoders.

The main limitations of Stim are:

  1. All circuits must be stabilizer circuits (eg. no Toffoli gates).
  2. All error channels must be probabilistic Pauli channels (eg. no amplitude decay).
  3. All feedback must be Pauli feedback (eg. no classically controlled S gates).

How do I use Stim?

See the Getting Started Notebook.

For using Stim from python, see the python documentation and the python API reference. For using Stim from the command line, see the command line documentation. For building Stim for yourself, see the developer documentation.

Circuits are specified using the stim circuit file format (.stim). See the supported gate reference for a list of available circuit instructions, and details on what they do. Samples can be output using a variety of text and binary formats.

Error models are specified using the detector error model file format (.dem).

How does Stim work?

See the paper describing Stim published in Quantum.

In terms of performance, Stim makes three core improvements over previous stabilizer simulators:

  1. 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. 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.
  3. 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 with a deterministic result (given previous measurements) take linear time instead of quadratic time.

Attribution

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

stim's People

Contributors

dstrain115 avatar maffoo avatar newmanmg avatar speller26 avatar strilanc avatar viathor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.