Nodes¶
Definitions of node types.
This module provides definitions for various types of quantum network nodes. All node types inherit from the base Node type, which inherits from Entity. Node types can be used to collect all the necessary hardware and software for a network usage scenario.
- class src.topology.node.BSMNode(name: str, timeline: Timeline, other_nodes: List[str], seed=None, component_templates=None)¶
Bell state measurement node.
This node provides bell state measurement and the EntanglementGenerationB protocol for entanglement generation. Creates a SingleAtomBSM object within local components.
- name¶
label for node instance.
- Type:
str
- eg¶
entanglement generation protocol instance.
- Type:
- eg_add_others(other)¶
Method to add other protocols to entanglement generation protocol.
Local entanglement generation protocol stores name of other protocol for communication. NOTE: entanglement generation protocol should be first protocol in protocol list.
- Parameters:
other (EntanglementProtocol) – other entanglement protocol instance.
- receive_message(src: str, msg: Message) None ¶
Method to receive message from classical channel.
Searches through attached protocols for those matching message, then invokes received_message method of protocol(s).
- Parameters:
src (str) – name of node sending the message.
msg (Message) – message transmitted from node.
- class src.topology.node.Node(name: str, timeline: Timeline, seed=None, component_templates=None)¶
Base node type.
Provides default interfaces for network.
- name¶
label for node instance.
- Type:
str
- cchannels¶
mapping of destination node names to classical channel instances.
- Type:
Dict[str, ClassicalChannel]
- qchannels¶
mapping of destination node names to quantum channel instances.
- Type:
Dict[str, QuantumChannel]
- generator¶
random number generator used by node.
- Type:
np.random.Generator
- first_component_name¶
name of component that first receives incoming qubits.
- Type:
str
- add_component(component: Entity) None ¶
Adds a hardware component to the node.
- Parameters:
component (Entity) – local hardware component to add.
- assign_cchannel(cchannel: ClassicalChannel, another: str) None ¶
Method to assign a classical channel to the node.
This method is usually called by the ClassicalChannel.add_ends method and not called individually.
- Parameters:
cchannel (ClassicalChannel) – channel to add.
another (str) – name of node at other end of channel.
- assign_qchannel(qchannel: QuantumChannel, another: str) None ¶
Method to assign a quantum channel to the node.
This method is usually called by the QuantumChannel.add_ends method and not called individually.
- Parameters:
qchannel (QuantumChannel) – channel to add.
another (str) – name of node at other end of channel.
- get_generator()¶
Method to get random generator of parent node.
If entity is not attached to a node, return default generator.
- init() None ¶
Method to initialize entity (abstract).
Entity init methods are invoked for all timeline entities when the timeline is initialized. This method can be used to perform any necessary functions before simulation.
- receive_message(src: str, msg: Message) None ¶
Method to receive message from classical channel.
Searches through attached protocols for those matching message, then invokes received_message method of protocol(s).
- Parameters:
src (str) – name of node sending the message.
msg (Message) – message transmitted from node.
- receive_qubit(src: str, qubit) None ¶
Method to receive qubits from quantum channel.
By default, forwards qubit to hardware element designated by field receiver_name.
- Parameters:
src (str) – name of node where qubit was sent from.
qubit (any) – transmitted qubit.
- schedule_qubit(dst: str, min_time: int) int ¶
Interface for quantum channel schedule_transmit method.
- send_message(dst: str, msg: Message, priority=inf) None ¶
Method to send classical message.
- Parameters:
dst (str) – name of destination node for message.
msg (Message) – message to transmit.
priority (int) – priority for transmitted message (default inf).
- send_qubit(dst: str, qubit) None ¶
Interface for quantum channel transmit method.
- class src.topology.node.QKDNode(name: str, timeline: Timeline, encoding={'bases': [((1 + 0j, 0j), (0j, 1 + 0j)), ((0.7071067811865476 + 0j, 0.7071067811865476 + 0j), (- 0.7071067811865476 + 0j, 0.7071067811865476 + 0j))], 'name': 'polarization'}, stack_size=5, seed=None, component_templates=None)¶
Node for quantum key distribution.
QKDNodes include a protocol stack to create keys. The protocol stack follows the “BBN QKD Protocol Suite” introduced in the DARPA quantum network (https://arxiv.org/pdf/quant-ph/0412029.pdf page 24). The protocol stack is:
4. Authentication <= No implementation 3. Privacy Amplification <= No implementation 2. Entropy Estimation <= No implementation 1. Error Correction <= implemented by cascade 0. Sifting <= implemented by BB84
Additionally, the components dictionary contains the following hardware:
lightsource (LightSource): laser light source to generate keys.
qsdetector (QSDetector): quantum state detector for qubit measurement.
- name¶
label for node instance.
- Type:
str
- encoding¶
encoding type for qkd qubits (from encoding module).
- Type:
Dict[str, Any]
- destination¶
name of destination node for photons
- Type:
str
- protocol_stack¶
protocols for QKD process.
- Type:
List[StackProtocol]
- get(photon: Photon, **kwargs)¶
Method for an entity to receive a photon.
If entity is a node, may forward to external quantum channel. Must be overwritten to be used, or will raise exception.
- Parameters:
photon (Photon) – photon received by the entity.
**kwargs – other arguments required by a particular hardware component.
- get_bits(light_time: int, start_time: int, frequency: float, detector_name: str)¶
Method for QKD protocols to get received qubits from the node.
Uses the detection times from attached detectors to calculate which bits were received. Returns 0/1 for successfully transmitted bits and -1 for lost/ambiguous bits.
- Parameters:
light_time (int) – time duration for which qubits were transmitted.
start_time (int) – time at which qubits were first received.
frequency (float) – frequency of qubit transmission.
detector_name (str) – name of the QSDetector measuring qubits.
- Returns:
list of calculated bits.
- Return type:
List[int]
- init() None ¶
Method to initialize entity (abstract).
Entity init methods are invoked for all timeline entities when the timeline is initialized. This method can be used to perform any necessary functions before simulation.
- receive_message(src: str, msg: Message) None ¶
Method to receive message from classical channel.
Searches through attached protocols for those matching message, then invokes received_message method of protocol(s).
- Parameters:
src (str) – name of node sending the message.
msg (Message) – message transmitted from node.
- set_bases(basis_list: List[int], start_time: int, frequency: float, component_name: str)¶
Method to set basis list for measurement component.
- Parameters:
basis_list (List[int]) – list of bases to measure in.
start_time (int) – time to start measurement.
frequency (float) – frequency with which to measure.
component_name (str) – name of measurement component to edit (normally a QSDetector).
- set_protocol_layer(layer: int, protocol: StackProtocol) None ¶
Method to set a layer of the protocol stack.
- Parameters:
layer (int) – layer to change.
protocol (StackProtocol) – protocol to insert.
- class src.topology.node.QuantumRouter(name, tl, memo_size=50, seed=None, component_templates=None)¶
Node for entanglement distribution networks.
This node type comes pre-equipped with memory hardware, along with the default SeQUeNCe modules (sans application). By default, a quantum memory array is included in the components of this node.
- resource_manager¶
resource management module.
- Type:
- network_manager¶
network management module.
- Type:
- map_to_middle_node¶
mapping of router names to intermediate bsm node names.
- Type:
Dict[str, str]
- app¶
application in use on node.
- Type:
any
- add_bsm_node(bsm_name: str, router_name: str)¶
Method to record connected BSM nodes
- Parameters:
bsm_name (str) – the BSM node between nodes self and router_name
router_name (str) – the name of another router connected with the BSM node
- get(photon: Photon, **kwargs)¶
Receives photon from last hardware element (in this case, quantum memory).
- get_idle_memory(info: MemoryInfo) None ¶
Method for application to receive available memories.
- get_other_reservation(reservation: Reservation)¶
Method for application to receive another reservation.
- get_reserve_res(reservation: Reservation, res: bool) None ¶
Method for application to receive reservations results.
- init()¶
Method to initialize quantum router node.
Inherit parent function
- memory_expire(memory: Memory) None ¶
Method to receive expired memories.
- Parameters:
memory (Memory) – memory that has expired.
- receive_message(src: str, msg: Message) None ¶
Method to receive message from classical channel.
Searches through attached protocols for those matching message, then invokes received_message method of protocol(s).
- Parameters:
src (str) – name of node sending the message.
msg (Message) – message transmitted from node.
- reserve_net_resource(responder: str, start_time: int, end_time: int, memory_size: int, target_fidelity: float) None ¶
Method to request a reservation.
Can be used by local applications.
- Parameters:
responder (str) – name of the node with which entanglement is requested.
start_time (int) – desired simulation start time of entanglement.
end_time (int) – desired simulation end time of entanglement.
memory_size (int) – number of memories requested.
target_fidelity (float) – desired fidelity of entanglement.
- set_app(app: RandomRequestApp)¶
Method to add an application to the node.