Skip to main content

quaq: A duck over crabs

A quantum simulator engine 10–170x faster than Qiskit Aer.

Researchers should not have to choose between expressive models and efficient execution. Their quantum simulator must be shaped for them, to any experiment, and be deeply efficient inside.

To solve this issue, quaq is shaped by three main pillars:

  1. Quantum-unit agnostic simulation: quaq is centered on qudits with configurable dimension d rather than assuming qubits everywhere. That makes it a natural foundation for working with qubits (d = 2), higher dimensional qudits, and continuous-variable-inspired discretizations within a single conceptual model.

  2. Performance-first engineering: quantum simulation gets expensive very quickly. quaq pushes all execution into Rust and is designed around low-level performance concerns. In some algorithms like VQE, quaq can reach ~180x speedup versus Qiskit Aer.

  3. Minimal surface, powerful internals: performance should not come at the cost of usability. quaq aims to stay compact at the API level while gradually providing the core building blocks and algorithms researchers need for real workflows, from circuit simulation to machine-learning-oriented quantum pipelines. Our goal is to grow the library with strong community submissions so useful ideas can become directly available to everyone.

Performance

quaq is 10–170x faster than Qiskit Aer depending on the algorithm and circuit size.

Algorithm Median speedup Range
VQE 169x —
QRC 33x 7x – 90x
GHZ 31x 10x – 48x
MPS random circuit 16x 2x – 42x
Random circuit 16x 2x – 59x

Benchmarks run with 200 samples. QRC range measured across 1–10 qubits and 1–10 reservoir layers. Speedup = Aer sustained runtime / quaq sustained runtime.

Installation

From PyPI

pip install quaq

Optional numerical extras listed in pyproject.toml:

pip install "quaq[numpy]"
python3 -m venv venv
source venv/bin/activate
pip install -U pip

Install from source

If you want to work from the repository:

pip install -U maturin
pip install -e .

For a compiled development install:

maturin develop --release

Quickstart

This section will be removed after version 0.1.0, when the documentation will be available to everyone.

1. Build and run a Bell-state-style circuit

from quaq import SystemSpec, Circuit

spec = SystemSpec.from_qubits(2)
circ = Circuit(spec)

circ.h(0).cnot(0, 1)
circ.measure_z("z0", 0)
circ.measure_z("z1", 1)
circ.measure_zz("corr", 0, 1)

result = circ.run([])
print(result)

run(...) returns a dictionary keyed by your measurement labels.

2. Use parametric gates

from quaq import SystemSpec, Circuit

spec = SystemSpec.from_qubits(2)
circ = Circuit(spec)

circ.ry(0, 0).rz(1, 1).rzz(0, 1, 2)
circ.measure_z("left", 0).measure_z("right", 1)

print(circ.run([0.7, 1.2, 0.3]))

Parametric gates store parameter indices in the circuit. The actual values are supplied later through run(...).

3. Evaluate a circuit in batches

outputs = circ.run_batch([
    [0.1, 0.2, 0.3],
    [0.4, 0.5, 0.6],
    [0.7, 0.8, 0.9],
])

print(outputs)

4. Define mixed-dimension systems

from quaq import SystemSpec

spec = SystemSpec([2, 2, 3]) #2 qubtis, 1 qutrit
print(spec.dims())
print(spec.n_subsystems())
print(spec.total_dim())

The system description is based on subsystem dimensions rather than assuming everything is a qubit.

Quantum Reservoir Computing

from quaq import QuantumReservoir

model = QuantumReservoir(
    n_qubits=6,
    reservoir_layers=2,
    input_window=10,
    entanglement="brick",
    algorithm="qrc",
    two_body_readout=True,
)

model.fit(train_inputs, train_targets, method="ridge", lambda_=1e-4)
predictions = model.predict(test_inputs)

print(model.n_features())
print(predictions[:5])

Helper functions in quaq.reservoir:

  • fit_predict(...)
  • score(...)

Current reservoir configuration parameters exposed by the bindings include:

  • n_qubits
  • input_window
  • reservoir_layers
  • input_scale
  • seed
  • algorithm
  • warmup_steps
  • entanglement
  • two_body_readout
  • include_raw_input
  • include_x_readout
  • include_y_readout
  • use_zz_entangler
  • forecast_horizon
  • feature_leak

Advanced Public Bindings

These are part of the top-level package today, but they feel more advanced than the main SystemSpec + Circuit workflow.

MPS simulator

from quaq import MpsSimulator

sim = MpsSimulator.from_qubits(6, chi_max=64, singular_value_eps=1e-10)
sim.h(0)
sim.cnot(0, 1)

print(sim.norm_sq())
print(sim.max_bond_dim())

Current limitation exposed in the binding: MpsSimulator.cnot(control, target) only supports nearest-neighbor CNOT with target = control + 1.

Gaussian-state continuous-variable API

from quaq import GaussianState

state = GaussianState.vacuum(2)
state.displace(0, 0.2, -0.1)
state.squeeze(1, 0.4)
state.beamsplitter(0, 1, 0.3)

print(state.n_modes())
print(state.phase_space_dim())
print(state.homodyne(0, "x"))

The Gaussian-state binding currently exposes:

  • vacuum(n_modes)
  • displace(mode, alpha_x, alpha_p)
  • squeeze(mode, r)
  • beamsplitter(mode_a, mode_b, theta)
  • homodyne(mode, "x" | "p")
  • heterodyne(mode)
  • accessors for displacement and covariance

Metadata

