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.17.0.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_complex128-2.17.0-py3-none-win_amd64.whl (1.0 MB view details)

Uploaded Python 3Windows x86-64

pyqrack_complex128-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_complex128-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_complex128-2.17.0-py3-none-macosx_15_0_x86_64.whl (2.1 MB view details)

Uploaded Python 3macOS 15.0+ x86-64

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

Uploaded Python 3macOS 15.0+ ARM64

pyqrack_complex128-2.17.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.17.0.tar.gz.

File metadata

  • Download URL: pyqrack_complex128-2.17.0.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_complex128-2.17.0.tar.gz
Algorithm Hash digest
SHA256 a4cbe5ac7a83f70641fc10e74b5f7ab9ebf04a0ceee93932fbff45dba148e07d
MD5 07d0c78273db2f61c7afe66910647931
BLAKE2b-256 fa8e910f85030752597df8f5edb8680ed7ff05c529b0c5db315c608ed38a8a43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.17.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a043b9f5f4da35b77b41f3ca8f2e568cf6ee4f86c2e645d911957f0b3eead91b
MD5 0d13377a799cf73f85129988fbb8a3d4
BLAKE2b-256 069b4a27701568661d8e1e0612e0358649c40364197afb84758d285635b9d497

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.17.0-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 d291e2d5c80cf6cec3e0e7bc8f0876f441bcf6d3c3817011a0b9ec54e06b2b2f
MD5 0b962056eb87cd89fb7f8326be67d35d
BLAKE2b-256 1b69ce81e0335d509a6e191049fb8dbc6d3d0813da0f3d93101353589c89a2ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.17.0-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 6081f68a4a1be7409b7ca64cc352bf1ee8ec8be3f580b7ab6f18a612e46a0107
MD5 0225ba529a1221f51a7c455b33360133
BLAKE2b-256 d24b8b3fd87c5f5fd6cd3c616d9cc92407d85843b70e9b6cf6c89ce40e9176ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.17.0-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 c294be0d0069685eeea6f34a4c85706dafa2be53202b4d54b6605fd70c3fa1fa
MD5 26ae832f6d2b8fea91a1b15a2aa91a8d
BLAKE2b-256 faa536658bad7c3381924098d58874b04510830691c1b8f8549ea38868725244

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.17.0-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 02085e64745cc6998d09ffaa4190f7142ab097cebd616a5eff2e74536f679224
MD5 0f26d3bad42f9064e3efbc196af673f5
BLAKE2b-256 0ebaa6bbe9a3bb48df9642481ccf4d823497401a59614e99bad3d2b6b9f51738

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.17.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 920a043567d664b0ba91576c1aa25cd41a895df3d6bb498ec1b39d76cbbe2fa4
MD5 469243f6d389540218818ff42b29a1f4
BLAKE2b-256 3320d8b987421c7d4a926ff12eef830a9fa275a7b9aafd77fdcd0da0f7c2035b

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