ReQuSim: Faithfully simulating near-term quantum repeaters

,


I. INTRODUCTION
Quantum communication constitutes one of the core subfields of the quantum technologies.A cornerstone of virtually every large-scale quantum research effort around the world, its most compelling applications include secure communication via quantum key distribution [1][2][3] as well as other multiparty cryptographic primitives [4,5] and even functionality for secure, distributed quantum computing [6].Indeed, distributed and entangled quantum systems allow us to establish secure encryption keys based on fundamental physical principles.With respect to real world implementations of key distribution over arbitrary distances-in particular arbitrary locations on earth-it has early on been realized that techniques would be needed that can combat unavoidable losses and errors.In the quantum setting, classical strategies of signal amplification as used in classical repeaters are not applicable and so the idea of a quantum repeater has been devised [7][8][9][10].
While already to date, impressive implementations of direct quantum communication have been achieved [11][12][13], there are limits to this approach.Only with the help of such quantum repeaters, can fundamental limits being governed by the repeaterless bound, the so-called PLOB bound [14] (see Refs. [15,16] for a strong converse), be overcome.Indeed, it is seen that the ultimate limits in the presence of repeaters are substantially more favourable [17,18].Since the first repeater proposals substantial research effort has been dedicated to experimentally realizing full-scale quantum repeaters.These realizations remain a major technological challenge, and therefore, one of the main goals of the quantum communications field is to overcome this significant bottleneck [2,3,19].These technological challenges are not so much conceptual-the basic principles have been known for a long time-but arise from the complicated interplay of the components, which include quantum light and, usually, matter qubits.This central bottleneck is, therefore, primarily one of quantum engineering in the field of quantum optics and light-matter interactions-albeit a persistent and difficult one.
From a high level perspective, there are indeed a number of open challenges when considering more advanced repeater schemes.For one, there are many design features for variants of repeater protocols that can be modified or combined.Also, it is very difficult to compare advantages between vastly different platforms involving trapped ions, NV centres, siliconbased systems or atomic gases.For simple, paradigmatic problems, some settings can be analytically studied, even involving some experimentally relevant parameters [9,[20][21][22][23][24].Beyond such paradigmatic settings, an analytical study seems to be out of reach.In contrast, several large-scale initiatives which aim at realizing quantum networks within the quantum internet-such as the Quantum Internet Alliance or the Quantum Internet Task Force-have set-up simulation schemes for simulating high level quantum communication protocols.Naturally, they differ in scope and goals as well as the used models and abstractions.Other simulation tools like NetSquid [25], QuISP [26] and SeQUeNCe [27] have been used to great effect to study various aspects of quantum networks (see section V for a more detailed discussion).
With ReQuSim we present an event based Monte-Carlo simulation platform for realistic quantum repeaters, that is versatile enough to study complex repeater schemes for realistic, small-to intermediate-scale quantum networks and that is first and foremost faithful to a wide range of physically relevant parameters on the hardware level of quantum repeaters.This platform allows us to compare different physical architectures fairly, to explore new regimes, and to identify new, possibly unexpected schemes in the first place.In ReQuSim we combine scale with realism.With respect to realism, the platform is detailed enough to, in particular, include arbitrary time-dependent decoherence mechanisms as opposed to a simple waiting-time loss model.This facilitates the modelling of heterogeneous networks incorporating multiple physical realisations for communication channels and network nodes.With regards to scale, our analysis in this work includes schemes of up to 32 repeater links, however, we demonstrate the run-time scaling of up to 1024 repeater links in Appendix B. Therefore, we consider our simulation scheme to be useful for any quantum network scenario expected to exist in the short to medium term.
Analyzing such near-term scenarios with realistic error models is precisely the focus of our method.While there are existing numerical analyses on using realistic devices for quantum repeaters (see, e.g., Refs.[25,[27][28][29]), the sheer variety of potential approaches and the fact that their performance is strongly dependent on the precise circumstances, make further investigation of these concepts indispensable.
We stress that we can do more than just simulating what will happen in a given scenario with certain resources.Instead, we are able to simulate a host of scenarios and give actionable advice on what should be done with a given set of equipment to maximise performance.This point is critical for establishing whether implementing new methods actually leads to improved results for actual applications.We demonstrate such a case in Section IV A, where we consider a repeater scheme with a single repeater station that can optionally make use of entanglement purification as an additional tool.While this certainly increases the complexity of the scheme, there are clear circumstances where it outperforms a naive scheme using only entanglement swapping.However, discarding qubits in memory after a certain cutoff-time, is an alternative method that can be used to reduce the error rates at the cost of throughput.A proper optimisation over cutoff times (a relatively simple software adjustment instead of requiring new operations) can see the relative advantage shrink or vanish.In this case, the overall performance would not be meaningfully improved by the expenditure of additional resources on employing entanglement purification methods.This kind of detailed benchmarking is essential to properly evaluate under which circumstances a particular building block should be utilised.
With ReQuSim we can provide guidance in a meaningful strategy analysis.Using multiple repeater stations instead of one can extend the reachable distances, but will also subject the process to additional noise from storing more qubits in memory and performing more operations.In Section IV B, we explore this trade-off and show that the number of repeater stations needs to be carefully optimized if their quality is limited, even if their quantity is not.Furthermore, we demonstrate that improving the quality of those repeater station resources results in a disproportionate improvement in achievable rates, as it allows us to modify the protocol to use a larger number of repeater stations, which would otherwise be detrimental.In a similar vein, in Section IV C we demonstrate how our approach can be used to give insight about necessary hardware parameters in a setting with a customized noise model.
Considering the points above, it is clear that there is no shortage of potential options to improve performance.As the examples shown in this work compellingly demonstrate, there are highly nontrivial relationships between combinations of these strategies.Optimising repeater protocols for a variety of realistic devices therefore requires a deeper understanding of repeater protocols and is not simply a matter of tweaking a few parameters.

II. REQUSIM: THE SIMULATION FRAMEWORK
ReQuSim [30] is a simulation framework we have developed specifically for simulating quantum repeaters.It is available as an open source Python package from the Python Package Index.Simulating quantum repeaters is a very attractive option, as the complexity of analytical expressions is increasing rapidly if one deviates from the known standard cases.A central challenge in that regard is that everything that happens anywhere in the system can potentially effect parts on the opposite end of the repeater chain, e.g., the time a qubit needs to wait in memory.Working with averages calculated for parts of the system does not necessarily give the full picture if there are non-linearities such as the dephasing in quantum memories.By contrast, Monte-Carlo methods are well suited to deal with systems with many interconnected probabilistic components.The simulation approach further allows for a modular design that makes switching to different error models and introducing asymmetries straightforward.
In the following, we describe the basic working principles of the simulation.First, the various parts needed for the given scenario are initialized, e.g., where the end stations and repeater stations are located.This also includes setting up the noise models that are specific to certain devices, such as the dephasing time for quantum memories.
The core of the simulation relies on an event system the repeater protocol can interact with.Changes to the state of the simulation are done via events that represent operations being performed.These are scheduled in an event queue and later resolved at the appropriate time.Naturally, an event needs to have the information about when to resolve and which are the involved quantum states and repeater stations.For example, an entanglement swapping event would follow the data structure (type, time, pairs, station).What exactly occurs when an event resolves depends on the type of the event, e.g., an entanglement purification event will simulate the required quantum operations and measurements for an entanglement purification protocol on the involved quantum states.
The other moving part of the system is the repeater protocol, i.e. the high-level strategy, the simulation should follow, because this defines which events should be scheduled and when.Naturally, the chosen repeater strategy decides which events exactly are used, e.g., a repeater protocol without entanglement purification may decide to schedule an entanglement swapping event at a station, immediately after entangled pairs in both directions have been established.Alternatively, in Fig. 1 the high-level strategy of a repeater protocol following a layered approach for entanglement swapping is illustrated.
The way the simulation moves forward revolves around a constant interaction of the protocol and the event system.That means after an event is resolved, the protocol immediately checks whether any new events need to be scheduled, i.e. the protocol will continuously monitor the changes performed by the last event.An abstract representation of how this core FIG. 1.An entanglement-swapping-based repeater protocol in the ReQuSim simulation framework.Running the protocol schedules first events on the event queue.The events on the queue are successively resolved and may schedule further events.An example of this is highlighted above for an entanglement purification event scheduling an entanglement swapping event.
Algorithm Run multi-memory repeater if n l + s l < nmem then SCHEDULE source events drawing from time distribution if nr + sr < nmem then SCHEDULE source events drawing from time distribution if n l > 0 and nr > 0 then SCHEDULE entanglement swapping event FIG. 2. Pseudocode for formulating a protocol and running the simulation.This example describes a protocol for a single repeater station that has access to multiple quantum memories to simultaneously attempt to establish an entangled connection for both repeater links and immediately performs entanglement swapping once successful qubits for both directions are in memory.The events are standardized ways to interact with the current state of the simulation.They have a method that specifies the associated quantum operation that is performed on the quantum states when they are resolved, e.g., a Bell state measurement for the entanglement swapping event.
simulation loop and the decision making process of a simple repeater protocol works is described in Fig. 2.
While protocols are usually formulated from a high-level point of view similar to the situation depicted in Fig. 1, due to the probabilistic nature at multiple parts of the simulation, e.g., the initial distribution process, the actual simulation process needs to be able to act and react at a more detailed level.Consider as an example the situation in Fig. 3: While multiple pairs between station A and C 2 have been established, the protocol is currently waiting for progress on the right hand side before it can proceed further.After a source event confirms the successful generation of an entangled pair between stations C 2 and C 3 , the protocol reacts by scheduling entanglement swapping events at stations C 2 and C 3 , since these are now finally possible.Since these can be performed immediately, they are inserted at the front of the event queue, pushing back the other events that happen at a later point in simulated time.Then, the entanglement swapping events are resolved one by one, and after each one the protocol checks whether anything new needs to be done-in this case no new events need to be scheduled.Finally, the event system goes back to resolving the previously scheduled events in the event queue.
The output of the simulation is a sample of the time and state distributions that is produced by the repeater setup.This means, one gets a list of states (if distributing entangled pairs) or error probabilities (if measuring qubits arriving at the end stations as soon as possible, as one would do for quantum key distribution) and the times when they and all necessary classical information were present at the end stations.For the purposes of this work we focus on key rates for quantum key distribution as a familiar way to assign meaning to both the speed and quality of the entanglement distribution process.However, the simulation is not limited to this application and the obtained information can easily be used to calculate other figures of merit like the raw rate of distributed pairs or the Source event Source event < l a t e x i t s h a 1 _ b a s e 6 4 = " 7 R J Y f C V W v n y 7 N u + t z S 6 g f p c K 8 q s = " > a a T 2 O A t s Z U T P U y 9 5 M / M / r p C a 8 8 S d c J q l B y R a L w l Q Q E 5 P Z 1 6 T P F T I j x p Z Q p r i 9 l b A h V Z Q Z m 0 3 B h u A t v 7 x K m h d l 7 6 p 8 W a + U q p U s j j y c w C m c g w f X U I V 7 q E E D G C A 8 w y u 8 O Y / O i / P u f C x a c 0 4 2 c w x / 4 H z + A J F D j L 8 = < / l a t e x i t > A < l a t e x i t s h a 1 _ b a s e 6 4 = " t w

C2
< l a t e x i t s h a 1 _ b a s e 6 4 = " X W q B l 8 9 m w v x y E i r 3 j J x Y t e P 1 q / 0 = " >

C3
< l a t e x i t s h a 1 _ b a s e 6 4 = " 6 M p 3 v y e g y A 6 b 3 a a T 2 O A t s Z U T P U y 9 5 M / M / r p C a 8 8 S d c J q l B y R a L w l Q Q E 5 P Z 1 6 T P F T I j x p Z Q p r i 9 l b A h V Z Q Z m 0 3 B h u A t v 7 x K m h d l 7 6 p 8 W a + U q p U s j j y c w C m c g w f X U I V 7 q E E D G C A 8 w y u 8 O Y / O i / P u f C x a c 0 4 2 c w x / 4 H z + A J L H j M A = < / l a t e x i t > B < l a t e x i t s h a 1 _ b a s e 6 4 = " 7 R J Y f C V W v n y 7 N u + t z S 6 g f p c K 8 q s = " >

C2
< l a t e x i t s h a 1 _ b a s e 6 4 = " X W q B l 8 9 m w v x y E i r 3 j J x Y t e P 1 q / 0 = " > 3. Illustration of a step by step update of the state of the simulation and the event queue.The source event (representing the successful establishment of an entangled pair between neighboring repeater stations) triggers the protocol to schedule two new entanglement swapping events, inserting them at the front of the event queue.Resolving the entanglement swapping events establishes a long-distance pair between the end stations.After each step, i.e., after every event that is resolved, the protocol again has the chance to react to the new situation.fraction of pairs above a certain fidelity threshold.For the key rates in particular, we let the simulation run until a large sample (usually 10 5 ) has been obtained and then we use the sample mean of the error rates to estimate the asymptotic key rate.
Before moving on to the particular scenarios discussed in this work, we comment on a few design decisions of our approach: This system centered around events is very flexible when it comes to including noise models as the events can simply be modified depending on the conditions, e.g., the repeater station from the example above may have a parameter that describes the quality of Bell state measurements available at this particular station.ReQuSim supports arbitrary completely positive, trace preserving maps to describe physically meaningful noise processes.
Two key challenges that are addressed by our framework are the probabilistic nature of distributing entangled states between neighbors and the time-dependent noise that acts on qubits stored in quantum memories.Generally, the probability that a photon gets lost in transmission is very high, so it is certainly not efficient to keep track of every single photon that is sent individually.Instead, we draw from a probability distribution for how many trials are needed until the next successful attempt happens (this is simply a geometric distribution if the probability of success in one trial stays constant).This means we use a combination of two methods to handle probabilistic aspects of the simulation -a Monte Carlo approach for loss and a the density matrix formalism for other types of noise.We handle the time dependent nature of the noise in quantum memories not by continuously updating the quantum state e.g., in fixed time steps, but instead by doing so only when it becomes relevant, e.g., when performing an operation involving this particular entangled pair.For this we simply need to track how much time has passed since the last time this update was performed.Both of these approaches are essential for allowing the simulation to run in a reasonable time frame.
At various points in a quantum repeater protocol, classical information needs to be exchanged.While, again, we do not simulate each individual message and are not concerned with the exact content of the classical communication, it is nonetheless essential to take the timing of classical information into account.This we achieve in our simulation by adding an appropriate delay to when an event will be able to be resolved or by blocking any additional operations being performed on a certain part of the simulation until a point in time when the necessary classical information is able to reach the involved parties.

III. MODEL
We consider two distant parties that want to share a secret key via an entangled swapping based repeater protocol with one or multiple repeater stations between them.The repeater station have the capability to locally perform quantum operations such as entanglement swapping and are equipped with quantum memories.Some of the stations also control an entangled pair source that they can use to establish entangled links between neighboring stations.
In any realistic setting, one inevitably needs to account for imperfections in multiple parts of the system, which make employing a quantum repeater protocol necessary in the first place.In the following paragraphs we describe a number of sources of imperfection and how we modeled them.Additional comments can be found in Appendix A.
a. Arrival probability.Establishing links between neighbouring stations is an elementary operation for the protocols we consider.However, creating entangled links between stations is not always successful and usually needs multiple tries.
There are sources of loss that occur systematically, regardless of the precise layout of the repeater stations.These could for example include the probability of an entangled pair being generated in the first place (preparation efficiency), the wave length conversion efficiency, the probability that photons are successfully coupled into the optical fiber, the efficiency of the detectors or the probability qubits are loaded into quantum memories successfully (memory efficiency).We summarize these in an abstract success probability P link , which represents the probability that a pair can be established not taking into account distance-based losses.
Another central source of loss in the system is the distance dependent loss of qubits during transmission.We describe this by the channel efficiency η ch .For the purposes of this work we always consider photons being sent through optical fibers, but for other repeater setups (such as quantum repeaters using satellites as repeater stations), this part would need to be modified.We define where L denotes the length the photon has to travel and L att = 22 km denotes the attenuation length of optical fibers at Telecom wavelengths.Therefore, the total probability η that a pair is established between two neighboring repeater stations separated by a distance L in one trial is given by b. Initial fidelity.The initially created and distributed Bell pairs may also be imperfect.This could stem from an imperfect generation procedure of the entangled pair sources or from other systematic errors in the handling of the qubits of the initial pairs.
We assign an initial fidelity F init , which represents all these imperfections except the effect of dark counts discussed below, which is loss-dependent.The initial state given by depolarizing noise acting on the desired Bell state vector |Φ + ⟩ as c. Dark counts.Dark counts are an imperfection in detectors and manifest themselves by clicks when no actual signal has arrived.Usually, this is measured in dark counts per second, but for our purposes we are interested in the probability, that a dark count will occur in a detection window, when we would potentially expect a signal.We denote this probability by p d , e.g., for a detector with a dark count rate of 1 Hz and detection windows of 1 µs we get p d = 10 −6 .
We can model dark counts by replacing the erroneously expected qubit with a fully mixed state.In order to obtain the effective density matrix we need not only consider the probability that a dark count occurred, but we must set this into relation with the probability of a true click occurring in the first place, i.e. when success rates are very low, nearly every click is caused by a dark count.
The chance for a detector to click is given by and the probability that the click indicates a real event is then Therefore, the state ρ that represents the output state of a successful attempt is affected by where tr i denotes the partial trace over the i-th subsystem and 1 is the identity operator.
d. Memory noise.Since the usage of quantum memories is of central importance to this type of quantum repeater, time-dependent decoherence for qubits stored in them is another source of imperfection.We assume that the noise caused by this is predominantly in one direction, and described by a dephasing noise channel with the index i marking the qubit that is stored in memory and with where the dephasing time T dp is a parameter specific to the quantum memory in question.Note that other imperfections of the memories, e.g., related to read-in and read-out of qubits can be included in other parameters such as P link and imperfections in the Bell measurements.e. Imperfect Bell measurements.Entanglement swapping is the main quantum operation that needs to be performed once the repeater links have been established.Naturally, the necessary Bell state measurement will be subject to imperfections, which we model as two-qubit depolarizing noise (acting on the qubits being measured) followed by the perfect Bell measurement.The two-qubit depolarizing noise acting on qubits i and j is given by where tr i,j denotes the partial trace over the i-th and j-th subsystem and λ BSM is the Bell state measurement ideality parameter (1 corresponds to perfect operation), which is a property of the repeater station where the Bell state measurement is performed.Another common imperfection is that the measurement may only work with a certain probability, which not only reduces the reliability of the setup, but can even change which swapping strategy should be used [31].However, for the purposes of this work, we consider the Bell state measurements to always be successful.
f. Distribution times.In the scenarios considered in this work, the entangled pair sources are always located directly at a repeater station S. A trial to establish an entangled pair for a repeater link is done by first creating an entangled pair, which takes a preparation time T P (in practical terms this is often related to the the clock rate f clock of the entangled pair source).After one of the qubits is loaded into the memory at station S, the other qubit is sent to a neighboring station S ′ .Before any part of the entangled pair can be used, S needs to wait for a classical message from station S ′ confirming whether the qubit arrived successfully.Therefore, one trial will take t trial = T P + 2d/c, where d is the distance between S and S ′ , and c = 2 × 10 8 m/s is the speed of light in optical fibre.
This also means that when the pair is confirmed to be successfully established, the qubit at S will already have been effected by memory noise for a duration of 2d/c and the qubit at S ′ for d/c.Since loss is a major source of imperfection, it is highly likely that multiple trials are needed to establish an entangled state between neighbouring stations.If the trial is not successful the qubit in memory needs to be discarded and the process started again from the beginning.The time it takes until the next entangled pair is established can be obtained by k × t trial (10) where k is drawn randomly from a geometric distribution k(η eff ) with a success probability η eff .Note that both t trial and η eff are distance dependent.
In scenarios with multiple memories we assume the trials are performed simultaneously and independently for each memory slot.For simplicity we treat them as using spatially separate channels, although in practice one would likely need to consider allocation of certain time slots in the quantum channel to specific processes.However, as long as the time of one trial is much larger than the time it takes to prepare a new entangled pair for sending, any effects arising from this are very small.

IV. RESULTS AND DISCUSSION
At the core of an entanglement-swapping-based quantum repeater (as opposed to a scheme instead using quantum error correction [19]) protocol lies the realization that subdividing a channel into multiple parts and using entanglement swapping can be beneficial.However, many previous investigations fall roughly into two very different categories.On one side there are very abstract models that presume that a large ensemble of entangled states is readily available at the lowest repeater level and the main source of imperfections is the (potentially distance dependent) fidelity of these initial states, while the quantum memories are very high quality and the use of entanglement purification protocols is plentiful (see, e.g., Refs.[7,8,32,33]).In these kinds of scenarios choosing the number of purification steps at each repeater level is the main challenge in optimizing the protocols.
On the other side there are models that are closer to the experimental setups (see, e.g., Refs.[9,22,23,34]), where loss of qubits during the initial distribution of entangled states is a major factor and the coherence times of memories are rather short, and entanglement purification is hardly considered, if at all.Instead, taking into account the exact timing of qubits arriving and operations being performed is the focus of the analysis.Remarkably, the basic approach of shorter channel segments and entanglement swapping has proved useful in these very different situations.

A. Two links with entanglement purification
In the following, we investigate a situation that can be seen as being located somewhere in between the two categories mentioned above: Quantum repeater protocols using entanglement purification while properly considering the timing considerations in the presence of realistic error models.
It is easy to see the pros and cons of adding entanglement purification when considering the extreme ends of the parameter regime: If the initially generated entangled states are of such low fidelity that after performing entanglement swapping the output state is no longer useful (e.g., it would introduce a too high quantum bit error rate for key distribution or fall short of some threshold fidelity at the output), no meaningful connection can be established without a mechanism to improve the fidelity.Entanglement purification protocols can help in this case by increasing the fidelity above the relevant threshold, if the quality of the quantum memories is sufficiently high to accommodate the additional time needed to perform them.However, if the decoherence time of the quantum memories is very short, clearly any gain in the fidelity from entanglement purification will long be gone by the time the required classical information arrives and therefore, performing entanglement swapping as soon as possible is more desirable.
Here we investigate parameters in between those extremes and especially initial fidelities F init for which both approaches with and without the use of an entanglement purification protocol (EPP) can, in principle, achieve non-zero key rates.This allows us to quantify under which circumstances the use of EPPs can be beneficial in this intermediate regime and what memory times need to be achieved in order to make that possible.A similar perspective on the trade-off between using additional memories for entanglement purification or multiplexing has been studied in Ref. [35], albeit with perfect quantum memories.
For now, consider a setup with a single repeater station, i.e., consisting of two repeater links.The repeater station is equipped with an entangled pair source and four memories per repeater link, so multiple pairs can potentially be established simultaneously.Either 0, 1 or 2 steps of the DEJMPS entanglement purification protocol [36] (see also Appendix A 1) are performed on each side before the station applies entanglement swapping.The established connections are then used to perform quantum key distribution.However, entanglement purification is a probabilistic process and measurement outcomes have to be communicated between the involved parties in order for them to know whether the EPP has been successful.
If no entanglement purification is performed, the end stations do not need to have quantum memories, because the arriving qubits can be measured right away.However, when performing entanglement purification the end stations will also need to be equipped with quantum memories.Since in this instance we are only concerned about the secret key rate and not about storing a final long distance entangled state, at the end stations the output qubits of the final EPP step can be measured immediately to avoid additional time in memory, even though the classical information about whether the entanglement purification was successful has not arrived yet.
In Fig. 4, the achievable key rates with varying number of entanglement purification steps are shown for a selection of specific values of F init , for which the use of entanglement purification is just barely advantageous.For the given parameters, at F init = 0.95 using entanglement purification actually leads to a slight reduction in the achievable key rate for most In both cases, it is also apparent that the number of purification steps needs to be managed carefully.For these parameters, using two purification steps is actually detrimental.
distances (e.g.key rates of ~61 Hz with one step of EPP compared to ~75 Hz without EPP at 100 km).However, the use of EPP can extend the distances, for which a positive key rate can be achieved, by a bit (from ~160 km to ~170 km), because there the reduction in error rate by the EPP is actually worth the lower raw bit rate.As expected from the extreme parameter regimes discussed above, if F init is sufficiently low, the use of entanglement purification indeed is just outright beneficial (as is the case in Fig. 4b with F init = 0.935).
For both of these cases, it is also clear that doing more than one step of entanglement purification is not helpful.However, more purification steps may become useful at even lower F init .In any case, clearly the number of purification steps to be performed as part of the protocol needs to be carefully adjusted according to which experimental parameters are available.
We remark that in order to optimize this even further other schemes of entanglement purification could be considered.For example, a pumping scheme [37] instead of a strict repetition scheme could be employed.Alternatively, the number of entanglement purification steps could be dynamically adjusted depending on whether the other link is already ready for entanglement swapping or not.
While the above examples demonstrate there are situations for which the use of EPPs is worth considering, in Fig. 5 a wider range of parameters is considered.It shows the increase in reachable distance, i.e.where a non-zero key rate can be still be achieved, when using one EPP step compared to not using entanglement purification.As expected, the addition of entanglement purification is most impactful when F init is low and the memory quality (represented by dephasing time T dp ) is high.However, it also shows that the usefulness is not restricted to the most extreme cases, but the addition of entanglement purification can somewhat extend secure transmission distances for a wide range of parameters.

Cut-off time as an alternative strategy
In essence, the use of entanglement purification can be understood as one way of trading some of the raw rate for a higher fidelity of the pairs that are used.However, another strategy that is also reducing the raw rate in exchange for a lower error rate, is simply discarding qubits that have been kept in storage for too long.A common mechanism for this is to choose a fixed cutoff time t cut (see, e.g., Ref. [38]) after which a qubit is discarded, and the process of establishing a link is started again.In general, optimizing whether to keep or discard an existing link has been shown to be exponentially hard [39] since all decisions at previous times need to be taken into account as well to formulate the optimal strategy.However, at the individual link level a cut-off time strategy is in- deed optimal in the steady state limit [40].
We applied the cut-off time approach both for the protocol with and without EPP for an F init that is just barely above the threshold where a non-EPP protocol is viable.A selection of the best cut-off times we found for both approaches is shown in Fig. 6.First, it shows that also the EPP approach can benefit from some upper limit on the storage time.Naturally, the optimal cut-off time is much higher for the entanglement purification approach, as one must allow time for the classical information after the entanglement purification as well.This demonstrates that one necessarily needs to consider combinations of approaches when designing quantum repeater protocols.Furthermore, this shows the trade-off between the EPP and cut-off time strategies is complex: for short distances the use of entanglement purification leads to higher key rates, however, the simple protocol without entanglement purification (but with optimized cut-off times) is the better choice at long distances for this parameter set.
Even though entanglement purification and cut-off times are used for similar reasons, it should be noted there is a fundamental difference between them.While cut-off times can reduce the effect of decoherence on the final states, it cannot increase the fidelity of an individual state.For even lower F init , where using a method to increase the fidelity of a pair (like EPPs) is necessary, simply optimizing the cut-off time cannot be sufficient.

B. Multiple repeater links
Already a single repeater station is very useful in reaching longer distances and allows the fundamental limits of repeaterless quantum communication to be overcome.However, with the increasing loss along distances, invariably one will need to consider adding more repeater stations at some point, e.g., the exponential loss in optical fibres is a severe limitation when aiming for intercontinental distances.Indeed, the multiple station scenario is where the quantum memories truly become indispensable, as for a single station so-called twinfield QKD [41] achieves repeater-like scaling with only a simplified relay station that can perform measurements but has no memories.
In principle, subdividing a channel into more segments is very attractive.After all, if adding in a repeater station can improve the connection between two parties under certain conditions, it stands to reason that the same principle can be applied for each individual link.For each individual segment the channel loss in much shorter connections will be lower.Naturally, this does not come without a trade-off: All the imperfections that are not distance dependent but instead are related to generation of the entangled states, handling the states and performing operations, will be present at each of these repeater links, therefore affecting the output multiple times.In order to optimize the connection between two distant parties, the number of repeater links is an additional factor to consider and will certainly depend on the parameters of the available quantum hardware.
For repeater setups with multiple repeater links (without entanglement purification) some expressions for average waiting times are known, e.g., with probabilistic entanglement swapping [22,34,42] or for specific loss models, e.g., suited for satellite-based repeaters [43].For some setups even expressions for the obtainable key have been found recently [24].
To investigate the inherent trade-off when adding additional repeater stations mentioned above we opt for a simple model of fixed, per-link overhead: We consider an imperfect initial fidelity F init < 1.0 of the generated entangled states at each repeater link.This could be interpreted as either imperfect entangled pair sources or some additional constant imperfections that arise from handling the states at the repeater station, e.g., by the read-in procedure that loads an arriving qubit into the quantum memory.One could also consider different sources of imperfections that happen at every link, such as imperfect operations to perform Bell state measurements at the repeater stations (which has a similar effect as lowering F init ), or even a combination of multiple noisy processes.However, we focus on a single parameter for now, in order to keep the results easier to interpret.Furthermore, we limit our investigation to an equidistant spacing of repeater stations, although this may not be optimal in some cases, e.g., when photons cannot be sent in both directions simultaneously [9], and asymmetric repeater setups come with their own set of considerations, see, e.g., Ref. [44].In Fig. 7a, perfect initial states (F init = 1.0) with multiple repeater stations are considered.While there are still some factors to consider that arise from using multiple repeater stations, such as many qubits potentially dephasing in quantum memories at multiple stations, adding more repeater links is generally favorable.E.g. at ~150 km key rates are improved by a factor of approximately 30, 260, 1100 or 3500 when using 4, 8, 16 or 32 repeater links, respectively, compared to a two-link approach.
However, adding even a tiny constant overhead per repeater link immediately demonstrates that there is a serious trade-off when adding more repeater stations, as is apparent from Fig. 7b with F init = 0.998.It also clearly illustrates that the optimal number of repeater stations can be different depending on the distance between the end stations, e.g., for these parameters using a protocol with 32 repeater links leads to improved key rates at 50 km distance, but the protocol with 8 repeater links allows to reach much longer distances overall.
Naturally, the point where adding more repeater stations becomes detrimental depends strongly on the per-link overhead itself.When looking at different values of F init in Fig. 8, we can see that making efforts to improve an experimental parameter can have implications beyond simply increasing achievable rates for a fixed strategy.For example, when considering end stations 125 km apart for this particular set of parameters, improving the achievable F init allows us to switch to using a protocol with more repeater links that increases the obtainable key rate even more than the F init improvement alone would have done.
This demonstrates that considering multiple different repeater strategies is vital when analyzing quantum communication setups.Even if more complex schemes are not realistically possible at present, if improved operations or devices are likely to exist in the future, it might open possibilities for new strategies.Furthermore, this example illustrates how simulation tools can potentially guide experimental developments.Being able to quantify the effect of improving a certain experimental parameter is essential to make an informed decision on where to focus future efforts.

Entanglement purification at the lowest level
When considering entanglement purification as an additional tool for repeater protocols with multiple links, many variations of protocols are possible (e.g. an approach that is generally similar but differs in detail is analyzed in Ref. [25]).This is because in principle one can apply entanglement purification protocols at multiple points of the whole process, e.g., after a certain number of swapping operations it can even become essential to improve the fidelity of the entangled pair via entanglement purification lest the systems becomes completely disentangled.In fact, due to the relative increase in fidelity of repetition protocols being dependent on the input states, on which repeater levels to put the entanglement purification steps has been a consideration for entanglementswapping-based quantum repeaters from the very beginning [7,8].However, with coherence times of quantum memories remaining a central limitation for the foreseeable future, it remains doubtful how useful entanglement purification at higher repeater levels can be.One entanglement purification step at that level is costly in terms of resources as for the creation of each of the long distance pairs multiple lowest level pairs have been used.Furthermore, with the increasing distance at higher repeater levels, the transmission of the classical information necessary for performing the entanglement purification protocol will take longer and at some point the increase in fidelity achieved through a entanglement purification protocol will be negated by the noise processes in the memory during this time.
Optimizing repeater protocols with entanglement purification in mind therefore inevitably means considering these complex trade-offs.For the purpose of this work we only consider whether adding entanglement purification at the lowest level, i.e., purifying only the initial entangled pairs distributed to neighboring repeater stations, can already be beneficial.
We consider a setup with high quality memories (T dp = 100 ms), which favors entanglement purification, and analyse the question of whether one step of entanglement purification at the lowest level should be performed.The results are depicted in Fig. 9; they show that for this parameter set entanglement purification significantly changes the impact of the trade-offs being made when including additional repeater stations.In fact, it is what makes using more repeater stations viable in this case, which in turn improves the reachable distances significantly.This is one example how the use of entanglement purification can be beneficial not just when considering very low initial fidelities, but even when dealing with initial states with relatively high F init .More generally, it showcases how how the access to certain tools (like entanglement purification) makes it necessary to reevaluate other aspects of how the repeater setup is constructed.

C. Impact of improving parameters for custom error models
For the previous results, we have used a fairly uniform error model to make the results easy to interpret.In order to showcase a broader range of error models, we consider an alternative noise model and analyze the effect of improving certain parameters of the hardware.This also follows the line of thought of the previous scenario that a small change in conditions can have a significant effect on the overall outcome.
We consider quantum memories with a time-dependent amplitude damping channel captured as with γ(t) = 1 − e −t/T damp and the damping time T damp .Furthermore, we assume that both entanglement purification and Bell state measurements are performed in a gate based way with the same two-qubit gate error parameter p gate .The noisy CNOT gates involved in both of these operations are modeled as local depolarizing noise channels E d (p gate ) acting on both of the input qubits, followed by the perfect gate operation.The local depolarizing channel on the i-th qubit is defined as with tr i denoting the partial trace over the i-th subsystem.In Fig. 10, the impact of making improvements to either the memories (higher T damp ) or 2-qubit gates (higher p gate ) on the reachable key rate is shown for a protocol with 4 repeater links and one entanglement purification step at the lowest level.It is clear that both parameters have strict minimum FIG. 8. Key rates for 8 (green) or 16 (yellow) repeater links, with varying initial fidelities: Finit = 0.996 (crosses), 0.997 (plusses), 0.998 (circles).Improving some experimental parameters can enable alternative strategies.E.g., when connecting end stations 125 km apart, improving Finit from 0.996 to 0.998 allows changing from a 8-link protocol to a 16-link protocol, which improves the obtainable key rate more than the increase in Finit alone.Other parameters: T dp = 10 ms, P link = 0.5, p d = 10 −6 .
requirements to achieve a non-zero key rate with this protocol at a specified distance.

V. RELATED WORK
In recent years many tools have been released to study various aspects of quantum repeaters and quantum networks.Naturally, each of them focus on different aspects of quantum communication and use differing assumptions and abstractions to model what is important for their specific considerations.Such a variety of interpretations and implementations is certainly beneficial to the discussion in the field and the over- all understanding of quantum networks.At the same time, the field of quantum network simulation is not really mature enough to have a standardized framework for comparing features and protocols.In the following we give a brief overview over some of the available simulation platforms.
SimulaQron [45] provides a distributed classical simulation of multiple connected parties with quantum computers that allows to use the delay of real world classical networks as part of their model.Furthermore, it allows the development of software for quantum networks based on the instruction set architecture NetQASM [46], which would then allow the protocols that were built using the simulation to be run on quantum hardware.
QuISP [26] uses an event-driven approach to simulate quantum networks, but it places a much stronger focus on the networking aspects for large-scale networks.It achieves the necessary scalability by updating an error model rather than tracking full quantum states.
Close in mindset to the approach introduced in this work are the approaches followed by NetSquid [25] and SeQUeNCe [27], which are both event-based software tools for modelling and simulating quantum networks.NetSquid has also been used in the context of quantum repeater chains with realistic hardware.In Ref. [25], a setup with a different variation of an entanglement purification strategy is analyzed for a NV-center based quantum repeater stations with additional hardware restrictions.It has also used to consider aspects for quantum repeaters based on atomic ensembles [47] and real world fiber infrastructure [28], as well as the use of genetic algorithms to optimize repeater protocols [29,48].SeQUeNCe has investigated the distribution of entangled states in a nine node network in Ref. [27].It has also been used to model and analyze a specific generation procedure for photonic quantum states with absorptive quantum memories [49].In Ref. [50], it is explained how the simulator can parallelise some calculations.

VI. SUMMARY AND OUTLOOK
Quantum communication constitutes a central pillar of quantum technologies, with cryptographic applications being the main practical application.The vision of achieving secure communication over arbitrary distances requires overcoming the strict limitations that stem from not having quantum repeaters available.Hence, the quest for achieving realistic and efficient quantum repeater protocols is by no means a detail, but is actually a core step before practically relevant protocols of quantum communication over arbitrary distances become viable.Research on hardware development is progressing well, but is challenged by the situation that the multitude of design rules render the optimal construction of quantum repeaters challenging.
In order to substantially assist this task, we have developed a numerical simulation that allows us to analyse practical quantum repeater setups, as a versatile scheme, but detailed enough that a multitude of physical aspects can be accommodated.We stress that our approach can obtain not only waiting times but also calculate quantities directly from the output distribution (such as secret key rates) while taking into account the probabilistic distribution of initial states, time-dependent memory noise, multiple quantum memories per repeater link, entanglement purification and multiple repeater links (including analyses for up to 32 in this work and a demonstration of up to 1024 in Appendix B).
We have analyzed multiple scenarios that are focused on the comparison and combination of repeater strategies: We have explored the use of entanglement purification as part of a quantum repeater protocol and quantified under which circumstances employing such a strategy can be beneficial.More importantly, we found that increasing the complexity in this way may be unwarranted if a strategy with optimized cut-off times can produce similar or even greater performance.Furthermore, we have analyzed the trade-offs that come with protocols that use multiple repeater links and provided a clear example how improving the experimental capabilities (e.g.better initial fidelities) can make new options for optimisation (e.g. using more repeater stations) viable, which leads to a larger improvement together than what would be obtainable in isolation.
In general, there are a multitude of questions when it comes to the design of quantum repeaters or, at a higher level, quantum networks.One of the main challenges in exploring further options is that the parameter space is not only vast, but any result of optimality can only be understood in a specific context and with a specific set of tools in mind.While our approach will certainly allow to explore different parameter regimes in a more rigorous manner, we expect it will be particularly useful for investigating advanced repeater protocols, e.g., for asymmetric setups or with dynamic adjustments of strategies.Another possible direction is to use a numerical simulation to closely model particular experimental setups and investigate the viability of building more complex schemes with currently available experimental hardware (e.g., Ref. [28] follows such an approach).It is the hope that the versatile platform presented here substantially contributes to the quest of identifying good design principles for feasible quantum repeaters and hence contributions to achieving quantum communication over arbitrary distances.
If the initial fidelity λ 0,0 is sufficiently high, a repeated application of this protocol will result in an amplification of that coefficient.In Ref. [36], this repeated application is formulated as a repetition protocol, i.e., one performs the above protocol on many initial copies and uses the output copies of successful purification steps as input for the second step.
In the scenarios considered in this work, it is common that the input pairs used for the DEJMPS protocol are not identical.If one pair has been established between two parties, it will often have to wait in noisy quantum memories until a second pair can be established and the entanglement purification protocol can be performed.In the context of a quantum repeater, it is also important to stress the necessity of communicating the measurement outcomes, which need to be communicated to both parties performing the protocol in order to decide whether the entanglement purification was successful.

Key rates
The asymptotic key rate (per time) is lower bounded by [9,53,54], where r is the raw rate of bits obtained from measurements at the end stations that have been confirmed to correspond to successful entanglement swapping operations at the repeater stations, h is the binary entropy function and e X(Z) represents the quantum bit error rate of measurements in the X(Z) basis.Furthermore, the key rate can be constrained by an error correction inefficiency f ≥ 1, with 1 being to the ideal case.
In this work, we obtain a large sample of long-distance links between the end stations of the repeater chain from our simulation and use the sample mean of r and e X(Z) to calculate an estimate for the asymptotic key rate (A3).However, it should be noted that in practice the effects of finite-size effects should be carefully considered for cryptographic applications [55], e.g., some special considerations for satellitebased quantum key distribution (because of the small expected block sizes for current experimental parameters) are discussed in Refs.[56,57].
It should be noted that the term key rate is used for multiple related quantities in the literature: Some publications instead focus on the key rate per channel use with the yield Y instead of the raw rate r.Furthermore, some use Y /2 or r/2 to obtain a key rate per mode since the B92 protocol [58] requires two modes.It is also worth mentioning that depending on how the channel uses are counted the key rate per time may either be directly related to the key rate per channel uses (if the potential number of channel uses in a time interval is counted) or not directly related, e.g., if the actual number of photons sent through a channel in a sequential protocol are counted.The main texts is restricted to discussing setups of up to 32 repeater links, which is both due to using models that are straightforward to interpret, but also because, as Section IV B clearly shows, the range of scenarios that are both viable and interesting while using the same parameter sets are inherently limited.
In Fig. 11 the run times of repeater setups up to 1024 repeater links are shown.These were obtained on a machine with an Intel Core i9-12900 Processor running up to six data points in parallel.

Appendix C: Known setups with analytical results
As part of developing the simulation, we naturally tested our approach using known analytic results.In the following, we use the error models and protocols from some specific publications and recreate them using our simulation.We have done this not only to test whether our simulation works correctly, but also to show that our simulation can support the kind of error models frequently found in the literature.Our framework goes substantially beyond first steps that have been taken towards the simulation of repeaters in Ref. [59], on which this comprehensive simulation platform presented here builds.
In the following, we will briefly describe the protocols, explain how the error model translates to our parameter set, and show that our numerically calculated key rates agree with the analytical formulas.All of them use a key rate per channel use as a metric.12. Obtainable key rates for the two link repeater protocol and parameters described in Ref. [9].Comparison of analytic formulas (lines) and our simulation (dots).

Memory-based quantum repeater with two links
Ref. [9] analyses a generic repeater protocol with one repeater station.Entangled pairs are created at the repeater station with one qubit directly loaded into the memory, while the other is sent via glass fibre to the end stations.There are two variants of this protocol, one with sequential entanglement generation, i.e., first only on of the sides tries to establish an entangled pair and only after that is successful, the process is started for the other side, and a simultaneous variant, where both sides are trying to establish pairs simultaneously.
This scenario has an additional parameter for the imperfection that arises from the setups of different repeater stations being misaligned.This can be modeled as a Y -noise channel with misalignment error e ma ∈ [0, 1] acting on one of the qubits Y (e ma )ρ = (1 − e ma )ρ + e ma Y (i) ρY (i) , (C1) where D Y denotes the Pauli-Y -noise channel and Y is the Pauli-Y operator, with the superscript (i) indicating that they each act on the i-th qubit.Note that a Y -noise error is consistent with a symmetric, randomly distributed misalignment angle of the detectors for photonic polarization encoded qubits for measurements in the X-Z plane.Both the BB84 and B92 QKD protocols, as well as the Bell state measurements for entanglement swapping, rely on these measurements in the X-Z plane.In Fig. 12, the results of our simulation compared to the analytical formulas is shown (compare Fig. 3 in Ref. [9]).The parameters for this scenario are: P link = 0.002376, T P = 2 × 10 −6 s, e ma = 0.01, p d = 10 −8 , λ BSM = 0.97, F init = 1.0, T dp = 1.0 s, n mem = 1, t cut = ∞ s, f = 1.16.

Two repeater links for multiple experimental platforms
Ref. [21] contains parameters of multiple experimental platforms from research groups in Germany, and summarizes them to a model using only P link , T dp and the clock rate f clock .The scenario we recreate here is referred to as the node sends photons protocol in Ref. [21], which is a protocol with two repeater links with entangled pair sources located at the central repeater station and also makes use of cut-off times.The comparison of our simulation results with the analytical formulas is shown in Fig. 13 (compare also the secret key plots in Fig. 5 in Ref. [21]).The full parameter sets used are summarized in Tables I and II.

Two repeater links with multiple memories
Ref. [23] analyzes a protocol that makes use of multiple memories and obtains expressions for achievable key rates depending on the number of memories.It assumes that there is a separate channel for each quantum memory and trials to establish entangled pairs can be attempted simultaneously.However, unlike the scenarios we discuss in the main text, this is not done for both repeater links at the same time.The protocol works as follows: First, trials are repeated for one of the repeater links until at least one attempt is successful.It is possible that multiple pairs are established in the same trial.Then, trials are performed for the other repeater link until at least one attempt is successful.The quantum memories now containing qubits from successful attempts are paired and entanglement swapping is performed.Finally, if one of the repeater links had more successes then the other, the leftover qubits are discarded.This last step has a similar effect as introducing a cut-off time mechanism, as it prevents qubits being stored in quantum memories for too long.
scenario ← Setup including e.g., position of stations and sources iter ← desired number of long distance entangled connections params ← parameters of the model as described in Section III protocol ← description of the repeater protocol to perform function RUN(scenario, iter, params, protocol) INITIALIZE setup according to scenario & params l ← number of successfully established links starting at 0 while l < iter do protocol.CHECK for new events to be scheduled if long distance connection has been established then UPDATE collected data.l ← l + 1 RESOLVE next event in event queue function CHECK (example for a single station) nmem ← number of quantum memories per link at station n l,r ← number of established pairs left/right of station s l,r ← number of events creating pairs left/right of station (i.e.accounting for busy memories with no established pair)

FIG. 4 .
FIG. 4. Obtainable key rates for two repeater links with 0 (blue), 1 (red) or 2 (green) entanglement purification steps before entanglement swapping.(a) Finit = 0.95:Even though no entanglement purification protocol (EPP) is necessary for most distances, EPP can help extend the reachable distance.(b) Finit = 0.935: At worse initial fidelity EPP can improve key rate for all distances.In both cases, it is also apparent that the number of purification steps needs to be managed carefully.For these parameters, using two purification steps is actually detrimental.Other parameters: T dp = 100 ms, P link = 0.5, p d = 10 −6 , 4 memories per repeater link.

1 FIG. 5 .
FIG.5.Increase in achievable distance (i.e. with non-zero key rate) using a repeater protocol with one entanglement purification step compared to a repeater protocol without entanglement purification.Other parameters: P link = 0.5, p d = 10 −6 , 4 memories per repeater link.

1 FIG. 6 .
FIG. 6.Achievable key rates for two repeater links with a combination of strategies.Without entanglement purification and cutoff times tcut = ∞ (red) or 50 ms (blue).Alternatively, a protocol with one step of entanglement purification and cut-off times tcut = ∞ (green) or 650 ms (yellow).Properly optimized cut-off times can clearly help in both cases.Other parameters: T dp = 1 s, P link = 0.5, Finit = 0.925, 2 memories per repeater link.

FIG. 10 .
FIG. 10.The impact of improving certain hardware parameters for a custom error model.Using a repeater protocol with 4 repeater links and 1 entanglement purification step at the lowest repeater level. 2 quantum memories per connected link are available at each station.Parameters: P link = 0.01, p d = 10 −6 , Finit = 0.99.For a total total distance of 20 (blue), 35 (red), 50 (green), 75 (yellow) or 100 (cyan) km (a) varying memory quality with fixed pgate = 0.99 ; (b) varying quality of 2-qubit gates with fixed T damp = 1s (no positive key rate for 75 or 100 km).

1 FIG. 11 .
FIG.11.Scaling of run times of the simulation with the number of repeater links.This is for a setup with single memories and no entanglement purification like in Section IV B of the main text.Two methods of scheduling events are compared: A general, adjustable method indicative of the protocols used in the rest of this work (blue) and a specialized one for this scenario optimized for scaling (red).
Appendix B: Scaling to more repeater links FIG.12.Obtainable key rates for the two link repeater protocol and parameters described in Ref.[9].Comparison of analytic formulas (lines) and our simulation (dots).