Skip to main content

qnet-core Python SDK

Quantum Network Entanglement Simulation Engine

Simulate entanglement distribution across repeater networks, model link generation protocols, fidelity purification, routing strategies, QKD key distribution, quantum teleportation, and distributed quantum computing.

Get Started →Browse Tutorials

What you can do with qnet-core

🔗

Entanglement Distribution

Simulate entanglement generation and purification across quantum repeater networks with configurable topology, routing strategies, and stochastic link models.

Learn more →
📊

Monte Carlo Ensembles

Run thousands of simulation trials to measure success rates, mean latency, fidelity distributions, and per-link utilization across your network.

Learn more →
🔐

QKD Key Distribution

Run BB84-style quantum key distribution protocols between nodes. Inspect QBER, secret key length, and protocol efficiency.

Learn more →

State Teleportation

Teleport quantum states across multi-hop paths with optional relay nodes. Compare relayed vs direct performance.

Learn more →
⚛️

Distributed Computing

Coordinate multi-party quantum computations using star, ring, mesh, or arbitrary topologies with GHZ / cluster / graph measurement bases.

Learn more →
📄

.qnet File Format

Author, validate, diff, and version-control network topologies as JSON. Build configs programmatically or reload from disk.

Learn more →

Quick Start

Three steps to your first simulation: install, define a network, and request entanglement.

Installation
pip install qnet-core
from qnet_core import (
    QNetEngine, NodeDefinition, LinkDefinition,
    StrategyType,
)

engine = QNetEngine()

engine.define_network(
    nodes=[
        NodeDefinition(id="Alice", memory_lifetime_t2=1.0),
        NodeDefinition(id="Bob",   memory_lifetime_t2=1.0),
    ],
    links=[
        LinkDefinition("Alice", "Bob", distance_km=10.0,
                       base_fidelity=0.95, generation_rate_hz=1000.0),
    ],
)

result = engine.request_entanglement(
    from_node="Alice",
    to="Bob",
    fidelity_target=0.90,
    max_latency_ms=5000.0,
    strategy=StrategyType.HighestFidelity,
)

print(f"Success: {result.success}")
print(f"Fidelity: {result.final_fidelity:.4f}")
print(f"Path: {' → '.join(result.execution_path)}")