Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

qsim and qsimh

Quantum circuit simulators qsim and qsimh. These simulators were used for cross entropy benchmarking in [1].

[1], F. Arute et al, "Quantum Supremacy Using a Programmable Superconducting Processor", Nature 574, 505, (2019).

qsim

qsim is a Schrödinger full state-vector simulator. It computes all the 2n amplitudes of the state vector, where n is the number of qubits. Essentially, the simulator performs matrix-vector multiplications repeatedly. One matrix-vector multiplication corresponds to applying one gate. The total runtime is proportional to g2n, where g is the number of 2-qubit gates. To speed up the simulator, we use gate fusion [2] [3], single precision arithmetic, AVX/FMA instructions for vectorization and OpenMP for multi-threading.

[2] M. Smelyanskiy, N. P. Sawaya, A. Aspuru-Guzik, "qHiPSTER: The Quantum High Performance Software Testing Environment", arXiv:1601.07195 (2016).

[3] T. Häner, D. S. Steiger, "0.5 Petabyte Simulation of a 45-Qubit Quantum Circuit", arXiv:1704.01127 (2017).

qsimh

qsimh is a hybrid Schrödinger-Feynman simulator [4]. The lattice is split into two parts and the Schmidt decomposition is used to decompose 2-qubit gates on the cut. If the Schmidt rank of each gate is m and the number of gates on the cut is k then there are mk paths. To simulate a circuit with fidelity one, one needs to simulate all the mk paths and sum the results. The total runtime is proportional to (2n1 + 2n2)mk, where n1 and n2 are the qubit numbers in the first and second parts. Path simulations are independent of each other and can be trivially parallelized to run on supercomputers or in data centers. Note that one can run simulations with fidelity F < 1 just by summing over a fraction F of all the paths.

A two level checkpointing scheme is used to improve performance. Say, there are k gates on the cut. We split those into three parts: p+r+s=k, where p is the number of "prefix" gates, r is the number of "root" gates and s is the number of "suffix" gates. The first checkpoint is executed after applying all the gates up to and including the prefix gates and the second checkpoint is executed after applying all the gates up to and including the root gates. The full summation over all the paths for the root and suffix gates is performed.

If p>0 then one such simulation gives F ≈ m-p (for all the prefix gates having the same Schmidt rank m). One needs to run mp simulations with different prefix paths and sum the results to get F = 1.

[4] I. L. Markov, A. Fatima, S. V. Isakov, S. Boixo, "Quantum Supremacy Is Both Closer and Farther than It Appears", arXiv:1807.10749 (2018).

C++ Usage

The code is basically designed as a library. The user can modify sample aplications in apps to meet their own needs. The usage of sample applications is described in the docs.

Input format

The circuit input format is described in the docs.

NOTE: This format is deprecated, and no longer actively maintained.

Sample Circuits

A number of sample circuits are provided in circuits.

Unit tests

Unit tests for C++ libraries use the Google test framework, and are located in tests. Python tests use pytest, and are located in qsimcirq_tests.

To build and run all tests, navigate to the test directory and run:

make run-all

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.

To clean up generated test files, run make clean from the test directory.

Cirq Usage

Cirq is a framework for modeling and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.

To get started simulating Google Cirq circuits with qsim, see the tutorial.

More detailed information about the qsim-Cirq API can be found in the docs.

Disclaimer

This is not an officially supported Google product.

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

Metadata

Release files for qsimcirq 0.12.2.dev20220422

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.12.2.dev20220422
File
qsimcirq-0.12.2.dev20220422-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
qsimcirq-0.12.2.dev20220422-cp39-cp39-manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
qsimcirq-0.12.2.dev20220422-cp39-cp39-macosx_10_9_universal2.whl CPython 3.9 CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) Details
qsimcirq-0.12.2.dev20220422-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
qsimcirq-0.12.2.dev20220422-cp38-cp38-manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
qsimcirq-0.12.2.dev20220422-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
qsimcirq-0.12.2.dev20220422-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
qsimcirq-0.12.2.dev20220422-cp37-cp37m-manylinux2014_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Details
qsimcirq-0.12.2.dev20220422-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
qsimcirq-0.12.2.dev20220422-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
qsimcirq-0.12.2.dev20220422-cp36-cp36m-manylinux2014_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64 Details
qsimcirq-0.12.2.dev20220422-cp36-cp36m-macosx_10_9_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 Details

Total release size: 14.6 MB

Release files / qsimcirq-0.12.2.dev20220422-cp39-cp39-win_amd64.whl

Download URL qsimcirq-0.12.2.dev20220422-cp39-cp39-win_amd64.whl
Size 1.0 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
f4472b71408f42c43857f38236e845e94a6d92d7798948f199d9b156fe5ddea8
BLAKE2b-256 checksum
How to use checksums
1f250a254bd859cfad6fe8e0dd4038c80a6bb3cfbdf1be7f98cedcf387a605a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / qsimcirq-0.12.2.dev20220422-cp39-cp39-manylinux2014_x86_64.whl

