Long-distance device-independent quantum key distribution

Besides being a beautiful idea, device-independent quantum key distribution (DIQKD) is probably the ultimate solution to defeat quantum hacking. Its security is based on a loophole-free violation of a Bell inequality, which results in a very limited maximum achievable distance. To overcome this limitation, DIQKD must be furnished with heralding devices like, for instance, qubit amplifiers, which can signal the arrival of a photon before the measurement settings are actually selected. In this way, one can decouple channel loss from the selection of the measurement settings and, consequently, it is possible to safely post-select the heralded events and discard the rest, which results in a significant enhancement of the achievable distance. In this work, we investigate photonic-based DIQKD assisted by two main types of qubit amplifiers in the finite data block size scenario, and study the resources—particularly, the detection efficiency of the photodetectors and the quality of the entanglement sources—that would be necessary to achieve long-distance DIQKD within a reasonable time frame of signal transmission.

Besides being a beautiful idea, device-independent quantum key distribution (DIQKD) is probably the ultimate solution to defeat quantum hacking.To guarantee security, it requires, however, that the fair-sampling loophole is closed, which results in a very limited maximum achievable distance.To overcome this limitation, DIQKD must be furnished with fair-sampling devices like, for instance, qubit amplifiers.These devices can herald the arrival of a photon to the receiver and thus decouple channel loss from the selection of the measurement settings.Consequently, one can safely postselect the heralded events and discard the rest, which results in a significant enhancement of the achievable distance.In this work, we investigate photonic-based DIQKD assisted by two main types of qubit amplifiers in the finite data block size scenario, and study the resources-particularly, the detection efficiency of the photodetectors and the quality of the entanglement sources-that would be necessary to achieve long-distance DIQKD within a reasonable time frame of signal transmission.

I. INTRODUCTION
The use of quantum mechanics for cryptographic means was first proposed in the early 70's by Stephen Wiesner, aiming to create unfalsifiable banknotes [1].Inspired by this seminal work, Charles Bennett and Gilles Brassard introduced a protocol to securely distribute cryptographic keys [2].Nowadays, intense theoretical and experimental research [3][4][5] has turned this latter task-called quantum key distribution (QKD)-into a feasible commercial solution [6].
Despite such tremendous progress, a major flaw of QKD today is the existing big gap between the theory and the practice.This is so because security proofs of QKD typically rely on simple mathematical models to describe the behaviour of the different physical devices.As a result, any departure from these models might render real-life QKD implementations vulnerable to quantum hacking attacks [7][8][9][10][11][12][13].
To overcome this problem, the ultimate solution probably is device-independent QKD (DIQKD) [14][15][16][17][18][19].Given that the users' devices are honest [20,21], DIQKD can guarantee security without characterizing the internal functioning of the apparatuses, thereby ruling out all hacking attacks against the physical implementation.It is based on a feature of some entangled states known as nonlocality [22], which guarantees that two distant parties (say, Alice and Bob) sharing an ideal nonlocal quantum state observe perfectly correlated outcomes when performing adequate quantum measurements on their shares.Moreover, these correlations are monogamous, i.e., the measurement outcomes are statistically independent of any pre-existing information held by a third party.This property can be verified with a two-party Bell test [22][23][24][25][26][27] known as the Clauser-Horne-Shimony-Holt (CHSH) test, which basically consists of repeatedly playing a two-party nonlocal game [19,28].The winning * Electronic address: vzapatero@com.uvigo.esrate of the game indicates the amount of monogamous correlations shared between Alice and Bob.
The security of DIQKD has been rigorously established in different works, first against collective attacks [15] in the asymptotic regime, then against coherent attacks [17] also in the asymptotic regime, and only recently in the practical scenario of finite data block sizes [28] (see also [29]).The security proof in [28] relies on the socalled entropy accumulation theorem [30,31], which effectively allows to prove the security of the full protocol from the security of a single round of the protocol by using a worst-case scenario.
Security proofs require, however, that two fundamental loopholes are closed: the locality loophole [22] and the fair-sampling loophole [22,32,33].The former is closed by enforcing a proper isolation of Alice's and Bob's devices.Closing the fair-sampling loophole is more tricky, specially if Alice and Bob wish to cover long distances.Indeed, if an adversary were able to correlate channel loss to Alice's or Bob's measurement settings, such an adversary could easily fake nonlocal correlations, and thus compromise the security of the distilled key.A simple solution is to assign a pre-established outcome value to each lost signal while running the CHSH test.The main drawback of this technique is however the limited achievable distance, because such mapping translates loss into errors.Indeed, with such an approach, even if the entanglement source could generate perfect Bell pairs and Alice and Bob could measure them with unit efficiency detectors, channel loss would limit the maximum DIQKD transmission distance to about only 3.5 km for a typical optical fiber.
To enhance the distance, Alice and Bob need to use fair-sampling devices.These are devices that herald the arrival of a signal to the receiver, allowing a fair postselection of the heralded events.Then, if Alice and Bob choose their measurement settings a posteriori, i.e., once their fair-sampling devices have declared the reception of a signal, they actually decouple channel loss from their measurement settings selection, thus paving the way for DIQKD over long distances.
A fair-sampling device particularly suited for DIQKD is a qubit amplifier [34][35][36], which basically consists of a teleportation gate.That is, a successful heralding corresponds to the teleportation of the state of the arriving signal to a signal at the output port of the qubit amplifier.DIQKD supported by qubit amplifiers has been analysed in [34][35][36][37][38] in the asymptotic regime, i.e., by considering an infinite number of signals.In this work, we focus on the practical finite data block size scenario.More precisely, we study finite-key DIQKD with the two different types of qubit amplifier architectures introduced in [35] and [36].We pay particular attention to the effect that typical device imperfections (specially, the finite detection efficiency of the photodetectors and the multi-photon pulses emitted by practical entanglement light sources) have on the performance of the system.In doing so, we determine the resources needed to achieve long-distance implementations of DIQKD within a reasonable time frame of signal transmission.
The structure of the paper goes as follows.Sec.II introduces the mathematical models that we use to characterize the behaviour of the difference physical devices.Sec.III contains the description of the considered DIQKD protocol, and Sec.IV introduces its secret key rate formula for the finite-key regime.Then, in Sec.V we present the main contributions of this paper.Here, we evaluate the performance of the DIQKD scheme as a function of the data block size and various device imperfections for two different qubit amplifier architectures.Finally, Sec.VI summarizes the main conclusions.The paper includes a few appendices with complementary results and calculations.

II. TOOLBOX
We begin by briefly introducing the mathematical models that we use in our analysis.They describe the main optical devices employed in a photonic implementation of a DIQKD setup, together with the behaviour of a typical lossy quantum channel.

A. Photonic sources
We will consider two types of light sources.The first one emits a coherent superposition of bipartite entangled states with the following form where p n , with ∞ n=0 p n = 1, stands for the probability of generating a 2n-photon entangled state of the form In Eq. ( 2), |0 ab is the vacuum state and a † h and a † v (b † h and b † v ) denote, respectively, the creation operators of horizontally and vertically polarized photons at the spatial mode a (b).
The case p 1 = 1 (and, thus, p n = 0 ∀n = 1) in Eq. ( 1) corresponds to an ideal entanglement source generating singlet states, while the distribution corresponds to a type-II parametric down-conversion (PDC) source [39,40].The parameter λ in Eq. ( 3) is one half of the expected number of photon pairs generated by the source each given time, i.e., λ = 1 2 ∞ n=0 p n n.The second type of light source that we will consider emits states of the form where the 2n-photon state |n, n ab = (a † b † ) n /n!|0 ab , a † (b † ) being the creation operator in the idler (signal) mode.As an example, a triggered PDC source can generate states like Eq. ( 4) with p n = µ n (1 + µ) −n−1 , µ being the mean number of photon pairs per pulse [41,42].This latter source can be used, for instance, to simulate practical single-photon sources.For example, upon the successful detection of one photon in the idler mode a of |Ψ ab , the normalized quantum state in the signal mode can be written as for a certain probability distribution, r n , which depends on the characteristics of the photodetector used to measure the idler mode.See Appendix A 2 a for the value of r n in the case of triggered PDC sources.

B. Photodetectors
We shall consider that Alice and Bob have at their disposal photon-number-resolving (PNR) detectors, which are able to count the number of photons contained in each incoming optical pulse.In the relevant regime of low noise, they can be described by a positive operator valued measure (POVM) with the following elements: where the quantity p d stands for the dark count rate of the photodetectors, which is, to a good approximation, independent of the incoming signals.On the other hand, the operators Πk that appear in Eq. ( 6), with k ∈ N, are given by with η d denoting the detection efficiency of the detectors, and where |j stands for a Fock state with j photons.
We remark that the mathematical model given by Eq. ( 6) assumes, for simplicity, that dark counts can only increment by one unit the number of photons observed in a given pulse.That is, if an optical pulse contains, say, k photons, we assume that the measurement outcome is at most k + 1 photons due to the dark counts, but not greater than this.This is a fair approximation given that p d is sufficiently low, which indeed is typically the case in practice.

C. Heralded qubit amplifiers
As already discussed above, to achieve long-distance DIQKD, we will consider that Alice and Bob use heralded qubit amplifiers [34][35][36] to notify them the arrival of a photon before they select their measurement settings.That is, only after the qubit amplifier confirms that a photon has arrived, Alice (Bob) selects the measurement and measures the photon.If no successful heralding takes place, the optical pulse is simply discarded.
Typical qubit amplifiers consist in a teleportation gate [43].That is, a successful heralding occurs when the state of the arriving photon is teleported to a photon at the output port of the qubit amplifier.The general mechanism is depicted in Fig. 1(a), while Fig. 1(b) shows the standard linear-optics Bell state measurement (BSM) used by the qubit amplifiers introduced in [34][35][36] to teleport the input photon.More efficient BSMs exist [44,45] and could be used here as well, although they require complicated entangled ancilla states.Depending on the mechanism used to generate the bipartite entangled states, ρ bc , illustrated in Fig. 1(a), one can distinguish two types of qubit amplifiers: polarization qubit amplifiers (PQAs) [34,35] and entanglement swapping relays (ESRs) [36].
PQAs, first introduced in [34] based on the seminal work reported in [46], typically employ practical singlephoton sources to generate ρ bc .For instance, the PQA proposed in [35] uses the linear-optics circuit shown in Fig. 1(c) for this purpose, where ρ h single (ρ v single ) represents the state of a single-photon pulse prepared in horizontal (vertical) polarization.In the ideal case of perfect single-photon sources and unit detection and coupling efficiencies, it is straightforward to show that the circuit given by Fig. 1(c) generates states ρ bc = |φ bc φ| with where the parameter t is the transmittance of the tunable beamsplitter (BS) illustrated in Fig. 1 [34][35][36].A successful heralding is indicated with a flag.It notifies that a photon at the input port, a, of the qubit amplifier was teleported to a photon at its output port, c.For this, the qubit amplifier first generates a bipartite entangled state, ρ bc , and then measures the signals in modes a and b with a Bell state measurement (BSM).In doing so, the state of the photon at mode a is teleported to that at mode c up to a unitary rotation.The main difference between the qubit amplifiers proposed in [34][35][36]  |ψ bb , |ϕ cc , and |χ bc have the form In Eq. ( 9), the states |0 b , |0 c and |0 bc denote the vacuum states of the corresponding modes.The expression for the output states of the PQA in the practical scenario with non-ideal sources and non-unit detector and coupling efficiencies can be found in Appendix A 2.
Let us continue assuming, for simplicity and for the moment, an ideal scenario where the BSM within the qubit amplifier uses perfect PNR detectors (i.e., p d = 0 and η d = 1 in Eqs. ( 6)-( 7)) and lossless BSs and PBSs.Then, from Eq. ( 8), it can be shown that whenever a single-photon pulse prepared in, say, the pure state ) arrives at the input port a of the qubit amplifier, a successful BSM occurs with probability t(1 − t).Also, in the case of a successful result, the state of the output photon at mode c (after applying an appropriate unitary transformation) is equal to That is, the state |ϕ in a of the input photon is successfully teleported to an output photon.On the other hand, if a vacuum pulse, |ϕ in a = |0 a , arrives at the input port a of the qubit amplifier, this state can never lead to a spurious heralding event, at least in the ideal scenario.This is so because, when the BSM uses perfect PNR detectors with no dark counts, the state |0 a |φ bc , with |φ bc given by Eq. ( 8), cannot produce two detection clicks associated to orthogonal polarizations if it is measured with the BSM shown in Fig. 1(b).
Finally, qubit amplifiers based on ESRs [36] directly prepare the state ρ bc with practical entanglement light sources like, for example, PDC sources.Indeed, in contrast to the arguments presented in [34,47], it was shown in [36] that when this type of qubit amplifier is used in DIQKD it can provide higher secret key rates than those achievable with the PQA introduced in [34] when using PDC sources.

