Skip to main content

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

Project description

qsim

High-performance quantum circuit simulator for C++ and Python.

Licensed under the Apache 2.0 license C++ qsim project on PyPI Compatible with Python versions 3.10 and higher Archived in Zenodo

FeaturesUsageDocumentationCiting qsimContact

qsim is a state-vector simulator for quantum circuits. It is highly tuned to take advantage of vector arithmetic instruction sets and multithreading on computers that provide them, as well as GPUs when available. qsim also provides a Cirq interface (qsimcirq) and can be used to simulate quantum circuits written in Cirq.

Introduction

qsim is a Schrödinger full state-vector simulator: it models quantum computations by representing the quantum state of a system as a vector of complex numbers (a state vector) and evolving it through the application of quantum gates. One matrix-vector multiplication corresponds to the application of one gate. Essentially, the simulator performs matrix-vector multiplications repeatedly.

Being a full state-vector simulator means that qsim computes all the 2 n amplitudes of the state vector, where n is the number of qubits. The total runtime is proportional to g2 n, where g is the number of 2-qubit gates. To speed up simulation, qsim uses gate fusion (Smelyanskiy et al., arXiv:1601.07195, 2016; Häner and Steiger, arXiv:1704.01127, 2017), single-precision arithmetic, AVX/FMA instructions for vectorization, and OpenMP for multithreading (on hardware that provides those features).

qsim was used to produce landmark cross-entropy benchmarking results published in 2019 (Arute et al., "Quantum Supremacy Using a Programmable Superconducting Processor", Nature vol. 574, 2019).

Usage

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.

Python usage

The qsim-Cirq Python interface is called qsimcirq and is available as a PyPI package for Linux, MacOS and Windows users. It can be installed by using the following command:

pip install qsimcirq

qsimcirq is also available for Conda for Linux and MacOS. To install it from conda-forge, you can use the following command:

conda install -c conda-forge qsimcirq

Note: The core qsim library (located in the source repository under the lib/ subdirectory) can be included directly in C++ programs without installing the Python interface.

Cirq usage

Cirq is a framework for modeling and invoking Noisy Intermediate-Scale Quantum (NISQ) circuits. Cirq can use qsim as its simulation library. To get started with simulating Cirq circuits using qsim, please refer to the tutorial.

More detailed information about the qsim-Cirq API can be found in the docs.

Input format

[!WARNING] This format is deprecated, and no longer actively maintained.

The circuit input format is described in the docs.

Sample circuits

A number of sample circuits are provided in circuits.

Unit tests

Unit tests for C++ libraries use the GoogleTest 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

qsim documentation

Please visit the qsim documentation site guides, tutorials, and API reference documentation.

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

Contact

For any questions or concerns not addressed here, please email quantum-oss-maintainers@google.com.

Disclaimer

This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.

Copyright 2019 Google LLC.

Project details


Download files

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

Source Distribution

qsimcirq-0.22.0.tar.gz (133.6 kB view details)

Uploaded Source

Built Distributions

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

qsimcirq-0.22.0-cp313-cp313-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.13Windows x86-64

qsimcirq-0.22.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

