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

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.12.0-cp39-cp39-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.9 Windows x86-64

qsimcirq-0.12.0-cp39-cp39-manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.9

qsimcirq-0.12.0-cp39-cp39-macosx_10_9_universal2.whl (1.2 MB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

qsimcirq-0.12.0-cp38-cp38-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.8 Windows x86-64

qsimcirq-0.12.0-cp38-cp38-manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.8

qsimcirq-0.12.0-cp38-cp38-macosx_10_9_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

qsimcirq-0.12.0-cp37-cp37m-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.7m Windows x86-64

qsimcirq-0.12.0-cp37-cp37m-manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.7m

qsimcirq-0.12.0-cp37-cp37m-macosx_10_9_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

qsimcirq-0.12.0-cp36-cp36m-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.6m Windows x86-64

qsimcirq-0.12.0-cp36-cp36m-manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.6m

qsimcirq-0.12.0-cp36-cp36m-macosx_10_9_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: qsimcirq-0.12.0-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/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 70961010f1420f5eaad68e7edf8401c6f95d3e4e86c51216aa22f977fa7ea53c
MD5 e2c6f14465aa0f67d9740506f91c0cb7
BLAKE2b-256 1ef28bf2fedf25b38fb68ccf56f7ce7995509466ee464951db44efcbb0009b5c

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.12.0-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

  • Download URL: qsimcirq-0.12.0-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 48355023dfb823c1da1756da7585b7d9b2e1b2f127f0f8a1b928b94b64bb8f18
MD5 aa6a15cb31e8ed0c0315cd6760a081ff
BLAKE2b-256 62b7517e918ffd4fa5b3c02a95487ce291f09406f3bc30b98836f2ff2f8b6f1a

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.12.0-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

  • Download URL: qsimcirq-0.12.0-cp39-cp39-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0acc7108e542332579fc7ce8b78021672705775de157806b657a202329b65f45
MD5 c2d53e863fe012f19767a164f5d4144a
BLAKE2b-256 466bf00ed9e9aea4a0e1ab2867d06e209bef458bdf5740f70acbbe379a0fb489

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: qsimcirq-0.12.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e509f5d18e75eac5e9bd010f7722582f8c7b7193517ec159aed357763affd179
MD5 a6164b8f8b4da6d6b9947bbc9ee976f4
BLAKE2b-256 37f18b66d72ab4793b1b0780abe4a98e465cfe3a2ac79825a588a15e08616ded

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.12.0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: qsimcirq-0.12.0-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3d43c36164b15b8a7368d46a1aa9b7334d6ae622f8f2601e42842e0e81ed951c
MD5 a64992f3845a41244378fe985ffb91c7
BLAKE2b-256 a01272e85fd9d54e67912a41eb3b015968a5f9887ddcbd241738d7a87e001b30

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: qsimcirq-0.12.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 87788356781ed388f1ef91b4418a7ff69db214f05fc0b185dca56fd95c8e8ea0
MD5 e9a3fd3a4e3eb1c553fa27ba90d73e63
BLAKE2b-256 6166f4ff4fed33f3fee726ad9159366b9047cb147cfe34be5b984b4639670d7b

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: qsimcirq-0.12.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 9b6ec5e1a6645fb2cc846ce09adb29e4c4e8328f4ab479c44ca7fe47316b294b
MD5 99c70634da015ac48d308eb06afe1c2f
BLAKE2b-256 a48ea9672b6fa3437d93be5686d9828671065342791d9121e4d6578ab6ea4f80

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.12.0-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: qsimcirq-0.12.0-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 27b2e75988e1fcf91035f6692971f48d8197038a90ef2ef3ac24bee0ff6f6f77
MD5 60f46c44a779d655ca1bbc61e4bdfa9c
BLAKE2b-256 5dab37e178c80d60ecbad41746a2680835db196a124b4ef47675610d02c683b5

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: qsimcirq-0.12.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8129f9ff1d2f0607b9d0410fb7a489283bbf390ebe48948ef1a160e51e1a396e
MD5 47405ad984685db23f8d12d144421d75
BLAKE2b-256 63c0f3bd01e1b456ab9e9357d95bc4a1f090949f7c68c801eaca62d53273c72e

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.12.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: qsimcirq-0.12.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 5110259d45cdd172828300598a611370de16388928a733af8405533afe05a12c
MD5 190916dd8437fe6ce9ce48566d6e6850
BLAKE2b-256 f620fef3a2967b848a1470ebe4f05c59e72c1a2dd60720acc15ad45434510204

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.12.0-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: qsimcirq-0.12.0-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4f968beac9ac5a17f86a8435eac9a7c7f44fc897fa0dc8874d8874c7d7e4afd4
MD5 2252f6add281a8e1eb80ee3216588a0a
BLAKE2b-256 f065d63e3fc06d3408ecd0423d07d8ce2af905387fb074e65dc29912991dbd8d

See more details on using hashes here.

Provenance

File details

Details for the file qsimcirq-0.12.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: qsimcirq-0.12.0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for qsimcirq-0.12.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ee8ad25750f32bdf8a680f4b515e93f25309e4589af1578df15694a3647bf6db
MD5 4ab64b5a16b8d5b8a99f3cfa1d0901cf
BLAKE2b-256 66feacb0dcad89911992570a1f7238f4671ac6c8008d00af2ff5f2f87d0bb68c

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