Release files for quaq 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for quaq 0.0.3
File Actions
quaq-0.0.3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for quaq-0.0.3-cp313-cp313-win_amd64.whl
quaq-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for quaq-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
quaq-0.0.3-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for quaq-0.0.3-cp313-cp313-macosx_11_0_arm64.whl
quaq-0.0.3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for quaq-0.0.3-cp312-cp312-win_amd64.whl
quaq-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for quaq-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
quaq-0.0.3-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for quaq-0.0.3-cp312-cp312-macosx_11_0_arm64.whl
quaq-0.0.3-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for quaq-0.0.3-cp311-cp311-win_amd64.whl
quaq-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for quaq-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
quaq-0.0.3-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for quaq-0.0.3-cp311-cp311-macosx_11_0_arm64.whl
quaq-0.0.3-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for quaq-0.0.3-cp310-cp310-win_amd64.whl
quaq-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for quaq-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
quaq-0.0.3-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for quaq-0.0.3-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 9.9 MB

Release files / quaq-0.0.3-cp313-cp313-win_amd64.whl

Download URL quaq-0.0.3-cp313-cp313-win_amd64.whl
Size 741.1 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
b72b77fc0b22df54842c66e107cf995ee64a0ab464b4b1561d33ae57a4d2447c
BLAKE2b-256 checksum
How to use checksums
8c124de8f572923c448cefc45562955446eb720c7278e3c309bc350c9c295207
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / quaq-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL quaq-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.0 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1104fe01ae9f8dc3379fcbabacf135f508e38d38528244ef88f0a4c440bdb28d
BLAKE2b-256 checksum
How to use checksums
81023ac2c53e674a4dbb77fa0b6e9a21d410d7f8c73d0291028ddb1219529155
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / quaq-0.0.3-cp313-cp313-macosx_11_0_arm64.whl

Download URL quaq-0.0.3-cp313-cp313-macosx_11_0_arm64.whl
Size 718.1 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ce9c84b733c4772cc86714683ac21ad048b1738f2286301d85b1f8cf0d629e55
BLAKE2b-256 checksum
How to use checksums
59595a715bba2c63955ba358035c60c481a60ea0c255d30259bdb63e145fbe8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / quaq-0.0.3-cp312-cp312-win_amd64.whl

Download URL quaq-0.0.3-cp312-cp312-win_amd64.whl
Size 741.2 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
a1e4f371a37bc0db8e88c5b39618aab11f17168f19e755285fb8ed5dd1f8b572
BLAKE2b-256 checksum
How to use checksums
d72f0f2c5abcf8541d75d8d2bbce2e3891b360ab0e1d6a0c249eb473c34a711b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / quaq-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL quaq-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.0 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7a26a0f3652ac2428dd3bea8eeb480081bd4971bb1670554e9c8f33bd39b5308
BLAKE2b-256 checksum
How to use checksums
b97c137d740ee095617be7bdbbc780cb4d22522e30842b21b8c54cb375cdc53e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / quaq-0.0.3-cp312-cp312-macosx_11_0_arm64.whl

Download URL quaq-0.0.3-cp312-cp312-macosx_11_0_arm64.whl
Size 717.9 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9d684c2adbfbf656364b6ba672610d61e75e1a5a585ae97967af2367e24f2608
BLAKE2b-256 checksum
How to use checksums
819ccb66c569051468a4a7dc8de917c05dff7d44e4a339781296455a01b63f79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / quaq-0.0.3-cp311-cp311-win_amd64.whl

Download URL quaq-0.0.3-cp311-cp311-win_amd64.whl
Size 742.8 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
a89d46c17d9a754da5e35ac75379f95c1c5aa4274bca20715387f8722d9981dc
BLAKE2b-256 checksum
How to use checksums
b640557654c9c8a0a87fb35dca2420a49ef26191b798cf9957bed0f8fb005333
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / quaq-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL quaq-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.0 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2378926fdf545342a00d312ef21ffedf6893408f656e8ef6d9eeba07fb869b50
BLAKE2b-256 checksum
How to use checksums
15947a4e437c76ee383b100eddb5ff4231eecaf01049207b07c2ad1b74920bdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / quaq-0.0.3-cp311-cp311-macosx_11_0_arm64.whl

Download URL quaq-0.0.3-cp311-cp311-macosx_11_0_arm64.whl
Size 719.2 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0ab51ad9b6487c26a24edae87fb40b0953898defed8ce479923b8bf9631d80c7
BLAKE2b-256 checksum
How to use checksums
6a7cbd61c5ac4b38cd7e7bfa7dae7d880837276b85a5f87f9d2177f971c1a568
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / quaq-0.0.3-cp310-cp310-win_amd64.whl

Download URL quaq-0.0.3-cp310-cp310-win_amd64.whl
Size 742.9 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
5c8ba95db38845e78854215ed071cb266312547ef15e0f3b6cc7fdfa0a550b03
BLAKE2b-256 checksum
How to use checksums
47d4e8b6ac9d832fa1832bdec36a177f47e176cc513642b08377a8884aaa9728
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / quaq-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL quaq-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
5c08ca051aa2d69eb911284baed4fddeeb543e72d35cbf722552cba7560b339a
BLAKE2b-256 checksum
How to use checksums
0ab61cae9413e43e44354b6fb19a1fff270d1097ecab78a757cd479948c4ec3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Release files / quaq-0.0.3-cp310-cp310-macosx_11_0_arm64.whl

Download URL quaq-0.0.3-cp310-cp310-macosx_11_0_arm64.whl
Size 719.2 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4a2781d31f473ca5733e349eb69b9a943ab952db8c96818fcc314e2f55a87f86
BLAKE2b-256 checksum
How to use checksums
b7d67de19a25031502bc06ba58f03885317992363cea6932f8df51c9b0d1901b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

Security for quaq 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 12 files in this release have been uploaded with provenance metadata.

Select from 12 files

Attestation for quaq-0.0.3-cp313-cp313-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page