Finite-key analysis for memory-assisted decoy-state quantum key distribution

Memory-assisted quantum key distribution (MA-QKD) systems are among novel promising solutions that can improve the key-rate scaling with channel loss. By using a middle node with quantum storage and measurement functionalities, they offer the same key-rate scaling with distance as a single-node quantum repeater. However, the distance at which they can surpass the nominal key rate of repeaterless systems, in terms of bits per second, is typically long, owing to the efficiency and/or interaction time issues when one deals with quantum memories. This crossover distance can be a few hundred kilometres, for instance, when one relies on the exchange of infinitely many key bits for the key-rate analysis. In a realistic setup, however, we should account for the finite-key effects in our analysis. Here, we show that accounting for such effects would actually favour MA-QKD setups, by reducing the crossover distance to the regime where realistic implementations can take place. We demonstrate this by rigorously analysing a decoy-state version of MA-QKD, in the finite-key regime, using memory parameters already achievable experimentally. This provides us with a better understanding of the advantages and challenges of working with memory-based systems.


I. INTRODUCTION
Quantum key distribution (QKD) has made a lot of progress as part of the solution package for secure communications in the quantum era [1]. But, when it comes to long distances, quantum technologies still have a long way to go before they can replicate the same functionalities that public-key cryptography offers. In terrestrial networks, such as the infrastructure that today's Internet is based on, the biggest challenge to overcome is perhaps the exponential growth of loss in optical fibres [2]. This makes it extremely difficult to perform QKD at long distances without trusted middle nodes. Quantum repeaters are potential solutions, but none of their theoretical architectures can currently be implemented experimentally to the full effect [3]. For instance, probabilistic quantum repeaters [4][5][6] would require quantum memory (QM) modules with high coupling efficiencies to light and with coherence times exceeding the transmission delays, which are hard to achieve together [7]. That said, even if the current QMs are not sufficiently advanced for quantum repeaters, they may still be used to offer key-rate improvements in some of the existing QKD systems. Working on such memory-assisted QKD (MA-QKD) systems paves the way for future scalable quantum repeaters. This work studies the secret key rate for decoy-state MA-QKD systems in the practical regime where only a finite block of data is exchanged among QKD users.
MA-QKD setups [7,8] are based on the measurement-device-independent QKD (MDI-QKD) protocol [9], in which Alice and Bob send BB84-encoded pulses to a middle node, Charlie, who performs a Bell-state measurement (BSM). In MDI-QKD, a raw key bit can be generated if both pulses survive the channel loss in the same round and the BSM is successful. In MA-QKD, however, Charlie employs two QMs to store the quantum state of the users' pulses, and only performs the BSM when both memories have been loaded. This will allow the pulses that arrive in different rounds to be combined to produce a key bit. Thus, the key-rate scaling is improved from η 2 in MDI-QKD to η in MA-QKD [7], where η is the transmittance of the channel between Alice/Bob and Charlie. Together with the recently introduced twin-field QKD (TF-QKD) [10], MA-QKD is a strong contender to beat the current rate versus distance records in QKD. Such an advantage has recently been demonstrated experimentally using silicon vacancy centres [11].
Offering advantage in a realistic setup that relies on imperfect QMs is not without its own challenges. For instance, photon-memory coupling can introduce additional loss in the setup. Some memories have also a long photon-memory interaction time that requires users to employ a low source repetition rate. The better scaling with channel loss can only offset these effects after a certain distance, which we refer to as the crossover distance. If this distance happens to be long, it would then be difficult to experimentally implement a stable system that benefits from such an advantage. Other effects, such as decoherence in the QMs, also need to be taken into account when evaluating system performance [7] and they typically exacerbate the situation. Additionally, in realistic setups, we should consider the effect of using weak laser pulses by the users in conjunction with finite-key effects. In this work, we develop a security analysis that accounts for all the above, and, in particular, quantify the interplay between the crossover distance and other parameters of the system. Several analyses of MA-QKD have already been carried out, under varying assumptions and for different implementations of QMs. However, most of them [8,12,13] assume single-photon sources, which are difficult to attain in practice. In many QKD experiments, attenuated laser sources are used, instead. The multi-photon components in the signals generated by these sources introduce security loopholes, and they need to be dealt with [14]. The decoy-state method [15] is often used to bound the leaked information from these multi-photon signals, thus closing the loophole. This method involves the statistical estimation of channel probabilities, based on data collected from the use of different laser intensities. This statistical characterisation of the channel would only be perfect if one could collect an infinite amount of data by using the channel infinitely many times. In practice, a QKD experiment will run for a fixed amount of time, and a finite-size dataset will be generated [16]. By using statistical analyses based on concentration inequalities, it has been shown that a bound on the leaked information can be computed [16,17], thus a secret key can still be distilled, with a failure probability that can be made arbitrarily small. However, as the total number of signals exchanged (the block size) gets smaller, the obtainable secret key rate is reduced. In fact, if the block size is too small, no secret key rate may be obtained at all.
In this paper, we provide the first analysis of a decoy-state MA-QKD setup that accounts for the statistical fluctuations that arise from generating a finite-size key. Previous work [7] on MA-QKD has only considered the asymptotic limit in which the users exchange an infinite number of signals, and under simplified assumptions on the loading of QMs with attenuated laser sources. In our finite-key analysis, we compare MA-QKD performance with that of a no-memory MDI-QKD system, by using parameters from state-of-the-art experiments on quantum memories [12]. We find that MA-QKD is inherently more resistant to finite-key effects, and it experiences a lower reduction in secret key rate than MDI-QKD. In particular, we see that once these effects are considered, the distance from which MA-QKD offers an advantage is reduced. This would make it easier for experimentalists to implement a decoy-state MA-QKD setup that outperforms, in terms of secret key rate versus distance, the equivalent decoy-state BB84 or MDI-QKD setups.
In terms of key rate, MA-QKD may not outperform the recently introduced TF-QKD, at least with state-of-the-art quantum memories. However, one should be careful when comparing systems that have different requirements. For instance, the single-photon interference of TF-QKD demands phase stability over long channels, which is experimentally difficult, and which MA-QKD does not need. We believe that comparing MA-QKD with MDI-QKD is the fairest when it comes to the requirements of each system. We note that there exists some recent work on memory assisted TF-QKD [18], which specifies under what circumstances adding quantum memories to TF-QKD setups can be advantageous. Moreover, we believe that MA-QKD is of special interest as is the very first step toward building memory-based quantum repeaters. Unlike TF-QKD, or other no-memory systems, these offer a scalable solution for long distance quantum communications. Any practical progress with quantum repeaters would be based on fully understanding and implementing MA-QKD as the simplest memory-based repeater system. Our findings for MA-QKD systems suggest that memory-based quantum repeaters may also be resilient to finite-key effects, at least when users access them with decoy-state sources.
The rest of the paper is organised as follows. In Section II, we describe the analysed setup, placing an emphasis on the QM modules, and the different parameters that are used for modelling them. In Section III, we explain how different system parameters affect the secret-key rate. In Section IV, we compare the secret key rate achievable in decoy-state MA-QKD and decoy-state MDI-QKD with examples from warm vapour and cold atomic ensembles. Section V concludes the paper with our interpretation of the results.

