Skip to main content

mimiq-exaqt (python wrapper, rust core)

Python bindings for exaqt-rs — a SIMD-accelerated state-vector quantum simulator. The distribution is mimiq-exaqt and the import package is exaqt; the native module is exaqt._core, whose public types are re-exported on the top-level package.

Install (release wheel)

Wheels are published to the project's GitLab PyPI package registry, built on each v* tag:

pip install mimiq-exaqt --index-url https://gitlab.qperfect.io/api/v4/projects/<id>/packages/pypi/simple

The wheel bundles the documentation. Read it offline, without a network round trip, with:

exaqt docs                  # open the bundled site in a browser
exaqt docs --print-path     # or just print where it lives

Install (development checkout)

From this repository, with maturin and uv available (the Nix devshell provides both):

cd exaqt-python
uv venv && uv pip install -e ~/Code/mimiq/mimiqcircuits-python pytest numpy  # needs mimiqcircuits>=0.26 (newer than PyPI)
.venv/bin/maturin develop --release
.venv/bin/python -m pytest -q tests/

A maturin develop build does not build the docs, so exaqt docs has nothing to open. To produce the wheel exactly as CI publishes it — documentation included — run python scripts/build_wheel.py instead.

Quick example

import numpy as np
from exaqt import ExaqtSV, Rng

sv = ExaqtSV.zero(3)
sv.apply_h(0)
sv.apply_cx(0, 1)
sv.apply_cx(0, 2)
print(sv.amplitudes())          # numpy complex128 array, length 2**3

# Multi-qubit Pauli expectation (no need to build a 2^k × 2^k matrix).
print(sv.expectation_pauli("XXX", [0, 1, 2]))   # +1 for the GHZ state

# Sampling.
r = Rng(seed=42)
shots = sv.sample(r, nsamples=1000)             # shape (1000, 3) uint8

mimiqcircuits integration

import mimiqcircuits as mc
from exaqt import ExaqtQCS

c = mc.Circuit()
c.push(mc.GateH(), 0)
c.push(mc.GateCX(), 0, 1)

sim = ExaqtQCS()
result = sim.execute(c, nsamples=1000)   # returns a mimiqcircuits.QCSResults
print(result)

Conventions

  • Qubit ordering. Qubit 0 is the least-significant bit of the basis-state index (matches Qiskit and MimiqCircuitsBase).
  • 2-qubit gate basis. For apply_gate_2q(M, q1, q2), q1 is the most significant bit of the gate's local 2×2-bit basis. See the Rust crate's docs for the precise layout.
  • Cross-language reproducibility. The same Rng(seed) produces the same Xoshiro256++ stream in the Rust core, the Python wrapper, and the Julia wrapper.

Errors

The wrapper raises Python exception subclasses of ExaqtError:

  • GateShapeError — gate matrix has the wrong shape or layout.
  • QubitIndexError — qubit index out of bounds, or duplicate qubits.
  • DegenerateStateError — sampling a state with zero / non-finite norm.
  • NonUnitaryError — only raised when the Rust crate is built with the unitary-checks feature; flags a non-unitary user matrix.

MemoryError is raised for state-vector allocations that won't fit (e.g. ExaqtSV.zero(40)) — instead of aborting the process.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

mimiq_exaqt-0.2.0-cp310-abi3-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.10+Windows x86-64

mimiq_exaqt-0.2.0-cp310-abi3-manylinux_2_34_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.34+ x86-64

mimiq_exaqt-0.2.0-cp310-abi3-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file mimiq_exaqt-0.2.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: mimiq_exaqt-0.2.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for mimiq_exaqt-0.2.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9fdc82777b79c166bba06103d245b8ed30df82c203e45635ffb747d32296e487
MD5 872bbcc3bff8cbb9a04750715d985f30
BLAKE2b-256 2ca60e2f0a0d43284bf7f135acf63751fcfe4bcf845c384b525887b8baadd56c

See more details on using hashes here.

File details

Details for the file mimiq_exaqt-0.2.0-cp310-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for mimiq_exaqt-0.2.0-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 25fe6be9473648ef9a9c132749801811ff460d112fda6fa194de763fbd725836
MD5 e47cb60a2d3f7c1a0e9a40cfaf59a513
BLAKE2b-256 a0b01d9a8d77d0321f32e5ac15893e19da262b27b260fdd3c079630517b055f6

See more details on using hashes here.

File details

Details for the file mimiq_exaqt-0.2.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mimiq_exaqt-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 17a61741b6cfa4ef830836140f6d96f68bf37c4a342548e08dcfa1fa94cd7e04
MD5 e06e31262ff0636abbdbdb356dbeae27
BLAKE2b-256 e04305a439cc1052aa231bfd92629e68848fd9ab16af66ad809bf37699c2cfea

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

3 files

This release

0.2.0 This release

3 files

Supported by

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