progress.hardware

This package contains an abstract class for Link Layer Protocols that can be instantiated to create custom protocols. It also provides a ready-to-use protocol called MPSProtocol which is the default protocol used by quantum network devices.

class progress.hardware.llps.__init__.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

alias of request_resume_generation

req_stop_generation

alias of request_stop_generation

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

Bases: LinkProtocol

This protocol simulates the Midpoint source (MPS) protocol on the link interface of a node. An independent instance of this protocols must be started on a node for each link on which MPS protocols is activated.

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 SocketDescriptor 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.

free(request)[source]

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

run()[source]

References

See netsquid.protocols.Protocol.run().

start()[source]

Start this protocol on a specified link of this node.

References

See netsquid.protocols.Protocol.start() for more information.