progress.pqnet.repository

Some popular, ready-to-use, module behaviors for the DAG

class progress.pqnet.repository.DEJMPSModuleBehavior(module_id, dest_device, dest_module_id, is_solicitor, name, node, qnic=None)[source]

Bases: ProcessingModuleBehavior

This class implements the behavior of a module that performs the DEJMPS protocol.

Parameters:
module_idint

The ID of the module

dest_deviceint

The ID of the device that the distillation outcome must be sent to

dest_module_idint

The ID of the module on the destination device that the distillation outcome must be sent to

is_solicitorbool

Whether the module is the solicitor or not

namestr

The name of the module

nodeModule

The module that this behavior is attached to

qnicint or None, optional

See ModuleBehavior.

handle_message(request)[source]

If the module is the solicitor, it receives distillation outcomes from the solicited module. If the module is not the solicitor, it receives distillation solicitations from the solicitor.

See also

handle_message()
handle_new_token(request)[source]

If the module is the solicitor, it must check whether a new distillation can be carried out. If the module is not the solicitor, it must wait for a message from the solicitor, and just stores the token.

handle_response(request)[source]

If the module is the solicitor, it must send the distillation outcome to the solicited module. If the module is not the solicitor, it must check whether the distillation was successful and tell the solicitor.

class progress.pqnet.repository.EntanglementSwappingModuleBehavior(dest_devices, dest_module_ids, name, node, qnic=None)[source]

Bases: ProcessingModuleBehavior

This class implements the behavior of a module that performs the entanglement swapping protocol.

handle_message(request)[source]

This method is called when a classical message is received from another remote module.

Parameters:
requestreq_handle_message

The request containing the message to handle.

handle_new_token(request)[source]

This method is called when a new token is received as input.

Parameters:
requestreq_handle_new_token

The request containing the new token to handle.

handle_response(request)[source]

This method is called when a response to a previous request is received from the qhal.

Parameters:
requestreq_handle_response

The request containing the QHAL response to handle. The response contains the outcome and the originating request piggybacked.

class progress.pqnet.repository.FreeEverythingModuleBehavior(name, node, qnic=None, collect_stats=False)[source]

Bases: ProcessingModuleBehavior

This class implements the behavior of a dummy module that frees all tokens.

Parameters:
namestr

The name of the module

nodeModule

The module that this behavior is attached to

qnicint or None, optional

See ModuleBehavior.

collect_statsbool, optional

Whether to collect statistics about the freed tokens.

Attributes:
FREED_TOKEN_SIGNALstr

Label used to signal that a token has been freed. Only used if collect_stats is True.

FREED_TOKEN_EVT_TYPEpydynaa.core.EventType

Event type used to signal that a token has been freed. Only used if collect_stats is True.

FREED_TOKEN_EVT_TYPE = <pydynaa.core.EventType object>

Label used to signal that a token has been freed.

handle_message(request)[source]

Raises an error if called. This module does not receive messages.

See also

handle_message()
handle_new_token(request)[source]

Free the token.

See also

progress.pqnet.p_module.ProcessingModuleBehavior.handle_new_token()
handle_response(request)[source]

Raises an error if called. This module does not receive responses.

class progress.pqnet.repository.RoundRobinSchedulingModuleBehavior(name, node, qnic=None)[source]

Bases: SchedulingModuleBehavior

This class implements the behavior of a module that performs a simple, non-blocking, round-robin scheduling of tokens among output ports.

handle_message(request)[source]

Raise an error when called. This module does not receive messages.

handle_new_token(request)[source]

Promote the token to the next output port.

handle_response(request)[source]

Raise an error when called. This module does not receive responses.

class progress.pqnet.repository.ShortCircuitModuleBehavior(name, node, qnic=None)[source]

Bases: SchedulingModuleBehavior

This class implements the behavior of a dummy module that promotes all tokens to its first output port.

Parameters:
namestr

The name of the module

nodeModule

The module that this behavior is attached to

qnicint or None, optional

See ModuleBehavior.

handle_message(request)[source]

Raises an error if called. This module does not receive messages.

See also

handle_message()
handle_new_token(request)[source]

Simply promotes the token to the first output port.

handle_response(request)[source]

Raises an error if called. This module does not receive responses.

class progress.pqnet.repository.WaitForSwappingModuleBehavior(name, node, output_map=None, qnic=None, collect_stats=False)[source]

Bases: SchedulingModuleBehavior

This class implements the behavior of a module that waits for the outcome of the entanglement swapping protocol.

NEW_TOKEN_EVT_TYPE = <pydynaa.core.EventType object>

Label used to signal that a token has been captured.

handle_message(request)[source]

This method is called when a classical message is received from another remote module.

Parameters:
requestreq_handle_message

The request containing the message to handle.

handle_new_token(request)[source]

This method is called when a new token is received as input.

Parameters:
requestreq_handle_new_token

The request containing the new token to handle.

handle_response(request)[source]

This method is called when a response to a previous request is received from the qhal.

Parameters:
requestreq_handle_response

The request containing the QHAL response to handle. The response contains the outcome and the originating request piggybacked.