Skip to main content

Intelligent quantum simulator router with automatic backend selection

Project description

Ariadne

Intelligent Quantum Simulator Router

The Google Maps for quantum circuit simulation, automatically finding the fastest path for your quantum circuits.

PyPI version Python 3.11+ License: Apache 2.0 CI codecov Open In Colab


Table of Contents



What is Ariadne?

Stop wasting hours choosing quantum simulators. Ariadne automatically routes your quantum circuits to the optimal backend, giving you maximum performance with zero configuration.

One line of code. Up to 1000ร— speedup for specific circuit types.

from ariadne import simulate
result = simulate(quantum_circuit, shots=1000)  # That's it!

Before Ariadne: You spend hours researching backends, dealing with installation nightmares, and manually optimizing for each circuit type.

After Ariadne: Write your circuit once. Ariadne analyzes it instantly and routes to the perfect backend automatically.


Performance Highlights

Circuit Type Traditional Approach Ariadne Speedup
50-qubit Clifford Crashes or 45+ seconds 0.045s 1000ร— faster*
Low-entanglement circuits 12.8s 0.26s 50ร— faster*
Large Clifford circuits Memory errors 0.045s Handles circuits that fail on other simulators*
Large quantum algorithms Manual backend tuning Automatic Zero configuration

*Benchmarks run on an Apple M3 Max with 128GB RAM. Speedups are relative to Qiskit Aer.


๐ŸŽฏ Perfect For Your Use Case

๐ŸŽ“ Students & Educators

  • Learn quantum computing without backend complexity
  • Interactive tutorials and educational tools
  • Cross-platform consistency (Windows, macOS, Linux)
  • Start with our Quantum Computing Primer

๐Ÿ”ฌ Researchers

  • Reproduce published results with automatic optimization
  • Scale to circuits that crash other simulators
  • Focus on science, not simulator configuration

โš™๏ธ Developers & Engineers

  • Integrate quantum simulation into existing workflows
  • Production-ready with enterprise support
  • Automatic scaling from your laptop to powerful multi-core servers

Quick Start

Installation

pip install ariadne-router

Hardware Acceleration (Optional):

# Apple Silicon (M1/M2/M3/M4)
pip install ariadne-router[apple]

# NVIDIA GPUs
pip install ariadne-router[cuda]

Basic Usage

from ariadne import simulate, explain_routing
from qiskit import QuantumCircuit

# Create a 40-qubit GHZ state
qc = QuantumCircuit(40, 40)
qc.h(0)
for i in range(39):
    qc.cx(i, i + 1)
qc.measure_all()

# Simulate with automatic backend selection
result = simulate(qc, shots=1000)

print(f"Backend: {result.backend_used}")
print(f"Time: {result.execution_time:.3f}s")
print(f"Why: {explain_routing(qc)}")

Output:

Backend: stim
Time: 0.012s
Why: Clifford circuit detected โ†’ routed to Stim for 1000ร— speedup

๐Ÿง  How Ariadne Works

Intelligent Routing Engine

graph TD
    A[Quantum Circuit] --> B{Circuit Type?};
    B --> C{Clifford?};
    B --> D{General?};

    C --> E{Stim available?};
    E -->|Yes| F[Stim Backend];
    E -->|No| G[Qiskit Backend];

    D --> H{Circuit Size?};
    H --> I{"Small (<= 20 qubits)"};
    H --> J{"Medium (21-35 qubits)"};
    H --> K{"Large (> 35 qubits)"};

    I --> L{Hardware?};
    L -->|Apple Silicon with JAX/Metal| M[JAX/Metal Backend];
    L -->|NVIDIA GPU with CUDA| N[CUDA Backend];
    L -->|CPU or other| O{Optional Backends?};
    O -->|Cirq| P[Cirq Backend];
    O -->|Qulacs| Q[Qulacs Backend];
    O -->|PennyLane| R[PennyLane Backend];
    O -->|None| G;

    J --> S{Entanglement?};
    S --> T{Low};
    S --> U{High};

    T --> V{MPS available?};
    V -->|Yes| W[MPS Backend];
    V -->|No| X{Tensor Network available?};
    X -->|Yes| Y[Tensor Network Backend];
    X -->|No| G;

    U --> Z{Hardware?};
    Z -->|NVIDIA GPU with CUDA| N;
    Z -->|Apple Silicon with JAX/Metal| M;
    Z -->|CPU or other| AA{Optional Backends?};
    AA -->|OpenCL| AB[OpenCL Backend];
    AA -->|Cirq| P;
    AA -->|Qulacs| Q;
    AA -->|None| G;

    K --> AC{Entanglement?};
    AC --> AD{Low};
    AC --> AE{High};

    AD --> AF{MPS available?};
    AF -->|Yes| W;
    AF -->|No| X;

    AE --> AG{Specialized Backends?};
    AG -->|Tensor Network| Y;
    AG -->|DDSIM| AH[DDSIM Backend];
    AG -->|Braket| AI[Braket Backend];
    AG -->|Q#| AJ[Q# Backend];
    AG -->|None| G;

