qnetbench.backends¶
The reference execution engine, and the replay seam every simulator backend fills.
Narrative guide: Backends and Extending the suite.
The replay seam¶
A supply backend implements exactly one method, _make_supply(node, peer),
returning the delivered-pair stream for an edge.
qnetbench.backends.replay
¶
Shared machinery for entanglement-supply backends.
A supply backend lets an external simulator own the entanglement-generation
physics (delivery timing + fidelity) and replays that supply through the verified
reference engine, which runs the local quantum ops and classical protocol. Both
the SeQUeNCe and NetSquid backends are ~1-method subclasses of ReplayBackend:
they only implement _make_supply. This is the "adding a backend is easy"
property the suite's adoption goal depends on.
Supply
dataclass
¶
A replayable entanglement supply between one pair of nodes.
inter_arrivals[i] is the simulated-seconds gap before delivery i (the first
is measured from the reservation/window start); fidelities[i] is that pair's
delivered fidelity. classical_latency is the one-way classical delay.
ReplayBackend
¶
ReplayBackend(
topology: Topology,
seed: int,
arbitration: str = "native",
policy: Policy | None = None,
)
Bases: ReferenceBackend
A ReferenceBackend whose entanglement physics is replayed from a pre-generated
per-edge Supply. Subclasses implement _make_supply.
Source code in qnetbench/backends/replay.py
The reference backend¶
qnetbench.backends.reference.backend
¶
The reference backend: a pure-Python, dependency-free implementation of the api. It is the CI oracle and the reference against which the SeQUeNCe and NetSquid backends are checked for equivalence — not a headline deliverable, but the only backend that runs anywhere without registration.
ReferenceBackend
¶
ReferenceBackend(
topology: Topology,
seed: int,
arbitration: str = "native",
policy: Policy | None = None,
pair_age: float = 0.0,
coherence_time: float = inf,
)
Source code in qnetbench/backends/reference/backend.py
run
¶
run(
app: Application,
cfg: dict[str, object],
roles_to_nodes: dict[Role, NodeId],
) -> list[Event]
Source code in qnetbench/backends/reference/backend.py
SeQUeNCe¶
qnetbench.backends.sequence.backend
¶
The SeQUeNCe backend (hybrid / entanglement-supply model).
SeQUeNCe owns the entanglement-generation physics: for each edge we run a
SeQUeNCe reservation and extract the delivered-pair stream (inter-arrival timing +
fidelity). The shared ReplayBackend then replays that supply through the
verified reference engine. Requires pip install qnetbench[sequence].
SequenceBackend
¶
SequenceBackend(
topology: Topology,
seed: int,
arbitration: str = "native",
policy: Policy | None = None,
window_s: float = 1.0,
)
Bases: ReplayBackend
Source code in qnetbench/backends/sequence/backend.py
NetSquid¶
qnetbench.backends.netsquid.backend
¶
The NetSquid backend (hybrid / entanglement-supply model).
NetSquid owns the entanglement-generation physics (a QSource elementary link with
fibre delay + depolarising noise); the shared ReplayBackend replays that supply
through the verified reference engine. Requires pip install
qnetbench[netsquid] (NetSquid ships from https://pypi.netsquid.org).
NetSquidBackend
¶
NetSquidBackend(
topology: Topology,
seed: int,
arbitration: str = "native",
policy: Policy | None = None,
window_s: float = 1.0,
)
Bases: ReplayBackend