Complete Import Map
Everything available after from qnet_core import .... This page lists all 32 classes and 12 module-level functions exported by the Python SDK.
Classes (32)
Engine
| Class | Purpose |
|---|---|
QNetEngine | Main simulation engine — create, define topology, run protocols |
SimulationConfig | Simulation timeline config (cutoff time, step resolution, physical layer) |
Core Types
| Class | Purpose |
|---|---|
PhysicalConfig | Physical layer constants (alpha loss defaults to 0.22 dB/km) |
NodeDefinition | Runtime node with ID and T2 coherence time |
LinkDefinition | Runtime link with distance, fidelity, rate, type |
StrategyType | Routing strategy enum (LowestLatency/HighestFidelity/HighestSuccess) |
LinkType | Physical medium enum (Fiber / Satellite) |
SatelliteConditions | Atmospheric conditions helper for satellite links |
Result Types
| Class | Purpose |
|---|---|
SimulationResult | Output from request_entanglement() |
MonteCarloStats | Output from simulate() ensemble runs |
Topology & Comparison
| Class | Purpose |
|---|---|
NetworkTopologyPayload | Generated topology (nodes + links) from generate_topology() |
TopologyEndpoints | Endpoint mapping for compare_topologies() |
TopologySnapshot | Programmatic topology snapshot (for diffing) |
TopologyMetadata | Snapshot metadata (name, version) |
TopologyConfig | Snapshot config (alpha_loss, gamma_swapping) |
TopologyDiff | Diff result between two snapshots |
.qnet File Format
| Class | Purpose |
|---|---|
QNetFile | .qnet container — load, save, diff JSON topologies |
QNetNode | Node type for .qnet format |
QNetLink | Link type for .qnet format |
QNetConfig | Physics config for .qnet files |
QNetConstraints | Fidelity/latency constraints for .qnet files |
QNetMetadata | Metadata (name, description, author, timestamp) for .qnet files |
QNetNodeType | Node type enum (Ground / Satellite / Repeater) |
QNetLinkType | Link type enum (Fiber / Satellite) |
QNetSatelliteExtension | Satellite extension fields for .qnet links |
QKD Protocol
| Class | Purpose |
|---|---|
QKDParameters | BB84 protocol parameters (rounds, error tolerance, etc.) |
QKDResult | Single QKD execution result |
QKDStats | Monte Carlo QKD statistics (planned) |
Teleportation Protocol
| Class | Purpose |
|---|---|
TeleportationParameters | Teleportation parameters (source, target, relay nodes) |
TeleportationOutcome | Single teleportation execution result |
TeleportationStats | Monte Carlo teleportation statistics (planned) |
Distributed Computing Protocol
| Class | Purpose |
|---|---|
CoordinationTopology | Party coordination pattern (star/ring/mesh/arbitrary) |
MeasurementBasis | Measurement basis config (type + correlation strength) |
BasisType | Measurement basis enum (GHZ / Cluster / GraphGraph) |
DistributedComputingParameters | Distributed computing parameters |
PartyOutcome | Per-party measurement outcome in distributed computation |
DistributedComputingResult | Distributed computation result |
DistributedComputingStats | Monte Carlo stats for distributed computing (planned) |
Module-Level Functions (12)
| Function | Returns | Purpose |
|---|---|---|
from_qnet_file(filepath) | QNetEngine | Factory: load a .qnet file and return an initialized engine |
generate_topology(name) | NetworkTopologyPayload | Generate a pre-built topology (telecom_backbone, repeater_chain, hybrid_satellite_fiber) |
compare_topologies(endpoints, ...) | TopologyComparisonReport | Compare topologies via Monte Carlo simulation |
save_topology(engine, filepath) | None | Save engine's current topology to .qnet file |
load_topology(engine, filepath) | None | Load a .qnet file into an existing engine |
validate(filepath) | dict | Validate a .qnet file (returns dict with valid/errors/warnings — never raises) |
load_qnet_file(filepath) | QNetFile | Load and parse a .qnet JSON file as Python objects |
diff(file1, file2) | dict | Diff two .qnet files on disk |
diff_topologies(snap1, snap2) | TopologyDiff | Diff two topology snapshots programmatically |
qkd(engine, from_node, to_node, ...) | QKDResult | Run BB84-style QKD (convenience wrapper) |
teleportation(engine, source, target, ...) | TeleportationOutcome | Execute state teleportation (convenience wrapper) |
distributed_computation(engine, participants, ...) | DistributedComputingResult | Run distributed quantum computation (convenience wrapper) |
Typical Imports
# Core simulation
from qnet_core import (
QNetEngine, NodeDefinition, LinkDefinition,
StrategyType, PhysicalConfig, SimulationConfig,
)
# Pre-built topologies
from qnet_core import generate_topology
# Higher-level protocols
from qnet_core import (
QKDParameters, TeleportationParameters,
CoordinationTopology, MeasurementBasis, BasisType,
)
# .qnet file management
from qnet_core import (
QNetFile, QNetNodeType, QNetLinkType,
from_qnet_file, validate, diff, load_qnet_file, save_topology,
)
# Topology comparison
from qnet_core import compare_topologies, TopologyEndpoints
What's next
- Tutorial Index — guided walkthroughs of every feature
- API Reference: QNetEngine — detailed engine documentation