Backend Selection Logic

Ariadne analyzes your circuit in milliseconds and selects the optimal backend:

Backend Best For Speedup When It Works
Stim Clifford circuits, error correction 1000ร— Circuit contains only H, S, CNOT, Pauli gates
Tensor Networks Low-entanglement circuits 50ร— Entanglement grows slowly with qubit count
JAX-Metal Apple Silicon acceleration 10ร— Running on M1/M2/M3/M4 Macs
CUDA NVIDIA GPU acceleration 20ร— NVIDIA GPU with sufficient memory
Qiskit Aer General-purpose, reliable fallback 1ร— Universal fallback for any circuit

๐Ÿ“Š Real Performance Benchmarks

Clifford Circuit Performance (Error Correction)

Note: The following code examples are snippets and may require additional code to run.

# 50-qubit surface code simulation
qc = create_surface_code(50)  # 50 qubits, 1000+ gates
result = simulate(qc, shots=1000)

# Results: Stim backend selected automatically
# Execution time: 0.045s vs 45.2s with Qiskit (1000ร— speedup)

Quantum Algorithm Performance

Note: The following code examples are snippets and may require additional code to run.

# VQE simulation for quantum chemistry
from ariadne.algorithms import VQE
vqe_circuit = VQE(molecule='H2', basis='sto-3g')
result = simulate(vqe_circuit, shots=8192)

# Tensor network backend selected for low entanglement
# 50ร— faster than state vector simulation

๐ŸŽ“ Educational Examples

Learn Quantum Algorithms Step-by-Step

from ariadne.education import AlgorithmExplorer, InteractiveCircuitBuilder

# Explore 15+ quantum algorithms
explorer = AlgorithmExplorer()
print(explorer.list_algorithms())
# ['bell', 'deutsch_jozsa', 'grover', 'shor', 'vqe', 'qaoa', ...]

# Interactive learning with explanations
builder = InteractiveCircuitBuilder(2, "Bell State")
builder.add_hadamard(0, "Create superposition")
builder.add_cnot(0, 1, "Create entanglement")
circuit = builder.get_circuit()

result = simulate(circuit, shots=1000)
print(f"Only |00โŸฉ and |11โŸฉ states: {dict(result.counts)}")
# Demonstrates quantum entanglement!

Real Research Applications

# Reproduce famous quantum papers
from ariadne.algorithms import reproduce_paper

# Google's quantum supremacy experiment (simplified)
supremacy_circuit = reproduce_paper('arXiv:1910.11333')
result = simulate(supremacy_circuit, shots=1000000)

# IBM's quantum error correction (surface code)
surface_code = reproduce_paper('arXiv:2012.04108')
result = simulate(surface_code, shots=10000)

๐Ÿ”ง Advanced Features

Custom Routing Strategies

from ariadne import RoutingStrategy, ComprehensiveRoutingTree

# Optimize for specific constraints
router = ComprehensiveRoutingTree()

# Speed-first routing (default)
result = router.simulate(qc, strategy=RoutingStrategy.SPEED_FIRST)

# Memory-efficient for large circuits
result = router.simulate(qc, strategy=RoutingStrategy.MEMORY_EFFICIENT)

# Accuracy-first for critical applications
result = router.simulate(qc, strategy=RoutingStrategy.ACCURACY_FIRST)

Backend Comparison & Validation

from ariadne.enhanced_benchmarking import EnhancedBenchmarkSuite

# Compare all backends for your circuit
suite = EnhancedBenchmarkSuite()
comparison = suite.benchmark_backend_comparison(
    circuit=your_circuit,
    backends=['auto', 'qiskit', 'stim', 'tensor_network'],
    shots=1000
)

# Validate results across backends
for backend, result in comparison.items():
    print(f"{backend}: {result.execution_time:.3f}s")
    print(f"  Fidelity: {result.fidelity:.4f}")
    print(f"  Memory used: {result.memory_usage_mb:.1f}MB")

๐Ÿ†š Ariadne vs Other Tools

Feature Ariadne Qiskit Aer Cirq PennyLane Stim (Direct)
Automatic Backend Selection โœ… โŒ โŒ โŒ โŒ
Zero Configuration โœ… โŒ โŒ โŒ โŒ
Educational Tools โœ… Limited Limited โœ… โŒ
Hardware Acceleration โœ… Auto-detect Manual setup Manual setup Manual setup โŒ
Large Circuit Support โœ… โŒ (crashes) โŒ โŒ โœ… (Clifford only)
Cross-Platform โœ… โœ… โœ… โœ… โœ…
Performance Optimal Good Good Good Excellent (Clifford only)

When to choose Ariadne:

  • You want maximum performance without manual tuning
  • You're teaching/learning quantum computing
  • You need to simulate circuits that crash other tools
  • You want consistent results across different hardware
  • You're building production quantum applications

