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

Uploaded Source

Built Distributions

pyqrack-1.32.14-py3-none-win_amd64.whl (866.5 kB view details)

Uploaded Python 3 Windows x86-64

pyqrack-1.32.14-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.14-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.14-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.14-py3-none-macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded Python 3 macOS 15.0+ ARM64

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

Uploaded Python 3 macOS 14.0+ ARM64

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

Uploaded Python 3 macOS 13.0+ x86-64

pyqrack-1.32.14-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.14.tar.gz.

File metadata

  • Download URL: pyqrack-1.32.14.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.14.tar.gz
Algorithm Hash digest
SHA256 715c63eca021b3de3a9ca233f956ff855255fa5eeb4bc7415e953c63aecd339d
MD5 5f122f5f6da5f75f22c9fd39c7aade02
BLAKE2b-256 ffb2b09bbf59614d386af09793a7253d87a7ba6d93bae999f1274d24a732a0f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.32.14-py3-none-win_amd64.whl
  • Upload date:
  • Size: 866.5 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.14-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ad2309d2e5f7de05167a113183253bc691aa3eb5128a39fcf39fd3a840174e92
MD5 e3ac8744c5ca88afaa4a0e46bb78cca7
BLAKE2b-256 5e62373083cf564d8aac2698316d26e6972ab849add82f9341aba1b5fcb0e27f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.14-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e2c451bb5b31ec38c27614017e7b4e6228af0d65850bd868ed95fd3c0075480e
MD5 4c8cd3087fa8d2793609cf2d88795150
BLAKE2b-256 256aad0ffb4a0da8e50ef5dad241dd3c1a7959ca7110569eea454ba7dc3cf16b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.14-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 ecc71734ecccafa5336021b8635709f7de2aba18035c0b1a1708595e08225769
MD5 c23892e5ed9e59e3f2d75d631f78a6fc
BLAKE2b-256 2bc09f124e48b8210c37f2d6ac35cb60642c16986e58794dadfaa6117220cfe6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.14-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 dbc4119fbbf3497155094ab56033d4ee4b3045cd7fe799a948aa46ebcb6510a8
MD5 3b729ff0ce258b8a9da193ca99d4c415
BLAKE2b-256 f0aff9fd18b939df8e00dd14287c66b784e82adf23aa2a25e4d246f38217108c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.14-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 35757933bcc4cd39651e524793a5abfab4864894b952a6106f610e34a12d8ece
MD5 0917c21ced4fa14ef9aa4d5ce84fda5c
BLAKE2b-256 86e637be9a26086aa45cb7ddc13d6de21b5eefe29c29cb6a07f23641963a84a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.14-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e2fa446158da9fe86f273b1663726225413200fe5309b124f5c5c97f28b17332
MD5 b6282a23b5bbcb1f6cbba0cb9cb1e56b
BLAKE2b-256 4e019bd38f0b0238e85f070095404df8038cfb54211c8573fc092109f7d986fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.14-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4c2299545c65e62393fa528e5f923a55834cfe49b47794afba18d960925493dc
MD5 6fb281d54591ea3f5549fd4e0598d98e
BLAKE2b-256 3c6924ebc44323d9bc6589606f56632a0bc0d485aa934c469b3ad53ad727ece1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.14-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 eab5fcaa90bbd8cb9d2285f677b9bb3ca77a7b3138ffbe5f2cc0d23b81d8bf4f
MD5 6adb5690a3c2c314b174c9a345a298f9
BLAKE2b-256 33f0998470a182683f7d4d3545a9c3351fed16b961b0374b305ac872788c98f0

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