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

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded CPython 3.9Windows x86-64

qsimcirq-0.10.3-cp39-cp39-manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9

qsimcirq-0.10.3-cp39-cp39-macosx_10_9_universal2.whl (1.3 MB view details)

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

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

Uploaded CPython 3.8Windows x86-64

qsimcirq-0.10.3-cp38-cp38-manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8

qsimcirq-0.10.3-cp38-cp38-macosx_10_9_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7m

qsimcirq-0.10.3-cp37-cp37m-macosx_10_9_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6m

qsimcirq-0.10.3-cp36-cp36m-macosx_10_9_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-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.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2ad20057a4f00503450f7169650f6c0cb17c4a688c0f00d37d69051d54e69564
MD5 6d9499c3689526a39b02a0a55a27e1ad
BLAKE2b-256 31af5c4e237b5364e86d045171e49a0e0d05ebb692e36bf67c0e7c730796498f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a704950358be8243b450e3139b3556cb266387c6f21269d39731469781b4946
MD5 ec44d99b68b50fb57e7b5b368b9fdefb
BLAKE2b-256 4b14369b4de6d7d2e7506cb9bf3ad0e8d6a08ba56bc0afc8297a6d799a0016c4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-cp39-cp39-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 bee659c183fd398a996cdafa57ff6367a7eeb91dee457c3831fe74e06adbb9b6
MD5 9277875a34625e6f2ed24f55ab5766db
BLAKE2b-256 c18008368c47fbbbf6f5a76e1aa095acaea129331efe39af8529543e723432e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-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.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b5a0258d918a50991d7c868732346fc41cdf85606f16c365cd9e285801d2390f
MD5 739860ebcdaf53d00cb5d2e9dcd785ee
BLAKE2b-256 0ffebfbab7c919480362db463431dccffda2cfe4c83c1db144e1eb2d7a78784a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1daf938fe84077c5d0a9b193fe4d432044093dea12597a120c31b7d34a0f890e
MD5 bdab159218e62d70c531f1cec6a9ed13
BLAKE2b-256 7814c1c2e5181d9999710856365a4a85e794661dcc4c37fa8ac73275530dd922

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a8b7d7ea208e5db8c8480c8babba98879c469438e78a53cccb096bfc79e84fa8
MD5 e57bc7556b06570f31e2f7c20adc8fa7
BLAKE2b-256 d6f618684fa67b38b526736c63f8387e4fa9364a40e21986f42e5ae2d9f2e6ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-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.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6246cc25bcf84390b581ad7abe17e40117f2399cad782571857c0a7ede863d9e
MD5 addd5d5abb530f4da994a50970aaaa84
BLAKE2b-256 3a47525c70d3b68ce4b4246118aae98faa2bc3c1918c59e8c0973657c305a1e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-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.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 49f8c8bdb309a61bc3f3a439eed3830e50d7d7eae9f27d93dcaefe7236f12d1d
MD5 9881612dc35be636f6f4377ee964866e
BLAKE2b-256 4fd64a0e11d4ce3be33a9f88b03d0cf3905f4d30d09f1c61ff7f9dd5c5469082

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bf86613c1ca8f08b6822c79344c74345296504abb09b841777e7d31629bf1b26
MD5 fbe40d24ecd8eab67d94f593f270e6b8
BLAKE2b-256 9348fd69bb7f7d85cf5595f5757ed9354abaa6d662479da3c255293a6a87f544

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-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.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 577db931b907f7237bcc2a20fd03336bb196cbd0a2e8249aa2fbb4d5755a1307
MD5 fa637f83731ffb66151d52717caa2941
BLAKE2b-256 aa16f0d093e67266e5fc6dd692f2a3ede9b4edabe730fe808f8d42cb4651c05f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-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.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d94d4fb26c372066f36db08b09a1607bd479e3ee9889c905d39a44e83c110d69
MD5 ffc70447ec69dc39afaa3ddce71deddd
BLAKE2b-256 e0d98aa5c7b890002d3b33b7e97270a51f368965a7d163aae49ff128ae568f21

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.10.3-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for qsimcirq-0.10.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b6f519cb9d0c8a275839acb3843daec1f46947ffef2c126ac487b5878baf4d23
MD5 cb6287714c1f7fd8302feda9e77f9b94
BLAKE2b-256 d7c83c91b189d31d8ab278a42daa2f8937373213142f06c38fda4aa003809826

See more details on using hashes here.

Supported by

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