When NOT to choose Ariadne:

  • You need fine-grained control over specific backend parameters
  • You're doing research on simulator algorithms themselves
  • You have very specific hardware requirements

๐Ÿณ Docker Usage

Quick Start with Docker

# Pull and run latest version
docker pull ghcr.io/hmbown/ariadne-router:latest
docker run --rm ghcr.io/hmbown/ariadne-router:latest \
  python -c "import ariadne; print('Ariadne ready!')"

Quantum Full Environment (All Platforms)

# Build with all quantum libraries (10+ backends)
docker build --target quantum-full -t ariadne-quantum-full .

# Interactive session with all tools
docker run -it ariadne-quantum-full

# Run specific examples
docker run ariadne-quantum-full python -c "
from ariadne import get_available_backends
print('Available backends:', get_available_backends())
"

๐Ÿ“š Documentation & Learning

Quick Learning Path

  1. 5-Minute Tutorial โ†’ Try in Colab
  2. User Guide โ†’ USER_GUIDE.md
  3. Educational Examples โ†’ examples/education/
  4. API Reference โ†’ docs/source/
  5. Research Papers โ†’ docs/project/CITATIONS.bib
  6. Configuration Options โ†’ Configuration Options

For Different Audiences


๐Ÿค Contributing

We welcome contributions! See our Contributing Guide for:

  • ๐Ÿ› Bug reports and feature requests
  • ๐Ÿ”ง Adding new backends
  • ๐Ÿ“š Improving documentation
  • ๐Ÿงช Adding tests
  • ๐ŸŽฏ Performance improvements

Quick Contribution Setup

git clone https://github.com/Hmbown/ariadne.git
cd ariadne
pip install -e .[dev]
pre-commit install
pytest  # Run tests

๐Ÿ“ˆ Performance Tuning

For Maximum Speed

# Ariadne automatically optimizes, but you can help:
from ariadne import analyze_circuit

# Check what Ariadne sees in your circuit
analysis = analyze_circuit(your_circuit)
print(f"Detected properties: {analysis.properties}")

# Force specific backend if you know better
result = simulate(your_circuit, backend='stim')  # For Clifford circuits

For Large Circuits

# Reduce memory usage for 30+ qubit circuits
from ariadne import RoutingStrategy

result = simulate(
    large_circuit,
    shots=100,  # Fewer shots
    strategy=RoutingStrategy.MEMORY_EFFICIENT
)

๐Ÿ› ๏ธ Troubleshooting

Common Issues:

Problem Quick Fix
Import errors pip install -e .[dev]
Backend not found Check troubleshooting guide
Simulation fails Reduce qubit count or use analyze_circuit()
Performance issues See performance guide
Memory errors Use RoutingStrategy.MEMORY_EFFICIENT

Get Help:


๐Ÿ“Š Project Status

  • โœ… Production Ready - All tests passing, security audited
  • โœ… Cross-Platform - Windows, macOS, Linux support
  • โœ… Hardware Acceleration - CUDA, Metal, Apple Silicon
  • โœ… Educational Tools - 15+ algorithms, interactive tutorials
  • โœ… Enterprise Support - Docker, CI/CD, monitoring
  • ๐Ÿ”„ Active Development - New backends and features monthly


๐Ÿ“„ License

Apache 2.0 - see LICENSE for details.


Built for the quantum computing community ๐ŸŒŸ

โญ Star us on GitHub โ€ข ๐Ÿ“ฆ PyPI Package โ€ข ๐Ÿฆ Follow Updates โ€ข ๐Ÿ’ผ Enterprise Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ariadne_router-0.3.4.tar.gz (585.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ariadne_router-0.3.4-py3-none-any.whl (305.3 kB view details)

Uploaded Python 3

File details

Details for the file ariadne_router-0.3.4.tar.gz.

File metadata

  • Download URL: ariadne_router-0.3.4.tar.gz
  • Upload date:
  • Size: 585.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ariadne_router-0.3.4.tar.gz
Algorithm Hash digest
SHA256 c0449fdc653fbd83ed002e9a5be204cb12c2be30b9d6412d0527a75b1b4bb445
MD5 39378e4c762bf8615fc90a81f5ec229f
BLAKE2b-256 380ab4d5ee1718eebec2beff58f2ac564631f69faa1ae3ccd69dd6d60ed2002d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ariadne_router-0.3.4.tar.gz:

Publisher: release.yml on Hmbown/ariadne

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

File details

Details for the file ariadne_router-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: ariadne_router-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 305.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ariadne_router-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e776bb627c5c21fee4667944db02c383f282d510f7e52bcf20d5399880fea2f5
MD5 87ec544776065bd5dd6bd43b15471513
BLAKE2b-256 d5ad59f216c7087c092222ba2c326060407f674b1b67acb8cd5f5656f7f42a05

See more details on using hashes here.

Provenance

The following attestation bundles were made for ariadne_router-0.3.4-py3-none-any.whl:

Publisher: release.yml on Hmbown/ariadne

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