D. Optical couplers
In our analysis in Sec.V, we will consider a fiber-based implementation of DIQKD.Thus, we will model the coupling of the photons generated by the light sources into the optical fibers by means of a BS of transmittance η c .One input to the BS is the quantum signal, while the other input is a vacuum state.Similarly, one of the outputs of the BS is the optical fiber, while we assume that the other output is not accessible and represents the loss.For further details about this model we refer the reader to Appendix A.

E. Quantum channel
For simplicity, we will suppose that the quantum channel mainly introduces loss.That is, we shall disregard any noise effect due for example to polarization or phase misalignment.
The channel loss is modeled with a BS of transmittance η ch = 10 −Λ/10 , where the parameter Λ (dB) is related to the transmission distance L (km) by an attenuation coefficient α (dB/km) via the expression Λ = αL.The specific value of α depends on the considered channel.For instance, a typical value for α in the case of singlemode optical fibers in the telecom wavelength is α = 0.2 dB/km.

III. DIQKD PROTOCOL
We consider the DIQKD protocol introduced in [28].It is based on a CHSH test [24], and is equivalent to a certain two-party nonlocal game known as the CHSH game.
Before presenting the steps of the protocol in detail, we introduce some notation first.Alice's measurement setting in the i-th successfully heralded round of the protocol is denoted by X i ∈ {0, 1}, where X i = 0 and X i = 1 tag the measurements described by the two following Pauli operators respectively.On the other hand, Bob's measurement setting in the i-th successfully heralded round of the protocol is denoted by Y i ∈ {0, 1, 2}, where √ 2 and Y i = 2 refers to the measurement σ z , with σ z and σ x again given by Eq. (10).Similarly, Alice's (Bob's) outcome in the i-th successfully heralded round is denoted by Next, we present the different steps of the protocol.A schematic is shown in Fig. 4. For simplicity and for the moment, we shall assume that only Bob holds a qubit amplifier to compensate channel loss, while Alice has the entanglement source, ρ ab , in her lab.The case where both Alice and Bob hold a qubit amplifier and the entanglement source is located in the middle of the channel between them is analyzed in Appendix A 4.

Protocol steps
1. Initialization.Bob sets the counter i of successfully heralded rounds to 0. While i < n SH for a certain prefixed value n SH , steps 2 and 3 below are repeated.

2.
Distribution.Alice prepares a bipartite entangled state, ρ ab , and sends system b to Bob through the e X H e n Y 9 l a 8 H J Z 0 7 h D 5 z P H w 5 M j a I = < / l a t e x i t > < l a t e x i t s h a 1 _ b a s e 6 4 = " p A e e X H e n Y 9 l a 8 H J Z 0 7 h D 5 z P H w 5 M j a I = < / l a t e x i t > < l a t e x i t s h a 1 _ b a s e 6 4 = " p A e e X H e n Y 9 l a 8 H J Z 0 7 h D 5 z P H w 5 M j a I = < / l a t e x i t > Y i < l a t e x i t s h a 1 _ b a s e 6 4 = " / p U u y / D 6 e y L A w Z i o i 1 y m w H Z t l L x f / 8 3 q p j a / D j M k k t V S S x a I 4 5 c g q l H + P h k x T Y v n U E U w 0 c 7 c i M s Y a E + s y q r g Q g u W X V 0 n 7 o h 7 4 9 e D + s t a 4 K e I o w w m c w j k E c A U N u I M m t I C A g G d 4 h T d P e y / e u / e x a C 1 5 x c w x / I H 3 + Q M X S 5 C V < / l a t e x i t > < l a t e x i t s h a 1 _ b a s e 6 4 = " A O 9 E 5 E c m 9 r 7 T 3 w y l N S J m 8 v j Q Bob holds a qubit amplifier to mitigate the effect of channel loss.In every round of the protocol in which a successful heralding takes place at Bob's qubit amplifier, he randomly chooses a bit value T i ∈ {0, 1}.If T i = 0, Alice (Bob) chooses as measurement setting , Alice chooses at random her measurement setting X i ∈ {σ z , σ x }, with σ z and σ x being the Pauli matrices given by Eq. (10).Similarly, in this latter case, Bob chooses at random his measurement setting Their respective outcomes are recorded as A i , B i ∈ {0, 1}, where A i (B i ) indicates which of Alice's (Bob's) two photodetectors registered a single-photon pulse.If, say, Alice obtains an inconclusive result (i.e., no photons or multiple photons are observed), she deterministically selects A i = 1, and similarly for Bob.The reader is referred to the main text for further details.
quantum channel.If no successful heralding takes place at Bob's qubit amplifier, the signal is discarded and step 2 is repeated.Otherwise, Bob updates the counter i to i + 1.Then, he randomly chooses a bit value T i ∈ {0, 1} with probabilities P(T i = 0) = 1 − γ and P(T i = 1) = γ, respectively, and sends it to Alice through an authenticated classical channel.We denote by T = (T 1 , T 2 , ..., T nSH ) the string of all bit values T i .

3.
Measurement.If T i = 0, the i-th successfully heralded round is considered to be a key generation round, and Alice and Bob choose the settings (X i , Y i ) = (0, 2).
If T i = 1, such round is considered to be a test round (i.e., a CHSH game round), and they independently select X i , Y i ∈ {0, 1} uniformly at random.Alice and Bob record their measurement outcomes as A i , B i ∈ {0, 1}, respectively.If, say, Alice (Bob) obtains an inconclusive result (i.e., no photon or multiple photons are observed in the detectors) she (he) deterministically assigns A i = 1 (B i = 1) to keep the fair-sampling loophole closed.
Finally, Alice (Bob) publicly announces the measurement settings In what follows, we will denote by X (Y ) the bit string Otherwise, the protocol aborts.
5. Parameter estimation.Bob sets the parameter C i =⊥ for the key generation rounds (i.e., when T i = 0) and ) for the test rounds (i.e., when T i = 1), with i = 1, 2, ..., n SH , and where Z Bi denotes the i-th bit of the string Z B and the function ω CHSH is defined as with ⊕ denoting bit addition modulo 2 and • denoting bit multiplication.The overall number of test rounds in which C i = 1 (and thus the parties win the CHSH game) is denoted by C SH = {i:Ti=1} C i .This quantity determines a lower bound on the number of secret bits that can be extracted from Z A and Z B using privacy amplification [28].Bob aborts the protocol if the fraction of wins lies below a certain prefixed threshold value, i.e., when C SH /n SH < ω| SH γ − δ est , where ω| SH is the expected winning rate of the CHSH game in the test rounds for the considered channel model [48], γ is again the probability that Bob uses a successfully heralded round as a test round, and δ est is the confidence interval that defines the abortion threshold.That is, δ est is the maximum difference between the expected and the actual winning rates of the CHSH game that Bob accepts without aborting.
6. Privacy amplification.Alice and Bob apply a privacy amplification protocol to their bit strings Z A and Z B to obtain the final keys, K A and K B , of length l.This protocol uses a randomness extractor that succeeds except with error probability PA .
The main protocol arguments are summarized in Table I.
We remark that in the distribution step of the protocol, Alice and Bob need to store their signals until they choose their measurement settings and measure the signals in the third step of the protocol.For simplicity, below we will optimistically assume that, for this purpose, both of them hold noiseless and lossless quantum memories in their labs.Alternatively, they could also decide which rounds are key generation rounds and which ones are test rounds a posteriori by using the typical sifting step in QKD, though this approach results in a slightly less efficient solution.This is so because the data associated to Alice measuring σ x and Bob measuring σ z is not used in the protocol.
Also, we note that in a photonic implementation of the DIQKD scheme, the measurements X i and Y i can be realized by means of a polarization modulator that rotates the polarization state of the incoming signals, together with a PBS that separates vertical and horizontal polarization modes, followed by two photodetectors.For example, the rotation angles of the polarization modulator associated to the measurements σ z , σ x , σ + and σ − are 0, π/4, π/8 and −π/8 radians, respectively.The observation of one single-photon in, say, horizontal (vertical) polarization is recorded by Alice as A i = 0 (A i = 1), and the same applies to Bob.

