Source code for qpce.router

"""Quantum Router."""

import collections

[docs]class Router: # TODO: Remove this when we have more methods # pylint:disable=too-few-public-methods """A quantum router. A quantum router object represents a quantum router that is part of a quantum network. Quantum routers are interconnected by quantum links.""" def __init__(self, network, name): """Initialize a quantum router. Args: network (Network): The network in which the router is created. name (str): The name of quantum router; uniquely identifies the router within the quantum network. Raises: AssertionError if there is already a router with the same name in the network.""" self.network = network self.name = name self._next_available_port = 0 self.links = collections.OrderedDict() # Link objects indexed by local port network.add_router(self)