Skip to main content

pyqrack

Downloads Downloads Downloads

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

(PyQrack is just pure Qrack.)

This is the purely CPU-based variant of PyQrack (with module name pyqrack-cpu). This alternate build of PyQrack is provided so that systems that won't use OpenCL or CUDA anyway (such as because they lack any GPUs or other accelerators like the Intel HD) do not need to install the OpenCL library in order to use PyQrack. In this form, both the PyQrack module and the underlying C++ Qrack library are entirely external dependency-free.

If you're looking for Mac ARM support, use the package pyqrack, not pyqrack-cpu. Mac officially "deprecated" OpenCL years ago. Hence, accelerator support is not included in ARM-based Mac wheels, and OpenCL installation is not required on these systems, but, if you have a CUDA accelerator on ARM-based Mac, you could try the package pyqrack-cuda instead.

Performance can benefit greatly from following the Qrack repository "Quick Start" and "Power user considerations."

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). Your Qrack installation floating-point build option must match this specific value, which might require a custom Qrack build.

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, Or Golan, for CI build pipeline tooling, and to the broader community of Qrack contributors, for years of happy Qracking! You rock!

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyqrack_cpu_complex128-2.11.0.tar.gz (66.2 kB view details)

Uploaded Source

Built Distributions

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

pyqrack_cpu_complex128-2.11.0-py3-none-win_amd64.whl (831.3 kB view details)

Uploaded Python 3Windows x86-64

pyqrack_cpu_complex128-2.11.0-py3-none-manylinux_2_39_x86_64.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

pyqrack_cpu_complex128-2.11.0-py3-none-manylinux_2_35_x86_64.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

pyqrack_cpu_complex128-2.11.0-py3-none-macosx_15_0_x86_64.whl (2.1 MB view details)

Uploaded Python 3macOS 15.0+ x86-64

pyqrack_cpu_complex128-2.11.0-py3-none-macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded Python 3macOS 15.0+ ARM64

pyqrack_cpu_complex128-2.11.0-py3-none-macosx_14_0_arm64.whl (2.0 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

Details for the file pyqrack_cpu_complex128-2.11.0.tar.gz.

File metadata

  • Download URL: pyqrack_cpu_complex128-2.11.0.tar.gz
  • Upload date:
  • Size: 66.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for pyqrack_cpu_complex128-2.11.0.tar.gz
Algorithm Hash digest
SHA256 491e3105b6d0057dc6283d20209e994722558f46682f27348b3b92ceeb964bd5
MD5 742a8f4234293663b91d05ca010acb67
BLAKE2b-256 f70f37c1af88984cf05eb9e74462b74dd5f53774734b4792b0b9f4965475a743

See more details on using hashes here.

File details

Details for the file pyqrack_cpu_complex128-2.11.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for pyqrack_cpu_complex128-2.11.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ffdb5183dc8e57ffbaeeb6443eb45088a4406d9640c4226debbd02d0164ae584
MD5 69a392b2c26c42c1029f7058829ef934
BLAKE2b-256 db8e00c01305f71a18d6655ba2d85546fe5c599aef1a7aed9835c4cb04aa7a52

See more details on using hashes here.

File details

Details for the file pyqrack_cpu_complex128-2.11.0-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack_cpu_complex128-2.11.0-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 50e41a9c8d8f66409e77aef43f075c52b8e10a51bdaecd971f19399cc28f94b9
MD5 a4a73b60b8fc68e1180c12ecaef16a47
BLAKE2b-256 32d233a8689b0301e93b38e57e1d2f70c041f2cc31a275aec60d95d9e1601c11

See more details on using hashes here.

File details

Details for the file pyqrack_cpu_complex128-2.11.0-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack_cpu_complex128-2.11.0-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 201c3f22650620a0577b3f072a9d7ae6f08ed9c7b486581530a6ddfde8952ee0
MD5 e2d5b348142838980b08b336aa09ef2c
BLAKE2b-256 e31b824fcc3ad68fff5bb738ee2c663c7f5795906b209404825b80ac30ce51d8

See more details on using hashes here.

File details

Details for the file pyqrack_cpu_complex128-2.11.0-py3-none-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for pyqrack_cpu_complex128-2.11.0-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 978a0e5899ab5c5d3e5e87da8d15bd938c487683aca3ff1804d1f0ca302ba57b
MD5 f4cb13de70f8a9c6f4be0f5fc7526dbc
BLAKE2b-256 b091677eabff4d5e59b132687afd82fd7552f511ff37ed9b175377cafb2dbf29

See more details on using hashes here.

File details

Details for the file pyqrack_cpu_complex128-2.11.0-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrack_cpu_complex128-2.11.0-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8a04fcbf45cfdc43526be1cfd665b93271a8e39d01fb90104586bcec8db4d60b
MD5 392a1c3193c9e386bfd08081005cfd10
BLAKE2b-256 2eccc1d5380420cb691935e4832cb51d1f69c2b6d4729c48e61d2e94a8902562

See more details on using hashes here.

File details

Details for the file pyqrack_cpu_complex128-2.11.0-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pyqrack_cpu_complex128-2.11.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0006372ed123a1eb5e85070fd632ac6e5ebb06010cef83bd8fb142e772a19ba6
MD5 b49a9000b82f6952c56056ac86771a07
BLAKE2b-256 de24587146758e97291c58dbddb7377b9b12128d7005b06dd7e1266db312f83f

See more details on using hashes here.

Release history Release notifications | RSS feed

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