Source code for kosmos.topology.link

import math
from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum
from typing import ClassVar

from kosmos.topology.node import Node


[docs] @dataclass(frozen=True) class LinkId: """Identifier of a link. Attributes: value (str): Identifier string. """ value: str def __post_init__(self) -> None: """Validate that the value is non-empty.""" if not self.value or not self.value.strip(): msg = "LinkId must be a non-empty string." raise ValueError(msg) def __str__(self) -> str: """Return the string value.""" return self.value
[docs] class LinkType(Enum): """Type of link.""" QUANTUM = "quantum" CLASSICAL = "classical"