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.0.tar.gz (71.4 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.0-py313-none-android_16_arm64_v8a.whl (17.0 MB view details)

Uploaded Android API level 16+ ARM64 v8aPython 3.13

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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.39+ x86-64

pyqrack-2.17.0-py3-none-manylinux_2_35_x86_64.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

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

Uploaded Python 3macOS 15.0+ x86-64

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

Uploaded Python 3macOS 15.0+ ARM64

pyqrack-2.17.0-py3-none-macosx_14_0_arm64.whl (1.9 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

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

File metadata

  • Download URL: pyqrack-2.17.0.tar.gz
  • Upload date:
  • Size: 71.4 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.0.tar.gz
Algorithm Hash digest
SHA256 611477baad03e42ad463d016b5db2144f76af31054f5c643ea568f5a8138684b
MD5 87c074625673b658e5959a14389d713a
BLAKE2b-256 33e1e5fae96118d53997fd5aeab0a11e3453f5906e1e425743669f9058d81a5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-2.17.0-py313-none-android_16_arm64_v8a.whl
Algorithm Hash digest
SHA256 3101af2cfd5b402413b12db15f66e2acd95ad8d03e5fd5ba69a0867c4326f491
MD5 561c93b6b6a117725a3ab8989874f2e2
BLAKE2b-256 6d73929833dcb79810597ec81e493d6f1f6826b77d1a34abc5190afd17f6d4c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-2.17.0-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.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 db0f637f4ee3eef49a3e5c8fd345e2a9a518621d26aecea66385ddeb7d263abf
MD5 d6a0bdcbf76f4cdaf394fe1b578906f4
BLAKE2b-256 b0fb61213c38c27798d166660531659a9916613671a934e5687882bd3866f501

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-2.17.0-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 21f1a44f28f3aa200023cca6d47cacc910ee7fa6099dce73fea5df307c9e7263
MD5 8b570c8262345666512b93167e6380f1
BLAKE2b-256 4e1cf17cedbd5ec1a7f3695757d6a8f8c0f629b9a9f558eb3059f6058b3c0cac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-2.17.0-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 e628381697d93ec72c5d7a610143271437d0cfe326ba8fe8d64cd527c2ce29f4
MD5 5b5b82da328245b180d4f25a2f56929b
BLAKE2b-256 a3b0208106218cccf25918f751d5feefdab0112dbe77bd51feb8c55ed5b21c97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-2.17.0-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 2b623ce659eb300ecee3d11496ebe061785b17bd95e9ff6564433756a9b1288b
MD5 2981f433f73065803e3b6606edd2d53e
BLAKE2b-256 c93d47f0d5dfc8546f2747b59d74591402916c9bca74603ebba3736a79965355

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-2.17.0-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8cbf4f788dc3421c310ac439b8f18080f6becf1766119b0b60b1aa0d4a688c47
MD5 54545e35157edcd04d2c96a2e5234858
BLAKE2b-256 1f3b8f38bb1763f7a4c375e2486a1b6a68bf2d99c1d88871ac1e2c04730063dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-2.17.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 dd46749178d8ca9f472a4c6cf379c7576ecd19ac0c3fc0a775467d62c36affb8
MD5 718daa40b005616fa91d76c5acf76a8b
BLAKE2b-256 570c9ca6f9c984217315ae51b6dfba20026713b80a2bb5a9c6839cbf6373b4d3

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