Skip to main content

pyqrack - Pure Python vm6502q/qrack Wrapper

Project description

pyqrack

Downloads Downloads

Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator library

(PyQrack is just pure Qrack.)

To use this package, it's helpful to be familiar with vm6502q/qrack. Users gain much more control over options by building vm6502q/qrack and vm6502q/pyqrack from source. For advanced users, building from source is the intended primary method of PyQrack package distribution and use.

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.

The package installation directory contains a qrack_cl_precompile folder with executables for supported platforms, to compile OpenCL kernels once, beforehand, avoiding the need to recompile "just-in-time" every time that you load this package in a Python interpreter. If you no longer want to use precompiled kernels, or if precompilation fails, just delete the ~/.qrack directory, or the equivalent .qrack sub-directory in the user home folder of your operating system.

To load the required vm6502q/qrack libraries from a different location, set the PYQRACK_SHARED_LIB_PATH environment variable. If an absolute path is set for this variable, it will be treated as an absolute path. If a relative path is used, the pyqrack package qrack_system directory is the root.

PyQrack v0.4.6 adds 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.

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyqrack-1.11.3-py3-none-win_amd64.whl (4.1 MB view details)

Uploaded Python 3Windows x86-64

pyqrack-1.11.3-py3-none-win32.whl (2.9 MB view details)

Uploaded Python 3Windows x86

pyqrack-1.11.3-py3-none-manylinux_2_35_x86_64.whl (4.4 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pyqrack-1.11.3-py3-none-manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded Python 3

pyqrack-1.11.3-py3-none-macosx_10_4_x86_64.whl (3.4 MB view details)

Uploaded Python 3macOS 10.4+ x86-64

pyqrack-1.11.3-py3-none-linux_armv7l.whl (3.8 MB view details)

Uploaded Python 3

pyqrack-1.11.3-py3-none-any.whl (26.7 MB view details)

Uploaded Python 3

File details

Details for the file pyqrack-1.11.3.tar.gz.

File metadata

  • Download URL: pyqrack-1.11.3.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pyqrack-1.11.3.tar.gz
Algorithm Hash digest
SHA256 fca609b661b3304a772a5b4179637ff5ea524d144c2d483340e46a29622fe049
MD5 6d63dbbaaed0b8b2e38f478b7f6438f3
BLAKE2b-256 a700ed3e7e94bf960ff5a798a8c563d3b1e941ae821be3a03b3e6d0340925f16

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyqrack-1.11.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pyqrack-1.11.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 451ace7c70a6402207b437bbf2366b9396dd94de94ff6f025658812bf79678d6
MD5 23e738eafe4cbfaf5f273f2687482d72
BLAKE2b-256 0adc216ab5436393eda28faa1b74c568ffb9166f869b875dfe0b93ff04484e97

See more details on using hashes here.

File details

Details for the file pyqrack-1.11.3-py3-none-win32.whl.

File metadata

  • Download URL: pyqrack-1.11.3-py3-none-win32.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pyqrack-1.11.3-py3-none-win32.whl
Algorithm Hash digest
SHA256 e4e7bf328296f92181ae15e9614c23be76c16b34168e732f70682ca5aecaf4d9
MD5 7add3012bdeee23cf46a648d4a626246
BLAKE2b-256 7d5c13593e2de25b39d384e26ef8dfb445b483da4f1125d2d47884b2f7731892

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyqrack-1.11.3-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 dbd7046c1ab6ba58c9513f8b99e8ec6fcab27eb24c18a5cf2c4492860041b87b
MD5 7941c9fdbb8ba728281aa119a2ae4279
BLAKE2b-256 4e0317b2dda7b15488689eaf73e31f2218826ebf5db6317ef0d551048c63b186

See more details on using hashes here.

File details

Details for the file pyqrack-1.11.3-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.11.3-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 77466c18f18c640415216f815ac0da67a328fcb733dd6375295c2cbcb5277adc
MD5 2e153334019b8bc908b0132649577fe6
BLAKE2b-256 2e77c07263424d093856d81345a4c9bd11a8a0d7ae17423a76553c6ec55b46ae

See more details on using hashes here.

File details

Details for the file pyqrack-1.11.3-py3-none-macosx_10_4_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack-1.11.3-py3-none-macosx_10_4_x86_64.whl
Algorithm Hash digest
SHA256 2e004e67a1bf904d4278d9a452ba041acb16188866cb336e1aff6a23ff466fe8
MD5 0d9ac9a8abcd66cc64f0e673c0efd75d
BLAKE2b-256 475b9c47f482b9a23a71d03d77caeca27df9a4e09a3b9c7f34e003029660e900

See more details on using hashes here.

File details

Details for the file pyqrack-1.11.3-py3-none-linux_armv7l.whl.

File metadata

File hashes

Hashes for pyqrack-1.11.3-py3-none-linux_armv7l.whl
Algorithm Hash digest
SHA256 288ec9d3419d378a6ed5bb5ebd1e750dc238f4bf46501fafb0c4642809f634e4
MD5 a7c37dd0f966374f8afc44a0d65cfb1a
BLAKE2b-256 221050ad8de09bcb4de77ba698f7ab5cb6e147a27f772782f9d4e7f42db1c63f

See more details on using hashes here.

File details

Details for the file pyqrack-1.11.3-py3-none-any.whl.

File metadata

  • Download URL: pyqrack-1.11.3-py3-none-any.whl
  • Upload date:
  • Size: 26.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pyqrack-1.11.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5a97b37879baeb198cd14927c3f37200935215dfa00c3952e205d77a7a92fcca
MD5 6b208e2243b39f8e43ba1d76c39afb89
BLAKE2b-256 3104c0a5efccdd31236134d62513ca3fa8a2401777800925467e71ee942e64e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page