progress.hardware.llps.mps

This module implements the Midpoint source (MPS) Link Layer protocol. It also provides a MPSSourceProtocol which is a netsquid.protocols.nodeprotocols.NodeProtocol determining the behavior of the Entangled Photon Source (EPS) in the middle of the physical link between the two nodes.

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

class progress.hardware.llps.mps.MPSSourceProtocol(node, name=None)[source]

Bases: NodeProtocol

This protocol is run at the mid-point source of a link and is used to handle ‘Reset Qubit’ messages.

run(self)[source]

Generator or function that runs the protocol.

Starting the protocol will execute this function. If a generator it will run it up to the first yield. All yields should return a EventExpression, the generator will only continue when the expression has been triggered.

If a function is returned, this protocol may still yield on the generator of its sub-protocols.

Sub-protocols are not started automatically when this method is overridden. Either start them manually in the overridden run() or call start_subprotocols() to start them all at once.

Returns:
Any

If this method returns a generator, then the final return of the generator will be set as the value of FINISHED.

start()[source]

References

See netsquid.protocols.Protocol.start().