Skip to content

MIMIQ Exaqt

Exaqt is a SIMD-accelerated state-vector quantum circuit simulator for MIMIQ. It represents the full quantum state as a dense complex vector of 2**num_qubits amplitudes and applies gates with a vectorised Rust core (runtime AVX-512 / AVX2 / NEON dispatch), exposed to Python through PyO3.

The native extension lives in exaqt._core; its public types are re-exported on the top-level exaqt package.

There are two ways to use it:

  • High level — build a circuit with mimiqcircuits, run it with a ExaqtQCS simulator, and receive the same QCSResults object MIMIQ uses elsewhere. See Circuit Execution.
  • Low level — drive a ExaqtSV state vector directly: allocate a state, apply gates by name, and read amplitudes, probabilities, expectation values, or samples. See Getting Started.

Quick start

import mimiqcircuits as mc
from exaqt import ExaqtQCS

# Build a Bell-state circuit.
c = mc.Circuit()
c.push(mc.GateH(), 0)
c.push(mc.GateCX(), 0, 1)
c.push(mc.Measure(), 0, 0)
c.push(mc.Measure(), 1, 1)

# Run it on the state-vector simulator — returns a QCSResults object.
sim = ExaqtQCS()
results = sim.execute(c, nsamples=1000)
print(results.histogram())      # e.g. {bs"00": 512, bs"11": 488}

Or work with the state vector directly:

from exaqt import ExaqtSV

sv = ExaqtSV.zero(3)       # |000>
sv.apply_h(0)
sv.apply_cx(0, 1)
sv.apply_cx(0, 2)
print(sv.amplitudes())          # numpy complex128 array, length 2**3
print(sv.expectation_pauli("XXX", [0, 1, 2]))   # +1 for the GHZ state

Features

  • Dense state-vector core written in Rust, exposed through PyO3.
  • Runtime SIMD dispatch: AVX-512 / AVX2 on x86-64, NEON on ARM.
  • Specialised kernels for the common gates (X, Y, Z, H, S, T, SX, P, RX, RY, RZ, U, CX, CY, CZ, SWAP, iSWAP, CP, CRX, CRY, CRZ, RXX, RYY, RZZ) plus generic apply_gate_1q / apply_gate_2q escape hatches for any unitary.
  • Multi-controlled gates applied directly, without CX decomposition.
  • Mid-circuit measurement, reset, and classically conditioned operations.
  • Noise simulation via Kraus and mixed-unitary channels (trajectory sampling).
  • Observables: single amplitudes, 1- and 2-qubit expectation values, and multi-qubit Pauli-string expectations.
  • Exact qubit reordering to land gates on the fastest kernels.
  • Reproducible sampling through a seeded Rng shared across the Rust, Python, and Julia wrappers.
  • Results returned as MIMIQ QCSResults (samples, amplitudes, fidelities, timings).

Installation

Exaqt is distributed as mimiq-exaqt and imported as exaqt:

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

The wheel bundles this documentation — run exaqt docs to open it offline.

To build from source instead, check the Rust core (exaqt-rs) out alongside this package and use maturin:

uv venv
uv pip install mimiqcircuits numpy
uv run maturin develop --release

See Getting Started for the full build instructions and the qubit-ordering conventions.

Where to go next

  • Getting Started — installation, your first state vector, gate application, and reading results.
  • Circuit Execution — running a mimiqcircuits.Circuit with ExaqtQCS: sampling vs. trajectory mode, observables, noise.
  • API Reference — every public type and function, generated from the source docstrings.

Conventions

  • Qubit ordering. Qubit 0 is the least-significant bit of the basis-state index (matches Qiskit's little-endian ordering and MimiqCircuitsBase). Amplitude index i has bit k set when qubit k is in state |1>.
  • Gate matrices. apply_gate_1q / apply_gate_2q and the expectation methods take numpy complex128 arrays — (2, 2) for a 1-qubit gate, (4, 4) for a 2-qubit gate.
  • Reproducibility. The same Rng(seed) produces the same Xoshiro256++ stream in the Rust core, the Python wrapper, and the Julia wrapper.