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

Uploaded Source

Built Distributions

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

Uploaded Python 3 Windows x86-64

pyqrack-1.32.12-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.12-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.12-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.12-py3-none-macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded Python 3 macOS 15.0+ ARM64

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

Uploaded Python 3 macOS 14.0+ ARM64

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

Uploaded Python 3 macOS 13.0+ x86-64

pyqrack-1.32.12-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.12.tar.gz.

File metadata

  • Download URL: pyqrack-1.32.12.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.12.tar.gz
Algorithm Hash digest
SHA256 1621553721aa18c99430c74f88685aa01c78066edb8d098b00ab42380e4c71de
MD5 33d974fc2626909907a90125d82ae252
BLAKE2b-256 7777701207fc8ca9366a6437d718f95b6438550dc16f685c7c86bca338647222

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.32.12-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.12-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 79936b63746b255ded1761067af44e3ae0a017308ff4cb2a1cce9064e8537456
MD5 e088a3fac1a132ffdcfb9043ee706c4b
BLAKE2b-256 172610ecdad650c73de3e464a2200c5a27fb9c69aaa84a6d321ddebe18b2d305

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.12-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 cb6615b692a0dfb31b68f57175d8654edd34cd8e978c1cf1aa0400a139c1d1df
MD5 c09923eee1898fd70cea047af3f82f2c
BLAKE2b-256 f01f6e7539501e17417bae4a0461267f29efe79f61da5735f95d9b7edf08778d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.12-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 635e96e365b3763876e7ca1cb93b96a0ff7265a94dc20935df2d79b7adee608b
MD5 d941dadd6f1d590e79e69df6501cfb33
BLAKE2b-256 b46b98e42f0b7d4eac4cb057011a5cefd729592d64df24476fc1fc2c5de12bcb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.12-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 b2ac1081d0729cafc6e857d890e5dbd4e6e794f2e399eaaddeaeebacb26f6b0e
MD5 5d5674e3bf9dba15b8f9a844b1fa9576
BLAKE2b-256 4f817b990ba6fe9559a216053c01278b6ea57ffc711f8a8fe829041b6862e948

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.12-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 59220871acf0267b09c7f409df699c6290be253b24f597d6094771157fd0d204
MD5 611fa1003f87316fb282464e99939d14
BLAKE2b-256 a631bf04d972112b8a85c5d55ee41d115e96a159eda763eeeb6feae4c2fa179f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.12-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6e350cb07221c8a29992151e8535bdc74c40f4a1b871c430d3720534d3e2d8f9
MD5 5aeb3e16e4f46445883521a195cd5102
BLAKE2b-256 55ececfb09fd36687cbf54f8f63c982f39e9f81876b30b2cea3d62a402e6f078

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.12-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 06412d4c8f8c0cf94a8bb5ee0ad314f7ea960cc21fe01738269f6db422c3d08c
MD5 4f6bd2bcef4ef7e02ce866a98d01b487
BLAKE2b-256 d3973b4705877c36429ca457d2ba3e5dd44fc7519f3e4e80ec34b1e995c976be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.12-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 d453059089101641f504168cabedb73eda65fb2d069c392aedac7d16fccf4543
MD5 8b5d8365d330a0a9a37fe31ab850b37d
BLAKE2b-256 995b86802abe4852694b871a5e965dde44de53dc81ee7d20c56f7ccb22d6e811

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