pyqrack - Pure Python vm6502q/qrack Wrapper
Project description
pyqrack
Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator library
(PyQrack is just pure Qrack.)
IMPORTANT: You must build and install vm6502q/qrack to use this main
branch. CI/CD builds wheels that contain pre-compiled Qrack binaries, and that is the form published on PyPi. You must also install OpenCL.
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.
To load the required vm6502q/qrack libraries from a different location, set the PYQRACK_SHARED_LIB_PATH
environment variable.
PyQrack has 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
Built Distributions
Hashes for pyqrack-1.30.16-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b154fcd9dbfd4ecca388c4e015e7f7a8c7c1a2f040ac69e2153b56638e1faa9f |
|
MD5 | 6db0b418e7a14b6c8e104cad1046f297 |
|
BLAKE2b-256 | 2ab493a466fda6f00a843d7989d4e3c55814e7d1e638c329069e5ff4d47f6b9b |
Hashes for pyqrack-1.30.16-py3-none-manylinux_2_39_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db9ee69b7f7c9b4dfa9ca475197420efc266b75eb8dbb4d12cd3187521d7b273 |
|
MD5 | 9dbf82e70cc41864df71865a82c6fb7c |
|
BLAKE2b-256 | 974c012d2938a741034b12b0e3b29b2203ded512833bf954a1672a2e1a597c19 |
Hashes for pyqrack-1.30.16-py3-none-manylinux_2_35_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07dabb1fc3169263a466f9a07b7011a29b2f4d15aa53ea4c734df3b9de4aebf8 |
|
MD5 | a8733d1579be1ae76053da8d18970ade |
|
BLAKE2b-256 | f869d82a071dcad5c4873ad19f153c77e58a0a46df4121ca22264d4325d03af1 |
Hashes for pyqrack-1.30.16-py3-none-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4df8e0b33919f77947af2ba13aae2599ddfee6cc2bae36a40b6e00c67c0db78d |
|
MD5 | b11e8a501b50872e40238389ae608e92 |
|
BLAKE2b-256 | 63fff964ee20ee3a90ce270c8e6f708b9fcdeabb83ffb3ae8f3f3fc2a31921f3 |
Hashes for pyqrack-1.30.16-py3-none-macosx_14_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ee9a2425dc94e3d55de0218811f0bafa734b171c7b0c89810adede07f0fed91 |
|
MD5 | 1ba0764eeba3b177d2d3ce7dbc74deb5 |
|
BLAKE2b-256 | dfe050e23d04b531b50922bf4325dc1013306a504d05484e69837c9b1a77f591 |
Hashes for pyqrack-1.30.16-py3-none-macosx_13_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53179b544a39158fe1169a9321b7e17c9f6a002abe331cf32dba1574cda31cba |
|
MD5 | 107318decd35debaf8df17fe722ab9fc |
|
BLAKE2b-256 | 1a11faf541d4a46591c42c4473c419bc02e4c2fa13f6f3d5fdcd110862f79407 |
Hashes for pyqrack-1.30.16-py3-none-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99fe9c1b2b73d08126fbe7d95272abb08f4d3f27dda53b8c0d1fe8b1388fadbd |
|
MD5 | 7261cec7de7bdab52eda529dea49114c |
|
BLAKE2b-256 | 889322b43ee6b023ab7e5b74576850d0d99d1b21c57c66ae1c351f21eba5e7cf |