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

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

qsimcirq-0.19.0-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11Windows x86-64

qsimcirq-0.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

qsimcirq-0.19.0-cp311-cp311-macosx_10_9_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10macOS 10.9+ x86-64

qsimcirq-0.19.0-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.9macOS 10.9+ x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8macOS 10.9+ x86-64

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

Details for the file qsimcirq-0.19.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: qsimcirq-0.19.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for qsimcirq-0.19.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 91cb118d71756e58d5d657db60ec90d3ed1a67ca63ed2d35a6a892c531082b13
MD5 584fe1bcabafe2c3cd0bfc16d0d7f22e
BLAKE2b-256 9578638a8f1b5df880faadd510741cebe477ab519d8fa9d2df5f00abd521f1af

See more details on using hashes here.

File details

Details for the file qsimcirq-0.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3bb074544573e5df2ccc2627bddfb25f1b00e94fccfdcf032108629debd0454d
MD5 7d7e1e31c1f9457c169e05631ef45d0f
BLAKE2b-256 56661e6a1f7433d6351c0b5a011dc646616942423533ea2ab750b5614ce56b8f

See more details on using hashes here.

File details

Details for the file qsimcirq-0.19.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.19.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3d4ff31397a89dc4bb0b67aee9f83a7b8903afe0b2a294d2f2da9dde62a6070c
MD5 b33f4f4f61541e3d1378bd2d4701b81c
BLAKE2b-256 6d1c3934bc915339cb006b1564e52a001a4333a21e52b87173b0c6bdf34660d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.19.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for qsimcirq-0.19.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 927bfd20841cac71eb821ae4bd233788777d74f56468d6242f6bdbc89bb92c06
MD5 32cffd43714709a660dd422fb02ff0a6
BLAKE2b-256 1939c602ceecff0dea7cd59d13b8f774a8f6b545506757ac587eb4e1308835e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 369a697c7ae705f184557b258fbc0ed3d2042bfc3e4996667d2af6cd79e7ba95
MD5 6087b664b438fe031cfd71bbec83646b
BLAKE2b-256 d38d377ff229634c254c726f7700bc89e900b444ba941632520e8196fe8e3fe1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.19.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 038516114759971836aa5403e252fecd53fd621c3b7236ac45fadd1f8fd222e1
MD5 b0f486268b8dba23226c71c6f6627e6e
BLAKE2b-256 338133aa35f661190e836597d049d73e65297ff6f916cd62d8b595086cde05e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.19.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for qsimcirq-0.19.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6fff3456d2a9c1db099f5f0ab4a65681c866132d1c754af17ed21ea76228b0ee
MD5 01f244fbf47a0da1442e780df8a77fdb
BLAKE2b-256 4f917090c31386839180098e4469286206c5b2ec0ea9aec50220fc3a0f7037e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.19.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 edab884a6dbb1e00c8ce154513d500532b711101b8f0b62c27b2081824466bf2
MD5 cd563680ca68df8fe69fd96d17db3541
BLAKE2b-256 2e91a367c81455859fb02408fda5721b263621f4e180f6033db9b9738fe26835

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.19.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a52b957e597e0c9228b36b966909fda6eddf48ef3f034051e01425e6275843cf
MD5 a49b58b02c91340fb686fa58d31d671a
BLAKE2b-256 aeeaf1fea99b89bf181730acf4b9ad3a02885cdc1ee17b6d161aa1371369f571

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.19.0-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.2 CPython/3.11.6

File hashes

Hashes for qsimcirq-0.19.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a90f8e79391198b1b93420e6d4c2c56c94e64da655abc8daa8dca0ad3226c966
MD5 bab46d4289cd2c05e10d46cedd3f1407
BLAKE2b-256 86c84686c9f614d6e0c0f6db605ecf75003772daa67a98614efd235210a17458

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.19.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 25256624299c168160cca106fc68c7f85ed99b44f774896ddd2f163bd98f5444
MD5 645b7a25039dd0a6945bb863c577baae
BLAKE2b-256 b0c12445982b085ce578d1612787e25e1f61af1931c3fd7bb5c1c616cc9f5195

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.19.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 717741c404abc1ed2ceb6fffaa6e09a5fc1e0cd8ba91785227be4280161ca96a
MD5 eaadaa9b9132c8c305fc7f106b61fc33
BLAKE2b-256 a8fabf7d546d2ee24cdb10a56e1c0434b9da1a0a17c4ce3db5f50d74e23e8085

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.19.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for qsimcirq-0.19.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e89b84343a1ac8cd309d42a461312af05a7ff17bd39674017cb5fea12142262c
MD5 f6ab23ea06be0717454f2c213a6a74dc
BLAKE2b-256 58d396497db292cac228d694ea11957977337b5e3ce58e4d49b82a1e3ca0fa25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.19.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bf5f8910a55c819fa6c0a35c8825e72d800e5d4fe8b0d65b74250b2a5bbac843
MD5 1bb98616737eaf7129f185fd7ccd6e65
BLAKE2b-256 d0362ba4385a46a5c0a47b13f39ae779ccbea65a7825d281a844218dfca08a5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.19.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ac9fe59cdfe8b72785cb8a45b7c10531cd51a7a1f398b2c5856b983e5bdf3847
MD5 e762f7668ba3b7c09cd452b06f5af0e6
BLAKE2b-256 05a9ed0c871f8c06aed94b35100e72f43f017c123c6b9378cceec0bbb0b68fef

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