Entanglement Generation¶
Code for Barrett-Kok entanglement Generation protocol
This module defines code to support entanglement generation between single-atom memories on distant nodes. Also defined is the message type used by this implementation. Entanglement generation is asymmetric:
EntanglementGenerationA should be used on the QuantumRouter (with one node set as the primary) and should be started via the “start” method
EntanglementGeneraitonB should be used on the BSMNode and does not need to be started
- class src.entanglement_management.generation.EntanglementGenerationA(own: Node, name: str, middle: str, other: str, memory: Memory)¶
Entanglement generation protocol for quantum router.
The EntanglementGenerationA protocol should be instantiated on a quantum router node. Instances will communicate with each other (and with the B instance on a BSM node) to generate entanglement.
- own¶
node that protocol instance is attached to.
- Type:
- name¶
label for protocol instance.
- Type:
str
- middle¶
name of BSM measurement node where emitted photons should be directed.
- Type:
str
- remote_node_name¶
name of distant QuantumRouter node, containing a memory to be entangled with local memory.
- Type:
str
- emit_event() None ¶
Method to set up memory and emit photons.
If the protocol is in round 1, the memory will be first set to the |+> state. Otherwise, it will apply an x_gate to the memory. Regardless of the round, the memory excite method will be invoked.
- Side Effects:
May change state of attached memory. May cause attached memory to emit photon.
- is_ready() bool ¶
Method to check if protocol is ready to start (abstract).
- Returns:
if protocol is ready or not.
- Return type:
bool
- received_message(src: str, msg: EntanglementGenerationMessage) None ¶
Method to receive messages.
This method receives messages from other entanglement generation protocols. Depending on the message, different actions may be taken by the protocol.
- Parameters:
src (str) – name of the source node sending the message.
msg (EntanglementGenerationMessage) – message received.
- Side Effects:
May schedule various internal and hardware events.
- set_others(protocol: str, node: str, memories: List[str]) None ¶
Method to set other entanglement protocol instance.
- Parameters:
protocol (str) – other protocol name.
node (str) – other node name.
memories (List[str]) – the list of memory names used on other node.
- start() None ¶
Method to start entanglement generation protocol.
Will start negotiations with other protocol (if primary).
- Side Effects:
Will send message through attached node.
- update_memory()¶
Method to handle necessary memory operations.
Called on both nodes. Will check the state of the memory and protocol.
- Returns:
if current round was successfull.
- Return type:
bool
- Side Effects:
May change state of attached memory. May update memory state in the attached node’s resource manager.
- class src.entanglement_management.generation.EntanglementGenerationB(own: BSMNode, name: str, others: List[str])¶
Entanglement generation protocol for BSM node.
The EntanglementGenerationB protocol should be instantiated on a BSM node. Instances will communicate with the A instance on neighboring quantum router nodes to generate entanglement.
- name¶
label for protocol instance.
- Type:
str
- others¶
list of neighboring quantum router nodes
- Type:
List[str]
- bsm_update(bsm: SingleAtomBSM, info: Dict[str, Any])¶
Method to receive detection events from BSM on node.
- Parameters:
bsm (SingleAtomBSM) – bsm object calling method.
info (Dict[str, any]) – information passed from bsm.
- is_ready() bool ¶
Method to check if protocol is ready to start (abstract).
- Returns:
if protocol is ready or not.
- Return type:
bool
- received_message(src: str, msg: EntanglementGenerationMessage)¶
Receive classical message from another node.
- set_others(protocol: str, node: str, memories: List[str]) None ¶
Method to set other entanglement protocol instance.
- Parameters:
remote_protocol (str) – other protocol name.
remote_node (str) – other node name.
memories (List[str]) – the list of memory names used on other node.
- start() None ¶
Method to start entanglement protocol process (abstract).
- class src.entanglement_management.generation.EntanglementGenerationMessage(msg_type: GenerationMsgType, receiver: str, **kwargs)¶
Message used by entanglement generation protocols.
This message contains all information passed between generation protocol instances. Messages of different types contain different information.
- msg_type¶
defines the message type.
- Type:
- receiver¶
name of destination protocol instance.
- Type:
str
- qc_delay¶
quantum channel delay to BSM node (if msg_type == NEGOTIATE).
- Type:
int
- frequency¶
frequency with which local memory can be excited (if msg_type == NEGOTIATE).
- Type:
float
- emit_time¶
time to emit photon for measurement (if msg_type == NEGOTIATE_ACK).
- Type:
int
- res¶
detector number at BSM node (if msg_type == MEAS_RES).
- Type:
int
- time¶
detection time at BSM node (if msg_type == MEAS_RES).
- Type:
int
- resolution¶
time resolution of BSM detectors (if msg_type == MEAS_RES).
- Type:
int
- class src.entanglement_management.generation.GenerationMsgType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Defines possible message types for entanglement generation.