IV. SECURITY ANALYSIS
We use the security analysis introduced in [28], which is valid against coherent attacks.Prior to the execution of the protocol, Alice and Bob agree on three parameters that tag the security of the final keys, K A and K B .These parameters are the secrecy parameter, sec , the correctness parameter, cor , and the robustness parameter, rob .
In particular, a protocol is said to be sec -secret, when implemented using a device D, if it satisfies where P(abort) is the abortion probability of the protocol, ||ρ|| 1 = ρρ † stands for the trace norm, E is a quantum register held by the eavesdropper that may be initially correlated with D, ρ KAE is the output state of the DIQKD protocol describing Alice's key string K A and the quantum register E conditioned on not aborting, is the uniform mixture of all possible values of a l-bit string K A , and ρ U l ⊗ ρ E is the perfectly secret output state.
The parameter sec is upper bounded by where PA + s is the total failure probability associated to the privacy amplification step, PA being an upper bound on the error probability of the randomness extractor and s being the smoothing parameter of the s -smooth minentropy [28].The term EA is the failure probability associated to the entropy accumulation theorem [30], which only guarantees that a certain lower bound on the ssmooth min-entropy holds with a probability larger than 1 − EA .The correctness parameter, cor , quantifies the probability that the final keys, K A and K B , are not equal.More precisely, a protocol is said to be cor -correct if P[K A = K B ] ≤ cor .According to the protocol definition given in the previous section, we have that cor = IR .
Finally, a protocol is said to be rob -robust for a specific honest implementation (i.e., for a particular implementation where the eavesdropper does not intervene) if it aborts with a probability smaller than rob .The protocol described above can only abort in two steps: the information reconciliation step, and the parameter estimation step.Therefore, we have that rob satisfies where IR rob ( PE rob ) is the probability of aborting at the information reconciliation (parameter estimation) step for the considered honest implementation.Moreover, we have that the quantity PE rob verifies where EA rob is the probability of the fraction of CHSH wins, C SH /n SH , being lower than the threshold ω| SH γ − δ est .That is, Note that for fixed values of EA rob and n SH , the minimum value of δ est , such that Eq. ( 15) holds, satisfies [49] Also, we note that the parameter IR contributes to PE rob in Eq. ( 14) because, conditioned on not aborting the protocol in the error verification step, Bob performs the parameter estimation step by using his original bit string of outcomes, B, and his estimate, Z B , of Alice's string, which is equal to Z A except with probability IR .A list with the main parameters related to the security of the protocol is provided in Table II.
Then, it turns out that, conditioned on not aborting, the DIQKD protocol presented in the previous section delivers cor -correct and sec -secret output keys, K A and K B , whose length, l, is given by Here, the term η opt represents a lower bound on the entropy generation rate of the CHSH game (see Appendix B for further details on η opt and leak IR ).Importantly, the conditional secret key rate, i.e., the number of secret key bits per successful heralding event, reads K| SH = l/n SH , and the secret key rate is defined as where N is the total number of transmitted signals.Below, we will use the term "success rate" to refer to the number of successful heralding events per transmitted signal, i.e., r SH = n SH /N .We remark that, in the limit where n SH → ∞, Eq. ( 18) matches the asymptotic secret key rate against general attacks reported in [17], which we will denote by K ∞ .To see this, note that the quantum communication phase of the protocol described in the previous section only ends when n SH heralded events are observed.This means that the number of transmitted signals, N , is a negative binomial random variable.Let Var (N/n SH ) be the variance of the related random variable N/n SH .Then, we have that lim nSH→∞ Var (N/n SH ) = lim nSH→∞ (1 − P SH )/(n SH P SH 2 ) = 0.This means that lim nSH→∞ N/n SH = 1/P SH , where P SH is the successful heralding probability of the qubit amplifier.By using this result, it is straightforward to show that K ∞ satisfies which is the result provided in [17].In this equation, is the binary entropy function, and Q| SH represents the quantum bit error rate of the key generation rounds.In the asymptotic regime, the conditional secret key rate reduces to K| SH = K ∞ /P SH , while for the success rate we have r SH = P SH .
In the next section, we evaluate the effect that device imperfections-particularly, finite detection and coupling efficiencies and the multi-photon pulses emitted by practical sources-have on the performance of DIQKD in terms of the resulting secret key rate for various honest optical implementations.

V. EVALUATION
Here, we use the device models introduced in Sec.II to evaluate the performance of the DIQKD protocol presented in Sec.III, by using the security analysis given in the previous section.The goal is to determine the resources needed to implement DIQKD over long distances.All the relevant calculations to reproduce the results presented in this section are included in Appendix A.
For simplicity, in the simulations below we assume that the coupling efficiency of the light sources is equal to the detection efficiency of the photodetectors, i.e., we set η c = η d = η c,d .This decision is motivated because DIQKD requires very high values of η c,d , so the effect of this simplification is negligible, and it reduces the number of experimental parameters to consider.Also, unless otherwise stated, we fix the dark count rate of the photodetectors to p d = 10 −7 , which is a reasonable value with current technology [50,51].
Furthermore, for illustration purposes, we consider two examples of security parameter sets ( sec , cor , rob ), which we denote by S 1 and S 2 .These sets are given in Table III.Also, to simplify the numerics, we fix the value of the failure probability of the entropy accumulation theorem to EA = 10 −6 ( EA = 10 −10 ) for the set S 1 (S 2 ).We remark, however, that according to our simulations the loss of generality that results from fixing the value of EA in advance is very small.The secret key rate is then maximized over the remaining parameters, which include the quantities PA , s , IR rob , EA rob , the value of the transmittance t in the case of a PQA (see Fig. 3(c)), as well as the intensities of the different light sources.
In the absence of real experimental data, in our simulations we set the denominator of Eq. ( 18) to the expected number of transmitted signals until n SH successful heralding detection events occur at the qubit amplifier, which is given by This also amounts to setting the success rate of the qubit amplifier to its expected value, i.e., r SH = P SH .
Finally, in all the plots below we assume a threshold value for the secret key rate as low as 10 −10 .That is, whenever the resulting secret key rate is smaller than this threshold value, it is considered to be impractical and we neglect it, as this value is already probably too low to have any practical relevance.

A. Ideal sources
We start by analyzing the ideal scenario where Alice and Bob hold perfect photon sources.Obviously, this case provides the best possible performance, and thus it can be used as a reference about the minimum resources (say, e.g., the minimum value of the detection and coupling efficiency, η c,d , and the minimum block size, n SH ) that are required to achieve a certain secret key rate.
More precisely, we consider here that the entanglement source, ρ ab , at Alice's lab generates perfect polarization Bell pairs, i.e., ρ ab = |φ 1 ab φ 1 | with |φ 1 ab given by Eq. ( 2).Also, in the case of a PQA, we set ρ h single (ρ v single ) to be a perfect single-photon source generating horizontally (vertically) polarized single photons.That is, ), being |0 the vacuum state.Similarly, in the case of an ESR, we set ρ bc = |φ 1 bc φ 1 |.

No channel loss
To begin with, we compare the achievable performance when using PQAs and ESRs in the absence of channel loss, i.e., we set the distance at L = 0 km.This scenario allows us to determine the minimum value of n SH as a function of η c,d .
As we will show below, it turns out that η c,d is quite high even in this ideal scenario.This means that the probability that any of these two amplifiers provides a spurious success at Bob's side due to the dark counts of the PNR detectors within the BSM is negligible compared to that of a genuine success triggered by a single photon from Alice.Therefore, for simplicity, in this subsection we set the dark count rate p d equal to zero.With this approximation, it is straightforward to derive simple analytical expressions for the quantities P SH , ω| SH and Q| SH .In the case of an ESR, we obtain where the parameter ξ = η 2 c,d .Similarly, it can be shown that in the case of a PQA we have where the parameter t corresponds to the transmittance of the BS within the amplifier.See Appendix A for details of the calculations to derive Eqs. ( 21) and (22).From Eq. ( 22), it is evident that there is a trade-off on the coefficient t.The terms ω| PQA SH and Q| PQA SH favor t ≈ 1, and thus the conditional secret key rate K| SH , which depends on these parameters but not on P PQA SH , also favors t ≈ 1.Indeed, in the limit t → 1 we have that ω| PQA SH = ω| ESR SH and Q| PQA SH = Q| ESR SH .On the other hand, the average success rate of the qubit amplifier, P PQA SH , is maximized when t = 1 − (2ξ) −1 , and it actually vanishes when t = 1.This behaviour can be easily understood by examining the states ρ bc = |φ bc φ| generated within the PQA and which are given by Eq. (8).By setting t close to 1 we have that whenever a successful heralding takes place at the qubit amplifier, with a high probability this event is due to the entangled pair |χ bc (see Eq. ( 9)), and thus K| SH is maximized.On the contrary, the lower the transmittance t is, the more likely is that a successful heralding comes from the spurious term |ψ bb and, consequently, K| SH is minimized.This might happen when only one photon from |ψ bb is detected due to the finite detection efficiency of the detectors, and the remaining necessary detection is caused by a single photon coming from Alice.In our simulations, we numerically optimize the value of t so that the overall secret key rate K is maximized.
Also, we remark that from Eqs. ( 19)-( 21)-( 22) it is easy to show that a positive secret key rate requires a very high value of ξ 92.3% (or, equivalently, η c,d = √ ξ 96.1%) for both types of qubit amplifiers.Similarly, from Eqs. ( 21) and (22), it can be shown that, irrespectively of the value of t, whenever ξ ≥ 50% we have that In Fig. 3(a) we plot the minimum block size, n SH , and the minimum detection efficiency, η c,d , that are needed to obtain a secret key rate above the threshold value of 10 −10 at L = 0 km.We denote this secret key rate by K| L=0 , and the minimum block size is denoted by n * SH | L=0 .The value of n * SH | L=0 is obtained for each value of η c,d via exhaustive numerical search over all the free parameters contained in the finite-key rate formula given by Eq. ( 18).The solid (dashed) bluish (reddish) lines correspond to the ESR (PQA) architecture, and in each case the lower (upper) line uses the set of security requirements S 1 (S 2 ); see Table III.Remarkably, despite the security parameters of S 2 being significantly more demanding than those of S 1 , it turns out that the set S 2 does not require much larger block sizes than S 1 .
Also, Fig. 3(a) indicates that both qubit amplifiers require a similar minimum block size, n * SH | L=0 , to deliver a secret key rate above the threshold value.Indeed, it is easy to show that if the threshold value for the secret key rate were zero (instead of 10 −10 ) then the value of n * SH | L=0 would be equal for both qubit amplifiers.However, since we use a threshold value greater than zero implies that n * SH | L=0 is always slightly lower for the ESR than for the PQA.This is so because, even though the latter can mimic the conditional secret key rate of the former for any efficiency η c,d , the ESR has a higher success probability P ESR SH , thus leading to a higher overall secret key rate.Nevertheless, this effect cannot be fully appreciated with the resolution of Fig. 3(a).
Finally, the dotted black vertical line illustrated in Fig. 3(a) corresponds to the (asymptotic) minimum efficiency, η c,d ≈ 96.1%, required to obtain K ∞ | L=0 ≥ 10 −10 .That is, no secret key rate above such threshold value is possible when η c,d 96.1%, no matter how much we increase the block size.
In what follows, we will refer to the lines in Fig. 3(a) as the critical lines, since every pair (η c,d , n SH ) lying below these lines delivers a negligible secret key rate with the corresponding security requirements.
Fig. 3(b) shows the zero-distance secret key rate, K| L=0 , as a function of the detection and coupling efficiency, η c,d , for different values of the block size, n SH .As already discussed above, the ESR architecture always leads to larger secret key rates for all values of η c,d , while the minimum efficiencies required to have a secret key rate larger than the threshold value are roughly equal for both qubit amplifiers.Again, the small mismatch between the minimum efficiencies required by both amplifiers occurs because the selected threshold is greater than zero.Otherwise, the minimum efficiencies would match.For illustrative purposes, Fig. 3(b) considers four different block sizes: n SH → ∞, n SH = 10 11 , n SH = 10 9 and n SH = 10 7 .As already shown in Fig. 3(a), the smaller the block size is, the larger the value of the minimum efficiency η c,d that is required.For instance, for a block size as large as, say, n SH = 10 11 , and if one considers the weaker set of security requirements S 1 , the minimum efficiency is at least η c,d ≈ 96.4%.Also, for any given value of n SH , the greater the detection efficiency considered (with respect to its minimum value), the closer the resulting secret key rates corresponding to the security settings S 1 and S 2 become.This is so because, in this situation, the effect of finite statistics is less prominent.Note that in the limit given by the asymptotic regime, the secret key rate K ∞ does not depend on the security sets S 1 and S 2 , but these sets are only relevant in the finite-key regime.

