Installation
Install qnet-core from PyPI, or build from source using Maturin for the latest development version.
From PyPI (Recommended)
pip install qnet-core
Verify the installation:
import qnet_core
print(qnet_core.__version__) # package version
Build from Source
If you're developing qnet-core and want to test your changes:
# Install build tooling
pip install maturin
# Build and install in development mode (watch for changes)
maturin develop
# Or build a wheel
maturin build --release
# Install the wheel
pip install target/wheels/qnet_core-*.whl
Verify Installation
Run the first example to confirm everything works:
from qnet_core import QNetEngine, NodeDefinition, LinkDefinition, StrategyType
engine = QNetEngine()
engine.define_network(
nodes=[NodeDefinition(id="A", memory_lifetime_t2=1.0),
NodeDefinition(id="B", memory_lifetime_t2=1.0)],
links=[LinkDefinition("A", "B", distance_km=10.0, base_fidelity=0.95, generation_rate_hz=1000.0)],
)
result = engine.request_entanglement("A", "B", fidelity_target=0.90, max_latency_ms=5000.0, strategy=StrategyType.HighestFidelity)
print(f"Success: {result.success}") # Should print True for a direct 10 km link
System Requirements
- Python: 3.9 or later (PyO3 bindings require recent Python ABI)
- Rust toolchain: Required only when building from source (
cargoinstalled via rustup) - OS: Linux, macOS, Windows (via MSVC toolchain on Windows)
Updating
pip install --upgrade qnet-core
What's next
- Quick Start — your first simulation in 5 lines
- API Reference Index — complete class/function documentation