Skip to main content

qsim

High-performance quantum circuit simulator for C++ and Python.

Licensed under the Apache 2.0 license C++ qsim project on PyPI Compatible with Python versions 3.10 and higher Archived in Zenodo

Features – Usage – Documentation – Citing qsim – Contact

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:

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:

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:

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 DOI to see all the citation formats for all versions.

An equivalent BibTeX format reference is below for all the versions:

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

Release files for qsimcirq 0.22.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for qsimcirq 0.22.1
File
qsimcirq-0.22.1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
qsimcirq-0.22.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
qsimcirq-0.22.1-cp314-cp314-macosx_15_0_arm64.whl CPython 3.14 CPython 3.14 macOS 15.0+ ARM64 Details
qsimcirq-0.22.1-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details
qsimcirq-0.22.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
qsimcirq-0.22.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
qsimcirq-0.22.1-cp313-cp313-macosx_15_0_arm64.whl CPython 3.13 CPython 3.13 macOS 15.0+ ARM64 Details
qsimcirq-0.22.1-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details
qsimcirq-0.22.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
qsimcirq-0.22.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
qsimcirq-0.22.1-cp312-cp312-macosx_15_0_arm64.whl CPython 3.12 CPython 3.12 macOS 15.0+ ARM64 Details
qsimcirq-0.22.1-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details
qsimcirq-0.22.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
qsimcirq-0.22.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
qsimcirq-0.22.1-cp311-cp311-macosx_15_0_arm64.whl CPython 3.11 CPython 3.11 macOS 15.0+ ARM64 Details
qsimcirq-0.22.1-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details
qsimcirq-0.22.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
qsimcirq-0.22.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
qsimcirq-0.22.1-cp310-cp310-macosx_15_0_arm64.whl CPython 3.10 CPython 3.10 macOS 15.0+ ARM64 Details
qsimcirq-0.22.1-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details

Total release size: 20.9 MB

Release files / qsimcirq-0.22.1-cp314-cp314-win_amd64.whl

Download URL qsimcirq-0.22.1-cp314-cp314-win_amd64.whl
Size 1.4 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
d3d2c6b6195ff4fe7b45b00bc2f38c32f8b1bc0fb85acc49289e334ed53ebcf5
BLAKE2b-256 checksum
How to use checksums
cdb14eb592ef1cc0338c05bb63da08b4e0415dc11296413098d8e40dc99144e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL qsimcirq-0.22.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.7 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1c2f5d8f38ba2cc2a808bb6e6ccb91701b11d810357eeb4d888a664ba45bb395
BLAKE2b-256 checksum
How to use checksums
864a125c20cdd83587c9cf95f1f8345375547b3c8f590348552012ebbe703f76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp314-cp314-macosx_15_0_arm64.whl

Download URL qsimcirq-0.22.1-cp314-cp314-macosx_15_0_arm64.whl
Size 558.2 kB
Tags CPython 3.14 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
320dbd7ee61d34b135be8fba497e4fc0fabb0133f0067076aa85529121784f15
BLAKE2b-256 checksum
How to use checksums
ea27cf5da5a7070080d11d1df9bf2afc64258dc66001a913b21c6e75eedfaa14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp314-cp314-macosx_14_0_arm64.whl

Download URL qsimcirq-0.22.1-cp314-cp314-macosx_14_0_arm64.whl
Size 561.9 kB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
7b18aada0372bf1ea1799c30edcae8411a51797aeb7becaa3bea775284070ca2
BLAKE2b-256 checksum
How to use checksums
0ac3115d9c9142e48c63493b7361813c5092cfd4eeab3a68ad4f7ab6e7e428e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp313-cp313-win_amd64.whl

Download URL qsimcirq-0.22.1-cp313-cp313-win_amd64.whl
Size 1.4 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
642199384070041495131a08d52362cf9dda7804e02255a4619e2d1f74cd5738
BLAKE2b-256 checksum
How to use checksums
0355bfda531d6dbbeddbec3ed411797af4e362f579341997247a7eeba4cd6978
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL qsimcirq-0.22.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.7 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
3519287025c3ae876500b563a16e046c3f7ff4629f42307a499f7bd9377af221
BLAKE2b-256 checksum
How to use checksums
3daed2b6e9e3e4e2169c59573f30b3be787e0cc1d0e2602763a310c6b8d66988
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp313-cp313-macosx_15_0_arm64.whl

Download URL qsimcirq-0.22.1-cp313-cp313-macosx_15_0_arm64.whl
Size 557.9 kB
Tags CPython 3.13 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
718e76419ca4537594f036862eedab0300d922902f60f54a9a0688c48921a44e
BLAKE2b-256 checksum
How to use checksums
308e70162462e133f5a8147872af1be6a381bc238cb6cb339607a294a6694af8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp313-cp313-macosx_14_0_arm64.whl

Download URL qsimcirq-0.22.1-cp313-cp313-macosx_14_0_arm64.whl
Size 561.5 kB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
18f4cd93b25caf3fcf824d9fb34d0067ac1b3078d6a3a8db7474b1805f8fe98d
BLAKE2b-256 checksum
How to use checksums
ba4e5fcff8d5256ce0801ca5fbce24c76864794a8a0f4c680b8ffa7153985280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp312-cp312-win_amd64.whl

