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.

Please feel welcome to open an issue, if you'd like help. 😃

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

Uploaded Source

Built Distributions

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

pyqrack-0.12.1-py3-none-win_amd64.whl (4.7 MB view details)

Uploaded Python 3Windows x86-64

pyqrack-0.12.1-py3-none-win32.whl (2.0 MB view details)

Uploaded Python 3Windows x86

pyqrack-0.12.1-py3-none-manylinux2014_x86_64.whl (3.0 MB view details)

Uploaded Python 3

pyqrack-0.12.1-py3-none-macosx_10_4_x86_64.whl (2.2 MB view details)

Uploaded Python 3macOS 10.4+ x86-64

pyqrack-0.12.1-py3-none-linux_armv7l.whl (2.6 MB view details)

Uploaded Python 3

pyqrack-0.12.1-py3-none-any.whl (15.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyqrack-0.12.1.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for pyqrack-0.12.1.tar.gz
Algorithm Hash digest
SHA256 6568905979588a93f185e16942f9da3dfdbed7fc891471bc0fa46a60a8a7b000
MD5 9ba0d171952d68dbc5854981df4f7858
BLAKE2b-256 8a047c3535867a8c19ec8e9511ab9f19cb1cc8566c59cba4c25109faf5c93a3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-0.12.1-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.0 CPython/3.8.10

File hashes

Hashes for pyqrack-0.12.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9540f98c529c374fe8896ac4ef4a24295195e37fa2058848591b50c9444663f3
MD5 edff4c8461b92f90877c51e9078ad367
BLAKE2b-256 39649452463ea6f7da829b68d78ded257ecbd4565485e62358cea2432f417a1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-0.12.1-py3-none-win32.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for pyqrack-0.12.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 7ea6a6ab6c96aaefb9a45af10f47aa9b4a8139c850d9743709fab4e12bfa2cdb
MD5 b31cdf0df46c7286b294c420a01d337c
BLAKE2b-256 e90bd37ce7f898907e116a590c6451cf424713945352db8fc0dfa258b08d7a4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-0.12.1-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5c49a839838b283a2ee23d9ffaa1d2af2f78bbca70fd17ac5e886c609b1106a
MD5 f17372bc6841468bec5c83365237c25e
BLAKE2b-256 af859173441e21ffa20f5edbbd00a94549e270054e66ebf7cc69a018da475fde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-0.12.1-py3-none-macosx_10_4_x86_64.whl
Algorithm Hash digest
SHA256 498f2fa94e2ecb12f8f320e30ac6c34abf8e925ad2b83cfe5c30252e10b7cc88
MD5 e617ec9147beaefd7d60940b7799a54b
BLAKE2b-256 bb486bcd9f2a65206a4da52ce8bb698a7e10add3874f8ca352ca580b247716f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-0.12.1-py3-none-linux_armv7l.whl
Algorithm Hash digest
SHA256 9033ebcce2f837eff4381eaffe9c3b178334c8b46b80862ba7b6f42ca3ce5a18
MD5 3733eb0d32dbd98c10d7d09b8bf519af
BLAKE2b-256 106847d2cc69f7dc073ef105b0ea3c8c007efe26c1ecfa7f3d447ebaf28cc72f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-0.12.1-py3-none-any.whl
  • Upload date:
  • Size: 15.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for pyqrack-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1df7c50092b1f5c98ffb755253528a3478620b155631e2d866857dc002954b0
MD5 688ea99dd526b6d4d8f4cbc6437ac851
BLAKE2b-256 9bcc0fb3c958479a44f818c58f86b42a547729104b7e21830a183d7f2709d6c1

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