Skip to main content

Quantum Optimization Toolkit

Tests arXiv PyPi version PyPI download month PyPI pyversions PyPI license

This repository contains fast CPU and GPU simulators for benchmarking the Quantum Approximate Optimization Algorithm, as well as scripts for generating matching quantum circuits for execution on hardware. See the examples folder for a demo of this package and check out the blog post describing the simulators.

Install

Creating a virtual environment is recommended before installing.

python -m venv qokit
source qokit/bin/activate
pip install -U pip

Install requires python>=3.10 and pip >= 23. It is recommended to update your pip using pip install --upgrade pip before install.

git clone https://github.com/jpmorganchase/QOKit.git
cd QOKit/
pip install -e .

Some optional parts of the package require additional dependencies.

  • GPU simulation: pip install -e .[GPU-CUDA12]
  • Generating LP files to solve LABS using commercial IP solvers (qokit/classical_methods and examples/advanced/classical_solvers_for_LABS/): pip install -e .[solvers]

Please note that the GPU dependency is specified for CUDA 12x. For other versions of CUDA, please follow cupy installation instructions.

If compilation fails, try installing just the Python version using QOKIT_PYTHON_ONLY=1 pip install -e ..

Installation can be verified by running tests using pytest.

MaxCut

For MaxCut, the datasets in qokit/assets/maxcut_datasets must be inflated

Cite

For the simulators and other software tools, please cite

@inproceedings{Lykov2023,
  series = {SC-W 2023},
  title = {Fast Simulation of High-Depth QAOA Circuits},
  url = {http://dx.doi.org/10.1145/3624062.3624216},
  DOI = {10.1145/3624062.3624216},
  booktitle = {Proceedings of the SC ’23 Workshops of The International Conference on High Performance Computing,  Network,  Storage,  and Analysis},
  publisher = {ACM},
  author = {Lykov,  Danylo and Shaydulin,  Ruslan and Sun,  Yue and Alexeev,  Yuri and Pistoia,  Marco},
  year = {2023},
  month = nov,
  collection = {SC-W 2023}
}

For LABS data, please cite

@article{https://doi.org/10.48550/arxiv.2308.02342,
  doi = {10.48550/ARXIV.2308.02342},
  url = {https://arxiv.org/abs/2308.02342},
  author = {Shaydulin,  Ruslan and Li,  Changhao and Chakrabarti,  Shouvanik and DeCross,  Matthew and Herman,  Dylan and Kumar,  Niraj and Larson,  Jeffrey and Lykov,  Danylo and Minssen,  Pierre and Sun,  Yue and Alexeev,  Yuri and Dreiling,  Joan M. and Gaebler,  John P. and Gatterman,  Thomas M. and Gerber,  Justin A. and Gilmore,  Kevin and Gresh,  Dan and Hewitt,  Nathan and Horst,  Chandler V. and Hu,  Shaohan and Johansen,  Jacob and Matheny,  Mitchell and Mengle,  Tanner and Mills,  Michael and Moses,  Steven A. and Neyenhuis,  Brian and Siegfried,  Peter and Yalovetzky,  Romina and Pistoia,  Marco},
  keywords = {Quantum Physics (quant-ph),  Statistical Mechanics (cond-mat.stat-mech),  Emerging Technologies (cs.ET),  FOS: Physical sciences,  FOS: Physical sciences,  FOS: Computer and information sciences,  FOS: Computer and information sciences},
  title = {Evidence of Scaling Advantage for the Quantum Approximate Optimization Algorithm on a Classically Intractable Problem},
  howpublished = {Preprint at https://arxiv.org/abs/2308.02342},
}

Metadata

Release files for qokit 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qokit 0.1.4
File Size Uploaded
qokit-0.1.4.tar.gz 12.8 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for qokit 0.1.4
File
qokit-0.1.4-cp311-cp311-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.5+ x86-64, Linux glibc 2.17+ x86-64 Details
qokit-0.1.4-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
qokit-0.1.4-cp310-cp310-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64, Linux glibc 2.5+ x86-64 Details
qokit-0.1.4-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details

Total release size: 65.0 MB

Release files / qokit-0.1.4.tar.gz

Download URL qokit-0.1.4.tar.gz
Size 12.8 MB
Tags Source
SHA-256 checksum
How to use checksums
ed0f4beb48b1d100b0611eca16cf21ecc4c5a1d8835a859f5b3596f9321f7c95
BLAKE2b-256 checksum
How to use checksums
977ec48aedd7a5fad0dea7968dd2d3f10cffb6a4bee158a287cf0f028a322c0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / qokit-0.1.4-cp311-cp311-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl

Download URL qokit-0.1.4-cp311-cp311-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Size 13.0 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
c90eb81bfa209ce209523634a0ab0ef170c6226bd53d70b571152f6b4b7a0163
BLAKE2b-256 checksum
How to use checksums
488bbd470877899c6931e8c8b36b4a46c1f8172fc4f4991bafdbcf76fa44e4fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / qokit-0.1.4-cp311-cp311-macosx_10_9_x86_64.whl

Download URL qokit-0.1.4-cp311-cp311-macosx_10_9_x86_64.whl
Size 13.0 MB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
b0ee20aa3e2119eed8f58cf624aa09dd6c6491e54c646976afc11622c24ccb3a
BLAKE2b-256 checksum
How to use checksums
697ef5bbde2db5b237685fa958bc3939a96932c7c9cd385771342059fb34bcad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / qokit-0.1.4-cp310-cp310-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl

Download URL qokit-0.1.4-cp310-cp310-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Size 13.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
0219a23cef187b10e90345506814fce47b259e6413e2d8121606932ff0cfe5e2
BLAKE2b-256 checksum
How to use checksums
a1f55b4e86fb0a20474cf9445d87b48c0ab2d4d6818183e0ae12bf115dd4162d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / qokit-0.1.4-cp310-cp310-macosx_10_9_x86_64.whl

Download URL qokit-0.1.4-cp310-cp310-macosx_10_9_x86_64.whl
Size 13.0 MB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
fd7204e5538728690fe2a50cd9c62b867375eebd8404aa6646ecd58062ab1d28
BLAKE2b-256 checksum
How to use checksums
940bb3f09a1c51964c0b9a5386a1f67fa72059e2fbdc92b726a92de6f642255b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.4 This release

5 release files

0.1.3

37 release files

0.1.1

37 release files

0.1.0

37 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page