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_complex128-2.10.1.tar.gz (65.1 kB view details)

Uploaded Source

Built Distributions

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

pyqrack_complex128-2.10.1-py3-none-win_amd64.whl (1.0 MB view details)

Uploaded Python 3Windows x86-64

pyqrack_complex128-2.10.1-py3-none-manylinux_2_39_x86_64.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

pyqrack_complex128-2.10.1-py3-none-manylinux_2_35_x86_64.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pyqrack_complex128-2.10.1-py3-none-macosx_15_0_x86_64.whl (2.1 MB view details)

Uploaded Python 3macOS 15.0+ x86-64

pyqrack_complex128-2.10.1-py3-none-macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded Python 3macOS 15.0+ ARM64

pyqrack_complex128-2.10.1-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_complex128-2.10.1.tar.gz.

File metadata

  • Download URL: pyqrack_complex128-2.10.1.tar.gz
  • Upload date:
  • Size: 65.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for pyqrack_complex128-2.10.1.tar.gz
Algorithm Hash digest
SHA256 7e5144bc0eb27c14d9be0ab4af526e8e60bca55aaea4acfaaa1e2e8c05391487
MD5 517f3becafbadf01e16ead10fb0af95c
BLAKE2b-256 bc1ae4ffa170e9fa9d7694bb172fec65e5e2ec22f99671d293d77d222cf862c0

See more details on using hashes here.

File details

Details for the file pyqrack_complex128-2.10.1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for pyqrack_complex128-2.10.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 14da67485460c595dd3a955477dabac3a59d6b863c9720b8c9af7ad7e921c990
MD5 b7824dcbd4f5e66ad905335f5043e685
BLAKE2b-256 cd4fa13dfc2f8cd61ddc7d1c095f22cdbad152adb75833f91e8b42d6be305364

See more details on using hashes here.

File details

Details for the file pyqrack_complex128-2.10.1-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack_complex128-2.10.1-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e667d903e2c4494e660628248f11bed073a70cdc2e1c41b5e7deaa9fb62cde62
MD5 9aaddc67878cfc12d621477fd0929f8e
BLAKE2b-256 484f001b247c954cc6c7b1cf07b9a98cad568871a8a5b4548be0725ac9c30703

See more details on using hashes here.

File details

Details for the file pyqrack_complex128-2.10.1-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack_complex128-2.10.1-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 2b108777d39d735bfd596dbf2ca9432f0ed44bc40c3d80f0f13a24721a4db80a
MD5 d9aa1580bca1a28dec9a7901d2930391
BLAKE2b-256 4125d6b1a5b94b48d9d48d4a98bb4817627190b4e08aaf22062b5353add46d1f

See more details on using hashes here.

File details

Details for the file pyqrack_complex128-2.10.1-py3-none-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack_complex128-2.10.1-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 f4a5e33f5faf78ab32daafb03f8bb64c258c53f9fef2786dae0fe5f36efdaa7e
MD5 33fd033a9c306a363afb19feafa63a01
BLAKE2b-256 9ddc3e4ee8f9d0b60828b55b0ed2a1d3530cb9b840fa6ce6c6097de07a59f97a

See more details on using hashes here.

File details

Details for the file pyqrack_complex128-2.10.1-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrack_complex128-2.10.1-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 62ba5ee00be8e14483efd84c305a9e8ab842306d39022b4953781a59bf5a8612
MD5 04fdaccbbe357d416a377c8365248caf
BLAKE2b-256 667b992c120135d79eb5e52b5d8003fb54733559d996466923695008b5ac6d28

See more details on using hashes here.

File details

Details for the file pyqrack_complex128-2.10.1-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrack_complex128-2.10.1-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 90c0c3632f0cd1833a495fed8114c3e6a8735a2f74ab7d4f7559c523b6275384
MD5 74947b0884cb0b689fe180de32c50d88
BLAKE2b-256 7ccbebc9146c79ea1361dc4f61e8dbffea832afe763ffac48858f4a94ee40614

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