II. SYSTEM DESCRIPTION
In this section, we describe our MA-QKD setup and the assumptions we make on different devices and components of the system. Figure 1 shows the schematic of the MA-QKD setup considered in this work. Here, in each round, Alice and Bob each send decoy-state BB84 states in their chosen basis. Charlie verifies the receipt of the transmitted signal by generating an entangled photon pair (EPP) on each side to effectively teleport the state of the users to a local photon on his site. The side BSMs in Fig. 1 would herald the success of such an event, in which case the remaining photon of the EPP source will be written to the corresponding QM. That is, its photonic state is transferred to the memory, and will be kept there until the state of the other user is also successfully received and teleported to its respective QM. At this point, the two QMs will be read, i.e., their states will be transferred to photons on which the middle BSM is performed. At the end of the protocol, Charlie announces his measurement results, and Alice and Bob would follow with conventional steps for sifting and post-processing of their key bits. Figure 1: The schematic of an MA-QKD system. The two users Alice and Bob use decoy-state BB84 encoders to generate polarisation/phase encoded signals. Charlie, in the middle, uses entangled photon pair (EPP) sources to teleport the state sent by the users to the corresponding memories. When both memories are loaded, their states are converted back to photons and combined in the middle BSM. For an example of the BSM module, see Fig. 4 of Appendix A.
Note that the teleportation scheme used here to herald and transfer the state of photons is not an ideal one. In an ideal teleportation setting, the users have to send ideal single photons, whereas here they are using weak laser pulses. The effect of the multi-photon components has then to be taken into account. We analyse the memoryloading procedure for weak laser pulses in Appendix A. In this scheme, we are also delaying the writing of the second photon of the EPP until we learn about the success of teleportation. While there is a chance that the transfer of this photonic state to the QM may fail, this delayed writing process has the advantage that the QM initialisation is not necessary in each round [12], but only when a writing procedure has been attempted. This helps with maximising the repetition rate of the protocol especially when the initialisation phase is time consuming. We account for the failure in transferring a local single photon to the memory by the memory writing efficiency parameter.
Finally, while, in practice, an ideal EPP source as assumed here may not be realistic, it would help us obtain the key features of our finite-key analysis without overly complicating the calculations. The former issue can be managed by techniques introduced in Ref. [12], where they propose a quasi-EPP scheme based on single-photon sources, instead. It is also possible to create a photon-QM entangled pair in certain QMs [13,19]. In all cases, we should be careful with the possible multiple excitations we may locally create at Charlie's node to not violate the conditions for the proper operation of MA-QKD systems [12,20]. Under above considerations, we believe that the main result from our paper, i.e., the resilience of the decoy-state MA-QKD to finite-key effects, should still hold.
In the following, we describe the key components of our system in more detail.

A. Quantum memories
We model QMs using a few relevant parameters to our setup, while keeping our model as general as possible: • The writing efficiency, denoted as η w , is the probability of successfully transferring a single-photon state to the quantum memory. We refer to this process by the term "loading".
• The reading efficiency, denoted as η r , is the probability to transfer the qubit state stored in the QM back to a single photon. We assume that, at time t after loading, η r (t) = η r0 exp[−t/T 1 ], where η r0 denotes the reading efficiency at time t = 0 and T 1 is the decay time constant of the QM.
• The QM decoherence time constant is denoted by T 2 . We consider two decoherence processes: dephasing and depolarisation. In the case of dephasing, for an initial state ρ(0) of the QM, the state at a time t after loading will be where p(t) = [1 + exp(−t/T 2 )]/2. Dephasing will only affect X-basis states. For a depolarisation process, we assume In both cases, we treat the QM state as a qubit for which σ x , σ y , and σ z are its corresponding Pauli operators.
• We denote the interaction time with single photons as τ int , for both reading and writing procedures. We denote the initialisation time of the QM as τ init . Because of our delayed-writing assumption, a writing procedure will always be followed by a reading procedure, and the QM only needs to be initialised after reading.
• The writing time is denoted as τ w , and the reading time is denoted as τ r . For our delayed writing procedure, we assume τ w = τ int and τ r = τ int + τ init . We effectively neglect the required time for measurement in both cases.
• We denote as τ p the pulse duration of both the user sources and the EPP sources, which are assumed to have matching pulse shapes. We assume τ p = τ w to maximize the writing efficiency into the memory. The MA-QKD system is to be run at a repetition rate of R s = 1/τ p .

