qsim
Fast C++ and Python library for state-vector simulation of quantum circuits.
Science Score: 77.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 8 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org, nature.com, zenodo.org -
✓Committers with academic emails
3 of 40 committers (7.5%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.9%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Fast C++ and Python library for state-vector simulation of quantum circuits.
Basic Info
- Host: GitHub
- Owner: quantumlib
- License: apache-2.0
- Language: C++
- Default Branch: master
- Homepage: https://quantumai.google/qsim
- Size: 6.33 MB
Statistics
- Stars: 597
- Watchers: 27
- Forks: 181
- Open Issues: 65
- Releases: 54
Topics
Metadata Files
README.md
qsim is a state-vector simulator for quantum circuits. It is highly tuned to
take advantage of vector arithmetic instruction sets and multithreading on
computers that provide them, as well as GPUs when available. qsim also provides
a Cirq interface (qsimcirq) and can be used
to simulate quantum circuits written in Cirq.
Introduction
qsim is a Schrödinger full state-vector simulator: it models quantum computations by representing the quantum state of a system as a vector of complex numbers (a state vector) and evolving it through the application of quantum gates. One matrix-vector multiplication corresponds to the application of one gate. Essentially, the simulator performs matrix-vector multiplications repeatedly.
Being a full state-vector simulator means that qsim computes all the 2 n amplitudes of the state vector, where n is the number of qubits. The total runtime is proportional to g2 n, where g is the number of 2-qubit gates. To speed up simulation, qsim uses gate fusion (Smelyanskiy et al., arXiv:1601.07195, 2016; Häner and Steiger, arXiv:1704.01127, 2017), single-precision arithmetic, AVX/FMA instructions for vectorization, and OpenMP for multithreading (on hardware that provides those features).
qsim was used to produce landmark cross-entropy benchmarking results published in 2019 (Arute et al., "Quantum Supremacy Using a Programmable Superconducting Processor", Nature vol. 574, 2019).
Usage
C++ usage
The code is basically designed as a library. The user can modify sample applications in apps to meet their own needs. The usage of sample applications is described in the docs.
Python usage
The qsim-Cirq Python interface is called qsimcirq and is available as a PyPI
package for Linux, MacOS and Windows users. It can be installed by using the
following command:
shell
pip install qsimcirq
qsimcirq is also available for Conda for Linux and MacOS. To install it from
conda-forge, you can use the following command:
shell
conda install -c conda-forge qsimcirq
Note: The core qsim library (located in the source repository under the
lib/ subdirectory) can
be included directly in C++ programs without installing the Python interface.
Cirq usage
Cirq is a framework for modeling and invoking Noisy Intermediate-Scale Quantum (NISQ) circuits. Cirq can use qsim as its simulation library. To get started with simulating Cirq circuits using qsim, please refer to the tutorial.
More detailed information about the qsim-Cirq API can be found in the docs.
Input format
[!WARNING] This format is deprecated, and no longer actively maintained.
The circuit input format is described in the docs.
Sample circuits
A number of sample circuits are provided in circuits.
Unit tests
Unit tests for C++ libraries use the GoogleTest framework, and are located in tests. Python tests use pytest, and are located in qsimcirq_tests.
To build and run all tests, run:
shell
make run-tests
This will compile all test binaries to files with .x extensions, and run each
test in series. Testing will stop early if a test fails. It will also run tests
of the qsimcirq python interface. To run C++ or python tests only, run
make run-cxx-tests or make run-py-tests, respectively.
To clean up generated test files, run make clean from the test directory
qsim documentation
Please visit the qsim documentation site guides, tutorials, and API reference documentation.
How to cite qsim
Qsim is uploaded to Zenodo automatically. Click on this badge to see all the citation formats for all versions.
An equivalent BibTeX format reference is below for all the versions:
bibtex
@software{quantum_ai_team_and_collaborators_2020_4023103,
author = {Quantum AI team and collaborators},
title = {qsim},
month = Sep,
year = 2020,
publisher = {Zenodo},
doi = {10.5281/zenodo.4023103},
url = {https://doi.org/10.5281/zenodo.4023103}
}
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 2019 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 provide human- & machine-readable citation info for software and
# datasets. GitHub, Zenodo, and the Zotero browser plugin all use CFF files
# automatically. Tools exist to generate CITATION.cff files from other formats
# such as BibTeX. For more info, visit https://citation-file-format.github.io/.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cff-version: 1.2.0
message: >-
Please cite your use of qsim using the reference metadata provided here.
# If preferred-citation is present, GitHub uses its value for the "cite this
# repository" button and ignores the rest of this file; conversely, the Zenodo-
# GitHub integration ignores this field when archiving a new software release
# and uses the metadata in the rest of this file.
preferred-citation:
type: generic
authors:
- family-names: Isakov
given-names: Sergei V.
affiliation: Google LLC
- family-names: Kafri
given-names: Dvir
affiliation: Google LLC
- family-names: Martin
given-names: Orion
affiliation: Google LLC
- family-names: Vollgraff Heidweiller
given-names: Catherine
affiliation: Google LLC
- family-names: Mruczkiewicz
given-names: Wojciech
affiliation: Google LLC
- family-names: Harrigan
given-names: Matthew P.
affiliation: Google LLC
- family-names: Rubin
given-names: Nicholas C.
affiliation: Google LLC
- family-names: Thomson
given-names: Ross
affiliation: Google LLC
- family-names: Broughton
given-names: Michael B.
affiliation: Google LLC
- family-names: Kissell
given-names: Kevin
affiliation: Google LLC
- family-names: Peters
given-names: Evan
affiliation: Fermi National Accelerator Laboratory
- family-names: Gustafson
given-names: Erik
affiliation: Fermi National Accelerator Laboratory
- family-names: Li
given-names: Andy C. Y.
affiliation: Fermi National Accelerator Laboratory
- family-names: Lamm
given-names: Henry
affiliation: Fermi National Accelerator Laboratory
- family-names: Perdue
given-names: Gabriel
affiliation: Fermi National Accelerator Laboratory
- family-names: Ho
given-names: Alan K.
affiliation: Google LLC
- family-names: Strain
given-names: Doug
affiliation: Google LLC
- family-names: Boixo
given-names: Sergio
affiliation: Google LLC
title: >-
Simulations of Quantum Circuits with Approximate Noise using qsim and Cirq
year: 2021
date-published: 2021-11-03
doi: 10.48550/arXiv.2111.02396
url: https://arxiv.org/abs/2111.02396
# The remaining metadata in this file describes the current software release.
title: qsim
authors:
- name: Quantum AI team and collaborators
website: https://github.com/quantumlib/qsim/graphs/contributors
abstract: High-performance quantum circuit simulator for C++ and Python.
version: 0.22.0
date-released: 2025-06-24
url: https://github.com/quantumlib/qsim
repository-code: https://github.com/quantumlib/qsim
license: Apache-2.0
type: software
identifiers:
- description: The home page for qsim
value: https://quantumai.google/qsim
type: url
- description: GitHub repository for qsim
value: https://github.com/quantumlib/qsim
type: url
- description: Archival DOI for qsim software releases
value: 10.5281/zenodo.4067237
type: doi
- description: Publication about qsim
value: 10.48550/arXiv.2111.02396
type: doi
keywords:
- algorithms
- API
- C++
- Cirq
- CUDA
- gate fusion
- GPU
- NISQ
- noise modeling
- Noisy Intermediate-Scale Quantum
- Python
- quantum
- quantum circuit
- quantum computing
- quantum information
- quantum programming
- quantum simulation
- quantum trajectories
- research
- Schrödinger equation
- science
- SDK
- simulation
- software
GitHub Events
Total
- Create event: 66
- Issues event: 64
- Watch event: 143
- Delete event: 66
- Member event: 2
- Issue comment event: 63
- Push event: 255
- Pull request review event: 88
- Pull request review comment event: 40
- Pull request event: 154
- Fork event: 35
Last Year
- Create event: 66
- Issues event: 64
- Watch event: 143
- Delete event: 66
- Member event: 2
- Issue comment event: 63
- Push event: 255
- Pull request review event: 88
- Pull request review comment event: 40
- Pull request event: 154
- Fork event: 35
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Orion Martin | 4****n | 425 |
| Sergei Isakov | i****e@g****m | 215 |
| Michael Broughton | m****h@g****m | 70 |
| Nour Yosri | n****i@g****m | 66 |
| Ross Thomson | j****n@g****m | 59 |
| Jae Yoo | j****o@g****m | 56 |
| Bas Nijholt | b****s@n****t | 31 |
| eliottrosenberg | 6****g | 28 |
| Laurynas Tamulevicius | l****t@g****m | 24 |
| Matthew Neeley | m****o@g****m | 18 |
| Billy Lamberta | b****b@g****m | 18 |
| Michael Hucka | m****a@g****m | 17 |
| Ricardo Olenewa | r****a@g****m | 15 |
| Jakub Kurzak | j****k@a****m | 15 |
| Vamsi Krishna Devabathini | 4****d | 15 |
| Ross Thomson | j****n@g****m | 12 |
| gecrooks | g****c@t****m | 12 |
| Ryan LaRose | r****e@u****u | 9 |
| hosseinberg | h****y@g****m | 6 |
| Bálint Pató | b****p@g****m | 6 |
| Bernardo Meurer | b****o@m****g | 6 |
| Yipeng Huang | y****g@c****u | 5 |
| vtomole | v****2@g****m | 5 |
| Pavol Juhas | j****s@g****m | 5 |
| jlow2397 | 5****7 | 4 |
| Jan Hosang | h****g | 4 |
| Dave Bacon | d****n@g****m | 3 |
| Douglas Thor | d****r@g****m | 3 |
| Kevin J. Sung | k****g@g****m | 3 |
| Burt Holzman | b****t@f****v | 2 |
| and 10 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 123
- Total pull requests: 305
- Average time to close issues: 7 months
- Average time to close pull requests: 9 days
- Total issue authors: 42
- Total pull request authors: 21
- Average comments per issue: 2.07
- Average comments per pull request: 0.65
- Merged pull requests: 223
- Bot issues: 0
- Bot pull requests: 13
Past Year
- Issues: 41
- Pull requests: 182
- Average time to close issues: about 1 month
- Average time to close pull requests: 7 days
- Issue authors: 10
- Pull request authors: 7
- Average comments per issue: 0.34
- Average comments per pull request: 0.17
- Merged pull requests: 119
- Bot issues: 0
- Bot pull requests: 13
Top Authors
Issue Authors
- mhucka (31)
- 95-martin-orion (29)
- rht (7)
- MichaelBroughton (5)
- maffoo (3)
- richrines1 (3)
- NoureldinYosri (3)
- vtomole (2)
- ochapman-dphil (2)
- Hosseinberg (2)
- laurynasas (2)
- jaeyoo (2)
- kevinsung (2)
- honamnguyen (1)
- hthayko (1)
Pull Request Authors
- mhucka (155)
- 95-martin-orion (45)
- NoureldinYosri (14)
- dependabot[bot] (13)
- basnijholt (11)
- eliottrosenberg (10)
- sergeisakov (10)
- jaeyoo (9)
- pavoljuhas (8)
- maffoo (5)
- vtomole (4)
- angelo-laskaris (2)
- dougthor42 (2)
- google-admin (2)
- lexi-nadia (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- pypi 10,375 last-month
- Total docker downloads: 62
-
Total dependent packages: 2
(may contain duplicates) -
Total dependent repositories: 5
(may contain duplicates) - Total versions: 93
- Total maintainers: 2
pypi.org: qsimcirq
Schrödinger and Schrödinger-Feynman simulators for quantum circuits.
- Homepage: https://github.com/quantumlib/qsim
- Documentation: https://qsimcirq.readthedocs.io/
- License: Apache-2.0
-
Latest release: 0.22.0
published 6 months ago
Rankings
Maintainers (2)
proxy.golang.org: github.com/quantumlib/qsim
- Documentation: https://pkg.go.dev/github.com/quantumlib/qsim#section-documentation
- License: apache-2.0
-
Latest release: v0.22.0
published 6 months ago
Rankings
pypi.org: qsim
High-performance quantum circuit simulation library
- Documentation: https://qsim.readthedocs.io/
- License: apache-2.0
-
Latest release: 0.22.0
published 6 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v2 composite
- actions/checkout v2 composite
- actions/setup-python v1 composite
- actions/checkout v2 composite
- actions/checkout v2 composite
- actions/setup-python v1 composite
- actions/checkout v2 composite
- actions/download-artifact v2 composite
- actions/setup-python v2 composite
- actions/upload-artifact v2 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/upload-artifact v2 composite
- debian latest build
- qsim latest
- qsim-cxx-tests latest
- qsim-py-tests latest
- debian latest build
- qsim-install latest
- debian bullseye build
- qsim latest build
- qsim latest build
- black * development
- flynt * development
- pytest * development
- absl-py *
- cirq-core *
- numpy *
- pybind11 *
- typing_extensions *