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

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

Release files for qsimcirq 0.14.1.dev20220804

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.14.1.dev20220804
File
qsimcirq-0.14.1.dev20220804-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
qsimcirq-0.14.1.dev20220804-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
qsimcirq-0.14.1.dev20220804-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
qsimcirq-0.14.1.dev20220804-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
qsimcirq-0.14.1.dev20220804-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
qsimcirq-0.14.1.dev20220804-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
qsimcirq-0.14.1.dev20220804-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
qsimcirq-0.14.1.dev20220804-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
qsimcirq-0.14.1.dev20220804-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
qsimcirq-0.14.1.dev20220804-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
qsimcirq-0.14.1.dev20220804-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Details
qsimcirq-0.14.1.dev20220804-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details

Total release size: 18.5 MB

Release files / qsimcirq-0.14.1.dev20220804-cp310-cp310-win_amd64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp310-cp310-win_amd64.whl
Size 1.1 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
b8a738cbe61bc287bbb84125347e3106c1be4fead89557c438f725795e480c03
BLAKE2b-256 checksum
How to use checksums
d8fc1ebadfb92e7df03505fedbfccd7d91116ce5c86e5fbd024b17fce21ec3d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / qsimcirq-0.14.1.dev20220804-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
3fb9a7e878e87c972ecac224edadf5ef88c468402a823f5c1521d26fba9088b8
BLAKE2b-256 checksum
How to use checksums
14e9ac873258368b477ed2ed06bccd4000e1ab8d450e9a0699fa841dc820dd19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / qsimcirq-0.14.1.dev20220804-cp310-cp310-macosx_10_9_x86_64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp310-cp310-macosx_10_9_x86_64.whl
Size 2.0 MB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
3ef8e8a1d02c7c4f431db9dac6a99d4afa3dd24e545f437baaceceb2ab9677f9
BLAKE2b-256 checksum
How to use checksums
5bb9d2d1a0a675586b0aacdc037ca8d247c4ba84f2a4dde282b6ab125ee5280c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / qsimcirq-0.14.1.dev20220804-cp39-cp39-win_amd64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp39-cp39-win_amd64.whl
Size 1.0 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
a8abbf8e73371e7a247e3640c9b24578864915d73e4b4c2633c85cc3d6fc5115
BLAKE2b-256 checksum
How to use checksums
639057ec2306e05548d22cc254b3f042cabeef4d4c5fd100c41a8c5fd39e333c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / qsimcirq-0.14.1.dev20220804-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.6 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
186671eccd3b9fb5ee6c74bfda6decf6dce88e47516348984f62a014eb3ed24e
BLAKE2b-256 checksum
How to use checksums
98249672c1d90dfd0770b7665b71e7a9fa40cc01e20e835d42735d8365716a3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / qsimcirq-0.14.1.dev20220804-cp39-cp39-macosx_10_9_x86_64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp39-cp39-macosx_10_9_x86_64.whl
Size 2.0 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
638babb46b0afde6592a888b360c6cde2bee4d781e19bd991c16950fd1054d76
BLAKE2b-256 checksum
How to use checksums
80a3b1b3ee313802eeaec57d73251fa4e24ffab90a32cea8da5212c97494e717
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / qsimcirq-0.14.1.dev20220804-cp38-cp38-win_amd64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp38-cp38-win_amd64.whl
Size 1.1 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
ade02266e29280f7c075bd254893bd3232f7b364c0b81b3f7c73420556a1b1b4
BLAKE2b-256 checksum
How to use checksums
80952961db57045cf4c07f7e91b8ffc8a3e6e6b9f5140401ee5718d0c3bf84ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / qsimcirq-0.14.1.dev20220804-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.6 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
9df10372c842344fab782422d8dfa2e719d372f04e2de3caf748d00c3ca82b8d
BLAKE2b-256 checksum
How to use checksums
752f30ac329711842d8c15c3529a7e824f6b568e8f47aa5fcaaa44d54a551280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / qsimcirq-0.14.1.dev20220804-cp38-cp38-macosx_10_9_x86_64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp38-cp38-macosx_10_9_x86_64.whl
Size 2.0 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
066e0e3a10378a617e3b2e674d2d907fd91d8d252fc6c2782eebd737a5f9463d
BLAKE2b-256 checksum
How to use checksums
ab291013c80d01764010fb0bc5dcb5d93ce8ac6de5c2747388be681155a78713
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / qsimcirq-0.14.1.dev20220804-cp37-cp37m-win_amd64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp37-cp37m-win_amd64.whl
Size 1.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
0960e829e47ea90e84568f4d46deacd3a3882949198bbcc26eef6e202a91df08
BLAKE2b-256 checksum
How to use checksums
d41485c5b50ce4bec4c799de8744226ad04a8d9c263ce08ef485a2a01e2b9168
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / qsimcirq-0.14.1.dev20220804-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.6 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cad8688c8a8e818b4fb9af67c2b9fbddc53dd94b7282f1f9f171df506d7c1753
BLAKE2b-256 checksum
How to use checksums
a69826f52cc6360e4cde3a0a6a75b6f267074ea0a7fd53265e3efe5a0cef689d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / qsimcirq-0.14.1.dev20220804-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL qsimcirq-0.14.1.dev20220804-cp37-cp37m-macosx_10_9_x86_64.whl
Size 2.0 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
ac22242dd50ddd5abd89ae5028f40136cabd3c92438de42e7367a13ab2de9a4b
BLAKE2b-256 checksum
How to use checksums
ab05bf964c786699a194162908bcff6ca779240edfd38a238f9fcfff79556984
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

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