Skip to main content

Schrödinger and Schrödinger-Feynman simulators for quantum circuits.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

qsimcirq-0.14.1-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10 Windows x86-64

qsimcirq-0.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

qsimcirq-0.14.1-cp310-cp310-macosx_10_9_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

qsimcirq-0.14.1-cp39-cp39-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.9 Windows x86-64

qsimcirq-0.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

qsimcirq-0.14.1-cp39-cp39-macosx_10_9_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

qsimcirq-0.14.1-cp38-cp38-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8 Windows x86-64

qsimcirq-0.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

qsimcirq-0.14.1-cp38-cp38-macosx_10_9_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

qsimcirq-0.14.1-cp37-cp37m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.7m Windows x86-64

qsimcirq-0.14.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

qsimcirq-0.14.1-cp37-cp37m-macosx_10_9_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file qsimcirq-0.14.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.14.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d5d726e8177a68c425a4d4e5c5c33edf9db1bfaeabe7014010fddf35f5436065
MD5 8ad60a659dd6f042023c711138a5aeef
BLAKE2b-256 d84cb319548f78d273533f924e78968fafd530d5e38974aa54b3865d328090ac

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 17e700707b7dc79b41d41c3aa9797303a39d921a89bedb97b15f5d53883f2694
MD5 96bd4e4f6c1539364684ef9e0685df5c
BLAKE2b-256 97e9c0707960a53059f2191535bc5fcc27e8ff3d31bb89d8719bfa26645c486d

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.14.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.14.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ff6c5b1126e29acfe1c1d36d267c5acb0e8b75982b0f6331c99fda25cfaf7ca7
MD5 6e99beecdd67b6fe0155d9d505aa6fd3
BLAKE2b-256 b7a2505c13110dbd1f43b8381b745d52d8bc776aeb424b05220f60986c35f22a

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.14.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: qsimcirq-0.14.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for qsimcirq-0.14.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 579dfb9b59149363e7af5784859aefb715908adcfef1a15c3afef0ca8e1bce48
MD5 0fe530876c521ea5d53d0f24906f09de
BLAKE2b-256 58b74245a1270604c85e4902463fc303cd6c18dacb54ba1cc13bcfa85022fa42

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 756ce702d3fdc71852723703550717c3c6bf22171cc31361a19c2207e7582248
MD5 fd7eb3c03f65ab754bf681a7765f504f
BLAKE2b-256 2d39fed2597f07b00966b3dce7131e08afeef1193cccbc9feba4cf33323f0680

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.14.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.14.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 eed9e47e60edf4e6228de4d35bb88a5fd40707951059b4b703a3e7dc2feddf88
MD5 0b6743a2b3172b3ccb280a57f3799aa4
BLAKE2b-256 50ff0a56c16aa2c88405f833095017270a98806a2200fc9bda4d73d76e37a954

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.14.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: qsimcirq-0.14.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for qsimcirq-0.14.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 09e9e36b6e29dad4622d7f18ce32992dae5df90b57b361b944f3c8882425f67b
MD5 da6d53db76edd03b5d5cb0bb00d88b85
BLAKE2b-256 38aeb30888e502afb463d1d7cc63f06e6b006c41b0cfffefdbaaea6eb7941afa

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 479f387f0b5f77e57f5a68c2675ec5beaf5e85178e9f83b1cc23f36a2708af9f
MD5 19ee4d5ada48dd22b05ebd555724fa55
BLAKE2b-256 47641737ce6a402ab075c1296845cd60ae1e4d56ca37d7a2e1691292666ad672

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.14.1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.14.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e3b5768db444891ef7fc4dbeb375a55a269e160b678705b90262a7abc04dbc0f
MD5 4e2f59dd1b98ea1cede332b3372abaa6
BLAKE2b-256 299b1a8ab7c42ccef14b0f1acc371cffc766839db7eee44d6b0500132ced6041

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.14.1-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.14.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 ec430743439187019be1fd7a9c009fc84bbd926d0a4b49d648577e4924c0fc8f
MD5 533c44fbeb5ebec0f9a4126d1fc965f6
BLAKE2b-256 ec622a7fc5b5eae35a4138537ceef2d7b4cd90fd849429ebe565b406aa856a8e

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.14.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.14.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 86d3545d70d39692380bf7f4e3943d29aacb88e5252796dfdeea8164deb95f72
MD5 64b51c4e61ea56a95a939af770a4be5e
BLAKE2b-256 7509edb3f966b74d4ced007c961d9bf08ad0ac3bbd63b2c032d1a1d11cd1272a

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.14.1-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.14.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 92d71926e7e4663d67ce3b4c908a9dcb4607d306ad88239f3df118af7b8baa88
MD5 43d789936549276462c0d8cdd9603ab6
BLAKE2b-256 4077ed7a47da72c9e8a91fe091804f651f39e2e5bc77704cd85f52e7c316680a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page