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

This version

1.8.1

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.8.1.tar.gz (22.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.8.1-py3-none-win_amd64.whl (4.0 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3Windows x86

pyqrack-1.8.1-py3-none-manylinux_2_35_x86_64.whl (4.2 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pyqrack-1.8.1-py3-none-manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded Python 3

pyqrack-1.8.1-py3-none-macosx_10_4_x86_64.whl (3.3 MB view details)

Uploaded Python 3macOS 10.4+ x86-64

pyqrack-1.8.1-py3-none-linux_armv7l.whl (3.6 MB view details)

Uploaded Python 3

pyqrack-1.8.1-py3-none-any.whl (25.6 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyqrack-1.8.1.tar.gz
Algorithm Hash digest
SHA256 53cc737b1d01c8807c9c63e3429b7972badbf78e4f99d73c061514c8a31918f5
MD5 0103e7fa90dfcccf3aa345b3e4959b62
BLAKE2b-256 8e9e738ec4b00ff6f4fc5c2db70994ad2ef7efdc6c32a265ce330e010dba6f68

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.8.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.0 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.8.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9c6a1fe3228154871b6aeeff467f64f1bb9072404bc320b9720ee010bcfa5819
MD5 d4db56d30a95ccbb98b53b0831d1ce72
BLAKE2b-256 b4e223ffb8bd23c054b5622a6f4093cb238f968b1d8eee0a82213e221e0ee352

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.8.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.8.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 d30ce7a169b77d8fef1dd548c7b2532a54176537b9f9af5b9f811ac32a6ea7e6
MD5 f3992a6dac28a11a1ad59957339c05a7
BLAKE2b-256 1ff1c6f521e21002d089fbfb4dcd87854227749a4ca560e6718c4a7cab2d5985

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.8.1-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 f51c275e476d9339835cd53e0f7edceb8790a28e56506ef62bf8ede2f7b9a04c
MD5 d0e4f803eaccaf19286b4b053a17a15a
BLAKE2b-256 c5b0e19642af31c4361641cc228905fa727dde442ed6c67079a0769f458c4d72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.8.1-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 365968eaf7a9c7ae13809fdcec66ad77b47b9144c9fc5707c629867ab6c285bb
MD5 258fdaac3da372bb590bd7f4d2e7425f
BLAKE2b-256 008e0255732d620df21ce0dde68c041c82e830f39a70ff21f51aaf826e62ecfd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.8.1-py3-none-macosx_10_4_x86_64.whl
Algorithm Hash digest
SHA256 ec30f064c315b7ea9d6580a5dc7be0647709bcac786f464e53b783184194cb77
MD5 cf0e6fff0f60f82b31f18c2587f9eb2e
BLAKE2b-256 13393026bb174a3231547c6f87e79ea85d9ab3cdf8e301d81eadf9a2148dbb91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.8.1-py3-none-linux_armv7l.whl
Algorithm Hash digest
SHA256 83ea9155895f24b69acba4ae1a5b3c2e3c4bf0c3fddcb33ca2b0cd2c907e5124
MD5 2857646517f5c8c145a430d127c43b02
BLAKE2b-256 b072ae6f5f35c931c68f8568d40e115b099eadfb3110399c78aea302492ddde0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.8.1-py3-none-any.whl
  • Upload date:
  • Size: 25.6 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.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c75a619f8a28945e1496e260d52a702520ee88d11e35c80cb240daee1765360c
MD5 0747fd38eb3f51149d6f3c9e44a648aa
BLAKE2b-256 3c6f4aceaaa673e0579fea92e79d30d2c0b52fc1583008803685c6537145da88

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