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.20.2.tar.gz (30.6 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.20.2-py3-none-win_amd64.whl (4.7 MB view details)

Uploaded Python 3Windows x86-64

pyqrack-1.20.2-py3-none-win32.whl (3.3 MB view details)

Uploaded Python 3Windows x86

pyqrack-1.20.2-py3-none-manylinux_2_35_x86_64.whl (4.8 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pyqrack-1.20.2-py3-none-manylinux2014_x86_64.whl (4.7 MB view details)

Uploaded Python 3

pyqrack-1.20.2-py3-none-macosx_10_4_x86_64.whl (3.8 MB view details)

Uploaded Python 3macOS 10.4+ x86-64

pyqrack-1.20.2-py3-none-linux_armv7l.whl (4.2 MB view details)

Uploaded Python 3

pyqrack-1.20.2-py3-none-any.whl (29.5 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyqrack-1.20.2.tar.gz
Algorithm Hash digest
SHA256 ee1061e404d6d5f91bd6cbd1f66e2804864c6f20e0b379ac972bb710358d35b9
MD5 7659b4983e4b1573212691e6812bfebc
BLAKE2b-256 a732e7fdd97f0768d0a8edbd12ddc9fb0e613f7f3908628b4580ef7c792c0282

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyqrack-1.20.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 8db8bcebc33b701f3f042b322e1cc1d3cef6d6eae7a53a58f7f161aa842abf7b
MD5 5e1a698570ffbd7a93f027b4e0ac8d41
BLAKE2b-256 3d576d96cfc10a9aa5d4c5691ee7c3096c1ad9ea7e4d7b9f479cd7152b20f2ff

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyqrack-1.20.2-py3-none-win32.whl
Algorithm Hash digest
SHA256 2a7c00d76168cffdcd3b481a6a7270711897a9e4280718644bec1c1b71f472fb
MD5 064941da2aa4fa8980d3595fe9672434
BLAKE2b-256 d38b6deaf6dc7cd652dc7a462e2cec2d514e725da423ebb75cc143f9238205de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.20.2-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 faf942018298c9947b7740ff0ac5bcd6fc1b26454f06f83bb0e7cc83433922e8
MD5 20afadfcc1f05c62b7226432d0932dda
BLAKE2b-256 c49b876314176572e3b3ebacb14375aa16d6c11a847d1fe10f864f2fec9a60ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.20.2-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca23eb0374a40ab18b02b2a61b862cdb62d54f0d5bcc846153b1e43fb7356b29
MD5 260527d46cbf2aeb8a89c4b82893871d
BLAKE2b-256 4fd9d2c04173fbab0a61d170fe4b5a683e82c858761ce8ebd103c357bf19f35d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.20.2-py3-none-macosx_10_4_x86_64.whl
Algorithm Hash digest
SHA256 d089d44af115dabbbe48000b40faadab5084e38b5367134d681cfc0472918e7f
MD5 4877ed916066d77bbeab3e6de7383dde
BLAKE2b-256 c60b8ba15bc77be2b512e4f657c46a60eae25056a217e0c14c0247b383bc78c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.20.2-py3-none-linux_armv7l.whl
Algorithm Hash digest
SHA256 55f16ff6931b87c5fcd0541c2cee49a2af353baf7882a83a961feb9a5de6cefc
MD5 9ad4e201bd589f292d2116e33dd7bd90
BLAKE2b-256 cdecce106c29e18f194d7c10f2d305667c9b6b55954dcb3ecc59b9181d5b7ab9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyqrack-1.20.2-py3-none-any.whl
Algorithm Hash digest
SHA256 658250a47a14c95e6e7114fcee8c5b4f1c087f1dedcdf667d83dfc6bd42d84bf
MD5 e3638d42336df665b83f8f9c8941dfda
BLAKE2b-256 664100034898c4384dbafe883e0bd27a8c78b37a144c83132e77eb169197e5e6

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