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

Uploaded Source

Built Distributions

pyqrack-1.32.20-py3-none-win_amd64.whl (867.3 kB view details)

Uploaded Python 3 Windows x86-64

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

Uploaded Python 3 macOS 15.0+ ARM64

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

Uploaded Python 3 macOS 14.0+ ARM64

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

Uploaded Python 3 macOS 13.0+ x86-64

pyqrack-1.32.20-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.20.tar.gz.

File metadata

  • Download URL: pyqrack-1.32.20.tar.gz
  • Upload date:
  • Size: 34.0 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.20.tar.gz
Algorithm Hash digest
SHA256 ed24050d641163d44edded0de04abdbdea718d2fe8474867ae8215fa5ed142f2
MD5 04028aec53aff4c9960aafa807d29831
BLAKE2b-256 a3cb5166301f2e5b67849789221d5d73148b7023143209cf6d8dec69e3c8b902

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.32.20-py3-none-win_amd64.whl
  • Upload date:
  • Size: 867.3 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.20-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 30670540c074b77a857573e460b307d2aa8beff19a0dccec8fee9d7ff0050c8e
MD5 bf27b0505db1d28a9a8196ac921feeea
BLAKE2b-256 231b570860f6b3044ff439453aa8f61be942218ff4464c258ea748418016c535

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.20-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 8d4f33176f984d1c6eb25b93296007967d2a60dba6e84df13ad1bea30f2aca77
MD5 401ae212de3ee311afebc44c5e897b0d
BLAKE2b-256 b9074e3cff540c422e6b32bfad63f35ba4abfdedc3f7e5b25fc2d85fa392ec2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.20-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 c5e006be9b20373015f4ec8a2cd3179971039dfe36d440a31fe14e9e200c94b5
MD5 e6f5574416da6c2e361b08c6c9c7d965
BLAKE2b-256 83956955b59eb6734a073fe28561c8c37dfed3f50b2b05b53a2116cbc906a293

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.20-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 42a864778df392aaeae4beb92537ab19e7c18b450770aca7e31c6ea20ecd9d7f
MD5 84c4df4af645cf639f0a04ee2186d707
BLAKE2b-256 b7fbeebf1a830fe0711fae681a3027161948f877f707ccd4e63be4352b3816a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.20-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 51ff8cd136ced38dfba26891a589c9c8fba21d00e7722cd6047820adf21ef655
MD5 a99b4aebecdad04d0fa547cc7b34f695
BLAKE2b-256 3e9f84af771d8971355535df7b8d5df9642283593da0b86f0861029cc770013f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.20-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 632ee98d05b92214c04cbb76609f2f305572ba2be713b6606558925e6c655d23
MD5 509976b0da90c32bf2ea687f920dcc17
BLAKE2b-256 36b17f32b32c5c6bd9850843fcebe3add065f9d15028381f3bfaa87be3d1cb01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.20-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 593eb0a5496283b3a59aee2d11e66e302eedea5ce22cd39bf9e60e8f89aa15dc
MD5 90cef1f32bfd62ed4c3a3859bb033e71
BLAKE2b-256 72c8772f55afdabe815d71f4c854654b59ae7e2558742f31301869f77c0ffc76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.32.20-py3-none-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 fcae6c8f496184c4ede123ff6868ea8bb21d39312d57e46e92c0fdb60d61060c
MD5 3cb302a2bff6964e68ab8c57246fc737
BLAKE2b-256 f78466b3ec1611562aedb937f79e3da39da0eec900464eb714f95b0f5302f80b

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