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

Uploaded Source

Built Distributions

pyqrack-1.32.17-py3-none-win_amd64.whl (868.0 kB view details)

Uploaded Python 3 Windows x86-64

pyqrack-1.32.17-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.17-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.17-py3-none-manylinux_2_31_x86_64.whl (2.7 MB view details)

Uploaded Python 3 manylinux: glibc 2.31+ x86-64

pyqrack-1.32.17-py3-none-macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded Python 3 macOS 15.0+ ARM64

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

Uploaded Python 3 macOS 14.0+ ARM64

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

Uploaded Python 3 macOS 13.0+ x86-64

pyqrack-1.32.17-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.17.tar.gz.

File metadata

  • Download URL: pyqrack-1.32.17.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.17.tar.gz
Algorithm Hash digest
SHA256 8ff88c5fde1191aeed9cd1faef72f64c4e6dffe1d3005578f1f7734e4daf5c01
MD5 eff30683b4b876efec402bd96cc314c8
BLAKE2b-256 9fb490815eb105a19164b841f9b285adb7526528910a8000f8dba0d307ad600c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.32.17-py3-none-win_amd64.whl
  • Upload date:
  • Size: 868.0 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.17-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 797990833a9612be1c87947a1eac7a76d2e011cabd52883ab76b63e44d515d41
MD5 4756744f224b9a91c723d0e26d28c14c
BLAKE2b-256 87c6a15fcbca135d405222e83e2e22e9cbadce0340137b450b83fc2b6e6becc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.17-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 52ca44225107b32e9ea97408636a2e9c20acb26f753705e446c834ac7ffcd5de
MD5 a7b715320555dfcd7115e85c54f745cb
BLAKE2b-256 3383978039e120ecbc7e663492d8ee833a534ac17e14040d02e284d6ac647e7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.17-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 90cdffefab6f23a30b8dd24a60c2cdd1388b95200ddc5a9e66a4b74f2c7ae245
MD5 64f7cf8eaebfdbe486dab1652260fc4c
BLAKE2b-256 83993559e8afa6271f1c807355c739c2152df5a8adb6d9339010e0e032043e9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.17-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 f9a836c54bcd9536027482b7bc11057050cefb329ae709bdcd76265a687587e5
MD5 c02f5b1b12059d6e37beddd7b212c226
BLAKE2b-256 7f0c57ce7677792dc661babde14263adb09b1e31ca13ca02e89485d8e0748bd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.17-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6846d18f252147b257d44284ba680e70723b6a4686b2cf229cfa7d5a98a13702
MD5 2162dc342a4afee5b3a5f2761efdd417
BLAKE2b-256 7d4a004ee5083161666269ee34be2a13d4b0920a7e9bfbac735dfd6fc340e182

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.17-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 22d3ba5de4cd5a3131bbaaccfe7d52bda70450e5a17738bcaa5126aceae011b4
MD5 cc3cd936af81981129b487baa5e7f916
BLAKE2b-256 71f67e711c7505a2de99b3f9d41a6980d720a45ecbed28741de54aa5f5acce6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.17-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8f48363c52ef4e3e277901410e840151063f016b1634bf96c81ff997488b6eca
MD5 2ed5cd8025a887ce0e92f2d9afd03ff9
BLAKE2b-256 6f409f2f7c3232918cbc2622e03acb4a917549eb1a106d1342ea02935717063e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.17-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 74e4460168c1ebdd88872481371ecabe4147d72d0c5dca9ca0da71c3782539ac
MD5 800afcb4352d70f573b5a967ad1da727
BLAKE2b-256 dc7a049a2f1504faf2a7b2160886e7f76af25814e7f9a35837194d0e8db2b3f7

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