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.11.0.tar.gz (66.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.11.0-py3-none-win_amd64.whl (1.0 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.39+ x86-64

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

Uploaded Python 3manylinux: glibc 2.35+ x86-64

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

Uploaded Python 3macOS 15.0+ x86-64

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

Uploaded Python 3macOS 15.0+ ARM64

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

File metadata

  • Download URL: pyqrack_complex128-2.11.0.tar.gz
  • Upload date:
  • Size: 66.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.11.0.tar.gz
Algorithm Hash digest
SHA256 888ad0eb1da1472c8165d2bbf3c7cc62d739bd855c4550d044b3f8dd74956e6f
MD5 c1a58afc77d3c680edd4bb906613fc3c
BLAKE2b-256 1a81af8c3424dcfbdf81be9f451899fa510731291e665129142ed262bd7b4080

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2b47058327e069caba66f011b3a566d90975989a865a09bf818e2410a4e49878
MD5 fc03028c6e2cf7ca1a7fbd68984132d9
BLAKE2b-256 487a19a86bc785a34d4c0e31365009f9dc4af4313b466943935b07a2f8cd8710

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.0-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 f294e0ce2b0a7649e445de6788519674cdd5f80fcb0beb8883a871839695a642
MD5 1443c32b18b28771e21f2eaf5e13e666
BLAKE2b-256 06c648ab7ce1d9914d6e5baa29659d84d7381912933ee86adf4c57ee074959b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.0-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 aedb6b17c623196d793839556a30c4c2529f166cfc442ebb4e46873dd621aeae
MD5 aeb4d373493610cd078ced7afd2e7d74
BLAKE2b-256 45a2359ee1b788e8305afd7302072bff97857c84e2c14aaa9dced35434afa22c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.0-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 f120ef99743c2a6bfcad55cf58b19430430db63a3a5b0cac125bdf528d5cdc4e
MD5 7b39a0c030d3615e8a8d24ba96a3de19
BLAKE2b-256 0692f3fc99b07cf6b959bc84137d77100d7dbb01910566b456a517a072f90cd5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.0-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 08d4cecb33fd9f52c45b56124cbe27de0e51a97b3e55b89d104e2a6b13150122
MD5 c987279f2032347c6c9dd937f3fc71cb
BLAKE2b-256 a04e9e3e912060b9112902d56ff1345c9f67a275684df8cc2308c7bf452fed07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0e8f481ab25af1a19e6231493c336b633a2778d74dd1da1a7796872efc6c4f03
MD5 9109e90d20953e0f73c62b955b2f46d8
BLAKE2b-256 ba1282290b9dadb0ea610a824ff7e33cba22b1886881cf26b675c31f41a0e4e2

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