B. Channel and source model
Similarly, we present our assumptions on the channel and the users sources: • We assume that the user sources produce phase-randomised coherent states, and that the intensity of the pulse can be perfectly tuned in each round. The users select a random intensity, in terms of mean number of photons, from the set {z, w 1 , w 2 , v} with probability {p z , p w1 , p w2 , p v }. Emissions with the z intensity will be encoded in the Z basis, and they will be used to generate the raw key. Emissions with any other intensity will be encoded in the X basis, and they will be used to estimate the single-photon counts and their corresponding phase-error rate. We will refer to z as the signal intensity, and to {w 1 , w 2 , v} as the decoy intensities. Our model can work with either polarisation or phase encoding. We denote the source repetition rate as R s .
• We assume non-resolving detectors with efficiency η d and a dark count rate γ dc . The latter includes intrinsic effects as well as background photons in the channel. The dark count probability per detector per round of the protocol is p dc = γ dc τ p .
• We denote the total length of the channel separating Alice and Bob by L. We assume that the central node is located exactly halfway between the users. We denote the attenuation length of the channel by L att . The transmission coefficient for each leg of the channel is given by η ch = exp −L 2Latt .
• We consider the effect of setup misalignment between the user sources and the measurement devices in the central node. The standard way to model misalignment in QKD is by a misalignment probability e mis , and previous analyses of MA-QKD have also modelled it that way [7]. However, as explained in Appendix A, such a model is not directly applicable when considering the indirect loading of QMs with weak laser pulses. Here, we model misalignment by assuming that the encoding modes, e.g., horizontal and vertical polarisations, have been rotated from their ideal settings by a random angle θ. We then average over θ to find parameters of interest.
• In our setup, we allow for the usage of frequency converters to match the frequency of the telecom signals sent by the users with that of the EPP source. The EPP source, in one leg, should generate a beam that interacts with the QM. For a degenerate EPP source, this would typically require us to downconvert the frequency of the other beam to the telecom band. One can, in principle, design a non-degenerate EPP source, but we should then be careful with the extent of multiple excitations in the source [20]. We account for the efficiency of frequency converters by including additional loss in our setup.

III. KEY-RATE ANALYSIS
In this section, we find the secret key generation rate for our decoy-state MA-QKD setup, in both the asymptotic and finite-key regimes. We assume the nominal mode of operation in which no eavesdropper is present, and the system is only affected by device imperfections. Also, for simplicity, we assume that the sources used by Alice and Bob, and the channels connecting them to the middle node are identical.

A. Asymptotic case
In this subsection, we calculate the key rate obtainable in the limit that the users exchange an infinite number of signals. In this regime, we can assume that the signal intensity is used with probability p z 1, and that the decoy-state analysis provides a perfect estimate of the single-photon channel probabilities. Under these assumptions, the secret key rate is lower bounded by [7] where Q Z is the probability of generating a sifted key bit per round of the protocol, and e Z is the error rate of the sifted key. Also, Q Z 11 is the single-photon contribution to Q Z , and e ph is the phase-error rate of these single-photon components.
Our objective here is to calculate what Alice and Bob would observe in a nominal experiment for directly measurable parameters Q Z and e Z , and their corresponding estimation for Q Z 11 and e ph after using the decoy state method. For this, we mainly use the method introduced in [7], but we adjust it as needed to account for the specific components of our model. In particular, in the case of weak laser pulses at the source, we need to pay special attention to the modelling of misalignment in the channel. We also extend the results of [7] to depolarising channels.
Appendix A provides a detailed and self-contained description of our analysis. In short, we first obtain the exact expression for loading probability p µ load and loading error rate e µ load when Alice/Bob sends a phase-randomised coherent state with intensity µ under a generic model for channel misalignment. This parameter would then allow us to calculate the average number of rounds needed to load both memories, and the corresponding state of the memories after a heralded loading. We will then account for memory decoherence and decay processes and calculate the rate of success, and the corresponding error rate, for the middle BSM. Section A 2 a, in Appendix A, provides the analytical form for all parameters needed in Eq. (3).

B. Finite-key regime
Now, we calculate the secret key rate in the more realistic scenario where the number of signals exchanged by the users is finite. In this regime, we still derive the secret key from the data points for which both users have used the Z basis, but we also need to take into account the rounds in which the users employ decoy intensities. In this case, we can no longer assume that the decoy-state analysis provides a perfect estimate of the single-photon statistics Q Z 11 and e ph . Instead, we use a statistical analysis to bound them. Under our new assumptions, the total secret key length K satisfies where M Z is the length of the sifted key, generated from the events in which both users selected the Z basis (i.e., the z intensity), and e Z is its bit error rate; M Z 11 is the number of bits in this sifted key that originated from single-photon emissions, and e ph is their phase-error rate.
In an experimental implementation of the protocol, the measurable observables available to us are the sets {M ab } and {E ab }, where M ab is the total number of measurement counts when Alice has used intensity a and Bob has used intensity b, while E ab is the number of such events that result in error. The objective of Alice and Bob is to use this data to obtain statistical bounds on M Z 11 and e ph . The full description of our statistical analysis appears in Appendix B. We use the idea in [21] to perform our statistical fluctuation analysis using X-basis data only. This would make our statistical estimation procedure more efficient. By applying tight multiplicative Chernoff bounds [16], we are then able to use the measured counts M ab and E ab to set linear constraints on the possible values that M Z 11 and e ph could take. These constraints enable us to express the desired bounds on these quantities as the solution to two linear programs. We use the analytical estimation procedure introduced in [17] to solve these programs.
For our numerical simulations, we still need to make some assumptions on the obtained measurement results in a nominal experiment. For this purpose, we use the expected values for relevant parameters using the corresponding probability in the asymptotic regime, derived in the previous subsection. That is, we assume where N is the total number of rounds, i.e., the number of transmitted pulses by Alice/Bob, in the protocol, Q ab is the probability of having a successful measurement originating from intensities a, for Alice, and b, for Bob, and e ab is the probability that this measurement results in an error. Section A 2 b, in Appendix A, provides the derivation and the analytical form for all these parameters. In our finite-key analysis, we have only considered the effect of statistical fluctuations on parameter estimation. Thus, in our key rate formula in Eq. (4), we have neglected some of the less significant terms that usually appear in a rigorous finite-key analysis. The latter is to adhere to the universal composable framework [22,23]; e.g., we direct the reader to Eq. (1) of [17]. We have neglected these terms for simplicity, as they are, in practice, only on the order of tens of bits, and because their effect is identical for the memory-assisted and no-memory systems, which the present work aims to compare.