Channel loss
In this subsection, we consider the effect of channel loss, which is parametrized by the quantity Λ = αL measured in dB (see Sec. II E).Also, we set here the dark count rate of the detectors to p d = 10 −7 , as the effect of dark counts becomes relevant in this scenario.Each finite-key rate is plotted twice, one line corresponds to the security settings S 1 and the other line to the security settings S 2 .Both finite-key rates assume a common block size n SH close to the critical one (see Fig. 3(a)).More precisely, we take n SH = 10 7 when η c,d = 100% and n SH = 10 11 when η c,d = 96.5%.By increasing the value of η c,d and/or n SH the finite-key rates approach those of the optimal scenario, which corresponds to K ∞ assuming η c,d = 100%.qubit amplifier architectures.More precisely, we use two values for η c,d : the ideal one, i.e., η c,d = 100%, and one close to the threshold value of 96.1% discussed above, say, η c,d = 96.5%.Moreover, for each of these values of the efficiency η c,d , we plot three different secret key rates: the asymptotic one K ∞ , and two finite-key rates, one for the security settings S 1 and another one for the secu-rity settings S 2 .In both finite-key cases, we use a common block size n SH close to the critical value obtained from Fig. 3.(a).Specifically, we set n SH = 10 7 when η c,d = 100%, and n SH = 10 11 when η c,d = 96.5%.In doing so, and for the considered security analysis, we are simultaneously providing upper bounds (given by K ∞ ) and lower bounds (given by the finite-key rates) to the finite-key performance that could be achieved with the chosen detection and coupling efficiencies, and the security requirements.By increasing the value of n SH , the finite-key rates approach the asymptotic scenario.Also, K ∞ with η c,d = 100% provides a clear upper bound for the achievable secret key rate with the security analysis introduced in Sec.IV.As a final remark, we note that if Bob did not use a qubit amplifier, then the maximum possible value of Λ would be very limited.Indeed, it can be shown that in the case of ideal sources, and even if one sets η c,d = 100% and n SH → ∞, the maximum value of Λ is as low as Λ 0.7 dB.See Appendix A 3 for further details.

Time constraints
In the discussion so far, we have not considered the duration of a DIQKD session, which is another crucial experimental parameter.Indeed, this parameter imposes strong restrictions on the loss that DIQKD can tolerate.We study it in this section.
In the protocol described in Sec.III, we have that the post-processing block size, n SH , is fixed a priori.This means, in particular, that the number of transmitted signals, N , which is needed to achieve n SH successful heralding events, and thus the duration of the distribution step of the protocol, which we shall denote by τ , are random variables.Their mean values are given by Eq. ( 20) and τ = ν N , respectively, where ν represents the clock rate of system.From Eq. ( 20) we have that, for given n SH , the value of N increases when the success probability of the qubit amplifier decreases, for instance, due to channel and/or detection loss.Indeed, according to Eqs. ( 21)-( 22) we find that N at L = 0 km, which we will denote by N | L=0 , is, in the case of an ESR, equal to while in the case of a PQA it satisfies  21)- (22), in this figure we disregard dark counts because their effect at L = 0 km is negligible.Also, we set the free experimental and security parameters to those values that optimize the secret key rate given by Fig. 3(b).The figure considers three different data block sizes, i.e., n SH = 10 7 , n SH = 10 9 and n SH = 10 11 .All the plots are cut at the value of η c,d for which the resulting secret key rate is below the threshold value of 10 −10 .We note that, since in the case of the ESR the value of N | L=0 does not depend on any parameter to be optimized, the cases S 1 and S 2 only differ in the minimum η c,d that still provides K ≥ 10 −10 , which can be extracted from Fig. 3.In the case of the PQA, N | L=0 depends on the transmittance t to be optimized, and therefore the cases S 1 and S 2 differ more from each other.This is illustrated in Fig. 5, which shows N | L=0 as a function of η c,d when n SH = {10 7 , 10 9 , 10 11 }.From Fig. 5 we find that the value of N | L=0 associated to the PQA presents a much steeper slope than that of the ESR architecture when η c,d decreases.This is because the optimal transmittance t of the PQA approaches 1 in that regime.
In the scenario where L > 0 km, the success probability of the qubit amplifier decreases exponentially with the channel loss.In particular, we find that the value of N | L≥0 in this case is given by  IV: Average number of signals, N , that Alice needs to send Bob to collect a data block size equal to n SH , when using ideal photon sources.The dark count rate of the photodetectors is set to p d = 10 −7 , and the detection and coupling efficiency is η c,d .For each combination (η c,d , n SH ), the considered value of Λ is approximately equal to the cutoff loss for which the secret key rate starts dropping down to zero in Fig. 4. Also, the values of η c,d and n SH correspond to the cases illustrated in Fig. 4, and both sets of security settings, S 1 and S 2 , are considered.
for the ESR architecture, and for the PQA.In these two equations, for simplicity, the success probability P SH is computed to the first order in p d .Table IV provides the value of N | L≥0 for a couple of detection and coupling efficiencies η c,d and data block sizes n SH .This table shows that the average number of signals that has to be transmitted increases significantly with Λ, both for the ESR and the PQA.Indeed, if one considers, for example, that the clock rate of the system is, say, 10 GHz, we find that when η c,d = 96.5% it would take about 2.1 (37.0) days to establish a secret key of length 7.56×10 7 (8.64×10 7) bits-out of a block size n SH = 10 11 -over a channel loss of 39 dB (37 dB) when using the ESR (PQA) architecture and the security settings given by S 1 .Of course, the result improves when η c,d increases.For instance, if η c,d = 100% then it would take of the order of 120 (250) seconds to establish a secret key of length 1.56 × 10 5 (1.58 × 10 5 )-out of a block size n SH = 10 7 -over 48 dB when using the ESR (PQA) architecture and the security settings given by S 1 .

B. PDC sources
In this subsection we consider now the more practical case where Alice and Bob use PDC sources instead of ideal sources.
That is, here we suppose that the quantum state, ρ ab , emitted by Alice's entanglement source in Fig. 2 is given by Eq. ( 1) with the statistics p n given by Eq. ( 3).The quantum state ρ bc generated by the entanglement source within the qubit amplifier depends on the architecture considered.In the case of a PQA, we will assume that the single-photon states, ρ h single and ρ v single , have the form given by Eq. ( 5) with the statistics r n given by Eq. (A33), i.e., they are generated with a triggered single-photon PDC source in combination with PNR detectors.In the case of a ESR architecture, we will asume that the state ρ bc is directly generated with a PDC source, i.e., it has the form given by Eq. ( 1) with p n given by Eq. (3).
To simplify the numerics, in our simulations below we consider a contribution of up to three photon pairs per source.That is, we set p n = 0 in Eq. ( 1) for all n ≥ 4 and we choose p 3 = 1 − p 0 − p 1 − p 2 .Likewise, we do the same with the statistics r n in Eq. ( 5).This is a reasonable approximation when the optimal intensities of the light sources are sufficiently small, which, indeed, is what we expect and observe in our simulations.A full mode analysis for this scenario is included in Appendix A, which in principle could be use to evaluate the contribution of up to any desired number of photon pairs per source.

No channel loss
Like in the case of ideal sources, we start our analysis by evaluating the critical lines corresponding to the security setting sets S 1 and S 2 when the channel loss and the dark count rate of the detectors is set to zero.
The results are illustrated in Fig. 6(a), which shows the minimum data block size, n * SH | L=0 , and the minimum detection and coupling efficiency, η c,d , that are needed to obtain K| L=0 ≥ 10 −10 .By definition, any combination of η c,d and n SH lying below the critical lines illustrated in the figure leads to a minuscule (if not zero) secret key rate below 10 −10 .The blue (red) solid lines correspond to the ESR (PQA) architecture, and in each case the lower (upper) line uses the security requirements S 1 (S 2 ).Fig. 6(a) shows clearly that the ESR architecture demands much larger data block sizes and detection and coupling efficiencies than the PQA architecture in this case.This can be understood if one compares P SH and K| SH separately for both qubit amplifiers: while the ESR has a considerably larger success probability in the relevant efficiency regime, its conditional secret key rate is lower.This suggests that the PQA performs better at filtering genuine entanglement, and thus it is more robust to efficiency decrease and statistical fluctuations (partly due to the availability of an extra tunable parameter t).Also, as already observed in the case of ideal sources, we note that using the security set S 2 (instead of that given by S 1 ) does not affect much the minimum data block size, despite the significant difference that exists between both sets in terms of security requirements (see Table III).The dotted blue (red) vertical line shown in Fig. 6(a) corresponds to the (asymptotic) minimum efficiency, η c,d ≈ 98.3% (η c,d ≈ 96.7%), that is necessary to obtain a secret key rate above the threshold value with the ESR-based qubit amplifier (PQA) when the block size n SH tends to infinity.As expected, these values are much higher than those required for the case of ideal sources, specially for the ESR.These results are also in accordance with the results reported in [36], as that work also considers a similar setup and device models like here, though the analysis of [36] is restricted to the asymptotic key rate scenario.From Fig. 6(a) we observe that when n SH decreases, the minimum value of η c,d increases even further as expected.For example, if n SH = 10 11 and we focus on, say, the weaker set of security requirements, S 1 , we find that the minimum values of η c,d are about 98.6% and 97% for the ESR and PQA, respectively.Fig. 6(b) illustrates the zero-distance secret key rate, K| L=0 , as a function of η c,d for varios values of the block size n SH .This figure shows that, in the absence of channel loss, an ESR-based qubit amplifier outperforms a PQA in the regime of very high detection and coupling efficiencies, while in principle the PQA can tolerate slightly lower values of η c,d , as we have already seen in Fig. 6(a).In any case, the minimum value of η c,d , specially for the ESR, seems to be already probably too high to have practical relevance.The main reasons for this behaviour are twofold.First, the vacuum and multiple photon pairs emitted by the light sources significantly reduce the probability to have a successful heralding event in the amplifier.And, second, multiple photon pairs are also responsable for spurious heralding events which increase (decrease) Q| SH (ω| SH ) and thus decrease the resulting R. The higher η c,d is, the higher is the number of multiple photon pairs which can be filtered out by Alice and Bob's PNR detectors and, therefore, the better the resulting performance.As already mentioned above, in our simulations we optimize over the intensities of the different light sources and, as expected, the optimal intensities decrease when η c,d decreases in order to reduce the number of multiple photon pairs generated.

