Skip to main content

A high-performance, qudit-agnostic quantum simulation engine and ML toolkit, optimized with a Rust core for 10-170x faster execution than industry standards.

Project description

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]"

Recommended local environment

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

Project details


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.

quaq-0.0.3-cp313-cp313-win_amd64.whl (741.1 kB view details)

Uploaded CPython 3.13Windows x86-64

quaq-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

quaq-0.0.3-cp313-cp313-macosx_11_0_arm64.whl (718.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

quaq-0.0.3-cp312-cp312-win_amd64.whl (741.2 kB view details)

Uploaded CPython 3.12Windows x86-64

quaq-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

quaq-0.0.3-cp312-cp312-macosx_11_0_arm64.whl (717.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

quaq-0.0.3-cp311-cp311-win_amd64.whl (742.8 kB view details)

Uploaded CPython 3.11Windows x86-64

quaq-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

quaq-0.0.3-cp311-cp311-macosx_11_0_arm64.whl (719.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

quaq-0.0.3-cp310-cp310-win_amd64.whl (742.9 kB view details)

Uploaded CPython 3.10Windows x86-64

quaq-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

quaq-0.0.3-cp310-cp310-macosx_11_0_arm64.whl (719.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file quaq-0.0.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: quaq-0.0.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 741.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quaq-0.0.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b72b77fc0b22df54842c66e107cf995ee64a0ab464b4b1561d33ae57a4d2447c
MD5 1b9548c9b61ff1b1345da6f9dda49c44
BLAKE2b-256 8c124de8f572923c448cefc45562955446eb720c7278e3c309bc350c9c295207

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp313-cp313-win_amd64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quaq-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quaq-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1104fe01ae9f8dc3379fcbabacf135f508e38d38528244ef88f0a4c440bdb28d
MD5 4a6704d65be5e9968a33d2481c34d3ea
BLAKE2b-256 81023ac2c53e674a4dbb77fa0b6e9a21d410d7f8c73d0291028ddb1219529155

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quaq-0.0.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: quaq-0.0.3-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 718.1 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quaq-0.0.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ce9c84b733c4772cc86714683ac21ad048b1738f2286301d85b1f8cf0d629e55
MD5 940260aa951028fd2382033f8f4ee4eb
BLAKE2b-256 59595a715bba2c63955ba358035c60c481a60ea0c255d30259bdb63e145fbe8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quaq-0.0.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: quaq-0.0.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 741.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quaq-0.0.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a1e4f371a37bc0db8e88c5b39618aab11f17168f19e755285fb8ed5dd1f8b572
MD5 505fa8c0be62b1c4c18ae522ff739229
BLAKE2b-256 d72f0f2c5abcf8541d75d8d2bbce2e3891b360ab0e1d6a0c249eb473c34a711b

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp312-cp312-win_amd64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quaq-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quaq-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7a26a0f3652ac2428dd3bea8eeb480081bd4971bb1670554e9c8f33bd39b5308
MD5 52174f3c8202d3860817289d18aad746
BLAKE2b-256 b97c137d740ee095617be7bdbbc780cb4d22522e30842b21b8c54cb375cdc53e

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quaq-0.0.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: quaq-0.0.3-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 717.9 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quaq-0.0.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d684c2adbfbf656364b6ba672610d61e75e1a5a585ae97967af2367e24f2608
MD5 b68eca70a453c4c92249f02fc7d0cbb4
BLAKE2b-256 819ccb66c569051468a4a7dc8de917c05dff7d44e4a339781296455a01b63f79

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quaq-0.0.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: quaq-0.0.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 742.8 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quaq-0.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a89d46c17d9a754da5e35ac75379f95c1c5aa4274bca20715387f8722d9981dc
MD5 89a6711a6542749861c726dc3ffebc63
BLAKE2b-256 b640557654c9c8a0a87fb35dca2420a49ef26191b798cf9957bed0f8fb005333

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp311-cp311-win_amd64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quaq-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quaq-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2378926fdf545342a00d312ef21ffedf6893408f656e8ef6d9eeba07fb869b50
MD5 9effd974989850bd891bf0ea05969977
BLAKE2b-256 15947a4e437c76ee383b100eddb5ff4231eecaf01049207b07c2ad1b74920bdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quaq-0.0.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

  • Download URL: quaq-0.0.3-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 719.2 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quaq-0.0.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0ab51ad9b6487c26a24edae87fb40b0953898defed8ce479923b8bf9631d80c7
MD5 1f58093ef17ee0b1000d776d4e3ac010
BLAKE2b-256 6a7cbd61c5ac4b38cd7e7bfa7dae7d880837276b85a5f87f9d2177f971c1a568

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quaq-0.0.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: quaq-0.0.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 742.9 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quaq-0.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5c8ba95db38845e78854215ed071cb266312547ef15e0f3b6cc7fdfa0a550b03
MD5 d1c2437d54f472131a1f7a4b1ede2e54
BLAKE2b-256 47d4e8b6ac9d832fa1832bdec36a177f47e176cc513642b08377a8884aaa9728

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp310-cp310-win_amd64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quaq-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quaq-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5c08ca051aa2d69eb911284baed4fddeeb543e72d35cbf722552cba7560b339a
MD5 5a111593bf2f2d14a10348b3a272536d
BLAKE2b-256 0ab61cae9413e43e44354b6fb19a1fff270d1097ecab78a757cd479948c4ec3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quaq-0.0.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

  • Download URL: quaq-0.0.3-cp310-cp310-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 719.2 kB
  • Tags: CPython 3.10, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quaq-0.0.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a2781d31f473ca5733e349eb69b9a943ab952db8c96818fcc314e2f55a87f86
MD5 264a1bb869bb4261732c99a893693ff4
BLAKE2b-256 b7d67de19a25031502bc06ba58f03885317992363cea6932f8df51c9b0d1901b

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.3-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on EnriqueAnguianoVara/quaq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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