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

Uploaded Source

Built Distributions

pyqrack-1.32.10-py3-none-win_amd64.whl (864.7 kB view details)

Uploaded Python 3 Windows x86-64

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

Uploaded Python 3 macOS 15.0+ ARM64

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

Uploaded Python 3 macOS 14.0+ ARM64

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

Uploaded Python 3 macOS 13.0+ x86-64

pyqrack-1.32.10-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.10.tar.gz.

File metadata

  • Download URL: pyqrack-1.32.10.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.10.tar.gz
Algorithm Hash digest
SHA256 0b3ca1db7ac75a2f37ac7f863e78584226281b888dc557d0ea68e2c917b63d03
MD5 34ec2315a5d9decb104462e25b375eeb
BLAKE2b-256 f11e14960ba88b5cc88c17e06fdd74f48c8f1a266a69f413edaa1f5ce42bba81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.32.10-py3-none-win_amd64.whl
  • Upload date:
  • Size: 864.7 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.10-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 61f7b5a825c6c55e76be0527d60dd56fa42e86a2e57793446b284db1495ba1e8
MD5 461248a3cf771092cc70761999a2d400
BLAKE2b-256 fb26afec3b82f4e19e35a500d9ef9c6e3afbaa0cc605d0f08847161a08db4f0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.10-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a17618333d14c6f2120431aee0225c728c6e9064ff2de65f30ee327b23cf98cd
MD5 e2ac8897901c964a8cf0058c901d8a9f
BLAKE2b-256 c8cebf4b58cd0252567bf68ea0850ee9cb69d68969e02a285e80587473fce027

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.10-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 f11494c8ddc332be54f8d4c621b986be7a276f1612e174ba8e8c98bf5e713d20
MD5 e636fb86c5efa1d6daa8a1ed3ecbade7
BLAKE2b-256 562e70c74f312d3691348fd18a815f5ec3946b798c153f488fdc6b3c6bed60a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.10-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 7396b6ce17e9cbdc3d3c9c8782f432cee45f347183cbbac6b3d1f7c73788ce0f
MD5 36bbda7c099222563fca4696a8a81543
BLAKE2b-256 150fe09643b709fbb72d3ddf85b0255b192cbffe70935398a36bef62f3f7d9a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.10-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8d846cc13f829cced80d8127aad5df92b7a020c23cfd69b6db195412501f9fa3
MD5 5ce1c607e6127de0083d24d8182eeddb
BLAKE2b-256 540c0d0241122b36041af628faa2edf7f6db2533e8b44a3f6e681b67800fa405

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.10-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 67e9e66fbcd1a59a5cfe7934797f12d6856bc8f8b71700cadce1ad2b6b599c19
MD5 73ee285749b83b7e6eba292547a64986
BLAKE2b-256 af88c2e4a9c08da6049ba5375c56c51d80e474a07b8ceb65c41ac6acc68c630d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.10-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 dc5ee1ee6158937c9e89dc15d610fbb615d1eb510a84cb44c4c995a244eb62f6
MD5 a4db78c283d10b8300c0d929e847923d
BLAKE2b-256 1a5a991afdec275e0e0bf63125246f08cfc6602db365807d061879ec4690ac4e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.10-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 707d7197b8a2034f3e4975c444adfd96e79912cab09ae6710aedb8d71f7c3ad9
MD5 d0e5b796b15c0fc22e62cfbb2ed24cf0
BLAKE2b-256 b10dd9b29e8599ff94423b596017735c63be331305094d0f08fb184d7092787e

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