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.11-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b8eafdc887908c57f9e4d1e64d9e2246c4925ac78afbf1459d441a96d50404a |
|
MD5 | 85f5bf06343c6b58f053a7f6fe67f902 |
|
BLAKE2b-256 | 2d3f2f338e22c34e81742c56a02cb9a783097c17f5711036970fc6f1b98b9ee7 |
Hashes for pyqrack-1.30.11-py3-none-manylinux_2_39_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83db9aa33253a0fa7431c1600218d187a1d1f61c214a246d5c378bdeed8842fd |
|
MD5 | 8c04b787b7b227817a4c292f3495112d |
|
BLAKE2b-256 | 1be4e089b6ebdefb6d2d5f470b4db245bd6d1d3f06466cd17a2a221c69ded122 |
Hashes for pyqrack-1.30.11-py3-none-manylinux_2_35_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a7650a53e4c196af91270fce1a6523760e6a034d865c47cd56b761835094c52 |
|
MD5 | 8ba550880240efc9f8f6cfff1b97bd5b |
|
BLAKE2b-256 | 2ef8a0ceab125f44d05e41aa8f7716f969cc7bcb740b498fc260b531103694aa |
Hashes for pyqrack-1.30.11-py3-none-manylinux_2_31_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fabfefffccf60e3c3e6a5f87f83deaf7610ff51634c8e44ab883ea0a7a2a05dc |
|
MD5 | 498a474482feaaa1fb9b7e955362ffed |
|
BLAKE2b-256 | a6439ea75fcec23bb3fa4f435729edac59f324ca6fa6fd4188d0a2910e345178 |
Hashes for pyqrack-1.30.11-py3-none-macosx_14_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca8655aefc89b91d9c54014168e9b33ca23934fb2b982b890220fb88423db8bc |
|
MD5 | 2c88a8dca172ef82f29f7cc358819908 |
|
BLAKE2b-256 | dcacd5d6a7ccba44b71796c67d18042cf6ee7f11060eece25a5842201c2a1ecc |
Hashes for pyqrack-1.30.11-py3-none-macosx_13_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ade2a9041b181bb47d9d46fc6cc4c75f6051f67db632aec791e13ba8a22f0443 |
|
MD5 | edc2bfbdfcd6d674e4dce3f4c97cd625 |
|
BLAKE2b-256 | cce6e53a48579de6a908d6b11d8e44d5362d6793179e7f1a63135d623ef17a43 |
Hashes for pyqrack-1.30.11-py3-none-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42b65a202af50c03e647b5e6c704fa1996002e4c38bb5907c1187fcef2d6732c |
|
MD5 | 372f23dbf3e9c7e7bc0ee22b94d11010 |
|
BLAKE2b-256 | 038b527afc089f870c6c427918398075dffe7c699bd98b2796f1af2586979aef |