IV. NUMERICAL RESULTS
In this section, we use the results of Section III to simulate the secret key rate that can be achieved with the decoy-state MA-QKD scheme in Fig. 1, in both the asymptotic and finite-key regimes. We use two types of memories for our analysis: Warm vapour atomic ensembles, which often offer high bandwidth, hence high repetition rates, but a rather low coherence time; and cold atomic ensembles, which are often slower but benefit from longer coherence times. Table I summarises the relevant memory parameters used in our simulation based on the experimentally reported values in [24], for warm vapours, and [25], for cold atomic ensembles. In our simulations, we have assumed T 1 = T 2 .  Table I: Parameter values of recently demonstrated warm vapour (WV) and cold atom (CA) ensembles [12], as well as silicon vacancy (SV) centres, used in the simulations in this work. For simplicity, in our simulations, we assume T2 = T1.
We compare the MA-QKD system with a no-memory MDI-QKD setup, run at a repetition rate of 1 GHz, as a reference point, and study how finite-key effects change the crossover distance under different circumstances. Section A 3 in Appendix A provides the analytical expressions used for simulating the MDI-QKD system. MDI-QKD is the closest no-QM system to MA-QKD, which enables us to make this comparison as fair as possible. They both offer measurement-device-independent features and they can both be run with minimal requirements on the source or channel phase stabilisation. The latter property is needed for advanced twin-field QKD systems, whose rate-versusdistance scaling is similar to MA-QKD, but are expected to offer higher rates if properly implemented [26][27][28].
In all cases, we use the system parameters listed in Table II, which are attainable by today's technologies [29]. In all graphs, we optimise over the values of the intensities {z, w 1 , w 2 }, and assume a vacuum intensity of v = 0.5·10 −3 , since the optimal value v = 0 may be difficult to achieve in practice. We also optimise over their selection probabilities {p z , p w1 , p w2 , p v }. In our finite-key analysis, we assume a failure probability of ε = 0.5 · 10 −11 for each of the concentration bounds used in Appendix B; the total failure probability of the estimation process is 20ε = 10 −10 .
Attenuation length of the channel, Latt 22 km Detector efficiency, η d 93% Detector dark count rate, γ dc 1 count/s Misalignment error probability, emis 0.5% Conversion efficiency, ηc 0.5, 1 Table II: System parameter values used for the simulations in this work. For no-memory MDI-QKD, we assume that the channel misalignment, in their respective leg of the channel, flips the state sent by each user with probability emis. For MA-QKD, we assume that channel misalignment rotates the states sent by the users by an angle θ that follows a uniform distribution of width 2 √ 3emis; see Eq. (A23), and the explanation preceding it.
In Fig. 2, we show the performance of the warm vapour memory in Ref. [24], for different values of the block size N , which represents the total number of signals sent by Alice (or Bob) in that run of the protocol. We can see that, at low distances, the key rate of MA-QKD is lower than that of MDI-QKD. This is partly due to the lower repetition rate for MA-QKD, but also due to the additional loss effects introduced by the QM's less-than-one writing and reading efficiencies. At longer distances, however, the improved key-rate scaling of MA-QKD with channel loss may overcome these effects. In Fig. 2(a), we can see that in the asymptotic regime (black curves), the MA-QKD protocol can only offer a small advantage over MDI-QKD from around 340 km to 430 km. However, once we use a finite block size N (colour curves), the crossover distance moves to the left to shorter channel lengths, and even approaches 100 km at N = 10 10 . This suggests that in order to see the advantages of MA-QKD over no-QM MDI-QKD we only need to demonstrate such systems over much shorter distances than one may require in the asymptotic regime. With record distances for entanglement distribution between two QMs being around 50 km [30], one can hope that such a demonstration can take place in near future.  While a slight shift to the left, due to finite-key effects, might be expected in Fig. 2, the considerable change in the crossover distance may come as a surprise. A naive thinking may suggest that in order to see the benefits in the finite-key setting, we need to have larger count numbers in MA-QKD, as compared to MDI-QKD, to reduce statistical errors in our parameter estimation. But, so long as, in the asymptotic case, the key rate for MDI-QKD is higher than that of MA-QKD, we may expect that the corresponding counts will also remain larger in the finite-key setting, hence no considerable change may be expected in the crossover distance. This argument, however, fails to give us an accurate picture of what is happening in the MA-QKD case. Below, we explain two key reasons for why the finite-key setting may benefit the MA-QKD setup, hence shifting the crossover distance to much shorter channel lengths.
• Self-purification of multi-photon terms: The MA-QKD system can by design get rid of some of the erroneous terms that would otherwise be present in the no-QM setup. Let us compare the two setups when Alice selects a non-vacuum intensity s, in the X basis, and Bob selects the vacuum intensity v. In no-QM MDI-QKD, there is a single BSM module, in which Alice's and Bob's emissions are directly combined. A successful BSM, in polarisation encoding, is declared if two detectors corresponding to different polarisations click. In the event that Bob sends a vacuum state, a successful BSM could happen because of the multi-photon terms in Alice's signal. This increases M sv and E sv counts, which add to the uncertainty in estimating e ph . In MA-QKD, such counts are much lower. Charlie will declare that Bob's QM has been loaded when his corresponding side BSM is successful. For a vacuum input, such an event could only happen if one of the detectors clicks because of the dark count, assuming that the EPP source can only cause a click in one of the detectors. For low dark count rates, as we assume here, the measurement counts M sv , as well as its corresponding terms in error will be close to zero in MA-QKD. Around the crossover distance, this makes the upper bound on e ph lower for MA-QKD even if its corresponding value in the asymptotic case is higher than that of MDI-QKD. That is, MA-QKD enjoys less noisy statistics that helps us obtain tighter bounds on our parameters of interest.
• Efficient use of decoy states: In both MDI-QKD and MA-QKD, the secret key is extracted from events in which both users select the signal intensity z. The rounds in which they both employ the decoy intensities are used for parameter estimation only. The points that one user uses the Z basis and the other uses the X basis, are then somehow "wasted" and will be sifted out. MA-QKD can help with better sifting efficiency. This is partly because of the main advantage of MA-QKD with respect to MDI-QKD in that the key rate scales with the transmissivity of one leg of the channel, rather than the entire channel. To better understand this point, let us consider the effect of employing the vacuum intensity, v. Suppose that Alice and Bob are using either an MDI-QKD or an MA-QKD setup with a channel transmittance per leg of η, and that they use intensity z with probability p z 1, as they do in the infinite key regime. Charlie will report a successful detection with probability Q z . Now suppose that they use the same scheme as above, except that they now employ a (fictitious) finite-key scheme, in which they employ the vacuum intensity v with probability p v = p z = 1/2. The effect of this is equivalent to using a channel with transmittance per leg of η/2, since the effective transmittance of each user's link has been reduced by one half. Since MDI-QKD scales with η 2 , Q z will be reduced by a factor of 4. However, since MA-QKD scales with η, Q z will only be reduced by a factor of 2. In reality, Alice and Bob will use additional decoy intensities other than the vacuum intensity. But since the decoy states will typically have larger vacuum components than the signal intensity z, they will have a similar effect as adding loss to the system, which MA-QKD tolerates better.
Another important factor in our finite-key comparison is the amount of time needed to collect data for a block size N . In the case of MDI-QKD, we can typically run the system at a high repetition rate on the order of GHz for very long periods of time. The stability of the memory-based system may, however, require us to stop collecting data after a certain period of time. It would be interesting to see how the two systems compare if, instead of the block size, one fixes the total data collection time T col , instead. This corresponds to a block size of N = R s T col , for each system, and gives a considerable advantage to the faster system in collecting more data at an identical time. This would not make much a difference in the case of warm vapours as we can already run the system at sub-GHz rates. But, in the case of cold atomic ensembles or silicon vacancy centres, which represent slower memories, this would be interesting to study. Figure 3 (a)-(c) show the performance of MA-QKD using the cold atom QM reported in Ref. [25], with a repetition rate of 4.2 MHz, at different collection times. This means that, at an identical collection time, the MDI-QKD system can collect almost 250 times more data than the MA-QKD setup. It is interesting to see that, even under these harsher conditions, the MA-QKD system can offer a similar advantage as we saw in Fig. 2 over the no-QM MDI-QKD setup. As shown in Fig. 3(a), for a dephasing channel, in the asymptotic regime (black curves), the MA-QKD system can only offer a small advantage in the range from 300 km to 430 km. However, if the experiment is run for an hour (orange curves), MA-QKD can generate more key after 230 km, and, while MDI-QKD dies off at about 250 km, MA-QKD can generate a key up to 350 km. If the experiment is run for just a minute (blue curves), MA-QKD can offer an advantage after a distance of just 170 km. In Fig. 3(d), we show a similar graph for the silicon vacancy centres used in the recent MA-QKD experiment reported in [11]. This system has a slightly higher repetition rate, but a lower coherence time. The latter is the main reason why the cut-off distance is shorter in Fig. 3(d) compared with Fig. 3(a).
Note that it may not be possible to use a memory-based system continuously for a long period of time without applying certain calibrations or cooling techniques. This could reduce the time available for data collection, reducing the effective block size for an MA-QKD system. One key technique that may mitigate this problem in the setup considered in this work is the delayed writing procedure, in which we only attempt to interact with the memory if the corresponding side-BSM is successful. This means that the memory is kept in a ready-to-go initial state until we know a photon has survived the path loss, in which case its state is teleported to the memory. Given that at long distances the chance of the latter event is low, this suggests that the external interaction with the memory is not that frequent, and the time between any two such events can be used to bring the memory back to a solid initial state. In the case of memories reported in [24] and [25], we also have the additional advantage that after reading the memory, it automatically goes back to its initial state. Nevertheless, it is easy in our analysis to consider the effect of possible interruptions in data collection by modifying the block size. For instance, for CA ensembles, we have verified that the advantage shown in Fig. 3(a) will remain even if we can only collect data a quarter of the experiment time.
Finally, we have looked at how different system parameters can affect the conclusion we draw above. In Fig. 2(b) and Fig. 3(b), we have used a depolarising channel to model the decoherence effect. In comparison to Fig. 2(a) and Fig. 3(a), where a dephasing model is used, we see that the warm vapour system, which has lower T 2 values, is more adversely affected than the cold atom system. We observe the same behaviour when we change the frequency converter efficiency from one to to 0.5 as can be seen in Fig. 2(c) and Fig. 3(c). This can simply be a ramification of Secret key rate (bits/s) having noisier data in the case of warm vapours as compared to the cold atom case. This would result in less tight bounds on system parameters at the same block size or collection time, hence sharper drop in key rates. The overall effect would nevertheless suggest that MA-QKD systems can offer competitive performances in the finite-key regime irrespective of the memory or other relevant system parameters. This would be an essential observation in the early demonstrations of memory-based systems and how we benchmark them against their rival counterparts.

