:py:mod:`kosmos.topology.node` ============================== .. py:module:: kosmos.topology.node Classes ------- .. py:class:: NodeId Identifier of a node. .. attribute:: value Identifier string. :type: str ---- .. py:class:: NodeType(*args, **kwds) Bases: :py:class:`enum.Enum` Type of node. ---- .. py:class:: NodeRole(*args, **kwds) Bases: :py:class:`enum.Enum` Role of a node. ---- .. py:class:: Node Bases: :py:class:`abc.ABC` Base for network nodes. .. attribute:: id Node identifier. :type: NodeId .. attribute:: label Label of the node. Defaults to None. :type: str | None .. attribute:: roles Role(s) of the node. :type: Collection[NodeRole] | .. rubric:: Properties .. py:property:: type Type of the node. | .. rubric:: Methods .. py:method:: has_role(role: NodeRole) -> bool Check if this node has a given role. :param role: Role to check. :returns: True if the role is present. ---- .. py:class:: ClassicalNode Bases: :py:class:`Node` Classical node. .. attribute:: id Node identifier. :type: NodeId .. attribute:: label Label of the node. Defaults to None. :type: str | None .. attribute:: roles Role(s) of the node. :type: Collection[NodeRole] | .. rubric:: Properties .. py:property:: type Type of the node. ---- .. py:class:: QuantumNode Bases: :py:class:`Node` Quantum node. .. attribute:: id Node identifier. :type: NodeId .. attribute:: label Label of the node. Defaults to None. :type: str | None .. attribute:: roles Role(s) of the node. :type: Collection[NodeRole] .. attribute:: num_qubits Number of physical qubits. :type: int .. attribute:: gate_fid Fidelity of multi-qubit gates. Defaults to 1.0. :type: float .. attribute:: meas_fid Fidelity of single-qubit measurements. Defaults to 1.0. :type: float .. attribute:: coherence_time Maximum storage time before decoherence in seconds. :type: float .. attribute:: has_transceiver Whether the node has a quantum transceiver. Defaults to False. :type: bool | .. rubric:: Properties .. py:property:: type Type of the node.