Skip to main content

pyqrack

Downloads Downloads Downloads

Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator library

(PyQrack is just pure Qrack.)

Note: You must also install OpenCL to use this version of Qrack. (There are also CPU-only and CUDA version.)

If you're looking for Mac ARM support, use the package pyqrack, not pyqrack-cpu. Mac officially "deprecated" OpenCL years ago. Hence, accelerator support is not included in ARM-based Mac wheels, and OpenCL installation is not required on these systems, but, if you have a CUDA accelerator on ARM-based Mac, you could try the package pyqrack-cuda instead.

Performance can benefit greatly from following the Qrack repository "Quick Start" and "Power user considerations."

If you use an integrated graphics accelerator, like the Intel HD, setting environment variable PYQRACK_HOST_POINTER_DEFAULT_ON=1 (or to any "truthy" value) will automatically set the default of isHostPointer option of QrackSimulator to True, to engage "zero-copy" mode by default.

Import and instantiate QrackSimulator instances. This simulator can perform arbitrary single qubit and controlled-single-qubit gates, as well as other specific gates like SWAP.

Any 2x2 bit operator matrix is represented by a list of 4 complex floating point numbers, in row-major order.

Single and array "b" parameters represent Pauli operator bases. They are specified according to the enumeration of the Pauli class.

MC[x] and MAC[x] methods are controlled single bit gates, with as many control qubits as you specify via Python list c argument. MCX is multiply-controlled Pauli X, and MACX is "anti-"controlled Pauli X, i.e. "anti-control" activates the gate if all control bits are specifically off, as opposed to on.

To load the required unitaryfund/qrack libraries from a different location, set the PYQRACK_SHARED_LIB_PATH environment variable.

PyQrack has experimental support for PyZX Circuit definitions as an intermediate representation for QrackSimulator. To try this, load a Circuit in PyZX, (use that module to optimize your circuit, as you like,) and create a QrackSimulator() instance using the pyzxCircuit named argument of the constructor, like so:

sim = QrackSimulator(pyzxCircuit=c)

where c is a PyZX circuit object. The circuit will automatically be simulated in the constructed QrackSimulator instance. This also allows loading from QASM and other intermediate representations supported by PyZX.

See https://pyqrack.readthedocs.io/en/latest/ for an API reference.

For custom Qrack build floating-point precision, where options are half, float, double, and quad, set an environment variable via export QRACK_FPPOW=[n] (or as appropriate to your shell) where [n] is the logarithm base 2 of the number of bits in the systemic floating point type (4, 5, 6, or 7, with 5 or float as default, i.e. 2**5=32 for 32-bit float). Your Qrack installation floating-point build option must match this specific value, which might require a custom Qrack build.

Please feel welcome to open an issue, if you'd like help. 😃

Special thanks go to Zeeshan Ahmed, for bug fixes and design suggestions, Ashish Panigrahi, for documentation and design suggestions, WingCode, for documentation, Or Golan, for CI build pipeline tooling, and to the broader community of Qrack contributors, for years of happy Qracking! You rock!

Download files

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

Source Distribution

pyqrack-2.17.2.tar.gz (71.5 kB view details)

Uploaded Source

Built Distributions

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

pyqrack-2.17.2-py313-none-android_16_arm64_v8a.whl (25.5 MB view details)

Uploaded Android API level 16+ ARM64 v8aPython 3.13

pyqrack-2.17.2-py3-none-win_amd64.whl (1.0 MB view details)

Uploaded Python 3Windows x86-64

pyqrack-2.17.2-py3-none-manylinux_2_39_x86_64.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

pyqrack-2.17.2-py3-none-manylinux_2_35_x86_64.whl (3.8 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pyqrack-2.17.2-py3-none-macosx_15_0_x86_64.whl (2.1 MB view details)

Uploaded Python 3macOS 15.0+ x86-64

pyqrack-2.17.2-py3-none-macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded Python 3macOS 15.0+ ARM64

pyqrack-2.17.2-py3-none-macosx_14_0_arm64.whl (2.0 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

Details for the file pyqrack-2.17.2.tar.gz.

File metadata

  • Download URL: pyqrack-2.17.2.tar.gz
  • Upload date:
  • Size: 71.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for pyqrack-2.17.2.tar.gz
Algorithm Hash digest
SHA256 086b4a5b8370b011e522cb6b2524df50bbec3afedc46da744125be57c8b7df22
MD5 096a8a2512013ab974bddd1dc27893c1
BLAKE2b-256 56f04ffeb00a6d5953c31db229b2c75f288ae00965cdf3a1550e8fe7751498ce

See more details on using hashes here.

File details

Details for the file pyqrack-2.17.2-py313-none-android_16_arm64_v8a.whl.

File metadata

File hashes

Hashes for pyqrack-2.17.2-py313-none-android_16_arm64_v8a.whl
Algorithm Hash digest
SHA256 d20f9d6e970e26f72fef00cda01016a869168f8b9783feac02463a9178d40d01
MD5 7277ddc2c5494b0cece595990f985cee
BLAKE2b-256 7590a2ea63bb183bd760bd0bfe0426fc899278bf51f1b3ab07e4c9f8df9b2c51

See more details on using hashes here.

File details

Details for the file pyqrack-2.17.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: pyqrack-2.17.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for pyqrack-2.17.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 155396df85ef6ccc0aaf769845dc9a0f818393f8194bc32713861b825182459e
MD5 beb44bfae5dfca98d9162a0d4b8d6db3
BLAKE2b-256 8078bd028b960b3e94602134f91896db0cdd9c225011286b7ca20e1e09c6a96a

See more details on using hashes here.

File details

Details for the file pyqrack-2.17.2-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-2.17.2-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 d1ded549c88d709222423271d00514fbe543f10f48c0928103798cf506f15af7
MD5 e31035b70dd6941d367459265330be4b
BLAKE2b-256 ad335f7cc44ca219a44e1fd3c454db7b23b8cdd04bdc5f6cead4702b0490427a

See more details on using hashes here.

File details

Details for the file pyqrack-2.17.2-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-2.17.2-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 3c1ad225d85ce4d05da44c37832293d1e9ed114d80777bf82df5d46b7881ceae
MD5 d142d33761d456e5fe4dd04290484ba2
BLAKE2b-256 2c5c62b914d01f0900fc98763f990251a18eecb10c4a610a7d00aefabdefa6c0

See more details on using hashes here.

File details

Details for the file pyqrack-2.17.2-py3-none-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-2.17.2-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 ef4f3b6d6448b920a6a1b94bb07330294daebe5a63c4625ed67b5a1d86dcacfc
MD5 9d1f2b823ad000444f18d28fb03e3b31
BLAKE2b-256 7225d8f9ce00c5b98461e40244cecc9c918ed1f47502c9580905a0f6d3eba351

See more details on using hashes here.

File details

Details for the file pyqrack-2.17.2-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrack-2.17.2-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7e286d48410bec21c7476c49c52032fb771a5f809b41dc7bdfb417b1c605048d
MD5 dab061fa72d5bf02dbf5f45a93067a9b
BLAKE2b-256 9e46d0b05fa28a296540c0ea95059891ed658bb01b85af169c92058aed62d5d4

See more details on using hashes here.

File details

Details for the file pyqrack-2.17.2-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrack-2.17.2-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 bb4d6e01c69b6e6b717421474b691f37a040fc352a8e2ad2479be95bbba68be8
MD5 03142014445b64936eb079e329843daf
BLAKE2b-256 93bff2b78f979aefeee60bf38c67d85d1f488df754ea0b4abcf9849197392689

See more details on using hashes here.

Release history Release notifications | RSS feed

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