Networks
- class pytket_dqc.networks.server_network.ServerNetwork(server_coupling: list[list[int]])
Class for the management of networks of quantum computers.
- __init__(server_coupling: list[list[int]])
Initialisation function.
- Parameters:
server_coupling (list[list[int]]) – List of pairs of server indices. Each pair specifies that there is a connection between those two servers.
- Raises:
Exception – Raised if internal lists are not a pair.
Exception – Raised if the network is unconnected.
- is_placement(placement: Placement) bool
Checks that placement is valid for this network. In particular check that all of the servers used by the placement are indeed in this network.
- Parameters:
placement (Placement) – Placement onto network.
- Returns:
Is placement valid.
- Return type:
bool
- get_server_list() list[int]
Return list of servers.
- Returns:
List of server indices.
- Return type:
list[int]
- draw_server_network() None
Draw server network using networkx draw method.
- class pytket_dqc.networks.nisq_network.NISQNetwork(server_coupling: list[list[int]], server_qubits: dict[int, list[int]], server_ebit_mem: dict[int, int] | None = None)
Class for the management of NISQ networks of quantum computers. Child class of ServerNetwork. Adds additional functionality to manage information about the internal architectures of servers.
- __init__(server_coupling: list[list[int]], server_qubits: dict[int, list[int]], server_ebit_mem: dict[int, int] | None = None) None
Initialisation function. Performs checks on inputted network description.
- Parameters:
server_coupling (list[list[int]]) – List of pairs of server indices. Each pair specifies that there is a connection between those two servers.
server_qubits (dict[int, list[int]]) – Dictionary from server index to qubits it contains.
server_ebit_mem (Optional[dict[int, int]]) – Dictionary from server index to its communication capacity. Optional; if not given, assumes unbounded.
- Raises:
Exception – Raised if a server is empty.
Exception – Raised if a qubit is in more than one server.
Exception – When the user provides server_ebit_mem, raised if the list of servers does not match self.get_server_list().
- get_qubit_list() list[int]
Return list of qubit indices.
- Returns:
List of qubit indices.
- Return type:
list[int]
- draw_nisq_network() None
Draw network using netwrokx draw method.
- to_dict() dict[str, Union[list[list[int]], dict[int, list[int]], dict[int, int]]]
Serialise NISQNetwork.
- Returns:
Dictionary serialisation of NISQNetwork. Dictionary has keys ‘server_coupling’ and ‘server_qubits’.
- Return type:
dict[str, Union[ list[list[int]], dict[int, list[int]], dict[int, int]]]
- classmethod from_dict(network_dict: dict[str, Union[list[list[int]], dict[int, list[int]]]]) NISQNetwork
Constructor for
NISQNetwork
using dictionary created byto_dict
.- Parameters:
network_dict (dict[str, Union[list[list[int]], dict[int, list[int]]]]) – Dictionary with keys ‘server_coupling’ and ‘server_qubits’.
- Returns:
NISQNetwork with variables corresponding to dictionary values.
- Return type:
- class pytket_dqc.networks.nisq_network.AllToAll(n_servers: int, qubits_per_server: int)
NISQNetwork consisting of uniformly sized, all to all connected servers.
- __init__(n_servers: int, qubits_per_server: int)
Initialisation function
- Parameters:
n_server (int) – Number of servers.
qubits_per_server (int) – Number of qubits per server
- class pytket_dqc.networks.random_networks.ScaleFreeNISQNetwork(n_servers: int, n_qubits: int, **kwargs)
NISQNetwork with underlying server network that is scale-free. This is to say one whose degree distribution follows a power law. The ebit memory for each module is the the larger of 2 and largest integer less than the average number of qubits in each module.
- __init__(n_servers: int, n_qubits: int, **kwargs)
Initialisation method for scale-free network.
- Parameters:
n_servers (int) – The number of servers in the network.
n_qubits (int) – The total number of qubits. Qubits are assigned randomly to each server, with at least one per server.
- Raises:
Exception – Raised if the number of qubits is less than the number of servers.
- class pytket_dqc.networks.random_networks.SmallWorldNISQNetwork(n_servers: int, n_qubits: int, **kwargs)
NISQNetwork with underlying server network that is a small-world network. This is to say most servers can be reached from every other server by a small number of steps. The ebit memory for each module is the the larger of 2 and largest integer less than the average number of qubits in each module.
- __init__(n_servers: int, n_qubits: int, **kwargs)
Initialisation method for small world network.
- Parameters:
n_servers (int) – The number of servers in the network.
n_qubits (int) – The total number of qubits. Qubits are assigned randomly to each server, with at least one per server.
- Raises:
Exception – Raised if the number of qubits is less than the number of servers.
- class pytket_dqc.networks.random_networks.RandomNISQNetwork(n_servers: int, n_qubits: int, **kwargs)
NISQNetwok with underlying server network that is random but connected. In particular graphs are erdos renyi random graphs, post selected on graphs that are connected. The ebit memory for each module is the the larger of 2 and largest integer less than the average number of qubits in each module.
- __init__(n_servers: int, n_qubits: int, **kwargs)
Initialisation function.
- Parameters:
n_servers (int) – The number of servers.
n_qubits (int) – The total number of qubits.
- Raises:
Exception – Raised if the number of qubits is less than the number of servers.
- Key edge_prob:
The probability of an edge between two servers, defaults to 2/(n_servers-1), adding roughly 2 edges per server.