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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3macOS 15.0+ x86-64

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

Uploaded Python 3macOS 15.0+ ARM64

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

File metadata

  • Download URL: pyqrack_complex128-2.7.0.tar.gz
  • Upload date:
  • Size: 62.8 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.7.0.tar.gz
Algorithm Hash digest
SHA256 4074f1bec1b389053cf3076a92d3d72cd015428826327bcd624c2bd78ed3e1ed
MD5 691d290749ae6a22bf7ac30abc11182b
BLAKE2b-256 291580b1fbe78196bb9daabc1b21c49959c68ef5e7927436eed57dbc11a86345

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.7.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 da2881c1b9ecc85f4d8b23c353f6e077ff1052ae53ccc3096e6c36f190baec96
MD5 e550bd000140fd5a9c00b51574a8fec8
BLAKE2b-256 d264c715833d4fc45bf969408f90b66660abdef44b11c5cbedcded407c7018cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.7.0-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 27e60db5cab848be2ef93f30e526740538388fa0f78e71044b308639c4c28580
MD5 f999d2f4c40b39488b5988d11d29ebf8
BLAKE2b-256 ff7c392f40edb0b07667cf512b81e7a3722f9689aecda4679a5793e9ffd1f669

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.7.0-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 82310faaa932ea75b345f44e34bdd235b2d57f9884638854a8a0d26feb2ee323
MD5 690f2df01dcad050283554d56e43fe96
BLAKE2b-256 9ee8eef203d17675f93b0ee23b677f6dee1e5a3f210fc7641ff70146de5c62f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.7.0-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 7059b8440a5c74eb511c9ef3384d5f45f80e1d1ea5209e26cf097ff48048e76a
MD5 8d083fa4115acedf42bc3cc60cda3d9a
BLAKE2b-256 6f98da3ba5a53052e81133d45ef67812cb004dd98b006e59ce8c91d2e286b205

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.7.0-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 27637e75d64d769c313cc0eed8ede109fbc5c1ecdd46d8843aa061c723684d08
MD5 9d2b90cea00cd5cc45400c4cf5bdb2ff
BLAKE2b-256 77928918384d88116668690485ed24771e5acb66bd983b74e9f7a33a24bb06ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack_complex128-2.7.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9f6073c3967497c28e2b3b7fb59aa4ba54584e6effbd4b8ace9e5931bace4aaa
MD5 748f66ff3e70962eee4dba809b2fca90
BLAKE2b-256 b20db4934b209694934e5eae39e955ee52d5a2b89443da6a782aef0754678162

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