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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3macOS 15.0+ x86-64

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

Uploaded Python 3macOS 15.0+ ARM64

pyqrack_complex128-2.11.1-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.1.tar.gz.

File metadata

  • Download URL: pyqrack_complex128-2.11.1.tar.gz
  • Upload date:
  • Size: 66.5 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.1.tar.gz
Algorithm Hash digest
SHA256 ffa569cf5228614f5c219c483e14239c053b84a3fcd4772f775528f2ce8d4227
MD5 23688304ad9159f823dd0d8ed92d6762
BLAKE2b-256 5278e3be0652c925d76526ece9c3fc31b1ca3e5d02d8fd25da43310c57c5477d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6d0b8f4c95eea81042826c1b847fe05670ed3ddb00eb82f5717a5bbb9e6db44a
MD5 de9eee2849aee469471b4eacdfe9d1bf
BLAKE2b-256 59472d3b30b4be9e69c15e99f0d01ec1888a75f7104a3cb891d1af4a22b6e857

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.1-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 b51a77ea6059da8740843d6b8f1829ea8d29a78bce71c0a15227f742f12bff2e
MD5 cdd82a8e9f1b522de3874aca20bc9e2a
BLAKE2b-256 71c940a9d8bc4025ae82d32822a98aaf2d306d63b8ebb91f7819c7ce144a8f54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.1-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 8d38d5554ae062fc4a6ee2c9d3fd3dff3313de13237924a50418b6e774d95d08
MD5 6cbc81a850cb5a7a8ca476c26a43da50
BLAKE2b-256 2551bad1f5e056c5fbfa7d6fc0ab0267ebe1ddabb10dca3ac74dabfce1cb6315

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.1-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 9c702038c9f4a98a651b90b1f8f914d6a7b24a6f8bf517f47362cc51b228e488
MD5 cfc828d536d37fb5b6cd7d8e7a6237a3
BLAKE2b-256 fc8634ae02adab38df57de4a5320648af47417d818309b46d6692d2b1a72ee72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.1-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 90cf029812022ef9900f977110a70c1d34f9181a971ace8e3a4695c0000c6fdf
MD5 d6a8ef1eb921188275646f81d16c4e60
BLAKE2b-256 e9450f1a019209f48443d675c490a4b4c029c9bce6b7d8de0b0a387c02c1f685

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.11.1-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d8283f7fcb40b46f13c386fd89a2350ba6912f34549aa9977aadec8a6a883c8a
MD5 80e4637ecc94e9118588ef7f6563d2b1
BLAKE2b-256 412a52ae9d8d94c7e0e166b2190a08f3fb41dd034c1c2c0f4c8250aaa88b4fef

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