Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fast C++ and Python library for state-vector simulation of quantum circuits.

License

NotificationsYou must be signed in to change notification settings

quantumlib/qsim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Licensed under the Apache 2.0 licenseC++qsim project on PyPICompatible with Python versions 3.10 and higherArchived in Zenodo

FeaturesUsageDocumentationCiting qsimContact

qsim is a state-vector simulator for quantum circuits. Also known as aSchrödinger simulator, it represents a quantum state as a vector ofcomplex-valued amplitudes (astate vector) and applies matrix-vectormultiplication to simulate transformations that evolve the state over time.

qsim was used to produce landmark cross-entropy benchmark results publishedin 2019 (Arute et al., "Quantum Supremacy Using a Programmable SuperconductingProcessor",Naturevol. 574, 2019).

Features

Being afull state-vector simulator means that qsim computes all the2 n amplitudes of the state vector, wheren is the number ofqubits. The total runtime is proportional tog2n, whereg is thenumber of 2-qubit gates.

  • To speed up simulation, qsim uses gate fusion (Smelyanskiy et al.,arXiv:1601.07195, 2016; Häner andSteiger,arXiv:1704.01127, 2017),single-precision arithmetic, AVX/FMA instructions for vectorization, andOpenMP for multithreading (on hardware that provides those features).

  • qsim is highly tuned to take advantage of vector arithmetic instruction setsand multithreading on computers that provide them, as well as GPUs whenavailable.

  • qsim includes aCirq interface (qsimcirq)and can be used to simulate quantum circuits written in Cirq.

Usage

C++ usage

The code is designed as a library that can be included in users' applications.The sample applications provided in the qsimapps directory can be usedas starting points. More information about the sample applications can be foundin the qsimdocumentation.

Python usage

The qsim-Cirq Python interface is calledqsimcirq and is available as a PyPIpackage for Linux, MacOS and Windows users. It can be installed by using thefollowing command:

pip install qsimcirq

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

Cirq usage

Cirq is a framework for modeling andinvoking Noisy Intermediate-Scale Quantum (NISQ) circuits. Cirq can use qsimas its simulation library. To get started with simulating Cirq circuits usingqsim, please refer to thetutorial.

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

Unit tests

Unit tests for C++ libraries use theGoogleTest framework, and are located intests. Python tests usepytest, and are located inqsimcirq_tests.

To build and run all tests, run:

make run-tests

This will compile all test binaries to files with.x extensions, and run eachtest in series. Testing will stop early if a test fails. It will also run testsof theqsimcirq python interface. To run C++ or python tests only, runmake run-cxx-tests ormake run-py-tests, respectively.

To clean up generated test files, runmake clean from the test directory

Documentation

Please visit theqsim documentation siteguides, tutorials, and API reference documentation.

How to cite qsim

When publishing articles or otherwise writing about qsim, please cite the qsimversion you use – it will help others reproduce your results. We use Zenodo topreserve releases. The following links let you download the bibliographicrecord for the latest stable release of qsim in some popular formats:

Download BibTeX bibliography record for latest qsim release  Download CSL JSON bibliography record for latest qsim release

For formatted citations and records in other formats, as well as records for allreleases of qsim past and present, please visit theqsim page onZenodo.

Contact

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

Disclaimer

This is not an officially supported Google product. This project is noteligible for theGoogle Open Source Software Vulnerability RewardsProgram.

Copyright 2019 Google LLC.

Google Quantum AI

Contributors41


[8]ページ先頭

©2009-2025 Movatter.jp