qns.network.topology package
Submodules
qns.network.topology.basictopo module
- class qns.network.topology.basictopo.BasicTopology(nodes_number, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
BasicTopology includes nodes_number Qnodes. None of them are connected with each other
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
qns.network.topology.gridtopo module
- class qns.network.topology.gridtopo.GridTopology(nodes_number, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
GridTopology includes nodes_number Qnodes. nodes_number should be a perfect square number. The topology is a square grid pattern, where each node has 4 neighbors.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
qns.network.topology.linetopo module
- class qns.network.topology.linetopo.LineTopology(nodes_number, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
LineTopology includes nodes_number Qnodes. The topology is a line pattern.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
qns.network.topology.randomtopo module
- class qns.network.topology.randomtopo.RandomTopology(nodes_number, lines_number: int, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
RandomTopology includes nodes_number Qnodes. The topology is randomly generated.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
qns.network.topology.topo module
- class qns.network.topology.topo.ClassicTopology(value)[source]
Bases:
Enum
An enumeration.
- All = 2
- Empty = 1
- Follow = 3
- class qns.network.topology.topo.Topology(nodes_number: int, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
object
Topology is a factory for QuantumNetwork
- add_cchannels(classic_topo: ClassicTopology = ClassicTopology.Empty, nl: List[QNode] = [], ll: List[QuantumChannel] | None = None)[source]
build classic network topology
- Parameters:
classic_topo (ClassicTopology) – Classic topology, ClassicTopology.Empty -> no connection ClassicTopology.All -> every nodes are connected directly ClassicTopology.Follow -> follow the quantum topology
nl (List[qns.entity.node.node.QNode]) – a list of quantum nodes
ll (List[qns.entity.qchannel.qchannel.QuantumChannel]) – a list of quantum channels
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
qns.network.topology.treetopo module
- class qns.network.topology.treetopo.TreeTopology(nodes_number, children_number: int = 2, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
TreeTopology includes nodes_number Qnodes. The topology is a tree pattern, where each parent has children_num children.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
qns.network.topology.waxmantopo module
- class qns.network.topology.waxmantopo.WaxmanTopology(nodes_number: int, size: float, alpha: float, beta: float, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
WaxmanTopology is the random topology generator using Waxman’s model.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
qns.network.topology.erdosrenyitopo module
- class qns.network.topology.erdosrenyitopo.ErdosRenyiTopology(nodes_number, generate_prob: float, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
ErdosRenyiTopology includes nodes_number Qnodes. The topology is randomly generated following the Erdos-Renyi model(G(n,p) Model). Each pair of Qnodes has a probability generate_prob to be connected by a QuantumChannel.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
qns.network.topology.barabasialberttopo module
- class qns.network.topology.barabasialberttopo.BarabasiAlbertTopology(nodes_number, new_nodes_egdes: int, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
BarabasiAlbertTopology is a random topology generator based on the Barabasi-Albert model. Each new QNode added has new_nodes_egdes to existing QNodes. The probability of a new QNode connecting to an existing QNode is proportional to the degree of the existing QNode.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
qns.network.topology.dualbarabasialberttopo module
- class qns.network.topology.dualbarabasialberttopo.DualBarabasiAlbertTopology(nodes_number, edges_num1: int, edges_num2: int, prob: float, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
DualBarabasiAlbertTopology is a random topology generator based on the Dual Barabasi-Albert model. Each new QNode added has either edges_num1 or edges_num2 edges to existing QNodes. The probability of a new QNode connecting to an existing QNode is proportional to the degree of the existing QNode.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
Module contents
- class qns.network.topology.BarabasiAlbertTopology(nodes_number, new_nodes_egdes: int, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
BarabasiAlbertTopology is a random topology generator based on the Barabasi-Albert model. Each new QNode added has new_nodes_egdes to existing QNodes. The probability of a new QNode connecting to an existing QNode is proportional to the degree of the existing QNode.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
- class qns.network.topology.BasicTopology(nodes_number, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
BasicTopology includes nodes_number Qnodes. None of them are connected with each other
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
- class qns.network.topology.DualBarabasiAlbertTopology(nodes_number, edges_num1: int, edges_num2: int, prob: float, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
DualBarabasiAlbertTopology is a random topology generator based on the Dual Barabasi-Albert model. Each new QNode added has either edges_num1 or edges_num2 edges to existing QNodes. The probability of a new QNode connecting to an existing QNode is proportional to the degree of the existing QNode.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
- class qns.network.topology.ErdosRenyiTopology(nodes_number, generate_prob: float, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
ErdosRenyiTopology includes nodes_number Qnodes. The topology is randomly generated following the Erdos-Renyi model(G(n,p) Model). Each pair of Qnodes has a probability generate_prob to be connected by a QuantumChannel.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
- class qns.network.topology.GridTopology(nodes_number, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
GridTopology includes nodes_number Qnodes. nodes_number should be a perfect square number. The topology is a square grid pattern, where each node has 4 neighbors.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
- class qns.network.topology.LineTopology(nodes_number, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
LineTopology includes nodes_number Qnodes. The topology is a line pattern.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
- class qns.network.topology.RandomTopology(nodes_number, lines_number: int, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
RandomTopology includes nodes_number Qnodes. The topology is randomly generated.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
- class qns.network.topology.Topology(nodes_number: int, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
object
Topology is a factory for QuantumNetwork
- add_cchannels(classic_topo: ClassicTopology = ClassicTopology.Empty, nl: List[QNode] = [], ll: List[QuantumChannel] | None = None)[source]
build classic network topology
- Parameters:
classic_topo (ClassicTopology) – Classic topology, ClassicTopology.Empty -> no connection ClassicTopology.All -> every nodes are connected directly ClassicTopology.Follow -> follow the quantum topology
nl (List[qns.entity.node.node.QNode]) – a list of quantum nodes
ll (List[qns.entity.qchannel.qchannel.QuantumChannel]) – a list of quantum channels
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
- class qns.network.topology.TreeTopology(nodes_number, children_number: int = 2, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
TreeTopology includes nodes_number Qnodes. The topology is a tree pattern, where each parent has children_num children.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel
- class qns.network.topology.WaxmanTopology(nodes_number: int, size: float, alpha: float, beta: float, nodes_apps: List[Application] = [], qchannel_args: Dict = {}, cchannel_args: Dict = {}, memory_args: List[Dict] | None = {})[source]
Bases:
Topology
WaxmanTopology is the random topology generator using Waxman’s model.
- build() Tuple[List[QNode], List[QuantumChannel]] [source]
build the special topology
- Returns:
the list of QNodes and the list of QuantumChannel