Channel loss
Next, we consider the effect of the channel loss and, as in Sec.V A 2, we set p d = 10 −7 .
The results are illustrated in Fig. 7, which shows the secret key rate K as a function of Λ for various values of η c,d and n SH .More precisely, Figs.7(a  tagged with a different color.For each value of the efficiency, we plot the asymptotic secret key rate K ∞ (dotted line), together with two finite-key rates for different values of n SH (solid lines).Each finite-key rate is plotted twice, one line corresponds to the security settings S 1 and the other line to the security settings S 2 .We take n SH ∈ {10 9 , 10 11 } for the ESR-based qubit amplifier and n SH ∈ {10 7 , 10 9 } for the PQA.By increasing the value of η c,d and/or n SH the finite-key rates approach those of the optimal scenario, which corresponds to K ∞ assuming η c,d = 100%.
the PQA.Also, Fig. 7 includes the results for the sets S and S 2 of security requirements, as well as the asymptotic curves corresponding to K ∞ .These latter curves serve as upper bounds to the attainable finite-key rates for each η c,d .Generally speaking, we observe that, in the presence of channel loss, the performance of DIQKD with PDC sources is again significantly worse than that achievable with ideal sources.The reason for this, as already ex-plained above, is due to the presence of vacuum and multiple photon pairs, which require that the intensities of the sources are quite low to palliate their negative effect.Indeed, in the case of an ESR, we find that even when n SH = 10 11 , the detection and coupling efficiency is as high as 98.7%, and the weaker set of security requirements is considered (S 1 ), the resulting secret key rate is already as low as K ≈ 10 −10 for a channel loss of only 9 dB.Similarly, for the same value of η c,d and a block size n SH = 10 9 , we find that the PQA can only tolerate about 14 dB channel loss.In this regard, we remark that setting n SH to a different value for each qubit amplifier does not necessarily lead to an unfair comparison between them, as the average number of signals, N , required to gather a particular block size is different in both cases.This is discussed in more detail in the following subsection.
Finally, from Fig. 7 we observe again that increasing the security requirements from S 1 to S 2 does not affect the system performance significantly.Also, we note that if Bob did not use a qubit amplifier, the maximum possible value of Λ in this scenario would be as low as Λ 0.4 dB, even if one sets η c,d = 100% and n SH → ∞.See Appendix A 3 for further details.

Time constraints
To conclude this part, we now consider the duration of a DIQKD session with PDC sources.As we show below, in this case the time requirements are much more demanding than in the scenario with ideal sources.As discussed above, this happens because the optimal intensity of Alice's source, ρ ab , is quite low in the high loss regime.As a result, the average number, N , of signals that Alice has to send Bob to achieve n SH successful heralding events turns out to be quite high.This is illustrated in Fig. 8, which shows the value of N as a function of η c,d at L = 0 km.As in Fig. 5, dark counts are disregarded here because their effect is negligible.Also, we consider both sets of security requirements (S 1 and S 2 ) and two different block sizes for each qubit amplifier: n SH = 10 11 and n SH = 10 9 .We note that the case N | L=0 ≥ 10 15 leads to DIQKD sessions that would take longer than one day even with 10 GHz PDC sources.Actually, if the conditions N | L=0 < 10 15 (see Fig. 8) and K ≥ 10 −10 (see Fig. 6) are imposed, one finds that the detection efficiency must satisfy η c,d 98%, irrespectively of the qubit amplifier and the data block size.This means that the examples shown in Fig. 6 for the PQA where K ≥ 10 −10 is possible for η c,d < 98%, are probably not too practical, as they require too long DIQKD sessions.Obviously, if one considers the case of nonzero channel loss, the time constraints become sharper.This is illustrated in Table V, which shows the maximum value of the channel loss, Λ, for which N ≤ 10 15 for various pairs (η c,d , n SH ) previously evaluated in Fig. 7.For instance, when η c,d = 98.7%, and assuming the ESR (PQA) ar- which the resulting secret key rate is below the threshold value of 10 −10 .Also, we consider both sets of security requirements (S 1 and S 2 ) and, like in Fig. 5, here we disregard dark counts because their effect at L = 0 km is negligible.(η c,d , n SH ) and on the qubit amplifier.The considered detection and coupling efficiencies, as well as the data block sizes, correspond to the finite-key rates illustrated in Fig. 7 with security settings S 1 and S 2 .As shown by the table, in the case of the PQA with η c,d = 100% and n SH = 10 7 , the secret key rate drops down to zero before N exceeds 10 15 signals.To be precise, the cutoff for S 1 (S 2 ) roughly occurs at Λ = 24 dB (17 dB), and the corresponding N is still 1.7 × 10 13 (8.6 × 10 12 ).
chitecture, the maximum Λ decreases from 9 ( 14) dB as shown in Fig. 7 to roughly 1 (4) dB for n SH = 10 11 (10 9 ).Indeed, in Appendix A 4 we show that, due to similar time constraints, locating the entanglement source ρ ab in the middle of the channel between Alice and Bob, and furnishing both Alice and Bob with a qubit amplifier, does not seem to improve the performance that can be obtained when Alice holds the source and only Bob holds a qubit amplifier, at least in the case of PDC sources.

C. Generic sources
Finally, in this section we further investigate the effect that vacuum pulses and multiple photon pairs, generated by practical entanglement sources, has on the performance of DIQKD.For concreteness, we focus on the ESR architecture and we consider entanglement sources generating signals of the form given by Eqs. ( 1) and ( 2).Also, for simplicity, we set p n = 0 for n ≥ 3 with p 2 = 1−p 0 −p 1 , the underlying assumption being that the effect of multiple photon pairs is properly encompassed by the effect of double photon pairs, which is supported by our numerical simulations.In doing so, we can characterize the photon-number statistics of the entanglement sources by means of only two parameters: the probability p 0 of emitting vacuum, and the ratio q = p 2 /p 1 between the probability of emitting a double photon pair and that of emitting a single photon pair.
Of course, if one considers a practical entanglement source, the photon-number statistics p n cannot be controlled separately, but they typically depend on an intensity parameter.For instance, in the case of PDC sources, we have that p n is fixed for all n once we set the value of the probability p 0 (or, equivalently, the value of λ).In this type of sources, by using Eq. ( 3), we have that The case of ideal sources, on the other hand, corresponds to p 0 = p 2 = 0 and thus q = 0. Since both scenarios have already been evaluated above, and the case q > q PDC delivers worse results than those evaluated in Sec.V B, below we consider combinations of (p 0 , q) that satisfy 0 ≤ q < q PDC for the corresponding p 0 > 0. In doing so, we investigate an intermediate scenario between the photon number statistics of ideal sources and those of PDC sources.
We remark, however, that Appendix A includes a full mode analysis, both for the ESR and PQA architectures, which allows the evaluation of any desired photon number distribution for the different light sources, including the contribution of up to any wanted number of photon pairs per source.That is, such analysis could be used to investigate any generic source of the form given by Eqs. ( 1) and (2).
The results for the simplified scenario discussed above are illustrated in Fig. 9, which shows the secret key rate as a function of the channel loss Λ for n SH = 10 9 and the security requirements given by S 1 .To simplify the comparison between this case and the one based on PDC sources, we use the values of η c,d employed in Fig. 7, i.e., η c,d ∈ {100%, 98.7%}.Moreover, for each value of η c,d , we plot three different cases.The first (second) case, assumes that the entanglement source ρ bc (ρ ab ) is an ideal entanglement source, while ρ ab (ρ bc ) is characterized by the parameters (p 0 , q).The third case considers that both ρ bc and ρ ab are characterized by the parameters (p 0 , q), which, for simplicity, we assume are the same for both sources, though, in general, the optimal intensity for each source will depend of the value of the channel loss.In each figure, we evaluate two possible values for p 0 : p 0 = 0.5 (solid lines) and p 0 = 0.9 (dotted lines).Also, we consider four different values for the parameter q ∈ Q = {0, 10 −2 , 10 −1.5 , 10 −1 }.
In all the plots within Fig. 9, if one compares the solid lines with the dotted lines, we observe that reducing the value of the probability p 0 for a fixed value of q basically leads to a rigid increase of the secret key rate.This is so because vacuum signals rarely lead to false heralding flags in the qubit amplifier: if ρ ab (ρ bc ) emits a vacuum state, it is necessary that either ρ bc (ρ ab ) emits more than one photon pair or that at least one dark count takes place at the detectors within the qubit amplifier in order to have a (spurious) successful heralding event.As a consequence, to a good extent, p 0 affects mainly the pre-factor P SH , but not the conditional secret key rate, K| SH .The greater the value of p 0 , the smaller the value of P SH , and thus the rigid decrease of the secret key rate.
On the other hand, for a fixed value of p 0 , increasing q significantly affects K| SH , so that multiple photon pairs are responsible for the changing slope of the secret key rate as well as for the position of the cutoff point where the secret key rate starts dropping down to zero, as shown in Fig. 9.This is so because multiple photon pairs lead to spurious heralding events that limit the utility of the qubit amplifier, and, as expected, this effect is amplified when the detection and coupling efficiency η c,d decreases.In this regard, we also note that the performance of DIQKD seems to be more robust to the presence of multiple photon pairs in ρ ab than in ρ bc .The reason goes as follows.Multi-photons arising from ρ ab need to undergo a lossy channel, but multi-photons from ρ bc do not.Therefore, the latter are more likely to trigger a spurious success at the qubit amplifier when the input from the channel is a vacuum signal.Actually, from Fig. 9 we observe that the curves with an ideal source ρ bc , and ρ ab characterized with q = 10 −2 or 10 −1.5 are relatively close to the curve corresponding to q = 0.This suggests that the cutoff points of these curves (at the high loss regime) are probably mainly due to the dark counts of the detectors at the qubit amplifier, as in the case q = 0, rather than due to the presence of multiple photon pairs in ρ ab .On the contrary, all the curves with an ideal source ρ ab , and ρ bc characterized with a nonzero q, show an early cutoff point induced by the multiple photon pairs in ρ bc .
Furthermore, we note that the cutoff points match for p 0 = 0.5 and p 0 = 0.9 if they are caused by the pres- The first (second) case, assumes that the entanglement source ρ bc (ρ ab ) is an ideal entanglement source, while ρ ab (ρ bc ) is characterized by the parameters p 0 and q = p 2 /p 1 .The third case considers that both ρ bc and ρ ab are characterized by the parameters p 0 and q = p 2 /p 1 .All figures consider two possible values for p 0 , i.e., p 0 = 0.5 (solid lines) and p 0 = 0.9 (dotted lines), and four different values for the parameter q ∈ Q = {0, 10 −2 , 10 −1.5 , 10 −1 }.Also, for concreteness, in all cases we set n SH = 10 9 and choose the security settings S 1 .
ence of multiple photon pairs, but they do not match if they are caused by the dark counts of the detectors.This is so because, in the former case, the cutoff point is roughly determined by the double-to-single photon pair ratio (i.e., by the parameter q), while in the latter case it is determined by the dark count to single photon pair ratio, which is different for each curve.Either way, Fig. 9 suggests that the noise induced by multiple photon pairs generated by the sources, particularly those generated by the sources within the qubit amplifier, seems to be the major challenge to achieve long-distance DIQKD with the considered setup.
This effect is investigated further in Fig. 10, where we plot an upper bound on the maximum value of the parameter q, which we denote by q max , to achieve K ≥ 0 with N ≤ 10 15 , as a function of the channel loss Λ.For this, we assume that the source ρ ab is an ideal source and we parametrize the source ρ bc with the quantity q.Note that since here we use the condition that the secret key rate is strictly greater than zero, we can set the parameter p 0 corresponding to ρ bc to zero.This is so because setting p 0 > 0 simply translates into a rigid decrease of the secret key rate, thus not affecting the value of q max .That is, we define q max = min p1 {(1 − p 1 )/p 1 |K ≥ 0}.In addition, and in order to investigate the limitations im-posed by the noise due to multiple photon pairs alone, we set p d = 0.In this scenario, Fig. 10 suggests that, irrespectively of the block size n SH , the value of the detector efficiency η c,d and the security settings, the double-tosingle photon pair ratio q severely restricts the maximum distance that is achievable with DIQKD.Moreover, note that in a realistic situation with a non-ideal ρ ab , q max would be lower than the value shown in Fig. 10.The vertical cutoffs in the graphs indicate the points where N ≈ 10 15 , as this value is already probably too large for a QKD session today.Since q max is very small at the cutoff points, the corresponding values of Λ are very close (indistinguishable to our numerical precision) to those of the case q = 0, which are given by for the different pairs (η c,d , n SH ).This expression is directly obtained from Eq. ( 25) assuming p d = 0.As a final remark, note that one might achieve a source whose parameter q < q max for a given distance by simply decreasing the intensity of the source.Indeed, this is the case, for example, of PDC sources, where one can reduce λ and thus q at the price of significantly increasing This is so because n SH = 10 9 and n SH = 10 7 do not deliver a positive secret key rate for η c,d = 96.5%.Also, for each pair (η c,d , n SH ), the graphs corresponding to both sets of security settings, S 1 and S 2 , are included whenever they are significantly different.Otherwise, we only plot that of S 1 for simplicity.The vertical cutoffs in the graphs indicate the points where N ≈ 10 15 .As expected, when η c,d decreases the value of q max decreases as well.
the probability p 0 of emitting vacuum.While this might provide a positive key rate according to Fig. 10 (by assuming still that ρ ab is an ideal source), the resulting secret key rate might be probably too low to be practical because the probability of having a successful heralding event would be very low.The situation gets worse in the presence of dark counts.

VI. CONCLUSIONS
Device independence is a desirable feature for quantum key distribution (QKD) to ultimately defeat quantum hacking.However, it comes at a high price, in terms of achievable performance and required resources.Indeed, long distance device-independent QKD (DIQKD) requires the use of fair-sampling devices, like for instance qubit amplifiers, which can herald the arrival of a photon and thus decouple channel loss from the measurement settings selection.
In this work, we have investigated all-photonic DIQKD assisted by two general types of qubit amplifiersentanglement swapping relays and polarization qubit amplifiers-in the finite-key regime.In doing so, we have quantified some crucial experimental parameters that are essential to achieve DIQKD over practical distances and within a reasonable time frame of signal transmission.This includes, for example, the minimum value of the detection efficiency of the photodetectors and the quality of the entanglement light sources, in terms of their vacuum and multi-photon contributions.In this regard, we have shown that, even if perfect entanglement sources and photon-number-resolving detectors were available, the ability to achieve large enough violations of a loopholefree CHSH test, within a DIQKD session of a reasonable time duration, already imposes very strong restrictions on the minimum detection efficiency ( 96, 5%), which further increases quickly with the length of the transmission link.Similarly, we have shown that multi-photon pulses emitted by practical entanglement sources have a severe effect on the performance of DIQKD assisted by qubit amplifiers, as multiple photon pairs lead to spurious heading successes that strongly decrease the conditional secret key rate.
Altogether, our results suggest that the possibility of implementing DIQKD over long distances is probably quite far-off, as it seems to require a significant improvement of our current experimental capabilities.optical fiber, and the output mode d represents loss.In Eq. (A1), the subscript "h, v" indicates again horizontal and vertical polarization respectively.That is, the BS transformation given by Eq. (A1) applies to both polarizations.
Similarly, polarization modulators are simply described by a rotation that transforms the input modes a † h and a † v as follows where b † h and b † v denote the output modes.The case θ = π/4 corresponds to the Hadamard transformation.

Entanglement swapping relay
Here, we calculate the parameters P SH , Q| SH and ω| SH for an honest implementation of the DIQKD protocol assisted by an ESR at Bob's side.A schematic of the mathematical model that describes the optical setup is given in Fig. (11).This figure includes all the parameters and the relevant notation that shall be used in what follows.
a. Click pattern distribution Since all photodetectors are described with a POVM whose elements are diagonal in the Fock basis (see Eq. ( 7)), for convenience we will consider that Alice's source emits mixed states of the form Similarly, we will consider that the state emitted by the entanglement source within the qubit amplifier is of the form where the apostrophe in p n indicates that the statistics of σ cd are generally different from those of σ ab .For instance, σ ab and σ cd could originate from PDC sources with different intensity parameters.The starting point for our calculations is then the quantum state Prior to the interference in the linear optics BSM, the states σ ab and σ cd evolve separately.In particular, let us focus on the evolution of σ ab first.We have that the states |φ n ab can be written as (A6) Here and in what follows, we shall simply use |0 to denote the vacuum state in all spatial modes.Since all detectors are assumed to have the same detection efficiency, η d , we model them by means of a BS of transmittance η d together with lossless PNR detectors, whose POVM elements are simply given by projectors onto Fock states: Π j = |j j|, j ∈ N. The effect of dark counts is incorporated a posteriori.This model is equivalent to that given by Eq. (6).Moreover, we combine the effect of finite detection efficiency and coupling efficiency (as well as channel loss) in one BS of transmittance ζ c,d = η c η d (ζ c,ch,d = η c η ch η d , where η ch = 10 −Λ/10 is the transmission efficiency of the fiber link connecting Alice's and Bob's labs, which depends on the channel loss Λ).In doing so, we find that the quantum states |φ n ab evolve to where the different modes are illustrated in Fig. (11).In Eq. (A7) we define Similarly, the state σ cd within the ESR undergoes a similar transformation, so that the pure states |φ n cd Putting it all together, the overall quantum state prior to the interference in the ESR is given by That is, Eq. (A13) describes the quantum state immediately prior to the detectors, conditioned on the photon pair numbers n and n .Importantly, as the detection efficiencies of all detectors were already accounted for in the effective BS models, projective measurements onto Fock states must be considered now, as explained above.More precisely, we are interested in the conditional probability, P ( α|n, n ) θA,θB , of observing a detection pattern α given the quantum state |φ n,n θA,θB a2b2c2d2;f1g1p1q1 .Here, we introduced the vector notation α = (α, β, γ, δ, µ, ν, τ, λ), where each element of the vector denotes the number of photons in a certain output mode: α refers to mode a 2,h , β to mode a 2,v , γ to mode d 2,h , δ to mode d 2,v , µ to mode c 2,h , ν to mode c 2,v , τ to mode b 2,h and λ to mode b 2,v .With this notation, and if we disregard for the moment the effect of dark counts, we have that P ( α|n, n ) θA,θB is given by P ( α|n, n ) θA,θB = | φn,n To compute | φn,n θA,θB α;f1g1p1q1 , we make use of the following orthogonality relation: where δ j i stands for the Kronecker's delta symbol, i.e., δ j i = 1 only if i = j, otherwise it is zero.Also, we recall that for finite range sums, A2 a=A1 f (a)δ a x = f (x)Θ x−A1 Θ A2−x , where Θ j is the "discrete" Heaviside function [55].Then, in order to incorporate the effect of the different Θ's, one must modify the affected index ranges accordingly.This yields where some overall constant terms were factored from the sums.
Then, by applying Eq. (A14) on the state given by Eq. (A17), we obtain where we have defined Again, the symbol "⊕" is used to denote the PBSs that precede the photodetectors.Similarly, the latin letters in blue color indicate the different modes, while the greek letters in red color are used to tag the number of photons observed at each of the detectors.The output modes f 1 , g 1 , p 1 and q 1 correspond to the losses, |0 is the vacuum state, t is the tunable transmittance of the BS within the PQA, two Hadamard gates are denoted by H, and a dashed grey rectangle identifies the PQA.
On the other hand, the states |n 1 , n 2 d evolve to Next, the quantum signals coming from both singlephoton sources enter a BS of transmittance t.This BS transforms the quantum states |ψ n1 , ψ n2 d1;p1q1 into where T t = t 1/2 .Afterwards, we have that two Hadamard gates rotate the outgoing signals at each output port of the beamsplitter.These Hadamard gates transform the operator d By using the same change of variables that we applied to Eq. (A10), we have that Eq. (A37) can be rewritten as Then, by putting it all together, we have that the overall quantum state prior to the BSM is given by where the pure states |φ n a1b1;f1g1 ⊗ |ψ n1,n2 c2d3;p1q1 can be written as Then, in an identical way as in the ESR-based setup, the probability P ( α|n, n 1 , n 2 ) θA,θB that a specific click pattern α = (α, β, γ, δ, µ, ν, τ, λ) occurs with the state written in Eq. (A43) is given by P ( α|n, n 1 , n 2 ) θA,θB = | φn,n1,n2   simply summing over all click patterns (α, β, γ, δ) that are mapped to a specific pair of deterministic assignments, (A A , A B ), as we are assuming here that p d = 0. Once this is done, it is straightforward to define the parameters of the honest implementation.
In particular, we have that Q = P(0, 1) 0,0 + P(1, 0) 0,0 .In doing so, one can numerically compute the maximum tolerated channel loss for any given photon-number statistics p n .For instance, in the case of PDC sources, the statistics read p n = (n + 1)λ n (1 + λ) −n−2 , so that Λ max = max{Λ ∈ R + |K ∞ ≥ 0}.In this scenario, however, the definition of K ∞ includes a maximization over the free parameter λ characterizing the intensity of the PDC source, i.e., In this way, we find Λ max ≈ 0.4 dB, which results in a maximum transmission distance L max ≈ 2 km for an attenuation coefficient α = 0.2 dB/km.FIG.13: Schematic of the DIQKD setup without a qubit amplifier.Since we are interested in determining the maximum achievable distance, detection and coupling efficiencies are assumed to be perfect, i.e., η c = η d = 1, and detector noise is set to zero, i.e., p d = 0. Again, η ch tags the transmission efficiency of the channel, η ch = 10 −Λ/10 , the symbol "⊕" represents the PBSs, the greek letters in red color identify the number of photons observed at each of the detectors and |0 denotes the vacuum state.

DIQKD with two qubit amplifiers
Finally, in this Appendix we consider a different setup from that presented in Fig. 2, i.e., we now assume that the entanglement source ρ ab is located in the middle of the channel, equidistant from Alice's and Bob's labs.Also, we suppose that both parties hold an ESR-based qubit amplifier to palliate the effect of the channel loss (the case with two PQAs is briefly discussed afterwards also below).The goal is to investigate whether or not such setup could increase the maximum transmission distance before the secret key rate sharply drops to zero.
Intuitively speaking, the cutoff point where the secret key rate drops down to zero happens at the range of distances for which a significant fraction of the successful heralding events at the qubit amplifier are triggered by the dark counts of the detectors.In this scenario, the conditional quantum state shared by Alice and Bob after a successful heralding takes place is a separable state, thus leading to a vanishing conditional secret key rate.
In the setup with a central source ρ ab and two qubit amplifiers, the input signal to each qubit amplifier has only traveled a half of the overall transmission distance, so the probability of still carrying a photon that hits a detector within the amplifier may still be large compared to that of a dark count, and this could lead to an enhancement of the transmission distance.Of course, one also expects that the overall secret key rate decreases, as the probability to have a simultaneous successful heralding event at both qubit amplifiers is lower than that of a single success in a unique qubit amplifier, as required in the setup given by Fig. 2. Nevertheless, it takes longer distances for the conditional secret key rate to sharply drop down to zero, since it comes from an entangled state with a higher probability than in the setup of Fig. 2. As a result, the cutoff point is shifted to further distances.
For instance, in the case where ρ ab is an ideal entanglement source, the setup with two qubit amplifiers roughly doubles the maximum distance without significantly affecting the secret key rate.This is illustrated by the bluish lines in Fig. 14, where we compare the secret key rate with one and two qubit amplifiers as a function of the channel loss.Here, as in the previous examples, we set the dark count rate to p d = 10 −7 .Also, we assume the security settings given by the set S 1 , and we evaluate the same two examples used in Sec.V. From Fig. 14 we have that, if ideal entanglement sources were available, it would actually be beneficial to use two ESRs for long-distance transmissions.Similar conclusions would be obtained if two PQAs were used instead.
However, this might not be the case if one considers practical light sources with a nonzero probability of emitting multi-photon pulses.For example, in the case of PDC sources, it turns out that the use of two qubit amplifiers does not seem to improve the performance of the system in a practical regime.This is exemplified by the yellowish lines in Fig. 14, which again correspond to the same examples as in Sec.V with the security settings S 1 .Precisely, Fig. 14(a) shows that no advantage is obtained with two qubit amplifiers in a practical key rate regime in this scenario.Arguably, one would expect to see an advantage by considering lower detection and coupling efficiencies or higher dark count rates, as in both situations the cutoff point where the key rate sharply drops to zero is shifted to lower distances.Nevertheless, these two scenarios are notably restricted by time considerations.
To see this, in Fig. 14(b) we plot the average number of transmitted signals N required to achieve the secret key rates of Fig. 14(a), comparing again the cases of one and two ESRs.As expected, using two qubit amplifiers instead of one demands longer DIQKD sessions in order to harvest a specific block size, due to the requirement of having simultaneous successful heralding events.In fact, even for η c,d = 100% and n SH = 10 9 , the necessary value of N is larger than 10 15 for a channel loss as low as Λ ≈ 4 dB, and any lower value of the detection and coupling efficiencies would result in smaller values of Λ.This being the case, even if one considers higher values of the dark count rate p d , no advantage is expected from the setup with two qubit amplifiers within such a short channel loss interval (before the duration of the DIQKD session becomes impractical).Indeed, if one considers two PQAs instead of two ESRs and compares again this setup with the one that uses a single PQA, the time constraint with PDC sources becomes even more strict, as each PQA additionally includes two triggered single-photon sources that must yield a success in their idler mode in order not to dismiss a detection event.That is, a setup with two PQAs requires the trigger of four single-photon sources and two simultaneous successful BSMs afterwards.As a result, this overall decrease of the success probability (which is particularly relevant for PDC sources) translates into larger values of N which seem to render this solution impractical.
In short, the potential advantage of using two qubit amplifiers to enhance further the distance covered with DIQKD strongly depends on the photon-number statistics of the entanglement sources under consideration.In this sense, although Fig. ( 14) is restricted to ideal sources and PDC sources, we include below all the necessary calculations to evaluate the case of general photon-number statistics, maintaining the form of the states given in Eqs. ( 1) and (2).In this regard, we remark that the results are similar to those illustrated in Sec.V C, i.e., by reducing the probability to emit multiple photon pulses with respect to that of PDC sources, one could approach the behaviour of ideal sources shown in Fig. (14).

a. Click pattern distribution
A schematic of the DIQKD setup with a central source and assisted by two ESR-based qubit amplifiers is shown in Fig. 15.Using the same techniques employed in Appendixes A 1 and A 2, it is possible to derive the click pattern distribution that matches the setup of Fig. 15, conditioned on the numbers of photon pairs n 1 , n 2 and n 3 emitted by the entanglement sources σ ab , σ ef and σ cd , respectively.Precisely, let us define the click pattern (in vector notation) as α = (α, β, γ, δ, µ A , ν A , τ A , λ A , µ B , ν B , τ B , λ B ), where µ A , ν A , τ A and λ A (µ B , ν B , τ B and λ B ) are the numbers of photons recorded within Alice's (Bob's) ESR in any given detection event, while α and β (γ and δ) denote again the numbers of photons she (he) observes with the detectors in her (his) lab when performing a measurement with rotation angle θ A (θ B ).In particular, one finds that P ( α|n 1 , n 2 , n 3 ) θA,θB reads

