qnetbench.topology
Named nodes, undirected edges, and the physical link model the backends draw from.
Narrative guide: Topologies and links.
qnetbench.topology
Network topology and the physical link model the backends draw from.
Phase 0 ships direct-link topologies only (no entanglement swapping); multi-hop
routing and swapping arrive with the SeQUeNCe backend.
LinkModel
dataclass
LinkModel(
attempt_latency: float = 0.001,
link_fidelity: float = 0.95,
fidelity_std: float = 0.01,
)
Elementary-link entanglement generation parameters.
attempt_latency
class-attribute
instance-attribute
attempt_latency: float = 0.001
link_fidelity
class-attribute
instance-attribute
link_fidelity: float = 0.95
fidelity_std
class-attribute
instance-attribute
fidelity_std: float = 0.01
Topology
dataclass
Topology(
name: str,
nodes: tuple[NodeId, ...],
links: dict[frozenset[str], LinkModel],
)
link
Source code in qnetbench/topology.py
| def link(self, a: NodeId, b: NodeId) -> LinkModel:
try:
return self.links[frozenset((a, b))]
except KeyError:
raise KeyError(f"no link between {a!r} and {b!r} in topology {self.name!r}") from None
|
line2
A single direct link between two nodes.
Source code in qnetbench/topology.py
| def line2(
a: NodeId = "alice",
b: NodeId = "bob",
*,
link: LinkModel | None = None,
) -> Topology:
"""A single direct link between two nodes."""
return Topology(name="line2", nodes=(a, b), links={frozenset((a, b)): link or LinkModel()})
|
star
A hub-and-spoke topology: center shares a direct link with each leaf.
Multipartite applications (e.g. anonymous transmission) fuse the hub's
bipartite pairs into a shared multipartite state.
Source code in qnetbench/topology.py
| def star(
center: NodeId,
leaves: list[NodeId],
*,
link: LinkModel | None = None,
) -> Topology:
"""A hub-and-spoke topology: `center` shares a direct link with each leaf.
Multipartite applications (e.g. anonymous transmission) fuse the hub's
bipartite pairs into a shared multipartite state.
"""
return Topology(
name=f"star{1 + len(leaves)}",
nodes=(center, *leaves),
links={frozenset((center, leaf)): link or LinkModel() for leaf in leaves},
)
|