qsimcirq-0.22.0-cp313-cp313-macosx_15_0_arm64.whl (555.6 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

qsimcirq-0.22.0-cp313-cp313-macosx_14_0_arm64.whl (558.6 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

qsimcirq-0.22.0-cp313-cp313-macosx_13_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

qsimcirq-0.22.0-cp312-cp312-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.12Windows x86-64

qsimcirq-0.22.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

qsimcirq-0.22.0-cp312-cp312-macosx_15_0_arm64.whl (555.4 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

qsimcirq-0.22.0-cp312-cp312-macosx_14_0_arm64.whl (558.4 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

qsimcirq-0.22.0-cp312-cp312-macosx_13_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

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

Uploaded CPython 3.11Windows x86-64

qsimcirq-0.22.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

qsimcirq-0.22.0-cp311-cp311-macosx_15_0_arm64.whl (556.5 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

qsimcirq-0.22.0-cp311-cp311-macosx_14_0_arm64.whl (559.5 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

qsimcirq-0.22.0-cp311-cp311-macosx_13_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

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

Uploaded CPython 3.10Windows x86-64

qsimcirq-0.22.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.22.0-cp310-cp310-macosx_15_0_arm64.whl (553.9 kB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

qsimcirq-0.22.0-cp310-cp310-macosx_14_0_arm64.whl (556.9 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

qsimcirq-0.22.0-cp310-cp310-macosx_13_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

File details

Details for the file qsimcirq-0.22.0.tar.gz.

File metadata

  • Download URL: qsimcirq-0.22.0.tar.gz
  • Upload date:
  • Size: 133.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for qsimcirq-0.22.0.tar.gz
Algorithm Hash digest
SHA256 90326abcfdfacd840cff61ca6c559ffc06ccf3bf6e631a5e44118894ff3109cb
MD5 7140c8bdc55bf421eb0940348ee744fa
BLAKE2b-256 509d9f97f878b0aca4098cec7c9838e92b52af9e2290211bd0961fa9c38c8646

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: qsimcirq-0.22.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for qsimcirq-0.22.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 00006f175464519c15d8c3cada9cf2ca1c5e383641a1420ad1a7ccc2874acac4
MD5 cd62b0f08c7bd094b06a90690958c902
BLAKE2b-256 bc8c296e2c3c37ea8e3ae922e00d55ebf34c0d947a6579860528cd2b64a5671f

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e351f73f32b817455c6ae793c9820a0a01e1a6f7f9875b6fc9f22307ca80d08
MD5 33b3547ee458e82006ffb41bc9367a79
BLAKE2b-256 ab9d4e56049b7f4c504393fe213a6b2a15aafe2db40008e326b9d439860d148e

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8067311b0a4e45c45581f69e3eb4b402498bcf4e30055307fdb1bec5df3c0d3b
MD5 18ad8a69863a18d6da4859d3d6b48d5c
BLAKE2b-256 c4b0713a757adbfb94e8a4f1011188fddbaa5c908b53e5283ff2f709903d0ee0

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e6a2089790cfcd08168dcc070f0c4761b1eebbe41c0373ab5cdb834e5bd07e73
MD5 aa8c371b8e8f4835cd7230f7b3975906
BLAKE2b-256 33605947e0b65be98318755ba1f1a48863d8ddf3cbfd6a39fbb5e7d666660e42

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a8426562d4b5fc4f573074e2bbf21ef8761a4d6f30cd500d07ef57fc61d466d8
MD5 9a50d01a26244c01396c36d4df68e2d8
BLAKE2b-256 5153019fb213f1913dcc1673392acea008b03e04c6284a2b0ecf72abab84304f

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: qsimcirq-0.22.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for qsimcirq-0.22.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b29a9339c0aefbd76726e90519fd0b94252867b2a76563ab647849d8efb717fe
MD5 9de10ff8c51f7a2b097bba6cad478fb0
BLAKE2b-256 4539dae281ac90740421d83be087be0b60778eed177edd542d5112a165827dc2

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 50152912c15c569efa5320c5549780b278325700b3fd37d79d7261340b3ecbe6
MD5 fd6700a1201b0ac9a3285cc1960411cf
BLAKE2b-256 e501e2452aa02eaf21df3c4b7053ea605ea6a8e488178fa5d5b036adb26e6dec

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c8f713875e9c75562592b27d2d4e1281338193dd7cb31323e9201bf7c404338a
MD5 eaff911f8a20f6003a81b2c8d9d7393e
BLAKE2b-256 0124f77889e6d0d62705965c02c0ac58b5da8642cd69a3ee9b1afa3ec7192a93

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 903f0ea935598383759519da3f8a70eb69823ff61088e7eb3bde6949c1bde58e
MD5 cd3adaff33f8246051d2e2c349adeb12
BLAKE2b-256 67d9fbe96f6d04f0214e0f7bd2e17d75069cccb5af8f50b7476f470a3ce9db70

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 68946878a8f04e642ff50e5e809e9b3f05243e5c9e20fa5d0fb3eece08312ee1
MD5 d28e50b5e74f04bd96bf197dffb01a84
BLAKE2b-256 3959e577f296aa7213398ea75dc28fbd10ed364a2b5de59863cbfb4a0a906611

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.22.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/6.0.1 CPython/3.10.0

File hashes

Hashes for qsimcirq-0.22.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c87d6e59d73abc75cfc79397f1a2156083b910b711bb6c54bb33be60a18cf1d4
MD5 18b8a86d7261f919d13529b31502672e
BLAKE2b-256 4205147f348c07493ee954956458fda186f86602ac15081c3c755c71a63e6462

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cb5ee6ca429379835d63bb8732cb0f49651b1bb8d068e2672d3b9ec1431de5cc
MD5 afb286bfce6b56d41872d7eb0b227c3c
BLAKE2b-256 b79b89fa9023af86f0795f35daccb5e9257c06d669075c78f5f5abc1ca5b7eca

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 0cebf0ec0754c6f6a6b482104c0a274288ae2b378ad6e079f04cba0777da46a6
MD5 36bc265928acecefaea676978949eced
BLAKE2b-256 47f0da198869ccfaa675d888cde4198dc87323ee9c145355fd69a0ba39c3475e

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d89311a147c1aa76d9760729c815656312562d4759f272382d50df85d5f12646
MD5 791b8b508c43d5f0d5e973bffb1bf27b
BLAKE2b-256 9a195a088a5bbb1b434199ddbae2ed5851710d90a9a847254ac8d3cfc54743b2

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a02a036c7874f01ca2dbf8f53550292385cf07a933e440e7103c1c37761f9ca9
MD5 c2d2f815313385b30abb5b368a76c0c7
BLAKE2b-256 cc108ce1d8de340a64b9d522b44cd7c38bc7681a1cec62e49e8b284f7232f289

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qsimcirq-0.22.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/6.0.1 CPython/3.10.0

File hashes

Hashes for qsimcirq-0.22.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f9992a1cd211df926386a544f9a3f65ddb3eabad3fed42d2ec3397f3ec83033e
MD5 c10d694b02d0d023453226b8ee57d1e5
BLAKE2b-256 383ad70c0a2c10910038d7c7669bc0baff5553841807b58009fac298286a4738

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2c8ce508cbe55903302988cd560635fb0bb1459af388954a41263bc188ea9313
MD5 9f163c7d93ea9d143aac594a269207b8
BLAKE2b-256 2701b468ba505c1f1ae62dceed0113610e804ec1bb59c2631c4d048b51866ca3

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 40032577c209edb7c8d74c367774017a355de4a7a7a8692e6db13b76de67020a
MD5 1163a0ea3962caa2852b1194f57ab55d
BLAKE2b-256 64415de951ee32f535bbdc87f9b9054aaf674d419d2526fb7751c7a09c2012eb

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3b4a7ddb9101b38b9444042c384f0902da991b6da9cfe132220b69295f8049cd
MD5 477d0ac9a9c166cc78df38d86c3b9da2
BLAKE2b-256 fcce590317671da07df8a8f93bf727ad0a81392e93dd7686d1f658617f1eec48

See more details on using hashes here.

File details

Details for the file qsimcirq-0.22.0-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for qsimcirq-0.22.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 b41074f1139c1430ad946c31cc41b45f09ca79adecb2d864d604961aff6f06bb
MD5 1724bbf44998b844c7a53e4b89a263db
BLAKE2b-256 e89b05ed31612220af4f25c183916c55d7f68970cf3cbda811d19865f46e6951

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