qns.network.route package

Submodules

qns.network.route.dijkstra module

class qns.network.route.dijkstra.DijkstraRouteAlgorithm(name: str = 'dijkstra', metric_func: Callable[[QuantumChannel | ClassicChannel], float] | None = None)[source]

Bases: RouteImpl

This is the dijkstra route algorithm implement

INF = inf
build(nodes: List[QNode], channels: List[QuantumChannel | ClassicChannel])[source]

build static route tables for each nodes

Parameters:

channels – a list of quantum channels or classic channels

query(src: QNode, dest: QNode) List[Tuple[float, QNode, List[QNode]]][source]

query the metric, nexthop and the path

Parameters:
  • src – the source node

  • dest – the destination node

Returns:

A list of route paths. The result should be sortted by the priority. The element is a tuple containing: metric, the next-hop and the whole path.

qns.network.route.route module

exception qns.network.route.route.NetworkRouteError[source]

Bases: Exception

class qns.network.route.route.RouteImpl(name: str = 'route')[source]

Bases: object

This is the route protocol interface

build(nodes: List[QNode], channels: List[QuantumChannel | ClassicChannel])[source]

build static route tables for each nodes

Parameters:

channels – a list of quantum channels or classic channels

query(src: QNode, dest: QNode) List[Tuple[float, QNode, List[QNode]]][source]

query the metric, nexthop and the path

Parameters:
  • src – the source node

  • dest – the destination node

Returns:

A list of route paths. The result should be sortted by the priority. The element is a tuple containing: metric, the next-hop and the whole path.

Module contents

class qns.network.route.DijkstraRouteAlgorithm(name: str = 'dijkstra', metric_func: Callable[[QuantumChannel | ClassicChannel], float] | None = None)[source]

Bases: RouteImpl

This is the dijkstra route algorithm implement

INF = inf
build(nodes: List[QNode], channels: List[QuantumChannel | ClassicChannel])[source]

build static route tables for each nodes

Parameters:

channels – a list of quantum channels or classic channels

query(src: QNode, dest: QNode) List[Tuple[float, QNode, List[QNode]]][source]

query the metric, nexthop and the path

Parameters:
  • src – the source node

  • dest – the destination node

Returns:

A list of route paths. The result should be sortted by the priority. The element is a tuple containing: metric, the next-hop and the whole path.

exception qns.network.route.NetworkRouteError[source]

Bases: Exception

class qns.network.route.RouteImpl(name: str = 'route')[source]

Bases: object

This is the route protocol interface

build(nodes: List[QNode], channels: List[QuantumChannel | ClassicChannel])[source]

build static route tables for each nodes

Parameters:

channels – a list of quantum channels or classic channels

query(src: QNode, dest: QNode) List[Tuple[float, QNode, List[QNode]]][source]

query the metric, nexthop and the path

Parameters:
  • src – the source node

  • dest – the destination node

Returns:

A list of route paths. The result should be sortted by the priority. The element is a tuple containing: metric, the next-hop and the whole path.