Download URL qsimcirq-0.22.1-cp312-cp312-win_amd64.whl
Size 1.4 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
1f694f445b3a156f740382c6a9a9e8d79343c389acc88ad52a819d024832cab8
BLAKE2b-256 checksum
How to use checksums
696fa7450fc62c4207bfc2de1886545d95c8fc4fbf9ecb8dbff68d4692de9b0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL qsimcirq-0.22.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.7 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
82dc81fc1be7941abd77696dcd278a4aede785798b6d3ebd9291be686882e193
BLAKE2b-256 checksum
How to use checksums
70298763650166b4b0c81431ed93e0c2d34faa597d55cab763224a69e19e88dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp312-cp312-macosx_15_0_arm64.whl

Download URL qsimcirq-0.22.1-cp312-cp312-macosx_15_0_arm64.whl
Size 557.7 kB
Tags CPython 3.12 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
a7959f161b7ed1c165e5ff6c2069e8b5297507fc0c94a9db0a848b863e268780
BLAKE2b-256 checksum
How to use checksums
b1940456e204aeea1b65ef04580f22eb5c4299ef95eb54d96ee6cd31235ad11d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp312-cp312-macosx_14_0_arm64.whl

Download URL qsimcirq-0.22.1-cp312-cp312-macosx_14_0_arm64.whl
Size 561.3 kB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
16ece72681fc99b71c31c44a9464353e41edb2c10f9f8b381ae6cf7756d69c3e
BLAKE2b-256 checksum
How to use checksums
943b64c05d8fe48008a8bd825a5528435bc47c5b1dbdf9901bfe15c1399ea6a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp311-cp311-win_amd64.whl

Download URL qsimcirq-0.22.1-cp311-cp311-win_amd64.whl
Size 1.4 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
ae0a2e6a90cc39140684e8497683de791d593fc23921758d39a7c855f7c2b8ae
BLAKE2b-256 checksum
How to use checksums
2c2f6401125929b3de4b8c278014240b77210f03c138512489fac997394d012a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL qsimcirq-0.22.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.7 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
97dd7c804a46f3b241b3932f9ee0e5a4f1fc342ba716cc116a730808b0332c82
BLAKE2b-256 checksum
How to use checksums
5f610dbebecc7b338efec7be7f5cefbf097905d8c306a4d70c5cbcb28b0502a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp311-cp311-macosx_15_0_arm64.whl

Download URL qsimcirq-0.22.1-cp311-cp311-macosx_15_0_arm64.whl
Size 558.7 kB
Tags CPython 3.11 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
0de15a2b8bebad4f8166922797e44f5da3d29aa14d71a8b4ce277774d3d498ea
BLAKE2b-256 checksum
How to use checksums
9e9ca5fea099f54ecc48b36e052a42832833b1bcf3f1afbce64410c1225c872b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp311-cp311-macosx_14_0_arm64.whl

Download URL qsimcirq-0.22.1-cp311-cp311-macosx_14_0_arm64.whl
Size 562.4 kB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
6563a0be721abc77a270b4218f6011e64c44b1bd89def11a7cce43654eee2c97
BLAKE2b-256 checksum
How to use checksums
90bc1783c947df8ad76bd9d9900b2f36bb2ed640c1966fbe07cd226d0f707a92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp310-cp310-win_amd64.whl

Download URL qsimcirq-0.22.1-cp310-cp310-win_amd64.whl
Size 1.4 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
3c173dbc3dc458aa5c8e684cee7d2122fb982cd4dca4a927d0b82b7e2c00198d
BLAKE2b-256 checksum
How to use checksums
fd4f84e885054321efdbeb597532b865592738ad4368110b18ba8dd672a0b8d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL qsimcirq-0.22.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
86937420a97718415fef23bcbec0013fb3eb28f2d81a5113aab74e91bcf060a0
BLAKE2b-256 checksum
How to use checksums
36ac2a6f8ca532a8487de2d2595e0b76a43fd9992bec3e40878166effc61e627
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp310-cp310-macosx_15_0_arm64.whl

Download URL qsimcirq-0.22.1-cp310-cp310-macosx_15_0_arm64.whl
Size 556.2 kB
Tags CPython 3.10 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
f239d25fb0514fa236311872737fdbdac15ead9836d878f8d16c06761579eae1
BLAKE2b-256 checksum
How to use checksums
afd59987f2cd36bdb15f03fb041094aa8921f0a1fd6145b2b2961bf6016169f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / qsimcirq-0.22.1-cp310-cp310-macosx_14_0_arm64.whl

Download URL qsimcirq-0.22.1-cp310-cp310-macosx_14_0_arm64.whl
Size 559.8 kB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
e4a97372ac4e9647d5fb5dce715a13a93ab21a7bd2056b9bbdcf30fccd6afc1d
BLAKE2b-256 checksum
How to use checksums
09ffa848a988e146d5e99192fe5067387470756bd25ab804de6df7fa55fe481c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release history Release notifications | RSS feed

This release

0.22.1 This release

20 release files

0.10.0

4 release files

0.9.5

1 release file

0.9.2

1 release file

0.9.0

1 release file

0.8.0

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page