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.CutoffProt
— Typestruct 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 fromConcurrentSim
net
: a network graph of registersnode
: the vertex index of the node on which the protocol is runningperiod
: time period between successive queries on the node (nothing
for queuing up)retention_time
: time after which a slot is emptiedannounce
: iftrue
, synchronization messages are sent after a deletion to the node containing the other entangled qubit
QuantumSavory.ProtocolZoo.EntanglementConsumer
— Typestruct 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 fromConcurrentSim
net
: a network graph of registersnodeA
: the vertex index of node AnodeB
: the vertex index of node Bperiod
: 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 bequery(node, EntanglementConsumer.tag, remote_node)
and it will be expected thatremote_node
possesses the symmetric reciprocal tag; defaults toEntanglementCounterpart
log
: stores the time and resulting observable from querying nodeA and nodeB forEntanglementCounterpart
QuantumSavory.ProtocolZoo.EntanglementCounterpart
— Typestruct 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 entangledremote_slot::Int64
: the slot in the remote node containing the qubit we are entangled to
QuantumSavory.ProtocolZoo.EntanglementHistory
— Typestruct 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 toremote_slot::Int64
: the slot of the remote node we used to be entangled toswap_remote_node::Int64
: the id of remote node to which we are entangled after the swapswap_remote_slot::Int64
: the slot of the remote node to which we are entangled after the swapswapped_local::Int64
: the slot in this register with whom we performed a swap
QuantumSavory.ProtocolZoo.EntanglementTracker
— Typestruct 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 fromConcurrentSim
net::RegisterNet
: a network graph of registersnode::Int64
: the vertex of the node where the tracker is working
QuantumSavory.ProtocolZoo.EntanglementUpdateX
— Typestruct 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 swappast_local_slot::Int64
: the slot of the node to which you were entangled before the swappast_remote_slot::Int64
: the slot of your node that we were entangled tonew_remote_node::Int64
: the id of the node to which you are now entangled after the swapnew_remote_slot::Int64
: the slot of the node to which you are now entangled after the swapcorrection::Int64
: what Pauli correction you need to perform
QuantumSavory.ProtocolZoo.EntanglementUpdateZ
— Typestruct 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 swappast_local_slot::Int64
: the slot of the node to which you were entangled before the swappast_remote_slot::Int64
: the slot of your node that we were entangled tonew_remote_node::Int64
: the id of the node to which you are now entangled after the swapnew_remote_slot::Int64
: the slot of the node to which you are now entangled after the swapcorrection::Int64
: what Pauli correction you need to perform
QuantumSavory.ProtocolZoo.EntanglerProt
— Typestruct 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 fromConcurrentSim
net::RegisterNet
: a network graph of registersnodeA::Int64
: the vertex index of node AnodeB::Int64
: the vertex index of node Bpairstate::Any
: the state being generated (supports symbolic, numeric, noisy, and pure)success_prob::Float64
: success probability of one attempt of entanglement generationattempt_time::Float64
: duration of single entanglement attemptlocal_busy_time_pre::Float64
: fixed "busy time" duration immediately before starting entanglement generation attemptslocal_busy_time_post::Float64
: fixed "busy time" duration immediately after the a successful entanglement generation attemptretry_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
: functionVector{Int}->Vector{Int}
or an integer slot number, specifying the slot to take among available free slots in node AchooseB::Union{Int64, var"#s39"} where var"#s39"<:Function
: functionVector{Int}->Vector{Int}
or an integer slot number, specifying the slot to take among available free slots in node Brandomize::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 slotsmargin::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
: Likemargin
, but it is enforced even when no entanglement has been established yet. Usually smaller thanmargin
.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 formtag(remote_node, remote_slot)
, by defaultEntanglementCounterpart
.
QuantumSavory.ProtocolZoo.EntanglerProt
— MethodConvenience constructor for specifying rate
of generation instead of success probability and time
QuantumSavory.ProtocolZoo.SwapperProt
— Typestruct 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 fromConcurrentSim
net::RegisterNet
: a network graph of registersnode::Int64
: the vertex of the node where swapping is happeningnodeL::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 nodenodeH::Any
: the vertex of the other remote node for the swap, the "high" counterpart ofnodeL
; if you are working on a repeater chain, a good choice is>(current_node)
, i.e. any node to the "right" of the current nodechooseL::Any
: thenodeL
predicate can return many positive candidates;chooseL
picks one of them (by index into the array of filterednodeL
results), defaults to a random pickarr->rand(keys(arr))
; if you are working on a repeater chain a good choice isargmin
, i.e. the node furthest to the "left"chooseH::Any
: thenodeH
counterpart forchooseH
; if you are working on a repeater chain a good choice isargmax
, i.e. the node furthest to the "right"local_busy_time::Float64
: fixed "busy time" duration immediately before starting entanglement generation attemptsretry_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 useCutoffProt
if you have an agelimit
QuantumSavory.ProtocolZoo.Switches.SimpleSwitchDiscreteProt
— Typestruct 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 fromConcurrentSim
net::RegisterNet
: a network graph of registersswitchnode::Int64
: the vertex index of the switchclientnodes::Vector{Int64}
: the vertex indices of the clientssuccess_probs::Vector{Float64}
: best-guess about success of establishing raw entanglement between client and switchticktock::Float64
: duration of a single full cycle of the switching decision algorithmrounds::Int64
: how many rounds of this protocol to run (-1
for infinite)assignment_algorithm::Any
: the algorithm to use for memory slot assignment, defaulting topromponas_bruteforce_choice
backlog::QuantumSavory.ProtocolZoo.Switches.SymMatrix{Matrix{Int64}}
QuantumSavory.ProtocolZoo.Switches.SwitchRequest
— Typestruct SwitchRequest
Notify a switch that you request to be entangled with another node.
requester::Int64
: the id of the node making the requestremote_node::Int64
: the id of the remote node to which we want to be entangled