V. CONCLUSIONS
By borrowing ideas from quantum repeaters, MA-QKD can improve the scaling of repeaterless QKD systems. However, the common imperfections in memory-based systems such as their coupling efficiency to photonic systems, or their finite coherence times, may make it difficult for them to offer any practical advantage as compared to their no-memory counterparts. In particular, previous analyses suggest that any advantage in the total key rate would often come only after a crossover distance that is still challenging to implement experimentally. In this work, we showed that once we considered the finite-key effects in the key rate analysis, the crossover distance in such systems was reduced to a point that an experimental implementation could be foreseen in the near future. This effect was attributed to two features of decoy-state MA-QKD systems. First is their ability to purify some of the errors that result from multi-photon terms in weak laser pulses, and the other relates to a more efficient sifting of signal and decoy states. It is essential, however, for MA-QKD systems to keep all sources of noise near the memory units low, as they otherwise would translate into erroneous measurements in the middle site. As such are the multiple excitation terms in the memories, or sources that drive them, or additional background noise that may enter the setup. All these issues are manageable with careful design and they are all precursors to implementing longer quantum communications links relying on quantum memory units. In particular, we believe that the results of this work would be applicable to possible architectures for future quantum networks, in which end users are only equipped with simple equipment, such as decoy-state BB84 encoders, but the core of the network has advanced memory-based repeater chains [31].
We should note that there are no-memory QKD systems, such as twin-field (TF) QKD [10], that offer a similar rate-vs-distance scaling as MA-QKD, and they have already been implemented at record distances [28]. An MA-QKD system may not be currently able to offer higher key rates or reach longer distances than those achieved by TF-QKD systems. But, it is important to recognise that the expertise and skills in both MA-QKD and TF-QKD would be required to implement scalable quantum repeater systems that go beyond the current rate-versus-distance records. In this respect, this work makes us one step closer to the final goal of implementing long-distance quantum communications systems.