FIG. 1 :
FIG.1:(a) Working principle of an heralded qubit amplifier based on teleportation[34][35][36]. A successful heralding is indicated with a flag.It notifies that a photon at the input port, a, of the qubit amplifier was teleported to a photon at its output port, c.For this, the qubit amplifier first generates a bipartite entangled state, ρ bc , and then measures the signals in modes a and b with a Bell state measurement (BSM).In doing so, the state of the photon at mode a is teleported to that at mode c up to a unitary rotation.The main difference between the qubit amplifiers proposed in[34][35][36] is the mechanism to generate the entangled states ρ bc .See the main text for further details.(b) Linear-optics BSM.The input states in modes a and b interfere at a 50:50 beamsplitter (BS).A polarizing BS (PBS) located at each output port of the BS separates vertically and horizontally polarized photons.Here we shall assume that all detectors are PNR detectors.A successful BSM corresponds to detecting two photons with orthogonal polarizations, i.e., only when exactly two detectors detect one input photon each for any of the following photodetector pairs: (D h , D v ), (D h , Dv ), ( Dh , D v ) or ( Dh , Dv ).(c) Scheme introduced in [35] to generate ρ bc .A light source emits horizontally (vertically) polarized single-photons ρ h single (ρ v single ), which interfere at a PBS and then go through a BS of tunable transmittance t.Two Hadamard gates, denoted by H in the figure, are used to avoid (if one disregards noise effects) that input vacuum signals at mode a can produce a successful heralding flag when the BSM is that given by Fig. 1(b).
FIG.1:(a) Working principle of an heralded qubit amplifier based on teleportation[34][35][36]. A successful heralding is indicated with a flag.It notifies that a photon at the input port, a, of the qubit amplifier was teleported to a photon at its output port, c.For this, the qubit amplifier first generates a bipartite entangled state, ρ bc , and then measures the signals in modes a and b with a Bell state measurement (BSM).In doing so, the state of the photon at mode a is teleported to that at mode c up to a unitary rotation.The main difference between the qubit amplifiers proposed in[34][35][36] is the mechanism to generate the entangled states ρ bc .See the main text for further details.(b) Linear-optics BSM.The input states in modes a and b interfere at a 50:50 beamsplitter (BS).A polarizing BS (PBS) located at each output port of the BS separates vertically and horizontally polarized photons.Here we shall assume that all detectors are PNR detectors.A successful BSM corresponds to detecting two photons with orthogonal polarizations, i.e., only when exactly two detectors detect one input photon each for any of the following photodetector pairs: (D h , D v ), (D h , Dv ), ( Dh , D v ) or ( Dh , Dv ).(c) Scheme introduced in [35] to generate ρ bc .A light source emits horizontally (vertically) polarized single-photons ρ h single (ρ v single ), which interfere at a PBS and then go through a BS of tunable transmittance t.Two Hadamard gates, denoted by H in the figure, are used to avoid (if one disregards noise effects) that input vacuum signals at mode a can produce a successful heralding flag when the BSM is that given by Fig. 1(b).

