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 goose 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.2-cp313-cp313-win_amd64.whl (764.8 kB view details)

Uploaded CPython 3.13Windows x86-64

quaq-0.0.2-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.2-cp313-cp313-macosx_11_0_arm64.whl (733.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

quaq-0.0.2-cp312-cp312-win_amd64.whl (765.4 kB view details)

Uploaded CPython 3.12Windows x86-64

quaq-0.0.2-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.2-cp312-cp312-macosx_11_0_arm64.whl (733.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

quaq-0.0.2-cp311-cp311-win_amd64.whl (768.0 kB view details)

Uploaded CPython 3.11Windows x86-64

quaq-0.0.2-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.2-cp311-cp311-macosx_11_0_arm64.whl (736.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

quaq-0.0.2-cp310-cp310-win_amd64.whl (767.4 kB view details)

Uploaded CPython 3.10Windows x86-64

quaq-0.0.2-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.2-cp310-cp310-macosx_11_0_arm64.whl (736.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: quaq-0.0.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 764.8 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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f8500dcccf05d837df69572c4beaa1727434e3c82d3e376d88952c3c01d1359e
MD5 3dc4ebea4ea7fd3a51f90fe6b5acd7cf
BLAKE2b-256 6ef721577c5f3f105b974d44167ff5f7004b111f0793d61514ccf081f4b82887

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quaq-0.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0af88cf3bfe451f516a7970f8d68cf38475eb4e69ca669a2cfa1cacb1904cfde
MD5 902601dd1c1e872b58b6b8d820f511b3
BLAKE2b-256 70c2a3c08acec46cf9cd9e65252391c619e3367c0c261f865724a6f586c65eb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: quaq-0.0.2-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 733.5 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.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c34a9924685840ba6800c1121396c11866a3d6628c67622a74e7462b8949237d
MD5 afb824a2071297732339c6cba524d380
BLAKE2b-256 ed419dafb9332f0e14e744b77859eeb40530c2bdf4f1c3afee2209704a01e688

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: quaq-0.0.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 765.4 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 82fc8c410e8dda5b8497630e09955b3082fdad9742c2a045587333ef379e8764
MD5 199e4f847efe11e80f34d0776c417edb
BLAKE2b-256 a7702e9b751ed85e439a8102a2dac78626a5a1c7b46d408c9c410bb276ffa3e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quaq-0.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b60b8919ced9fcea1aede544baa69dc1e2f02354f40276e078a037578301d3dc
MD5 7ea36fc933c6f1d611c70e17a8a0fe2f
BLAKE2b-256 452e43d84a220db0a2e53f882efab3db526b7c3a93f6a0ab8e281d253f6a5207

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: quaq-0.0.2-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 733.8 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.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3d115d7d20b1ef9ebb74c6ba73405400c6a519310aa8b0d41d2b16473271f040
MD5 b962357dbee6dfb624a58be2646403c7
BLAKE2b-256 6f3a7cd5ed09f045aac0495c42634de58444e9b5f1eeb88382dd0c47984ccf2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: quaq-0.0.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 768.0 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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 884d6b3479306bccdd0e9dd2cd40bc39a245b85c678fe0412392f7690349ada9
MD5 21dbbaf373f96138e39ade8d85de6cf5
BLAKE2b-256 05437a75cbbc33bd1e54f0922039b55e8141fe48f16a5f9c62fcf28084a288b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quaq-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e8cbd0cd0ebe51d5257592f739944e549536d2c8a56d32fb3e6777e90251b16b
MD5 7bb867733d4f5ee217ab003c9f03e397
BLAKE2b-256 67c11db9e83bf880ce8641120afb5290b07f6e8bfe7abd5cc43cf9afc0c7c1cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

  • Download URL: quaq-0.0.2-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 736.3 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.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5b2fb3a51ec3e6975ded290f8bb92029a995557151aae7c37b4b7727f8c4fa02
MD5 ebd9612a9fafe41be9375966766f916a
BLAKE2b-256 6ddf8ceac7a58b3d108dabae76ab61f2b7e2c164586035182b297a2c9c733caf

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: quaq-0.0.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 767.4 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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4f0c17194a9f706dcb818ef0796c2289d17a1a65efaf5783866283aea28124e0
MD5 6c9ac26b6bea26bcea25c548a23adf3b
BLAKE2b-256 6dc994562ed2ae3408fe7984a3492a1d7b4accb95897ccd27b3fff3dc836813b

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quaq-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b48a644df745a284037f7e8ed8922f235adfe4a52ff508b34e1d77ec17352ea1
MD5 e6cb948d3e3a8cb167e52ff59504f5f4
BLAKE2b-256 9ade4ddb2bd2132e0268b24a2b292dd4cf2ad9e659ce298b35f416e4e35d9174

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

  • Download URL: quaq-0.0.2-cp310-cp310-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 736.4 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.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d69e83faa2b9c73a82c7361083ecc4edd25bdf786a693993c1dba1b83f40ffb1
MD5 0ed0d40bb8e4cc032734923f530d0ab0
BLAKE2b-256 6193acb0daf9498296844223ab6355e86c8b69dbcc439fce6fe78532388ca3be

See more details on using hashes here.

Provenance

The following attestation bundles were made for quaq-0.0.2-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