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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3Windows x86

pyqrack-1.20.7-py3-none-manylinux_2_35_x86_64.whl (4.9 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pyqrack-1.20.7-py3-none-manylinux2014_x86_64.whl (4.8 MB view details)

Uploaded Python 3

pyqrack-1.20.7-py3-none-macosx_10_4_x86_64.whl (3.9 MB view details)

Uploaded Python 3macOS 10.4+ x86-64

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

Uploaded Python 3

pyqrack-1.20.7-py3-none-any.whl (29.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyqrack-1.20.7.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.7.tar.gz
Algorithm Hash digest
SHA256 8fe6d9ce022ec157e8903474a33171a26318db47089f55d6552dcc2dac6467e7
MD5 3faa12cf82b5ea67617b25718cb566e9
BLAKE2b-256 d6302940c04265e8f3866a6e347dbe0261d0707f91286c32f6b8c52f64dfc8ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.20.7-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.7-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 374794453dee4966b45520de8651f9c1a38062da98f8d5372b30f6b86167fa72
MD5 41e31885e1454cd506c71f9c3ecde2f8
BLAKE2b-256 9d487651fbdb19c810a7686ac86ab1d5d46cf7b95db71c87ba1c8f2c1b112fb4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.20.7-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.7-py3-none-win32.whl
Algorithm Hash digest
SHA256 1e99944d91811f5744c4ac8e2b3ee3675c487f04942058a2a436ea981cf40179
MD5 22533efcf0fab5df0199bf6faaf10b9a
BLAKE2b-256 829a4aa3d68bd0675294e84fada4127f5348bdc4a74f2d33d1d84fd52f4d2d14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.20.7-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 e5c0338dd83eb631ebd6662fcd44ef2f4f609562e40e0e4e38d527efc30aebce
MD5 8604ad436aa2a8b502ea410b13ab9968
BLAKE2b-256 3361d69b1532936581f1d2499549bb090515519d6ea8a4f0f36d7fc3c667e87f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.20.7-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09f44484103febed5114011aa13bb6fec9d7fbf4f69ad83c5fcaff81012d361c
MD5 e4d618710fd6d36102dabe882b1853f9
BLAKE2b-256 003bd32d49bba99a180657f7fef5b5d94d59327d3a578686ea3df9d730311a3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.20.7-py3-none-macosx_10_4_x86_64.whl
Algorithm Hash digest
SHA256 b94fc8e05caa8380b114010b5070e06909180c63a6a427550003296f3f2268fb
MD5 8dfc209be9c57879a5bc8e8f1746ba5d
BLAKE2b-256 ef9eb6b53290e143a1c3f03a9db3585c227b468b2dac81f935a939207f9dd13c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.20.7-py3-none-linux_armv7l.whl
Algorithm Hash digest
SHA256 b7b9d0d59918db5191dbc13614514f16f5f31ab1183a55febb040030cf4bf145
MD5 4a7de999897cf0e0d75d9e8d7f50f0f9
BLAKE2b-256 df74956309d8a78f3095d28fe91dec559fa9bfc99e3c595f0e3a056b27fda9f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.20.7-py3-none-any.whl
  • Upload date:
  • Size: 29.7 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 998ff7cd57f10418273b7b8c44d3f128c612d166084ee5cf1c398413fe210dbe
MD5 5c89524d148fa3bfbc48afbcd26ef149
BLAKE2b-256 31646fc797c27fe5a49a79b5f0627bd1d20a0dd673b78f008cf7f0aacc1f7c50

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