progress.hardware.llps.llp

This module contains an abstract class for a generic link protocol in our architecture. The class sums up the core services that a link layer protocol must provide to the StackEngine and to the upper layers in general.

class progress.hardware.llps.llp.LinkProtocol(num_positions, qnic, node=None, other_node_info=None, name=None)[source]

Bases: ABC, ServiceProtocol

This class is an abstract class for a generic link protocol in our architecture. The class sums up the core services that a link layer protocol must provide to the QHAL and to pqnet in general. When a new entangled pair is generated, the link protocol signals the event to the QHAL, which will handle the new resource. Each link protocol usually depends on the hardware it is running on, also involving the connection to the other node (e.g. BMS connection, EPS in the middle, etc.).

Parameters:
qnicstr

The port name on which the protocol will run.

num_positionsint

The number of qubits available for the link layer protocol.

nodeRepeater or None, optional

The node on which this protocols will run. If None, it must be set before starting the protocol and the link layer protocol must be manually subscribed to the node through the method subscribe_link_protocol().

other_node_infotuple or None, optional

A two-elements tuple where the first is the neighbor node id (int), and the second is the name of its attached interface (str). This info is used to generate a Token from each qubit. If None, it must be set before the protocol is started.

namestr, optional

The name of the instance, defaults to the class name.

Notes

Link protocols also act as a service to the physical service. It supports three request types:

  1. req_reset

    Free a qubit for a new entanglement.

  2. req_stop_generation

    Stop the mid-point entangling source. If already stopped, it has no effect.

  3. req_resume_generation

    Resume the mid-point entangling source. All allocated qubits are considered released. If already active, it has no effect

deliver_new_socket(idx)[source]

This method must be called by implementations of this abstract class when a new entangled pair is generated. It signals the new entanglement generation

Parameters:
idxint

The index of the qubit on the link protocol interface.

abstract free(request)[source]

This method is called when upper layers want to free a qubit for a new entanglement.

property interface

The interface on which the protocol runs.

class req_free(idx)

Bases: tuple

This request type is used to free a qubit which can now be used for a new link layer entanglement. Parameters:

  1. idx (int)

    The index of the qubit to free.

idx

Alias for field number 0

req_resume_generation

Request this protocol to resume the mid point entangling source. If the source is not stopped, this request has no effect.

alias of request_resume_generation

req_stop_generation

Request this protocol to stop the mid point entangling source. It can be resumed by this protocol or the link protocol at the other end of the link by using a req_stop_generation request. If the protocol is already stopped, this request has no effect.

alias of request_stop_generation