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.18.2.tar.gz (29.9 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.18.2-py3-none-win_amd64.whl (4.6 MB view details)

Uploaded Python 3Windows x86-64

pyqrack-1.18.2-py3-none-win32.whl (3.2 MB view details)

Uploaded Python 3Windows x86

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

Uploaded Python 3manylinux: glibc 2.35+ x86-64

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

Uploaded Python 3

pyqrack-1.18.2-py3-none-macosx_10_4_x86_64.whl (3.7 MB view details)

Uploaded Python 3macOS 10.4+ x86-64

pyqrack-1.18.2-py3-none-linux_armv7l.whl (4.1 MB view details)

Uploaded Python 3

pyqrack-1.18.2-py3-none-any.whl (29.1 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyqrack-1.18.2.tar.gz
Algorithm Hash digest
SHA256 3f67ebd5ef13b2ed514ec40889fae2f87ad9d190157c9958f60e91b4bf664230
MD5 c767606ccc3faa1e444b52e4fe97d950
BLAKE2b-256 87a48affba2c6364eda62130b5e8de662c79fc0d020788993f07c7a7d5402dd8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.18.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.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.18.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 698f6a2497b74267062ee7ff352630c2f7b97311eb7b0573a4f9d7892537dc5d
MD5 ca93dc6631878b4f7b83926787eba35a
BLAKE2b-256 934324f7bd29b7bfee69992bcca6fd840b1441c0cd6a8eb37a1829d26d51e11d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.18.2-py3-none-win32.whl
  • Upload date:
  • Size: 3.2 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.18.2-py3-none-win32.whl
Algorithm Hash digest
SHA256 aee7c58725e05216912891e5a2b7231b406404e5577ba02d19e35ed2798007c4
MD5 265046f1938013a904a4ec370f08eb17
BLAKE2b-256 93f13abcb7f38a784b7456a4d7d0e08c5030b3b447be05f514f5378ce35bce8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.18.2-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 f77f630e9d447430363c8bf9cf756608ca12d78489300dda6146f4c1f34a910f
MD5 c78803c90f71cc157a7e369260b2d075
BLAKE2b-256 7f800477f5a4b65ff7f035081a55c02996288a5cf80a73a69458c4271b8a1482

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.18.2-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 98b0b8341e0ab5449fd791b06c91d37115d4c054398396f3671a2f92a5e2c0bb
MD5 b416247560263c4a3c7786940144786f
BLAKE2b-256 a4254f228154bd4c0b5ce78a4c7b2e709deab5d9950fe1a5a4790ff94ec9128e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.18.2-py3-none-macosx_10_4_x86_64.whl
Algorithm Hash digest
SHA256 dcefc67441d1ce5fc21f5f18704b1229221d36c9aab51249def076248361bc69
MD5 f1c76f4e77b683d114a1b8bfa34491f5
BLAKE2b-256 a72d64dcbb86eec6e958d6002d449e0af5f41c8599eef0a1d485a0f4b3290a35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.18.2-py3-none-linux_armv7l.whl
Algorithm Hash digest
SHA256 f0d7d11f4eb788781b70d85ba63ecd3ddc8697b3a6bcbc1fda0a1c6705a52d6c
MD5 e7df88f646cce7349d272c65ed01cc28
BLAKE2b-256 24578cd059007fbbdc802d8a67aef055710efe69ebcfef6a89546d2d55e66e43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.18.2-py3-none-any.whl
  • Upload date:
  • Size: 29.1 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.18.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e04996536f7c01520024fb711986b8e4b942b869e9e1225ccaf3f83c8ce0468
MD5 bbef2537ff720455915209946bd85263
BLAKE2b-256 a659a4a43d6697a8fdd6818ffdd0c5a6902a47fd6365b185de084f3a89b59c0f

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