FIG. 2 :
FIG.2: Schematic of the considered DIQKD protocol.Alice holds an entanglement source, ρ ab , in her lab, and Bob holds a qubit amplifier to mitigate the effect of channel loss.In every round of the protocol in which a successful heralding takes place at Bob's qubit amplifier, he randomly chooses a bit value T i ∈ {0, 1}.If T i = 0, Alice (Bob) chooses as measurement settingX i = σ z (Y i = σ z ).If T i = 1, Alice chooses at random her measurement setting X i ∈ {σ z , σ x }, with σ z and σ x being the Pauli matrices given by Eq.(10).Similarly, in this latter case, Bob chooses at random his measurement settingY i ∈ {σ + , σ − }, where σ ± = (σ z ± σ x )/ √ 2.Their respective outcomes are recorded as A i , B i ∈ {0, 1}, where A i (B i ) indicates which of Alice's (Bob's) two photodetectors registered a single-photon pulse.If, say, Alice obtains an inconclusive result (i.e., no photons or multiple photons are observed), she deterministically selects A i = 1, and similarly for Bob.The reader is referred to the main text for further details.

FIG. 3 :
FIG. 3: Performance evaluation of DIQKD with ideal photon sources at L = 0 km.Bluish (reddish) lines are used for the ESR (PQA) architecture.(a) Minimum value of the detection and coupling efficiency, η c,d , and minimum value of the block size, n SH , required to obtain a zero-distance secret key rate K| L=0 ≥ 10 −10 .Both sets of security requirements, S 1 and S 2 , are compared for each qubit amplifier.Any combination of parameters η c,d and n SH must be above the lower (upper) lines to achieve a secret key rate above the threshold value with the security requirements given by the sets S 1 (S 2 ).The dotted black vertical line indicates the (asymptotic) minimum efficiency, η c,d ≈ 96.1%, which is the smallest detection efficiency that delivers a zero-distance asymptotic secret key rate K ∞ | L=0 ≥ 10 −10 .(b) Zero-distance secret key rate, K| L=0 , as a function of η c,d for various values of the block size n SH .For each qubit amplifier, four different block sizes are considered: n SH → ∞, n SH = 10 11 , n SH = 10 9 and n SH = 10 7 .The finite secret key rates appear in pairs of solid lines, one for the security set S 1 (upper line) and another one for the security set S 2 (lower line).The asymptotic secret key rates corresponding to n SH → ∞ are illustrated with dotted lines.

Fig. 4 FIG. 4 :
FIG. 4: Secret key rate K as a function of the overall channel loss Λ = 10 log 10 (1/η ch ) measured in dB for the case of ideal photon sources.Figure (a) corresponds to the ESR architecture and figure (b) to the PQA architecture.In both figures, we use two different detection and coupling efficiencies, η c,d = 100% and η c,d = 96.5%, each of them tagged with a different color.For each value of the efficiency, we plot the asymptotic secret key rate K ∞ (dotted line), together with two finite-key rates for different values of n SH (solid lines).Each finite-key rate is plotted twice, one line corresponds to the security settings S 1 and the other line to the security settings S 2 .Both finite-key rates assume a common block size n SH close to the critical one (see Fig.3(a)).More precisely, we take n SH = 10 7 when η c,d = 100% and n SH = 10 11 when η c,d = 96.5%.By increasing the value of η c,d and/or n SH the finite-key rates approach those of the optimal scenario, which corresponds to K ∞ assuming η c,d = 100%.
FIG. 4: Secret key rate K as a function of the overall channel loss Λ = 10 log 10 (1/η ch ) measured in dB for the case of ideal photon sources.Figure (a) corresponds to the ESR architecture and figure (b) to the PQA architecture.In both figures, we use two different detection and coupling efficiencies, η c,d = 100% and η c,d = 96.5%, each of them tagged with a different color.For each value of the efficiency, we plot the asymptotic secret key rate K ∞ (dotted line), together with two finite-key rates for different values of n SH (solid lines).Each finite-key rate is plotted twice, one line corresponds to the security settings S 1 and the other line to the security settings S 2 .Both finite-key rates assume a common block size n SH close to the critical one (see Fig.3(a)).More precisely, we take n SH = 10 7 when η c,d = 100% and n SH = 10 11 when η c,d = 96.5%.By increasing the value of η c,d and/or n SH the finite-key rates approach those of the optimal scenario, which corresponds to K ∞ assuming η c,d = 100%.

Figs. 4 .
(a)  and (b) further show, as expected, that in the case of ideal sources the ESR architecture outperforms the PQA architecture also in the presence of channel loss.

FIG. 6 :
FIG. 6: Performance evaluation of DIQKD with PDC sources.Bluish (reddish) lines are used for the ESR (PQA) architecture.(a) Minimum value of the detection and coupling efficiency, η c,d , and minimum value of the data block size, n SH , required to obtain a zero-distance secret key rate K| L=0 ≥ 10 −10 .Both sets of security requirements, S 1 and S 1 , are compared for each qubit amplifier.Any combination of parameters η c,d and n SH must be above the lower (upper) lines to achieve a secret key rate above the threshold value with the security requirements given by the sets S 1 (S 2 ).The dotted blue (red) vertical line indicates the (asymptotic) minimum efficiency, η c,d ≈ 98.3% (η c,d ≈ 96.7%), which is the smallest detection efficiency that delivers a zero-distance asymptotic secret key rate K ∞ | L=0 ≥ 10 −10 when using the ESR (PQA) architecture.(b) Zero-distance secret key rate, K| L=0 , as a function of η c,d for various values of the data block size n SH .For each qubit amplifier, three different block sizes are considered: n SH → ∞, n SH = 10 11 and n SH = 10 9 .The finite secret key rates appear in pairs of solid lines, one for the security set S 1 (upper line) and another one for the security set S 2 (lower line).The asymptotic secret key rates corresponding to n SH → ∞ are illustrated with dotted lines.
) and 7(b) are respectively devoted to the ESR-architecture and to the PQA-architecture.For each case, we assume two values of η c,d : the ideal one η c,d = 100%, and another one close to the threshold value of the ESR, say, η c,d = 98.7%.Regarding the block size n SH , we set it to a value near the critical line in each case.That is, we consider the pairs (η c,d , n SH ) ∈ {(100%, 10 9 ), (98.7%, 10 11 )} for the ESR, and (η c,d , n SH ) ∈ {(100%, 10 7 ), (98.7%, 10 9 )} for

