comyx.core#

Package Summary#

Classes#

SISOCollection

Data store for SISO (single-input single-output) environments.

Reference#

class comyx.core.SISOCollection(realizations: int)[source]#

Data store for SISO (single-input single-output) environments.

SISO (single-input single-output) channels are the simplest type of channels. They are used to model the propagation of signals between transceivers each with a single antenna. Optionally, the link can be to a RIS, which inherently contains multiple elements.

Stores the links between the trasnsceivers/RISs and allows for easy access to channel gains, angles, and other properties.

Dictionary of all links. Keys are tuples of the form (transceiver/RIS, transceiver/RIS).

channel_gains#

Dictionary of channel gains. Keys are tuples of the form (transceiver/RIS, transceiver/RIS).

property realizations: int#

Return the number of channel realizations.

Add a link to the channel.

Order of the nodes is important. The first node is the transmitter and the second node is the receiver. For example, if the link is from node A to node B, then nodes=[A, B].

For when RISs are used, the first node is the transmitter, the second node is the RIS, and the third node is the receiver. For example, if the link is from node A to node B to node C, then nodes=[A, B, C].

When adding an RIS-assisted link, the fading and path loss arguments can be either a list of length 2 or a single dictionary. In the former case, the first element of the list corresponds to the fading and path loss arguments between the tx and the RIS, and the RIS and the rx, respectively. In the latter case, the same fading and path loss arguments are used for both links.

Parameters:
  • nodes – List of transceivers/RISs.

  • fading_args – Arguments for the fading model.

  • pathloss_args – Arguments for the pathloss model.

get_angle(nodes: str | Tuple[Transceiver | RIS, Transceiver | RIS], str_repr: bool = True) comyx.network.NDArrayFloat[source]#

Return the angle between the nodes.

If str_repr is True, then the nodes must be a string of the form f”{node1.id}->{node2.id}”. Otherwise, the nodes must be a list of the form [node1, node2]. Can also be a list of the form f”{node1.id}->{node2.id}->{node3.id}” or [node1, node2, node3] as in the case of an RIS-assisted link.

Example input:
>>> get_angle("A->B") # Angle from node A to node B
>>> get_angle(["A", "B"]) # Equivalent to the above
Parameters:
  • nodes – List of transceivers/RISs.

  • str_repr – Whether to return a string representation of the nodes.

Returns:

Angle between the nodes.

get_channel_gain(nodes: str | Tuple[Transceiver | RIS, Transceiver | RIS], str_repr: bool = True) comyx.network.NDArrayComplex[source]#

Return the channel gain between the nodes.

If str_repr is True, then the nodes must be a string of the form f”{node1.id}->{node2.id}”. Otherwise, the nodes must be a list of the form [node1, node2]. Can also be a list of the form f”{node1.id}->{node2.id}->{node3.id}” or [node1, node2, node3] as in the case of an RIS-assisted link.

Example input:
>>> get_channel_gain("A->B") # Channel gain from node A to node B
>>> get_channel_gain(["A", "B"]) # Equivalent to the above
Parameters:
  • nodes – List of transceivers/RISs.

  • str_repr – Whether to return a string representation of the nodes.

Returns:

Channel gain between the nodes.

get_distance(nodes: str | Tuple[Transceiver | RIS, Transceiver | RIS], str_repr: bool = True)[source]#

Return the distance between the nodes.

If str_repr is True, then the nodes must be a string of the form f”{node1.id}->{node2.id}”. Otherwise, the nodes must be a list of the form [node1, node2]. Can also be a list of the form f”{node1.id}->{node2.id}->{node3.id}” or [node1, node2, node3] as in the case of an RIS-assisted link.

Example input:
>>> get_distance("A->B") # Distance from node A to node B
>>> get_distance(["A", "B"]) # Equivalent to the above
Parameters:
  • nodes – List of transceivers/RISs.

  • str_repr – Whether to return a string representation of the nodes.

Returns:

Distance between the nodes.

Return the link between the nodes.

If str_repr is True, then the nodes must be a string of the form f”{node1.id}->{node2.id}”. Otherwise, the nodes must be a list of the form [node1, node2]. Can also be a list of the form f”{node1.id}->{node2.id}->{node3.id}” or [node1, node2, node3] as in the case of an RIS-assisted link.

Example input:
>>> get_link("A->B") # Link from node A to node B
>>> get_link(["A", "B"]) # Equivalent to the above
Parameters:
  • nodes – List of transceivers/RISs.

  • str_repr – Whether to return a string representation of the nodes.

Returns:

Link between the nodes.

get_magnitude(nodes: str | Tuple[Transceiver | RIS, Transceiver | RIS], str_repr: bool = True) comyx.network.NDArrayFloat[source]#

Return the magnitude of the channel gain between the nodes.

If str_repr is True, then the nodes must be a string of the form f”{node1.id}->{node2.id}”. Otherwise, the nodes must be a list of the form [node1, node2]. Can also be a list of the form f”{node1.id}->{node2.id}->{node3.id}” or [node1, node2, node3] as in the case of an RIS-assisted link.

Example input:
>>> get_magnitude("A->B") # Magnitude from node A to node B
>>> get_magnitude(["A", "B"]) # Equivalent to the above
Parameters:
  • nodes – List of transceivers/RISs.

  • str_repr – Whether to return a string representation of the nodes.

Returns:

Magnitude of the channel gain between the nodes.