qns.network.route package

Submodules

qns.network.route.dijkstra module

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

Bases: qns.network.route.route.RouteImpl

This is the dijkstra route algorithm implement

build(nodes: List[qns.entity.node.node.QNode], channels: List[Union[qns.entity.qchannel.qchannel.QuantumChannel, qns.entity.cchannel.cchannel.ClassicChannel]])[source]

build static route tables for each nodes

Parameters

channels – a list of quantum channels or classic channels

query(src: qns.entity.node.node.QNode, dest: qns.entity.node.node.QNode) List[Tuple[float, qns.entity.node.node.QNode, List[qns.entity.node.node.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[qns.entity.node.node.QNode], channels: List[Union[qns.entity.qchannel.qchannel.QuantumChannel, qns.entity.cchannel.cchannel.ClassicChannel]])[source]

build static route tables for each nodes

Parameters

channels – a list of quantum channels or classic channels

query(src: qns.entity.node.node.QNode, dest: qns.entity.node.node.QNode) List[Tuple[float, qns.entity.node.node.QNode, List[qns.entity.node.node.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: Optional[Callable[[Union[qns.entity.qchannel.qchannel.QuantumChannel, qns.entity.cchannel.cchannel.ClassicChannel]], float]] = None)[source]

Bases: qns.network.route.route.RouteImpl

This is the dijkstra route algorithm implement

build(nodes: List[qns.entity.node.node.QNode], channels: List[Union[qns.entity.qchannel.qchannel.QuantumChannel, qns.entity.cchannel.cchannel.ClassicChannel]])[source]

build static route tables for each nodes

Parameters

channels – a list of quantum channels or classic channels

query(src: qns.entity.node.node.QNode, dest: qns.entity.node.node.QNode) List[Tuple[float, qns.entity.node.node.QNode, List[qns.entity.node.node.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[qns.entity.node.node.QNode], channels: List[Union[qns.entity.qchannel.qchannel.QuantumChannel, qns.entity.cchannel.cchannel.ClassicChannel]])[source]

build static route tables for each nodes

Parameters

channels – a list of quantum channels or classic channels

query(src: qns.entity.node.node.QNode, dest: qns.entity.node.node.QNode) List[Tuple[float, qns.entity.node.node.QNode, List[qns.entity.node.node.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.