Download URL qsimcirq-0.12.2.dev20220422-cp39-cp39-manylinux2014_x86_64.whl
Size 1.4 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7ca6dab1040ced270417c3fc6fe4b14f82ef5a98c74f068e984d40546937e268
BLAKE2b-256 checksum
How to use checksums
9e181a0701dcf5a0a9dfb9417caa091d41a55c6565cc0d1f4eb09d83c83466a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / qsimcirq-0.12.2.dev20220422-cp39-cp39-macosx_10_9_universal2.whl

Download URL qsimcirq-0.12.2.dev20220422-cp39-cp39-macosx_10_9_universal2.whl
Size 1.2 MB
Tags CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
63663abab1dc68a528430553b93a17de11b100806c97dd07992e6c3cc7a1a029
BLAKE2b-256 checksum
How to use checksums
72d7c8078db05f84a2e3ac5290182d2be3a7cd02a98fbe576f2fdb1fd3d632bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / qsimcirq-0.12.2.dev20220422-cp38-cp38-win_amd64.whl

Download URL qsimcirq-0.12.2.dev20220422-cp38-cp38-win_amd64.whl
Size 1.0 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
d8f1be49cf63cd3f867b40a0f705c040c31548ed2b34a5e5a685bd5f5b8e0996
BLAKE2b-256 checksum
How to use checksums
1a0e87b509ecd0e242d3c6f3608f0db0349031ad57bb325b870248956a58a189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / qsimcirq-0.12.2.dev20220422-cp38-cp38-manylinux2014_x86_64.whl

Download URL qsimcirq-0.12.2.dev20220422-cp38-cp38-manylinux2014_x86_64.whl
Size 1.4 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
de8e5f11c96218373be183e8b57adfb98cdb25e683d820cd7cece9fa0bc63b11
BLAKE2b-256 checksum
How to use checksums
72af9c8cf2afb498eea6b874d9d156588a2c66e40fbdb7c04fb9511c0e2a8409
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / qsimcirq-0.12.2.dev20220422-cp38-cp38-macosx_10_9_x86_64.whl

Download URL qsimcirq-0.12.2.dev20220422-cp38-cp38-macosx_10_9_x86_64.whl
Size 1.2 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
77ab4420ae0530c0e31754f9e9d1da4ef55e9d3ca0ef0fbb58bf82976585c43a
BLAKE2b-256 checksum
How to use checksums
1001148d150209c6d3f3cb0982412bbfbbf1a6849eb900079d3c09b15937d375
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / qsimcirq-0.12.2.dev20220422-cp37-cp37m-win_amd64.whl

Download URL qsimcirq-0.12.2.dev20220422-cp37-cp37m-win_amd64.whl
Size 1.0 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
87f6a67d9642bfe5e11a52d783d7a290660dae53af4d5b385397a0117c08a7a5
BLAKE2b-256 checksum
How to use checksums
76e1cd9393ade2834fc3529691f0af2f0a2d63f4130b6b229fc648f1ec5607a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / qsimcirq-0.12.2.dev20220422-cp37-cp37m-manylinux2014_x86_64.whl

Download URL qsimcirq-0.12.2.dev20220422-cp37-cp37m-manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
15708c6e8be639cb0cd26fb9c0a70795e257894c8df59ae440e058091df7260d
BLAKE2b-256 checksum
How to use checksums
729e9489fa72f3ac18194dc89c107e4f02dfbc5ce4fb8d152a79e514a579b833
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / qsimcirq-0.12.2.dev20220422-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL qsimcirq-0.12.2.dev20220422-cp37-cp37m-macosx_10_9_x86_64.whl
Size 1.2 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
e965eee54841cd5883b50e42c7ff9f626489169be19d94fe788eea7f7aeceb9a
BLAKE2b-256 checksum
How to use checksums
c971542014c4105da8186fd3d4ee1d5b31d927de29b7cb83517d11895e7bab79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / qsimcirq-0.12.2.dev20220422-cp36-cp36m-win_amd64.whl

Download URL qsimcirq-0.12.2.dev20220422-cp36-cp36m-win_amd64.whl
Size 1.0 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
7861a3941bafbcb62816ee3ee42600e8f2a69379b86def95781142e806a787d0
BLAKE2b-256 checksum
How to use checksums
0d0251663c4e6e851896e5c365e6222ade6ce2a15b031fb61989d4da1e9e869a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / qsimcirq-0.12.2.dev20220422-cp36-cp36m-manylinux2014_x86_64.whl

Download URL qsimcirq-0.12.2.dev20220422-cp36-cp36m-manylinux2014_x86_64.whl
Size 1.5 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
19406ddf8a9206e5b45498843477a6b657f2a699a2759492d5c88ee0ad35e7c0
BLAKE2b-256 checksum
How to use checksums
1cc38ad07e5c611914ec18bf14309e24e291ea8c40a33e4d6b7a60263af8d3db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / qsimcirq-0.12.2.dev20220422-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL qsimcirq-0.12.2.dev20220422-cp36-cp36m-macosx_10_9_x86_64.whl
Size 1.2 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
00fed848870c87c4c923a2cf776fdfebd41760ef8654970a7931ebd195c2211d
BLAKE2b-256 checksum
How to use checksums
6f15e05678ca4c1ed110e555e2c630ff8d93e84e200b595d04e52fdce6c31ac0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Security for qsimcirq 0.12.2.dev20220422

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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