Skip to main content

pyqrack - Pure Python vm6502q/qrack Wrapper

Project description

pyqrack

Downloads Downloads

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

(PyQrack is just pure Qrack.)

To use this package, it's helpful to be familiar with vm6502q/qrack. Users gain much more control over options by building vm6502q/qrack and vm6502q/pyqrack from source. For advanced users, building from source is the intended primary method of PyQrack package distribution and use.

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.

The package installation directory contains a qrack_cl_precompile folder with executables for supported platforms, to compile OpenCL kernels once, beforehand, avoiding the need to recompile "just-in-time" every time that you load this package in a Python interpreter. If you no longer want to use precompiled kernels, or if precompilation fails, just delete the ~/.qrack directory, or the equivalent .qrack sub-directory in the user home folder of your operating system.

To load the required vm6502q/qrack libraries from a different location, set the PYQRACK_SHARED_LIB_PATH environment variable. If an absolute path is set for this variable, it will be treated as an absolute path. If a relative path is used, the pyqrack package qrack_system directory is the root.

PyQrack v0.4.6 adds 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.

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.2.1.tar.gz (19.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyqrack-1.2.1-py3-none-win_amd64.whl (6.6 MB view details)

Uploaded Python 3Windows x86-64

pyqrack-1.2.1-py3-none-win32.whl (2.8 MB view details)

Uploaded Python 3Windows x86

pyqrack-1.2.1-py3-none-manylinux_2_35_x86_64.whl (4.1 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pyqrack-1.2.1-py3-none-manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded Python 3

pyqrack-1.2.1-py3-none-macosx_10_4_x86_64.whl (3.2 MB view details)

Uploaded Python 3macOS 10.4+ x86-64

pyqrack-1.2.1-py3-none-linux_armv7l.whl (3.5 MB view details)

Uploaded Python 3

pyqrack-1.2.1-py3-none-any.whl (24.8 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyqrack-1.2.1.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pyqrack-1.2.1.tar.gz
Algorithm Hash digest
SHA256 09e0e8aeb80209a02b14e49e7066e9a8e1cb54de2b6d169d1a38efc80beb18f8
MD5 f4e17562ceac771cdeca96e82fd16bb4
BLAKE2b-256 5dcf07215a5902c70d258172a087f24afa7e2feb8b69da4c595e0b036df338ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.2.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 6.6 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pyqrack-1.2.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e79f457130d2ae628307bf74a28871b837a503289c79a5bf96efd653fdb6fef3
MD5 f2631b65f898a4682dd837a2d532ea77
BLAKE2b-256 e0f75c5c1b33a2561e3d300ade4b5749f2371ef8efe3e77f48306e1c2362c6ce

See more details on using hashes here.

File details

Details for the file pyqrack-1.2.1-py3-none-win32.whl.

File metadata

  • Download URL: pyqrack-1.2.1-py3-none-win32.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pyqrack-1.2.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 8bfee9b6da68364f2b5de068cbd6f5df6b0ec4d99a7f26d6f8163df52fcc48eb
MD5 ce3f3810ee69f3fd5573a28c2fbfdbbd
BLAKE2b-256 82b78b7d56c8126c78f61ec4539edeb34bf484bc3996adeadb4cf44ed99b4eac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.2.1-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 decea58b729cf022fd8070c82aa01373adb002cc073532c7e537a358a94fa9fe
MD5 c6e728cbe2e2e52e754d380b240134c9
BLAKE2b-256 65dc69b174c2b58fa278f311b9c99631311eb564310dacbed1f5d47640d0e9cd

See more details on using hashes here.

File details

Details for the file pyqrack-1.2.1-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.2.1-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8410edb546c9a200c29cc38ebdb89a17937a5a7ed7d622a518fee2408a59906e
MD5 89ba766533ffe01206d73c2e58a58f51
BLAKE2b-256 6c87e3996be6b7b6eee620efcd064ad8bb62328f6d2c7423fb318f9545049018

See more details on using hashes here.

File details

Details for the file pyqrack-1.2.1-py3-none-macosx_10_4_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.2.1-py3-none-macosx_10_4_x86_64.whl
Algorithm Hash digest
SHA256 7e6668141a3448f1f94221eed500a0b2712b20fb45a7af44084253a32ed3289c
MD5 2546d8212ce4e8aa0cf7e2d216249d3d
BLAKE2b-256 6631d0fce687a5c045a91c86d4a9229f0f78c0cf2ee0c033d59bc28899efeb75

See more details on using hashes here.

File details

Details for the file pyqrack-1.2.1-py3-none-linux_armv7l.whl.

File metadata

File hashes

Hashes for pyqrack-1.2.1-py3-none-linux_armv7l.whl
Algorithm Hash digest
SHA256 18cd3d796b96e378071c9a52d905697a206bfcb8bd0ddabd9105bb8bf2512b86
MD5 6604a91ea1447d41e00349f5e2013b43
BLAKE2b-256 4add2083498dea2558eb4607af33e706f278c498e8909a3bf7764901baa0d1a9

See more details on using hashes here.

File details

Details for the file pyqrack-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: pyqrack-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 24.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pyqrack-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90d2546105306c1d112572170c7a0fa70795ab6f3222e6e1000dde127e258850
MD5 9ac1e11bfde36d978f3244e2cbc99b06
BLAKE2b-256 527326cb938150699752bb829ebadae23474fd5c6567850acc011374a2cfacfc

See more details on using hashes here.

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