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

Note, if building from source: 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.21.tar.gz (34.0 kB view details)

Uploaded Source

Built Distributions

pyqrack-1.32.21-py3-none-win_amd64.whl (867.7 kB view details)

Uploaded Python 3 Windows x86-64

pyqrack-1.32.21-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.21-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.21-py3-none-manylinux_2_31_x86_64.whl (2.7 MB view details)

Uploaded Python 3 manylinux: glibc 2.31+ x86-64

pyqrack-1.32.21-py3-none-macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded Python 3 macOS 15.0+ ARM64

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

Uploaded Python 3 macOS 14.0+ ARM64

pyqrack-1.32.21-py3-none-macosx_13_0_x86_64.whl (2.2 MB view details)

Uploaded Python 3 macOS 13.0+ x86-64

pyqrack-1.32.21-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.21.tar.gz.

File metadata

  • Download URL: pyqrack-1.32.21.tar.gz
  • Upload date:
  • Size: 34.0 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.21.tar.gz
Algorithm Hash digest
SHA256 61d3707c1c6170955c32dcbe809de917d6c1cd30eeb1d5194630d8f952b8465e
MD5 486ce14539bf6bd55ac27708ccd15065
BLAKE2b-256 786725b7f3170cf5163e13534a3bbc73282735a38855b7f6db3a4d5394fcd553

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.32.21-py3-none-win_amd64.whl
  • Upload date:
  • Size: 867.7 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.21-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 42da8b5b08ceb67fcc931f181de1490ac28030d6949d379d7b4327bacefb9475
MD5 9665790764297c4a51b1bcf3227165bb
BLAKE2b-256 c7b66d37efc6d061414cabd73ac9ffc5c67d0e11dc4701e4e6b9f7f3ecb69800

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.21-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 9382070708b90bd854cdfecaf7a902428cfd77255c96d709fa9187d705150bd9
MD5 f6466b9ea57d3d99370a49067e7b6223
BLAKE2b-256 f7e123d04a89bcdb183285d158270eb92fc03b0e77098c54c96274e91f687bc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.21-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 d9bc390bbc3946a4d92d3760b802e7508cca336819b212b233f6fd47de0bd84e
MD5 676a7aa658ca411493def333e34594d2
BLAKE2b-256 a85ee4fe682853638c9b97d420ad1219ab77af06e2213849aaf6635def58cfcf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.21-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 8da3aecc7d1257336d7541f057686359b076bd2558d4f12a5c1862e2fe8922bb
MD5 c1af1cb7032c737304d2cd51ba93feb2
BLAKE2b-256 0db46d0e3f4af278ea4b565a2ae23d6f26f47d78303f2da72ca20b444b53a70d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.21-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8777616f642014adb34d3a1df77d465c8cb9e5fe78fdc4db46525760ff51b1f9
MD5 939bd5542c65f6cec925749f404d687e
BLAKE2b-256 330281139268524c290cc9310b2dc1136a3af7b03271518ab0aac7866631a247

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.21-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 36f616f677238c61d8139efcf6949d98a23a2359a43cf3decd2990fdef2a2a71
MD5 c0113cf1fb7c03817f301e3558a613af
BLAKE2b-256 edabef9b86b05f478a754533c295b206cf4be691b4328217d0ed8d9937756c67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.21-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a18f0b011fbd3ec6bc20ec02513cf23ea424f7b4db0adc93d4b2f807550c16ca
MD5 82522047fb45a0b7620a8f246ddd44a2
BLAKE2b-256 59e6f513d0257d4973087c2f3cc4010bb4c81c8ed7bfdf7b2008dc6d0460ea48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.21-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 d3849e5f1c9c3167b80b2d4c3d479c58062f97e455e67538906ced4e1443b4aa
MD5 fe81cb532b83bfc7094910f85b63c18b
BLAKE2b-256 837d180c937ac083c273704c6f5a3ece2e5054bc347e84017a22d529705aec3b

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