Predefined Networking Protocols

The submodule QuantumSavory.ProtocolZoo provides models for many common quantum networking protocols, including the details of their discrete event scheduling and simulation.

Autogenerated API list for QuantumSavory.ProtocolZoo

QuantumSavory.ProtocolZoo.CutoffProtType
struct CutoffProt{LT} <: QuantumSavory.ProtocolZoo.AbstractProtocol

A protocol running at a node, checking periodically for any qubits in the node that have remained unused for more than the retention period of the qubit and emptying such slots.

If coordination messages are exchanged during deletions (instances of the type EntanglementDelete), then a EntanglementTracker protocol needs to also run, to act on such messages.

  • sim: time-and-schedule-tracking instance from ConcurrentSim

  • net: a network graph of registers

  • node: the vertex index of the node on which the protocol is running

  • period: time period between successive queries on the node (nothing for queuing up)

  • retention_time: time after which a slot is emptied

  • announce: if true, synchronization messages are sent after a deletion to the node containing the other entangled qubit

source
QuantumSavory.ProtocolZoo.EntanglementConsumerType
struct EntanglementConsumer{LT} <: QuantumSavory.ProtocolZoo.AbstractProtocol

A protocol running between two nodes, checking periodically for any entangled pairs between the two nodes and consuming/emptying the qubit slots.

  • sim: time-and-schedule-tracking instance from ConcurrentSim

  • net: a network graph of registers

  • nodeA: the vertex index of node A

  • nodeB: the vertex index of node B

  • period: time period between successive queries on the nodes (nothing for queuing up and waiting for available pairs)

  • tag: tag type which the consumer is looking for – the consumer query will be query(node, EntanglementConsumer.tag, remote_node) and it will be expected that remote_node possesses the symmetric reciprocal tag; defaults to EntanglementCounterpart

  • log: stores the time and resulting observable from querying nodeA and nodeB for EntanglementCounterpart

source
QuantumSavory.ProtocolZoo.EntanglementCounterpartType
struct EntanglementCounterpart

Indicates the current entanglement status with a remote node's slot. Added when a new entanglement is generated through EntanglerProt or when a swap happens and the EntanglementTracker receives an [EntanglementUpdate] message.

  • remote_node::Int64: the id of the remote node to which we are entangled

  • remote_slot::Int64: the slot in the remote node containing the qubit we are entangled to

source
QuantumSavory.ProtocolZoo.EntanglementHistoryType
struct EntanglementHistory

This tag is used to store the outdated entanglement information after a swap. It helps to direct incoming entanglement update messages to the right node after a swap. It helps in situations when locally we have performed a swap, but we are now receiving a message from a distant node that does not know yet that the swap has occurred (thus the distant node might have outdated information about who is entangled to whom and we need to update that information).

  • remote_node::Int64: the id of the remote node we used to be entangled to

  • remote_slot::Int64: the slot of the remote node we used to be entangled to

  • swap_remote_node::Int64: the id of remote node to which we are entangled after the swap

  • swap_remote_slot::Int64: the slot of the remote node to which we are entangled after the swap

  • swapped_local::Int64: the slot in this register with whom we performed a swap

source
QuantumSavory.ProtocolZoo.EntanglementTrackerType
struct EntanglementTracker <: QuantumSavory.ProtocolZoo.AbstractProtocol

A protocol, running at a given node, listening for messages that indicate something has happened to a remote qubit entangled with one of the local qubits.

  • sim::ConcurrentSim.Simulation: time-and-schedule-tracking instance from ConcurrentSim

  • net::RegisterNet: a network graph of registers

  • node::Int64: the vertex of the node where the tracker is working

source
QuantumSavory.ProtocolZoo.EntanglementUpdateXType
struct EntanglementUpdateX

This tag arrives as a message from a remote node to which the current node was entangled to update the entanglement information and apply an X correction after the remote node performs an entanglement swap.

  • past_local_node::Int64: the id of the node to which you were entangled before the swap

  • past_local_slot::Int64: the slot of the node to which you were entangled before the swap

  • past_remote_slot::Int64: the slot of your node that we were entangled to

  • new_remote_node::Int64: the id of the node to which you are now entangled after the swap

  • new_remote_slot::Int64: the slot of the node to which you are now entangled after the swap

  • correction::Int64: what Pauli correction you need to perform

source
QuantumSavory.ProtocolZoo.EntanglementUpdateZType
struct EntanglementUpdateZ

This tag arrives as a message from a remote node to which the current node was entangled to update the entanglement information and apply a Z correction after the remote node performs an entanglement swap.

  • past_local_node::Int64: the id of the node to which you were entangled before the swap

  • past_local_slot::Int64: the slot of the node to which you were entangled before the swap

  • past_remote_slot::Int64: the slot of your node that we were entangled to

  • new_remote_node::Int64: the id of the node to which you are now entangled after the swap

  • new_remote_slot::Int64: the slot of the node to which you are now entangled after the swap

  • correction::Int64: what Pauli correction you need to perform

source
QuantumSavory.ProtocolZoo.EntanglerProtType
struct EntanglerProt{LT} <: QuantumSavory.ProtocolZoo.AbstractProtocol

