Skip to main content

pyqrack - Pure Python vm6502q/qrack Wrapper

Project description

pyqrack

Downloads Downloads Downloads

Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator library

(PyQrack is just pure Qrack.)

Note, if building from source: You must build and install unitaryfund/qrack to build the main branch from source. 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 unitaryfund/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.

For custom Qrack build floating-point precision, where options are half, float, double, and quad, set an environment variable via export QRACK_FPPOW=[n] (or as appropriate to your shell) where [n] is the logarithm base 2 of the number of bits in the systemic floating point type (4, 5, 6, or 7, with 5 or float as default, i.e. 2**5=32 for 32-bit float).

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

Uploaded Source

Built Distributions

pyqrack-1.32.11-py3-none-win_amd64.whl (868.8 kB view details)

Uploaded Python 3 Windows x86-64

pyqrack-1.32.11-py3-none-manylinux_2_39_x86_64.whl (2.7 MB view details)

Uploaded Python 3 manylinux: glibc 2.39+ x86-64

pyqrack-1.32.11-py3-none-manylinux_2_35_x86_64.whl (2.7 MB view details)

Uploaded Python 3 manylinux: glibc 2.35+ x86-64

pyqrack-1.32.11-py3-none-manylinux_2_31_x86_64.whl (2.6 MB view details)

Uploaded Python 3 manylinux: glibc 2.31+ x86-64

pyqrack-1.32.11-py3-none-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded Python 3 macOS 15.0+ ARM64

pyqrack-1.32.11-py3-none-macosx_14_0_arm64.whl (1.5 MB view details)

Uploaded Python 3 macOS 14.0+ ARM64

pyqrack-1.32.11-py3-none-macosx_13_0_x86_64.whl (2.2 MB view details)

Uploaded Python 3 macOS 13.0+ x86-64

pyqrack-1.32.11-py3-none-macosx_12_0_x86_64.whl (2.1 MB view details)

Uploaded Python 3 macOS 12.0+ x86-64

File details

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

File metadata

  • Download URL: pyqrack-1.32.11.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyqrack-1.32.11.tar.gz
Algorithm Hash digest
SHA256 f9ef288aea1e4ce5aa2ff24e005a290fd0d284d64c10d8c6cde336e7a9b2f633
MD5 08d20d88c5186fa8c9c1ae2a205fec2e
BLAKE2b-256 c0db282fe213407c6e398dc54e34b75e38713f38768138202a841ca279a755a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.32.11-py3-none-win_amd64.whl
  • Upload date:
  • Size: 868.8 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyqrack-1.32.11-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 74573283ab523d344b6dae5d76508d6372b5d03226d9bdb86bcb61314ab4335a
MD5 4a120b753a7deeb1c30237a47d5ad76b
BLAKE2b-256 a9f2a6550310e0980b49ae232d2470ce7c4c31fc857c905848c70f826683c387

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.11-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.11-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 4f4ba49dfd708f3e7955d3a3910144bc5db2d8d9b8c11c422be12e9d308cb6ed
MD5 a8b471087bc3b523da8cf9949a682833
BLAKE2b-256 e800d6164c9b2c4af519c3b7ae79b8b27f0be644ecb2adeb45db87b62e2ceee0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.11-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 2cd89e3438e038f3335878b1062951efc917f5d7552011d263ffa11c299ed7ec
MD5 3aa00035ad1713365e4316f23e474c04
BLAKE2b-256 67a01b88abcee3088efbe842ca98ff4aa000f37296c6f3c090a349dd19fc163d

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.11-py3-none-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.11-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 0e3664b3fd0c4de9c7a7bd2ce47e17e446ff6e03b8ca17b62217c6d9f382d864
MD5 8b44239757e3e729f778484ac6dbc3a9
BLAKE2b-256 05097e6869046c5267de6992875415fc429fe47f0a4678899806a6b49fa57215

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.11-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.11-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d59cc0e300c5f11ba715668f1d89c90d3682040cdc42ba8a2d8bd3bc493e29ad
MD5 71f1a5b63a2ffc195980ef5bc7dc6cd5
BLAKE2b-256 3f844f44df2f154c7134097c7040e9c5940c8cb6e3643d2c227455a4b02318e1

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.11-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.11-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4ec651c51f14872bb614c4678b5079d48a48eb006ec26650fe161b992f4ae502
MD5 eb9870a8af9cb8e7b26bcc8c11372c26
BLAKE2b-256 42ca597b1c7a03a94a7e19f0e0fbc7b057fd5672ec0a859b699e77bff51b7dfc

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.11-py3-none-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.11-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f24a0b9ea480f7641471661bf01b2bd77e5ab5b4dc93330ccdd5a7cd0ee06d9b
MD5 d37c6b81cdfb2d36247c802c70be5d54
BLAKE2b-256 43d12d107f6020a9935856882f01474fc3c25b646a0e2143c7f8802d86e2982f

See more details on using hashes here.

File details

Details for the file pyqrack-1.32.11-py3-none-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.32.11-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 3c547895de7ef67f7a19e7290d65b0af634c6603fee2c365a2babd9f730a1a88
MD5 8422cf499211aa44b80067349ed3d15b
BLAKE2b-256 55239415e2440ee4093ad0c821223b5b90c78037756e67ad9f21623836df3bb4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page