Appendix A: Simulation model
In this appendix, we describe our simulation model, starting with our analysis of the indirect-loading of QMs with attenuated laser sources. Here, we assume that Charlie is honest, there is no eavesdropper, and we are only interested in finding the relevant parameters in a realistic setting.  Figure 4 shows a schematic view of our memory loading model for a single user, say Alice, in the polarisation encoding case. We model the loss in the channel, the measurement devices, and possible frequency converters as two beam splitters of transmissivity η a = η ch η d and η b = η c η d located at each input port of the 50:50 beam splitter of the BSM module. Here, η ch models the transmissivity of the Alice-Charlie channel, η c models the frequency conversion and/or coupling efficiency, and η d represents the efficiency of the single-photon detectors. Note that by assuming the same efficiency η d for all detectors, we are able to analyse its effects at the input ports of the BSM, simplifying our model. We do not need to consider the effect of the QM's writing efficiency, η w , at the loading stage. Instead, we modify the reading efficiency η r by an η w factor, allowing us to analyse its effect at the reading stage. In Fig. 4, the EPP source is assumed to generate an ideal entangled state in the form 1 √ 2 (|HH bm + |V V bm ), whereb andm, respectively, represent the two output modes of the EPP source heading toward the BSM module and the QM.
We also consider setup misalignment between the user sources and the central node, which, in polarisation encoding, we model as a random rotation of the horizontal and vertical modes. For simplicity, we assume that the rotation angle θ is independent and identically distributed between different rounds of the protocol, and for the two legs of the system. Also, we assume that polarisation maintenance schemes are in place, so that the reference frames at the user sources and the central node are the same on average. It is reasonable then to assume, as we do in this work, that the probability density function (PDF) f (θ) is an even function of θ. One can use a similar formulation when other types of encoding, e.g. time-bin, are used.
In the following, in Sec. A 1, we first find the post-measurement state of the loaded memory, the loading probability, and the its corresponding error rate under above considerations. The particular issue of misalignment turns out to complicate the analysis when we use weak laser pulses (WCPs) as compared to single-photon sources. Previous analyses of MA-QKD either assume no channel misalignment [8,12] or model it as an error probability e mis [7,20], which is effectively given by π −π f (θ) sin 2 (θ)dθ. In our case, while the analysis is more cumbersome, the end result, in terms of the form of the post-measurement state of the QM, is similar to the single-photon case. This allows us to replicate most of the analysis in [7] in Sec. A 2, and extend it to the case of depolarisation channels. In the last section of this Appendix, we have summarised the key rate relationships used for the no-QM MDI-QKD as a reference point.

