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.13.3-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10 Windows x86-64

qsimcirq-0.13.3-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.13.3-cp310-cp310-macosx_10_9_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

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

Uploaded CPython 3.9 Windows x86-64

qsimcirq-0.13.3-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.13.3-cp39-cp39-macosx_10_9_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

qsimcirq-0.13.3-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.13.3-cp38-cp38-macosx_10_9_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

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

Uploaded CPython 3.7m Windows x86-64

qsimcirq-0.13.3-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.13.3-cp37-cp37m-macosx_10_9_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.13.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1d398cdc253121737b9becb63958ef204eee04ab548196e8c614745d3961d740
MD5 6569703792885c3794c371d6aa0d07a1
BLAKE2b-256 46b0c69eef7a9ace2efbe9c2e143629f013f7e2fdb0a689ded58f19329c2f1a4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.13.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da25ddb8e62ee7234c77714f767f0d7910cf0530c30ea374f70e291025524158
MD5 43acafbea7bcbdc3fade6cb709c05b75
BLAKE2b-256 15042e71ffa7a815d5d185fc75fe73327835354d3b79238a8196f183b87fb326

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.13.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cb6ec998e753c79ba29c87cdc414ea0aae30018b7e486d3110458661d83340dc
MD5 a264a3cb18b32cd43e1b0ba723765bb1
BLAKE2b-256 97c5b8c9cd3068959d1adb966641d3191f0fd4c4060b88e516dcc00c8a3859e3

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: qsimcirq-0.13.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/4.0.1 CPython/3.9.13

File hashes

Hashes for qsimcirq-0.13.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c8aa1440a298543cc400ab5ed301924aa3b721ed6ad80f195373f842a3ddc0d0
MD5 ca968d2505458b66a2d80b0fc98cbcb6
BLAKE2b-256 883c18a24055d3cfd41749267fa379cd2759ca37163fe4b75e17ec3fc8f6af8f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.13.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f3e0597d23f3c0c37d87991b94adb700ff7af4f46b2366a76b5e54365c29fddc
MD5 ccdfc0c1aa2decced4888d7641331e1a
BLAKE2b-256 6f741f34721804c16fef641e3095b45099e2dcc31cc16393442c35e3df962d48

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.13.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4cda8aaf0c99291640845e157fc66e990dd5234645f88fa0a71c5d77b492b0ea
MD5 81c87c7615c423b258d302288f1f2a15
BLAKE2b-256 da22e6b85adb150ef8ef9c2197c1e9fc90f63b596c3aae5658ba98a3de706b2d

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: qsimcirq-0.13.3-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.9.13

File hashes

Hashes for qsimcirq-0.13.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 48f1e0c4d8fda8efe63956774fe26b78e51a2dd53710f5183e3243d015e4374a
MD5 3efe831e17f8f7d2389ca31972dd4803
BLAKE2b-256 cd7a86bc31ca2dc892947f4d7526217926790c605a0cae5978a4b28def8022c4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.13.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 db53012be54f38e25bee9a1f0445faa42c6efafaf7b69ddb2e2d60b9e7c4a4d8
MD5 e94244d4ef139f6d0e350063e955e3f9
BLAKE2b-256 321c5f5525e58c5176887a224d614b2393d3deea38d7f851b7844cf340f61813

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.13.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 471b5a4af03735eeebd61130cb681ee12abacf2c78d2cb1fea82a7abebd51f4e
MD5 6989d1ff6066a1437eaca7c71ab087e7
BLAKE2b-256 408960a53242f6ab2ecf23059b962153ddd9bbe37d1c8d837d5443beb739bab8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.13.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e79ba306f8cba0ff526e59be56548c31c675a8bf751e32367474bd4b5c888687
MD5 3c403040b5e5038646a8ddd3b847025c
BLAKE2b-256 251f7e897fadd47572c7df5c5a8c21f9135b037f3e735517dc2acad3f3c35f16

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.13.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 14a0c579a09ae25d97eecfd53f66d6a82d9deb0c9e3014562bd1b6b59c180116
MD5 1b4e0ad73832676d9273f4442b779f3d
BLAKE2b-256 d04440dc2cd24fcd0d800f5350df31ea990fab86a111356568eded7a096f6be0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.13.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ad589bf2d1cea8d4e7efacfeb055dd117245b198cad74dc74bddf8225c5ae5de
MD5 b5b253eb2fb0fd8d870f3a0193b0057b
BLAKE2b-256 ec00ecc713ccff9ede6990fb1411a9d3dd778821d3287c0a3ff7ad960ad4d47a

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