Skip to main content

pyqrack - Pure Python vm6502q/qrack Wrapper

Project description

pyqrack

Downloads Downloads Downloads

Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator library

(PyQrack is just pure Qrack.)

IMPORTANT: You must build and install unitaryfund/qrack to build the main branch from source. CI/CD builds wheels that contain pre-compiled Qrack binaries, and that is the form published on PyPi. You must also install OpenCL.

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).

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, and to the broader community of Qrack contributors, for years of happy Qracking! You rock!

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyqrack-1.32.8.tar.gz (33.6 kB view details)

Uploaded Source

Built Distributions

pyqrack-1.32.8-py3-none-win_amd64.whl (859.0 kB view details)

Uploaded Python 3 Windows x86-64

pyqrack-1.32.8-py3-none-manylinux_2_39_x86_64.whl (2.7 MB view details)

Uploaded Python 3 manylinux: glibc 2.39+ x86-64

pyqrack-1.32.8-py3-none-manylinux_2_35_x86_64.whl (2.7 MB view details)

Uploaded Python 3 manylinux: glibc 2.35+ x86-64

pyqrack-1.32.8-py3-none-manylinux_2_31_x86_64.whl (2.6 MB view details)

Uploaded Python 3 manylinux: glibc 2.31+ x86-64

pyqrack-1.32.8-py3-none-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded Python 3 macOS 15.0+ ARM64

pyqrack-1.32.8-py3-none-macosx_14_0_arm64.whl (1.5 MB view details)

Uploaded Python 3 macOS 14.0+ ARM64

pyqrack-1.32.8-py3-none-macosx_13_0_x86_64.whl (2.1 MB view details)

Uploaded Python 3 macOS 13.0+ x86-64

pyqrack-1.32.8-py3-none-macosx_12_0_x86_64.whl (2.1 MB view details)

Uploaded Python 3 macOS 12.0+ x86-64

File details

Details for the file pyqrack-1.32.8.tar.gz.

File metadata

  • Download URL: pyqrack-1.32.8.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyqrack-1.32.8.tar.gz
Algorithm Hash digest
SHA256 573d618030685f6c99753da69dc1a2be312bfb85a7ffbe66a77df942cde3fedc
MD5 3b806bbc131d89fc7432d91639a556cc
BLAKE2b-256 5b0c1a462f764e677605d81b7bebf52a30e4a2b75802c18f176e295e10d1ccb8

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.8-py3-none-win_amd64.whl.

File metadata

  • Download URL: pyqrack-1.32.8-py3-none-win_amd64.whl
  • Upload date:
  • Size: 859.0 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyqrack-1.32.8-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1a0e329fa85422d926ff253e74b4a04ff761c36e8c908e934be729be077a67ed
MD5 d3617716bc6ebb5a8e4d1184c7515a5c
BLAKE2b-256 93566ed0f8ff92eabfeb6847f9ecc81641148d703fec8a300f39cc1630d10528

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.8-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.8-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c0fc211d3d88b5f2466c597ff5c782728fcb77fb19857b63b60b479e4925fc73
MD5 d8e65ab8d3cfabcba9e1ce0b88e34e2e
BLAKE2b-256 c184850257b3e0ff076f9eac5980c3d4142abbb1351f92681acf4c90f883751c

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.8-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.8-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 f71540a6b50001ff4b7d9af7e971a776bdb9bc2de896a29e79de1c0584cfc4d1
MD5 3c5490c9f84fac125507ba1af6dee638
BLAKE2b-256 f89d4f36f6b56bbf3782832415e01ac69f0d36dc2be70395293499f51a9330d7

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.8-py3-none-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.8-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 70965b684f22792e3fe91d5b23be78ddaa19313de5cd02d299e338c6b5835506
MD5 eeae6d7960823906b56187683e89e249
BLAKE2b-256 edcd99bfee77d1768384007f3c1d7d08aa8ee41f327421ec21dc06d107130703

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.8-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.8-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6de40df14c7eb4995567c50dcac4dd2dfbe15f8d08265346003fa81a1d44b29b
MD5 4fb491138877adffe191caa445643f4d
BLAKE2b-256 749c75894d582e9c559f623a808f07d95d2f2b9f176e8ea6ccc6a0fe970e7db1

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.8-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.8-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 867e5a679de9c5e62c732436b9bb4ff6727039e7b22b60dcd256a912bece558f
MD5 19d6cd369026b48d71740b69871e2087
BLAKE2b-256 7e0b735bd38b4e31314299b44deecb598b3503b2645aa443a192b43a9a222636

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.8-py3-none-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.8-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 caa40946403cf0ed59a211386c4ec43066fa61d1523893747e6b56077a3453ee
MD5 4817d5e43203b738852669007089c1e4
BLAKE2b-256 1e38d3f69b4b3c37bb27702274e22e9a19e08c9221ee376c2052f91b646dbbcd

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.8-py3-none-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.8-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 0e2bcbe560c07ea8fc9ce141917342527461aa6043d28dba740eb27b5cdb2e90
MD5 7060762db68d632988db7b7980d37382
BLAKE2b-256 c5552c685fbcec2d3349dfacbb85c7943426766c65f65a6beaf003711a69f2be

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page