dqcnac.network.network module

Network class module.

class dqcnac.network.network.Network[source]

Bases: object

The network class representing a network of nodes and edges.

__init__() → None[source]

Initialize the network object

add_connection(node1: Node, node2: Node, properties: dict[str, list[int]] | None = None)[source]

Add a connection between two nodes.

Parameters:
  • node1 – the first node.

  • node2 – the second node.

  • properties – a dictionary of properties to add to the connection between node1 and node2.

add_node(node: Node)[source]

Add a node to the network.

Parameters:

node – the node to add.