App
Abstract base class for SeQUeNCe applications.
This module defines the App interface that all node-attached applications must implement. The three abstract callback methods, get_memory, get_reservation_result, and get_other_reservation are correspond to the calls that QuantumRouter already makes on whatever application is attached via set_app.
Subclasses that track throughput (e.g. RequestApp) should override it with a meaningful implementation.
- class sequence.app.app.App(node: QuantumRouter)
Abstract base application attached to a quantum network node.
Every concrete application must subclass App and implement the three abstract callback methods that QuantumRouter relies on.
The constructor automatically registers the application on the node via node.set_app(self), so subclasses should always call super().__init__(node)!
- node
The node this application is attached to.
- Type:
- name
Human-readable name for the application instance.
- Type:
str
- abstractmethod get_memory(info: MemoryInfo) None
Called when an entangled memory becomes available.
- Parameters:
info (MemoryInfo) – Information about the available memory.
- abstractmethod get_other_reservation(reservation: Reservation) None
Called when a reservation initiated by another node is approved and uses this node as the responder.
- Parameters:
reservation (Reservation) – The approved reservation.
- abstractmethod get_reservation_result(reservation: Reservation, result: bool) None
Called when a reservation result is received from the network manager.
- Parameters:
reservation (Reservation) – The reservation that completed.
result (bool) – Whether the reservation was approved.
- set_name(name: str) None
Override the default application name.
- Parameters:
name (str) – New name for the application.