Zero-config quantum simulator bundle for education, benchmarking & CI
Project description
Ariadne: The Google Maps of Quantum Simulation
Ariadne is an intelligent router for quantum simulations. Just as Google Maps finds the best route for a road trip, Ariadne automatically selects the most efficient backend for simulating your quantum circuit. It intelligently routes your simulation to the best-suited backend from a wide range of options, including Stim, Tensor Networks, Qiskit Aer, and hardware-accelerated backends like CUDA and JAX-Metal.
Why Ariadne?
- Zero-Configuration: A single
simulate(qc)call works across macOS, Linux, and Windows, with or without hardware acceleration. - Performance-Aware Routing: Ariadne understands the structure of your circuit. It routes Clifford circuits to Stim, low-entanglement circuits to Matrix Product State (MPS) or Tensor Network (TN) simulators, and defaults to a robust general-purpose simulator for all other cases.
- Explainable Decisions: Want to know why Ariadne chose a particular backend?
explain_routing(qc)provides a clear, human-readable summary of the decision-making process. - Cross-Ecosystem Support: Ariadne is not tied to a single simulation framework. It seamlessly integrates with a variety of popular quantum libraries, including Qiskit, Cirq, PennyLane, and more.
Note: Ariadne performs simulator backend routing, not hardware qubit routing. For mapping quantum circuits to physical hardware, consider tools like QMAP.
Getting Started
Installation
Install Ariadne from PyPI:
pip install ariadne-router
To enable hardware acceleration, install the appropriate extras:
# For Apple Silicon (M1/M2/M3/M4)
pip install ariadne-router[apple]
# For NVIDIA GPUs (CUDA)
pip install ariadne-router[cuda]
Docker Quick Start
Run a ready-to-use container from GHCR (if your project has access to images):
# Pull latest production image
docker pull ghcr.io/Hmbown/ariadne-router:latest
# Run a quick verification
docker run --rm ghcr.io/Hmbown/ariadne-router:latest \
python -c "import ariadne; print('Ariadne OK:', ariadne.__version__)"
Develop and test with docker-compose:
docker-compose build
docker-compose up -d ariadne-dev
docker-compose exec ariadne-dev bash
# or run tests
docker-compose up --abort-on-container-exit ariadne-test
Your First Simulation
Let's simulate a 40-qubit GHZ state. This is a classic example of a stabilizer circuit, which can be simulated efficiently with the right tools.
from ariadne import simulate, explain_routing
from qiskit import QuantumCircuit
# Create a 40-qubit GHZ circuit
qc = QuantumCircuit(40, 40)
qc.h(0)
for i in range(39):
qc.cx(i, i + 1)
qc.measure_all()
# Simulate the circuit
result = simulate(qc, shots=1000)
# See the results
print(f"Backend Used: {result.backend_used}")
print(f"Execution Time: {result.execution_time:.4f}s")
print(f"Routing Explanation: {explain_routing(qc)}")
Ariadne automatically identifies this as a Clifford circuit and routes it to the stim backend, resulting in a significant speedup compared to general-purpose simulators.
Core Features
- Intelligent Routing: Ariadne analyzes your circuit's properties (size, gate types, entanglement) to select the optimal simulation backend.
- Hardware Acceleration: Automatically utilizes Apple Silicon (via JAX-Metal) and NVIDIA GPUs (via CUDA) when available.
- Transparent Decisions: The
explain_routingfunction provides a detailed breakdown of the routing decision, so you always know why a particular backend was chosen. - Extensible Backend System: Ariadne's modular design makes it easy to add new backends and routing strategies.
Supported Backends
Ariadne supports a wide range of quantum simulation backends:
- Qiskit: A reliable and feature-rich CPU-based simulator.
- Stim: A high-performance simulator for Clifford circuits.
- Tensor Network (TN) / Matrix Product State (MPS): For circuits with low entanglement, powered by
quimbandcotengra. - JAX-Metal: For hardware acceleration on Apple Silicon.
- CUDA: For GPU acceleration on NVIDIA hardware.
- And more: DDSIM, Cirq, PennyLane, Qulacs, and experimental support for PyQuil, Braket, and Q#.
Advanced Usage
Forcing a Backend
You can override Ariadne's automatic routing and force a specific backend:
result = simulate(qc, shots=1000, backend='qiskit')
Custom Routing Strategies
Ariadne provides a variety of routing strategies to suit different needs:
from ariadne import ComprehensiveRoutingTree, RoutingStrategy
router = ComprehensiveRoutingTree()
decision = router.route_circuit(circuit, strategy=RoutingStrategy.MEMORY_EFFICIENT)
Available strategies include SPEED_FIRST, ACCURACY_FIRST, MEMORY_EFFICIENT, and more.
Configuration Tips
-
Tensor-network bit ordering:
- The tensor-network backend outputs Qiskit-compatible little-endian bitstrings by default.
- You can control this via
TensorNetworkOptions(bitstring_order='qiskit'|'msb'). - Example:
from ariadne.backends.tensor_network_backend import TensorNetworkBackend, TensorNetworkOptions backend = TensorNetworkBackend(TensorNetworkOptions(seed=123, bitstring_order='qiskit'))
-
Resource checks in constrained environments:
- If resource feasibility checks are overly conservative on your machine/CI, disable them for small circuits.
- Set env var
ARIADNE_DISABLE_RESOURCE_CHECKS=1or toggleget_config().analysis.enable_resource_estimation = False.
Contributing
We welcome contributions! Please see our Contributing Guidelines to get started.
License
Ariadne is licensed under the Apache 2.0 License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ariadne_router-0.3.3.tar.gz.
File metadata
- Download URL: ariadne_router-0.3.3.tar.gz
- Upload date:
- Size: 606.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02283f457c93cbdc7f3b1cbef0494783e4045edc1f6aff7966a371b6dc1b9b69
|
|
| MD5 |
29d463e7a68105d8ec3b89cbd49ed91f
|
|
| BLAKE2b-256 |
9323e572da08342bdef55753fc469235930ed260f8ac575bf97fd865ebcc265b
|
Provenance
The following attestation bundles were made for ariadne_router-0.3.3.tar.gz:
Publisher:
release.yml on Hmbown/ariadne
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ariadne_router-0.3.3.tar.gz -
Subject digest:
02283f457c93cbdc7f3b1cbef0494783e4045edc1f6aff7966a371b6dc1b9b69 - Sigstore transparency entry: 630373874
- Sigstore integration time:
-
Permalink:
Hmbown/ariadne@7cd61366b79b349e7c5af6c38ad312a9e344da24 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/Hmbown
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7cd61366b79b349e7c5af6c38ad312a9e344da24 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ariadne_router-0.3.3-py3-none-any.whl.
File metadata
- Download URL: ariadne_router-0.3.3-py3-none-any.whl
- Upload date:
- Size: 301.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
849c496edd4cdd26a5b87998c192579df72ce6493786fc2da2ad705d381cd1c2
|
|
| MD5 |
712bf6747bbc68fe0d7e21230c83367b
|
|
| BLAKE2b-256 |
346ec3a9622869f10f2bcf4c4d354439267b1613002f9778cf2e05aa9af8002a
|
Provenance
The following attestation bundles were made for ariadne_router-0.3.3-py3-none-any.whl:
Publisher:
release.yml on Hmbown/ariadne
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ariadne_router-0.3.3-py3-none-any.whl -
Subject digest:
849c496edd4cdd26a5b87998c192579df72ce6493786fc2da2ad705d381cd1c2 - Sigstore transparency entry: 630373877
- Sigstore integration time:
-
Permalink:
Hmbown/ariadne@7cd61366b79b349e7c5af6c38ad312a9e344da24 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/Hmbown
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7cd61366b79b349e7c5af6c38ad312a9e344da24 -
Trigger Event:
push
-
Statement type: