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 PyPI on each v* tag — one abi3 wheel per platform (Linux x86_64, macOS arm64, Windows x86_64), covering Python 3.10 and every later version:

pip install mimiq-exaqt

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 "mimiqcircuits>=0.26.2" pytest numpy
.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.1-cp310-abi3-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.10+Windows x86-64

mimiq_exaqt-0.2.1-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.1-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.1-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: mimiq_exaqt-0.2.1-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.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9f27884029673549d26dcd9c2ca87186af6b6c77ae638af8f1be7a559459a2a1
MD5 3f249f52a0197831b68080e8ffbef668
BLAKE2b-256 ddb1aee82962f17057d15c544556953b64b0db00a3068ba6595205a24dcd15b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mimiq_exaqt-0.2.1-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7d54f20f43ae1841b8cc61e3afa7f9757cf1c4ba1be9f83b643593ac4085be8a
MD5 a590e0fc1260ab8b298a3eddc0bd5cae
BLAKE2b-256 7cef5ffe73ce658e631fad906a5e6e488a5bc4846523625cf447a7400ddc7e4e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mimiq_exaqt-0.2.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1c53c1267e96296a2c2bbcedb0eab15ab89e9cd87845b193f86665d2444499c6
MD5 01f7a1bacf7b679c50aa3e3f5e3c029a
BLAKE2b-256 d0318b0aa6ee0cc3d9562f80385a5bc5a7bd9a31161d7d2aaa00db43de4b9150

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

3 files

0.2.0

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