FIG. 7 :
FIG. 7: Secret key rate K as a function of the overall channel loss Λ measured in dB for the case of PDC sources.Figure (a) corresponds to the ESR architecture and figure (b) to the PQA architecture.For each qubit amplifier, we use two different detection and coupling efficiencies, η c,d = 100% and η c,d = 98.7%, each of themtagged with a different color.For each value of the efficiency, we plot the asymptotic secret key rate K ∞ (dotted line), together with two finite-key rates for different values of n SH (solid lines).Each finite-key rate is plotted twice, one line corresponds to the security settings S 1 and the other line to the security settings S 2 .We take n SH ∈ {10 9 , 10 11 } for the ESR-based qubit amplifier and n SH ∈ {10 7 , 10 9 } for the PQA.By increasing the value of η c,d and/or n SH the finite-key rates approach those of the optimal scenario, which corresponds to K ∞ assuming η c,d = 100%.

FIG. 8 :
FIG. 8: Average number of transmitted signals, N | L=0 , that Alice needs to send Bob to collect a data block size equal to n SH when using PDC sources, as a function of the detection and coupling efficiency η c,d at L = 0 km.The free experimental and security parameters are set to the values that optimize the secret key rate given by Fig. 6(b).The figure considers two different data block sizes, i.e., n SH = 10 9 and n SH = 10 11 .All the plots are cut at the value of η c,d forwhich the resulting secret key rate is below the threshold value of 10 −10 .Also, we consider both sets of security requirements (S 1 and S 2 ) and, like in Fig.5, here we disregard dark counts because their effect at L = 0 km is negligible.

FIG. 9 :
FIG. 9: Secret key rate K as a function of the overall channel loss Λ measured in dB for generic photonic sources and assuming the ESR architecture.Figure (a) considers a detection and coupling efficiency η c,d = 100% and figure (b) considers η c,d = 98.7%.Each figure evaluates three different cases.The first (second) case, assumes that the entanglement source ρ bc (ρ ab ) is an ideal entanglement source, while ρ ab (ρ bc ) is characterized by the parameters p 0 and q = p 2 /p 1 .The third case considers that both ρ bc and ρ ab are characterized by the parameters p 0 and q = p 2 /p 1 .All figures consider two possible values for p 0 , i.e., p 0 = 0.5 (solid lines) and p 0 = 0.9 (dotted lines), and four different values for the parameter q ∈ Q = {0, 10 −2 , 10 −1.5 , 10 −1 }.Also, for concreteness, in all cases we set n SH = 10 9 and choose the security settings S 1 .

FIG. 10 :
FIG.10: Upper bound on the maximum double-to-single photon pair ratio q max of the entanglement source ρ bc required to achieve K ≥ 0 with N ≤ 10 15 , as a function of the channel loss Λ.Here, we set p d = 0, so that the multiphotons generated in the qubit amplifier are the only source of noise in the system.The bluish lines use coupling and detection efficiency η c,d = 100% and they include the block sizes n SH = 10 11 , 10 9 and 10 7 , while the yellow lines use η c,d = 96.5% and they only include the case n SH = 10 11 .This is so because n SH = 10 9 and n SH = 10 7 do not deliver a positive secret key rate for η c,d = 96.5%.Also, for each pair (η c,d , n SH ), the graphs corresponding to both sets of security settings, S 1 and S 2 , are included whenever they are significantly different.Otherwise, we only plot that of S 1 for simplicity.The vertical cutoffs in the graphs indicate the points where N ≈ 10 15 .As expected, when η c,d decreases the value of q max decreases as well.

FIG. 11 :
FIG. 11: Schematic of the ESR-based DIQKD setup matching the mathematical models presented in the main text: σ ab and σ cd stand for the entanglement sources, θ A (θ B ) denotes the rotation angle of Alice's (Bob's) measurement settings and ζ c,d and ζ c,ch,d tag the effective efficiency parameters, ζ c,d = η c η d and ζ c,ch,d = η c η ch η d , where η c , η d and η ch denote, respectively, the transmittance of the BSs modeling the coupling loss, the detection inefficiency of the detectors and the channel loss.The symbol "⊕" is used to denote the PBSs that precede the photodetectors.The latin letters in blue color indicate the different modes, while the greek letters in red color are used to tag the number of photons observed at each of the detectors in any given detection event.The output modes f 1 , g 1 , p 1 and q 1 correspond to the losses, |0 is the vacuum state, and a dashed grey rectangle identifies the ESR.

) Next, modes b 1
and c 1 interfere at a 50:50 BS within the ESR.The corresponding transformation is given by b

)
If we define the sum variables s = h + u and o = r + v, and we use the fact that a rectangle {0 ≤ a ≤ A, 0 ≤ b ≤ B} can be equivalently characterized by {0 ≤ s ≤ A + B, max(0, s − A) ≤ b ≤ min(s, B)}, we have that the RHS of Eq. (A10) can be written as the state |φ n a1b1;f1g1 ⊗ |φ n c1d1;p1q1 is transformed into |φ n,n a1b2c2d1;f1g1p1q1 given by |φ n,n a1b2c2d1;f1g1p1q1 = 1 n!n !(n + 1)(n + 1) ) Now, we incorporate Alice's and Bob's measurement settings by transforming the operators of the affected modes, a 1 and d 1 , with rotation angles θ A and θ B , respec-tively.We denote the corresponding output pure state by |φ n,n θA,θB a2b2c2d2;f1g1p1q1 , and it is given by |φ n

)FIG. 12 :
FIG. 12: Schematic of the PQA-based DIQKD setup matching the mathematical models presented in the main text.σ ab stands for the entanglement source held by Alice, while ρ h single and ρ v single denote the single-photon sources inside the PQA.θ A (θ B ) denotes the rotation angle of Alice's (Bob's) measurement settings and ζ c,d and ζ c,ch,d tag the effective efficiency parameters, ζ c,d = η c η d and ζ c,ch,d = η c η ch η d , where η c , η d and η ch denote, respectively, the transmittance of the BSs modeling the coupling loss, the detection inefficiency and the channel loss.Again, the symbol "⊕" is used to denote the PBSs that precede the photodetectors.Similarly, the latin letters in blue color indicate the different modes, while the greek letters in red color are used to tag the number of photons observed at each of the detectors.The output modes f 1 , g 1 , p 1 and q 1 correspond to the losses, |0 is the vacuum state, t is the tunable transmittance of the BS within the PQA, two Hadamard gates are denoted by H, and a dashed grey rectangle identifies the PQA.
A35) where T c,d = ζ c,d 1/2 and R c,d = (1 − ζ c,d ) 1/2 as in Appendix A 1. Here, like in the ESR-based setup, we have modeled the effect of coupling and detection loss by means of a BS with transmittance ζ c,d = η c η d .This means that for the remaining calculations we consider lossless PNR detectors.

FIG. 14 :
FIG.14:Comparison between the performance of the DIQKD scheme with one and two ESR-based qubit amplifiers for ideal sources (bluish lines) and for PDC sources (yellowish lines).In both cases, solid (dotted) lines are used for the case with one (two) qubit amplifiers.For illustration purposes, here we consider the same combinations of parameters η c,d and n SH like in Sec.V. Also, we suppose the less demanding set of security requirements given by S 1 .(a) Secret key rate as a function of the channel loss.(b) Average number of transmitted signals as a function of the channel loss.

FIG. 15 :
FIG. 15: Schematic of the DIQKD protocol with a central source and two ESR-based qubit amplifiers.The central source is denoted by σ ab , while σ ef (σ cd ) stands for the source within the ESR held by Alice (Bob).As usual, θ A (θ B ) denotes the rotation angle of Alice's (Bob's) measurement settings and ζ c,d and ζ c,ch,d tag the effective efficiency parameters, ζ c,d = η c η d and ζ c,ch,d = η c η ch η d , where η c , η d and η ch denote the transmittance of the BSs modeling the coupling loss, the detection loss and the channel loss, respectively.The symbol "⊕" is used again to indicate the PBSs, the greek letters in red color tag the number of photons observed at each of the detectors and |0 stands for the vacuum state.Two dashed grey rectangles identify the two ESRs, ESR A and ESR B .
Alice's (Bob's) measurement settings for the successfully heralded rounds.Similarly, A (B) will denote the string of measurement outcomes A 1 , A 2 , ..., A nSH (B 1 , B 2 , ..., B nSH ). 4. Information reconciliation.Alice and Bob use an error correction protocol to obtain from A and B two Protocol arguments nSH Post-processing block size γ Probability of a test round δest Confidence interval for the CHSH game winning rate IR Error probability of information reconciliation PA Error probability of privacy amplification l Length of the final keys KA and KB

TABLE I :
List containing the main protocol arguments.identical bit strings, Z A and Z B , respectively.For this, Alice sends Bob leak IR bits of syndrome information and Bob obtains an estimate, Z B , of A. Next, they perform an error verification step (using two-universal hash functions) that leaks at most log 2 1/ IR bits of information to Eve, for a certain prefixed parameter IR .If this last step is successful, it is guaranteed that Alice's and Bob's bit strings Z A = A and Z B satisfy P

TABLE II :
List containing the main finite-key security parameters.

TABLE III :
Sets of security parameters sec , cor and rob considered in the performance evaluation of DIQKD.The set S 1 provides a lower level of security than the set S 2 .

TABLE V :
Maximum value of the channel loss, Λ, before either N ≥ 10 15 or the secret key rate K starts dropping down to zero, depending on the pair ) for the explicit expression of |φ n ab ).Both states deliver exactly the same output statistics when measured in the Fock basis, and thus we can use the state σ ab for the calculations below.