Memory loading
Here, we calculate the post-measurement state of the QM, its loading probability and error rate, in the two cases of Z and X bases. a. Analysis for Z basis Without loss of generality, let us consider the case that the user generates a horizontally polarised WCP of intensity µ. Ideally, the state generated is of the form |α â h |0 âv , where α = √ µ andâ h andâ v represent, respectively, the horizontal and vertical modes of the transmitted light in Fig. 4. In a particular round with a misalignment angle of θ, the misaligned state, at the input of the butterfly module, is given by where α h = α cos θ and α v = α sin θ. Meanwhile, the joint state of the two output modes of the EPP source, i.e.,b andm, is given by where in the last equality, we have dividedb into, respectively, horizontal and vertical modesb h andb v . After reordering modes, and averaging over θ, the joint input state to the butterfly module is given bŷ and |ψ ψ|â is our shorthand notation for |ψ ââ ψ|.
We are interested in the state projected to the QM after a successful loading, i.e., when exactly an H detector and a V detector click in the BSM module. To model this measurement process, we should find the output state of the butterfly module, with an input state as in Eq. (A3), and then find the post-measurement state for the desired measurement outcome. The key to calculate this is to realise that the horizontal and vertical modes will interact separately at the 50:50 beam splitter of the butterfly module, and will cause clicks in the horizontal and vertically polarised detectors, respectively. Thus, we can split the overall transformationB for the butterfly module in Fig. 4, and the overall POVM operatorM in horizontal and vertical operators as follows: Here, the butterfly operatorsB h andB v in Fig. 4 only differ in their input and output modes:B h will take modeŝ a h andb h to modesl h andr h , whileB v will take modesâ v andb v to modesl v andr v . The measurement operators (POVMs) are also identical for both the horizontal and vertical modes, and are given bŷ for x ∈ {h, v}, whereÎ is the identity operator for the corresponding mode.M x represents the event of getting a click in the x-polarised left detector and no click on the x-polarised right detector, or vice-versa.
Using the above notation, the post-measurement state of the QM, after a successful loading, is given bŷ and is the probability of a successful loading for a WCP with intensity µ. Every individual trace term in Eq. (A10) involves either horizontal or vertical modes, and is equivalent to the probability of having exactly one detector click in the corresponding polarisation. Such terms have already been calculated in Table III of [31], which here we reuse, after making necessary adjustments, to obtain and It is interesting that, in the above, the diagonal terms c HV and c V H are odd functions of θ. Under our assumption that f (θ) is an even function, we have that implying that these terms vanish when considering the average post-measurement stateρm in Eq. (A8). Thus,ρm can be expressed as where is the probability of loading the memory with the wrong state. In our case, when we send H-polarised light, a successful BSM in Fig. 4 suggests that theb mode is V-polarised. The state stored in the memory, for an EPP source with |Φ + bm as its initial state, is then also expected to be V-polarised. That is why the coefficient for |H H|, in Eq. (A15), represents the loading error probability, in Z basis, for a WCP with intensity µ.
Due to the symmetry of the setup, if the user sends vertically polarised light, the loading probability p µ load would be the same, but the post-measurement state is given by ρm = (1 − e µ load ) |H H| + e µ load |V V |.
b. Analysis for X basis Without loss of generality, let us assume that Alice generates the plus state given by In a particular round with a misalignment angle θ, the butterfly module will receive the state while the output state of the EPP source can be written as where |D = (|H + |V )/ √ 2 and |A = (|H − |V )/ √ 2. The analysis is similar to the one for the Z basis. After going through similar steps, we find that the probability to successfully load the memory is given by and, under our assumption that f (θ) is even, the post-measurement state of the memory can be written as Finally, note that we calculate the integrals in Eqs. (A11), (A16), (A20) and (A22) numerically as a closed form expression for them could not be found. In our simulations, to compute p µ load and e µ load , we assume that f (θ) follows a uniform distribution over [−Θ, Θ]. To have a fair comparison with no-memory MDI-QKD, we choose Θ = √ 3e mis , where e mis is the misalignment error probability in one leg of a symmetric MDI-QKD setup. This is motivated by the fact that which implies that the chosen f (θ) would cause a misalignment error of approximately e mis in the MDI-QKD setup.

Key rate simulation
In Sec. A 1, we showed that the post-measurement QM state after a successful loading is a mixture of the desired and undesired states for the QM; see Eq. (A15) and Eq. (A21). In effect, it is as if the state of QM has flipped with a probability e µ load . This is similar to how misalignment acts on a single photon state, because of which we can think of the whole loading process as a channel with an effective misalignment of e µ load . This would also make it possible to use the methodology in Ref. [7] to calculate the required parameters of the key rate formula. In particular, the photonic states retrieved from the two QMs turn out to also have a similar form to a misaligned photon, although at a higher error rate to account for the dephasing/depolarisation process. In the following, we explain how to simulate all terms in the key-rate formula, in both the asymptotic and finite-key regimes. Given that in MA-QKD, one of the memories will be read immediately after loading, only one of the QMs would undergo the decay process. That implies that the middle BSM in Fig. 1 can be thought as an asymmetric MDI-QKD setup, with possibly different transmissivities η l and η r for, respectively, its left and right legs [7]. We can then use the yield and error rate formulas, summarised below, of asymmetric single-photon MDI-QKD for our rate calculation: where e 0 = 1/2 and e d is the total misalignment probability in the asymmetric MDI-QKD setup, i.e., the probability that exactly one of the photons is misaligned.

a. Asymptotic regime
In this case, the key-rate formula is given by Eq. (3). In this regime, we assume that the signal intensity z, encoded in the Z-basis, is chosen with probability approaching one, and the parameter estimation provides perfect estimates of the single-photon terms Q Z 11 and e ph . We only then need to simulate the values of Q Z , e Z , Q Z 11 and e ph under nominal mode of operation. The procedure we use to calculate these terms is very similar to that of [7]. The main differences are our new model for the memory-loading with WCPs, developed earlier in this Appendix, and the inclusion of the depolarising channel for memory decoherence.
To compute Q Z , we divide it into two parts: (1) the probability of having the two memories loaded and available to read in a given round, denoted by P side , and (2) the probability that the middle BSM is successful, given that the QMs are ready, denoted by P mid . Then, To find P side , we first estimate the probability to load the QM with a Z-encoded WCP, given by p z load in Eq. (A11). Then, we compute the average number of rounds N L that it takes to load both memories, substituting η A and η B by p z load in Eq. (C.3) of [7], to obtain .

(A28)
Then, we have that where N r is the number of rounds it takes to read the memory, which we assume to be one. The second term is given by where η m = η w η r0 η d is the effective reading efficiency of the QM loaded later, and η m is the average effective reading efficiency of the QM loaded earlier, given by [7] where T 1 is the time constant for the decay process of the QM. The single-photon component Q Z 11 is given by where p SP load is the probability to load the QM when a single photon is sent, given by [7] p SP load = Y MDI 11 (η ch η d , η c η d ). (A33) To find e ph , we first calculate the misalignment-error probability for loading the QM with an X-basis single photon, which is given by [7] e X,SP load = e MDI 11;X (η ch η d , η c η d , e mis ).
Then, we obtain where E e SP QM is the total misalignment probability, given by with in the case of dephasing memories, and by in the case of depolarising memories.
To calculate e Z , we use where E {e QM } is the average total misalignment-error probability between the two QMs, which depends on the specific model used for decoherence. In the dephasing model, the Z-basis QM states will not be affected by the decoherence, therefore, the probability that exactly one state is misaligned is as follows where e z load is given by Eq. (A16). For the depolarisation model, we have where β = 1 − 2e z load . To derive Eq. (A42) and Eqs. (A36) to (A39), we have used a similar analysis as in Appendix D of Ref. [7].