A protocol that generates entanglement between two nodes. Whenever a pair of empty slots is available, the protocol locks them and starts probabilistic attempts to establish entanglement.

  • sim::ConcurrentSim.Simulation: time-and-schedule-tracking instance from ConcurrentSim

  • net::RegisterNet: a network graph of registers

  • nodeA::Int64: the vertex index of node A

  • nodeB::Int64: the vertex index of node B

  • pairstate::Any: the state being generated (supports symbolic, numeric, noisy, and pure)

  • success_prob::Float64: success probability of one attempt of entanglement generation

  • attempt_time::Float64: duration of single entanglement attempt

  • local_busy_time_pre::Float64: fixed "busy time" duration immediately before starting entanglement generation attempts

  • local_busy_time_post::Float64: fixed "busy time" duration immediately after the a successful entanglement generation attempt

  • retry_lock_time::Any: how long to wait before retrying to lock qubits if no qubits are available (nothing for queuing up)

  • rounds::Int64: how many rounds of this protocol to run (-1 for infinite)

  • attempts::Int64: maximum number of attempts to make per round (-1 for infinite)

  • chooseA::Union{Int64, var"#s40"} where var"#s40"<:Function: function Vector{Int}->Vector{Int} or an integer slot number, specifying the slot to take among available free slots in node A

  • chooseB::Union{Int64, var"#s39"} where var"#s39"<:Function: function Vector{Int}->Vector{Int} or an integer slot number, specifying the slot to take among available free slots in node B

  • randomize::Bool: whether the protocol should find the first available free slots in the nodes to be entangled or check for free slots randomly from the available slots

  • margin::Int64: Repeated rounds of this protocol may lead to monopolizing all slots of a pair of registers, starving or deadlocking other protocols. This field can be used to always leave a minimum number of slots free if there already exists entanglement between the current pair of nodes.

  • hardmargin::Int64: Like margin, but it is enforced even when no entanglement has been established yet. Usually smaller than margin.

  • tag::Union{Nothing, DataType}: Tag to be added to the entangled qubits or nothing to not add any tag. The created tag will be of the form tag(remote_node, remote_slot), by default EntanglementCounterpart.

source
QuantumSavory.ProtocolZoo.SwapperProtType
struct SwapperProt{NL, NH, CL, CH, LT} <: QuantumSavory.ProtocolZoo.AbstractProtocol

A protocol, running at a given node, that finds swappable entangled pairs and performs the swap.

Consider setting an agelimit on qubits and using it together with the cutoff protocol, CutoffProt, which deletes qubits that are about to go past their cutoff/retention time.

  • sim::ConcurrentSim.Simulation: time-and-schedule-tracking instance from ConcurrentSim

  • net::RegisterNet: a network graph of registers

  • node::Int64: the vertex of the node where swapping is happening

  • nodeL::Any: the vertex of one of the remote nodes for the swap, arbitrarily referred to as the "low" node (or a predicate function or a wildcard); if you are working on a repeater chain, a good choice is <(current_node), i.e. any node to the "left" of the current node

  • nodeH::Any: the vertex of the other remote node for the swap, the "high" counterpart of nodeL; if you are working on a repeater chain, a good choice is >(current_node), i.e. any node to the "right" of the current node

  • chooseL::Any: the nodeL predicate can return many positive candidates; chooseL picks one of them (by index into the array of filtered nodeL results), defaults to a random pick arr->rand(keys(arr)); if you are working on a repeater chain a good choice is argmin, i.e. the node furthest to the "left"

  • chooseH::Any: the nodeH counterpart for chooseH; if you are working on a repeater chain a good choice is argmax, i.e. the node furthest to the "right"

  • local_busy_time::Float64: fixed "busy time" duration immediately before starting entanglement generation attempts

  • retry_lock_time::Any: how long to wait before retrying to lock qubits if no qubits are available (nothing for queuing up and waiting)

  • rounds::Int64: how many rounds of this protocol to run (-1 for infinite))

  • agelimit::Union{Nothing, Float64}: what is the oldest a qubit should be to be picked for a swap (to avoid swapping with qubits that are about to be deleted, the agelimit should be shorter than the retention time of the cutoff protocol) (nothing for no limit) – you probably want to use CutoffProt if you have an agelimit

source
QuantumSavory.ProtocolZoo.Switches.SimpleSwitchDiscreteProtType
struct SimpleSwitchDiscreteProt{AA} <: QuantumSavory.ProtocolZoo.AbstractProtocol

A switch "controller", running on a given node, checking for connection requests from neighboring clients, and attempting to serve them by attempting direct raw entanglement with the clients and then mediating swaps to connect two clients together.

Works on discrete time intervals and destroys raw entanglement not used by the end of a ticktock cycle.

This switch is mostly based on the architecture proposed in (Promponas et al., 2024). Multiple switch management algorithms are suggested in that paper. By default we use the QuantumSavory.ProtocolZoo.Switches.promponas_bruteforce_choice algorithm.

  • sim::ConcurrentSim.Simulation: time-and-schedule-tracking instance from ConcurrentSim

  • net::RegisterNet: a network graph of registers

  • switchnode::Int64: the vertex index of the switch

  • clientnodes::Vector{Int64}: the vertex indices of the clients

  • success_probs::Vector{Float64}: best-guess about success of establishing raw entanglement between client and switch

  • ticktock::Float64: duration of a single full cycle of the switching decision algorithm

  • rounds::Int64: how many rounds of this protocol to run (-1 for infinite)

  • assignment_algorithm::Any: the algorithm to use for memory slot assignment, defaulting to promponas_bruteforce_choice

  • backlog::QuantumSavory.ProtocolZoo.Switches.SymMatrix{Matrix{Int64}}

source
QuantumSavory.ProtocolZoo.Switches.SwitchRequestType
struct SwitchRequest

Notify a switch that you request to be entangled with another node.

  • requester::Int64: the id of the node making the request

  • remote_node::Int64: the id of the remote node to which we want to be entangled

source