kosmos.topology.node

Classes

class NodeId

Identifier of a node.

value

Identifier string.

Type:

str


class NodeType(*args, **kwds)

Bases: enum.Enum

Type of node.


class NodeRole(*args, **kwds)

Bases: enum.Enum

Role of a node.


class Node

Bases: abc.ABC

Base for network nodes.

id

Node identifier.

Type:

NodeId

label

Label of the node. Defaults to None.

Type:

str | None

roles

Role(s) of the node.

Type:

Collection[NodeRole]


Properties

property type

Type of the node.


Methods

has_role(role: NodeRole) bool

Check if this node has a given role.

Parameters:

role – Role to check.

Returns:

True if the role is present.


class ClassicalNode

Bases: Node

Classical node.

id

Node identifier.

Type:

NodeId

label

Label of the node. Defaults to None.

Type:

str | None

roles

Role(s) of the node.

Type:

Collection[NodeRole]


Properties

property type

Type of the node.


class QuantumNode

Bases: Node

Quantum node.

id

Node identifier.

Type:

NodeId

label

Label of the node. Defaults to None.

Type:

str | None

roles

Role(s) of the node.

Type:

Collection[NodeRole]

num_qubits

Number of physical qubits.

Type:

int

gate_fid

Fidelity of multi-qubit gates. Defaults to 1.0.

Type:

float

meas_fid

Fidelity of single-qubit measurements. Defaults to 1.0.

Type:

float

coherence_time

Maximum storage time before decoherence in seconds.

Type:

float

has_transceiver

Whether the node has a quantum transceiver. Defaults to False.

Type:

bool


Properties

property type

Type of the node.