b. Finite-key regime
In this case, we need to calculate the sets {M ab } and {E ab }, where M ab is the total number of measurement counts when Alice (Bob) has used intensity a (b), while E ab is the number of such events that also result in an error. Note that intensity z is encoded in the Z basis and intensities {w 1 , w 2 , v} are encoded in the X basis; we are only interested in estimating {M ab } and {E ab } when a, b are encoded in the same basis.
For our numerical simulations, we still need to make some assumptions on the obtained measurement results in a nominal experiment. For this purpose, we use the expected values for relevant parameters using the corresponding probability in the asymptotic regime. That is, we assume M ab = N Q ab and E ab = e ab M ab , where N is the total number of rounds, i.e., the number of transmitted pulses by Alice/Bob, in the protocol, Q ab is the probability of having a successful measurement originating from intensities a, for Alice, and b, for Bob, and e ab is the probability that this measurement results in an error.
To calculate Q ab , we first compute the total gain Q tot , using the same procedure as for Q Z in the asymptotic case, with the difference that Q tot is now a function of the average memory-loading probability given bȳ where p a is the probability of selecting intensity a ∈ {z, w 1 , w 2 , v}; and p a load is the probability of a successful loading when the user selects intensity a, given by either Eq. (A16) or Eq. (A22), depending on whether intensity a is encoded in the Z or X basis. Then, we have that where N r = 1 and η m = η w η r0 η d . Now, Q ab is the fraction of Q tot that originated from intensities a, b. Note that after a successful loading, the state projected to the QM is always a misaligned qubit. The probability that the middle BSM is successful only depends on the loss coefficients η m and η m , and it is independent of the intensities a, b that caused the loading. Thus, Q ab only depends on how likely intensities a, b are to cause a successful loading, that is, where E e QM ab is the total average misalignment error probability between the two QMs, and depends on whether one considers a dephasing or depolarisation model. The former has no effect on Z-basis states, and therefore For the X-basis intensities, we have that where β k = 1 − 2e k load , and Here, we give the formulas that we have used to simulate the no-memory MDI-QKD with WCP sources. In general, if Alice and Bob encode in the Z basis and choose intensities a and b, respectively, the gain and error-rate formulas are given by [32] Q ab = Q c + Q e , (A58) where e d represents the total misalignment error probability given by e d = 2e mis (1 − e mis ), and where I 0 is the modified Bessel function of the first kind and η = η ch η d is the total attenuation between each user and the middle node. If they encode in the X basis, they are given by [32] Q ab = 2y 2 [1 + 2y 2 − 4yI 0 (x) + I 0 (2x)], (A61) where a. Asymptotic regime In the asymptotic regime, the key rate formula is given by Q Z and e Z are given by Eqs. (A58) and (A59), respectively, by substituting a = b = z. In the asymptotic regime, we assume that the users are able to obtain perfect estimates of Q Z 11 and e ph , which are given by e ph = e MDI 11;X (η, η, e d ) = where We need to simulate the sets {M ab } and {E ab }. In our simulations, we assume that all measurement counts equal their expected values, that is, M ab = N p ab Q ab and E ab = e ab M ab , where Q ab and e ab are given by Eq. (A58) and Eq. (A59) for Z-encoded intensities, and by Eq. (A61) and Eq. (A62) for X-encoded intensities, and p ab is the probability that Alice and Bob choose intensities a and b, respectively.
p ab|mn,X M X mn , where S = {(m, n)|m, n ∈ Z, m, n ≥ 0} − {(0, 0), (0, 1), (1, 1)}. Each of these intensity assignments is a Bernoulli random variable, and therefore E[M ab ] is the average value of the sum of some Bernoulli random variables. The values of M ab measured by Alice and Bob correspond to an instance of this sum of Bernoulli random variables. Let χ = n i=1 χ i be the outcome of the sum of n independent Bernoulli random variables χ i ∈ {0, 1}. Given the observation of the outcome χ, its expectation value E[χ] can be bounded by [16] E L [χ] = χ 1 + δ L , except with probability , where δ L and δ U are the solutions of the equations These solutions can be expressed in terms of the Lambert W function, the inverse of f (z) = ze z , as follows δ L = W 0 (−e ln(ε/2−χ) /χ) δ U = W −1 (−e ln(ε/2−χ) /χ), a. Estimation of E11 Let us imagine that, in the virtual scenario, Alice and Bob measure all their pairs of ancillas in M 11 in the X basis, even those that they have assigned to M Z 11 . Let E 11 be the subset of M 11 in which they find a phase-flip error, and let E 11 = |E 11 |. Each event in E 11 is assigned to intensity a, b ∈ {z, w 1 , w 2 , v} with probability p ab|11 defined in Eq. (B6).
Also, let E X nm , with (n, m) = (1, 1), be the subset of M X nm in which Alice and Bob obtain a phase-flip error. Each event in E X nm is assigned to intensity a, b ∈ {w 1 , w 2 , v} with probability p ab|nm,X defined in Eq. (B5). For a, b ∈ {w 1 , w 2 , v}, the expected value of E ab with respect to these assignments is E[E ab ] = p ab|00,X E X 00 + p ab|01,X E X 01 + p ab|11 E 11 + (m,n)∈S p ab|mn,X E X mn .
∀a, b ∈ {w 1 , w 2 , v}. Again, this problem can be solved using linear programming techniques, but we use the analytical estimation method in the Supplementary Note 1 of [17]. Note that to use this analytical method, one needs to define a termÊ X 11 such that where p ab|11,X is given by Eq. (B5), and substitute p ab|11 E 11 by p ab|11,XÊ X 11 in Eq. (B17). Then, one can use the results of [17] to find an upper bound onÊ X 11 , and reuse Eq. (B18) to turn it into an upper bound E U 11 on E 11 .