Optimal quantum key distribution networks: capacitance versus security

The rate and security of quantum communications between users placed at arbitrary points of a quantum communication network depend on the structure of the network, on its extension and on the nature of the communication channels. In this work we propose a strategy for the optimization of trusted-relays based networks that intertwines classical network approaches and quantum information theory. Specifically, by suitably defining a quantum communication efficiency functional, we identify the optimal quantum communication connections through the network by balancing security and the quantum communication rate. The optimized network is then constructed as the network of the maximal quantum communication efficiency connections and its performance is evaluated by studying the scaling of average properties as functions of the number of nodes and of the network spatial extension.


I. INTRODUCTION
Quantum communication networks [1] enable the realization of tasks beyond the reach of classical communication systems.Examples are unconditionally secure quantum key distribution [2,3] (QKD), quantum teleportation [4], clock-synchronization [5], distributed quantum computing [6], to mention just a few.Characterizing and optimizing quantum communication networks have a crucial relevance for the development of quantum cryptography applications [7] and hold the potential to advance our understanding of fundamental quantum phenomena [8], such as entanglement percolation [9] or the emergence of non-local quantum correlations [10][11][12].
The performance of quantum networks is determined by the nature of the quantum communication channels and protocols [13,14] and by the overall network topology.The optimization of quantum communication networks involves therefore the closing of security loopholes and the mitigation of the effect of losses through the development of quantum communication protocols, such as for example the measurement device independent QKD [15][16][17] and the twin-field QKD [18] protocols.But it is also pursued by optimizing the allocation of quantum resources for quantum sensing [19] and for distributed quantum computing [20] or by engineering optimal routing strategies [21][22][23][24][25], taking into account the peculiar features of the network elements and the network architecture.
In the ideal case the ultimate properties of network elements, such as the quantum communication links, are dictated by the laws of quantum mechanics, enforcing their security but also imposing intrinsic bounds [26, 27]    * valentina.brosco@cnr.iton the rate of quantum information transmission.Specifically, the fundamental limit of repeaterless quantum communication found by Pirandola, Laurenza, Ottaviani and Banchi [28], known as PLOB bound, prevents to achieve simultaneously high rates and long distances in transferring quantum states and distributing entanglement or secret quantum keys through a quantum link.
The global features of quantum communication networks are strongly dependent on the spatial distribution of the users.Recent theoretical works developed a random network approach to large-scale quantum communication networks based on optical fibers [29] or satellite links [30] and analyzed their connectivity, nodes distance and the presence of small world features [29,30].
In this work we employ the tools of classical network science to devise a strategy of optimization of quantum communication networks.PLOB bound can be indeed circumvented by means of intermediate repeaters [13], either of quantum [31] or classical nature (trusted nodes [32,33]), that help the communication between distant parties.With few notable exceptions [34], most field tests of metropolitan-scale quantum networks to date are based on point-to-point architecture and they involve trusted nodes, see Refs.[35][36][37][38][39]. Trusted nodes in general lower the security of the network [32,40,41].Consequently, in designing a QKD network the following question arises naturally: given a set of QKD users, what is the optimal way to connect them to fulfill a given rate/security target, assuming that all trusted nodes have a certain probability p of being leaky?Here we address this optimization problem by introducing a quantum communication efficiency functional, that balances the quantum security and the quantum communication rate for each pair of users in the network.Note that in a classical network leakage can occur not only at nodes where the signal is amplified, but also along the con-nections between nodes: adding amplifiers therefore improves the capacitance without necessarily reducing the security level.For this reason in classical networks there is no tradeoff between capacitance and security, which is instead inherent in QKD networks.We develop an algorithm that maximizes the quantum communication efficiency and constructs the optimal network, that we refer to as maximal quantum communication efficiency network.We then investigate, for a random distribution of users in the plane, the average properties of these optimal networks.Their performance is evaluated by studying the scaling of average properties as a function of the number of nodes and of the network extension.While the quantum communication rate is linked to geometrical properties, such as the average distance between users, the security depends on the topology.The optimization algorithm therefore goes beyond standard dynamic programming methods, such as the Dijkstra algorithm [42], that were previously employed in the context of quantum repeater network optimization [21].

A. Communication efficiency of quantum networks
In its simplest realization a QKD network consists of a set of N users (nodes) that can send and receive quantum bits along a set of physical links.Here we assume that users are points located in a square of side L, as shown in Fig. 1.As physical connections we consider lossy bosonic links.In this case, following Ref.[28], the QKD rate of a link, e, connecting two users located at the points x a and x b can be quantified by its quantum capacitance q(e) fulfilling the PLOB relation where d ab = |x a − x b | is the Euclidean distance between the users and λ 0 is a characteristic decay length.For optical fibers the attenuation in the C telecom band is of the order of 0.2 db/Km yielding λ 0 ∼ 22 Km.Note that, since the link capacitance provides an estimate of the number of qubits sent per use of the channel, Eq. ( 1) sets to 15 Km the distance at which a single qubit per use can be sent using a standard optical fiber connection.
The quantum capacitance of a channel can be increased by means of repeaters.In particular, connecting the users a and b through a path featuring m trusted nodes, the capacitance of the channel [13] is given by As an example let us consider users a and b shown in Fig. 1(a) and let us assume that all other users can act as trusted nodes.We show two possible ways to connect a and b: a direct link or a path passing through three trusted nodes.In the first case the quantum capacitance is given by q(e ab ) while in the second case the capacitance is q(e cd ) > q(e ab ).Such an increased capacitance is however associated to a potential vulnerability to attacks, since in most practical situations, an intermediate node can only be partially trusted, as discussed e.g in Ref. [41].All links are instead assumed to be unconditionally secure.To quantify this aspect we assume that every trusted node has a certain probability p of being malicious and we define the security of a path, s({a → b}) as the probability of finding only non-malicious trusted nodes along the path, i.e.
where ℓ {a→b} is the topological length of the path.This definition yields s = 1 for a path having topological length ℓ = 1, i.e., no intermediate trusted nodes.Furthermore, it correctly gives s = 0 when p = 1 and s = 1 for p = 0. Within the model defined by Eqs. ( 2) and (3), capacitance and security in general compete, i.e., longer paths may have larger capacitance but at the price of lower security.To describe this trade-off we define the communication efficiency ǫ α ({a → b}) of a path where α ∈ [0, 1] is a user-tunable control parameter which gives more importance either to capacitance (α = 0) or to security (α = 1).For simplicity the communication efficiency is defined using the logarithm of the security that is proportional to the path length.
Given the positions of users in space and assuming that a direct link can be placed between any two of them, so that the network of all possible links G 0 is a fully connected (FC) graph, there is an exponentially large number of possible paths between two nodes, a and b.For a given α, an optimal path {a → b} * is defined as a path having maximal communication efficiency among all possible paths {a → b} * = arg max{ǫ α ({a → b})}. (5) Clearly, in the limit α → 0, the optimal path maximizes the capacitance, by going through many, physically close, intermediate nodes.In the limit α → 1 the optimal path maximizes security and is thus the direct link between the two nodes.The global communication efficiency of a network G is defined as the average, over all node pairs, of the communication efficiency of the optimal paths defined over the network It is important to remark that in general there can be more than a single optimal path between two nodes.As an example in Fig. 1(a) we show two optimal paths between the nodes a and b passing through the node k and k ′ , respectively.The two paths have the same communication efficiency since they have the same topological length, ℓ = 4, and the same capacitance Q = q(e cd ), being e cd the longest edge in both paths.

B. Network optimization
Given a set of N users, N , distributed in a square of size L, and a tradeoff parameter α, our goal is to find a network connecting the N users having maximal communication efficiency and minimal number of links.To reach this goal we start by determining an optimal path for each pair of users.This is achieved by means of a novel algorithm described in detail in the Methods section.Once an optimal path is identified for each pair, we define the optimal network, G * α ≡ (N , E * α ), as the graph union of the optimal paths, that is the network with node set N and edge set E * α given by This network has the maximum quantum communica-tion efficiency, i.e. no other network G ′ ≡ (N , E ′ ) can have larger communication efficiency, i.e., under the assumption of single-path [13,41] routing.For α = 0 optimal networks maximize the capacitance.In this case, an efficient optimization algorithm was proposed by Pollack [43].As discussed in Ref. [44], beside maximizing network capacitance, Pollack's algorithm minimizes the number of links yielding as optimal network the maximum spanning tree (MST) connecting the N users (Fig. 1(b)).
The method developed in this work builds on Pollack's algorithm to construct the optimal network G * α as prescribed by Eq. (7). Figure 1(c-f) shows instances of G * α for different values of α.As one can see, it interpolates between the fully connected network, realized for α = 1, and a much sparser network for α → 0. We note that for α → 0, G * α does not necessarily reduce to the MST.This is related to the fact that, as we explained above, the optimal paths are non-unique.In principle, for generic α one could complement our algorithm with further optimization techniques to reduce the number of links of G * α while preserving maximum communication efficiency.
This further development is deferred to future work.

C. Maximal quantum communication efficiency networks
For concreteness, in this subsection we assume a completely random distribution of users in the square of size L. As highlighted above, optimal networks maximize the quantum communication efficiency functional defined by Eq. ( 6).Their structure and performance depend sensitively on the user-defined parameter α and on the distance-loss ratio, L/λ 0 , that set the optimization regime.To show how these maximal quantum communication efficiency (MQCE) networks change across the different regimes, in Fig. 2 we plot their average capacitance, and average topological length, as a function of α for different values of L/λ 0 ranging from the case of weak losses (L/λ 0 = 0.1) to the case of strong losses (L/λ 0 = 10).
Let us consider first the case of weak losses, L/λ 0 ≪ 1, where the distance between any pair of users is, by construction, much smaller than the decay length λ 0 ; in this case we distinguish three regimes.
(i) For values of α larger than a threshold value α c we observe L * = 1, corresponding to all optimal paths having ℓ {a→b} * = 1.In this regime G * α coincides with the fully connected network.Moreover, since the structure of G * α does not change with α, the average capacitance is constant, Q * = Q FC (see Methods for its evaluation).The critical value α c is the lowest value of α such that, for every pair of users a, b in the system, it is more efficient to connect them through the direct link rather than using a trusted node c.This happens as long as the gain in communication efficiency due to increased capacitance, is smaller than the loss of communication efficiency associated to the introduction of an intermediate node, equal to α log(1 − p), yielding (see Methods for details) (ii) On the left of this threshold value we observe the existence of a "step", i.e., an interval of α values over which L * is practically constant and equal to 2. In this interval all optimal paths have 1 intermediate node.As α decreases other steps appear, corresponding to MQCE networks featuring all optimal paths having topological length L * = 3 (second step) and L * = 4 (third step).
The steps become sharper in the large N limit where a simple calculation (see Methods) shows that paths having m intermediate nodes become more efficient than those with m − 1 intermediate ones for where Note that α 0→1 (iii) As α tends to 0, MQCE networks increasingly resemble the maximum spanning tree.In this limit the average topological length of optimal paths tends to increase as a power-law with N (see Methods).Let us now consider the opposite case of strong losses, L ≫ λ 0 .In this limit the phenomenology is different and more difficult to interpret because, while most distances are much larger than λ 0 , still some pairs of users are at a distance smaller than the decay length.These pairs are responsible for the observation that L * > 1 as soon as α gets smaller than the threshold value still given by Eq. ( 11) (see Fig. 2(c-d)).At variance with the previous case, for α < α c the average topological length of the optimal paths L * grows rapidly as α is reduced, showing no steps at integer values.Moreover, there exist a value α such that for α < α, L * and Q * vary much less and assume values close to those of the MST network (see Methods).
A partially quantitative understanding of the nature of the different regimes can be achieved by considering how the properties of the optimal path linking a generic pair of users, a and b, change, as a function of their distance d ab and of α, in the limit N → ∞.In Fig. 3(a) we highlight with different colors the regions corresponding to different topological lengths of the optimal path between a and b.Boundaries shown in Fig. 3(a) are calculated analytically (see Methods).For large values of α security dominates and the optimal path is, for any d ab /λ 0 , the direct connection.When α is reduced the optimal path has a different behavior depending on the ratio d ab /λ 0 .For small d ab /λ 0 , when α is reduced it becomes more efficient to go through indirect paths going through m = 1, 2, 3, . .., intermediate trusted nodes and so on, which are equally spaced along the line connecting a and b.For larger d ab /λ 0 , the gain in capacitance provided by a single intermediate trusted node is not sufficient to compensate the loss in security and, as α is reduced, the first transition occurs between the direct link and a path going through m > 1 trusted nodes.This first transition is followed, as in the previous case, by a one by one increase in the number of intermediate nodes as smaller α values are considered.For d ab /λ 0 ≫ 1, m grows linearly with d and the position of the first transition scales as 1/d.
The phenomenology for the whole network shown in Fig. 2 results from the superposition of the behavior just  depicted for all user pairs whose distances are distributed according to Eq. ( 18) (see Methods).Specifically, if L ≪ λ 0 all pairs belong to the small distances regime of Fig. 3(a).As a consequence they all undergo the same transitions for the same values of α, thus generating the steps observed in Fig. 2 (a).For L ≫ λ 0 instead, most pairs are at distances larger than the decay length, but a few are still at distances much smaller than λ 0 .Therefore, depending on the exact value of d ab /λ 0 , each user pair undergoes different transitions for different values of α.All these transitions get "mixed", thus explaining the lack of steps in this case and a smooth growth of the observables between α c and α (see Fig. 2 (d)).

Performance of MQCE networks
By balancing security and quantum capacitance, MQCE networks yield the optimal strategy to connect N users for quantum communications and, at the same time, they represent a customizable benchmarking tool for quantum communication networks.To illustrate the performance of MQCE networks we start by comparing their quantum capacitance to that of FC networks.As one can see in Fig. 3(b), the outcome depends sensitively on the ratio L/λ 0 .For L/λ 0 ≪ 1 a limited increase of the average capacitance with respect to the FC network is observed.For values of L of the order of λ 0 the improved performance of the MQCE network becomes more significant.In this range of L/λ 0 values, the most important improvement concerns the minimum capacitance.While for FC networks some links have a strongly degraded capacitance, several orders of magnitude smaller than the average Q * , in the optimized network min Q is only slightly smaller than the average, thus guaranteeing that communication is possible among any pairs of users.For very large values of L/λ 0 the MQCE network tends to coincide with the FC one, as the weight of capacitance in the quantum communication efficiency functional becomes extremely small.In this regime the average capacitance Q * is essentially the same in the two networks and decays as (L/λ 0 ) −2 .In Fig. 3(b) we also note that in MQCE networks the minimum capacity reaches the threshold of one target bit per use of the channel, Q min = 1, for values of L/λ 0 about one order of magnitude larger than in standard FC networks.For fixed values of λ 0 , this implies that MQCE networks can provide the minimum quantum communication rate standard across much wider regions of space.Specifically, for the parameters in Fig. 3(b), the maximum value of L to have at least 1 target bit transferred between any user of the network goes from ≈ 0.5λ 0 (in the FC network) to ≈ 5λ 0 in the MQCE network.A natural question arises concerning how the the security requirement affects the maximal achievable rate.To clarify this point in Fig. 3(c) we plot the average capacitance of MQCE networks, Q * as a function of the average topological length L * , for different values of the ratio L/λ 0 .It turns out that it is sufficient to allow L * to grow from 1 (FC network) to 3 or 4 to ensure a considerable increase in the average capacitance, even one order of magnitude for large L/λ 0 .

Structure of MQCE networks
It is interesting also to analyze the structural features of the networks that the optimization algorithm generates.In Fig. 4 we report the dependence on α of the link density of the optimized network, ρ = k /(N −1), which is correlated with the cost to build the infrastructure.In all cases the density interpolates between a maximally dense network, the FC, (for α > α c ) and a much sparser network (for α → 0).As mentioned above, our algorithm does not exactly reproduce, in the limit α → 0, the MST (which has density 2/N ).The scaling of ρ vs N , which exhibits a decay N −ω , with an effective exponent to ω ≈ 0.83 implies that the optimized network has an average degree growing sublinearly with N .For large values of α the densities tend to converge to a finite limit, indicating that the networks are dense.For small but finite α values the initial decay with N appears analogous to the α = 0 case, there is some evidence that for any α > 0 the density tends to a constant.
Additional information on the optimized network is provided by Fig. 5, where the average length of optimal paths L * is plotted as a function of the number of users.For small values of L/λ 0 and relatively large values of α < α c it is clear that L * goes to a constant in the large-N limit (see Fig. 5(a)).This mirrors the presence of steps in Fig. 2. For smaller values of α and larger values of L/λ 0 the average optimal path length exhibits an initial power-law growth with N followed by a smooth crossover to a constant value.
The optimal network can be also characterized by measuring a quantity analogous to the betweenness usually considered in network analysis.The betweenness [45] of a node is the number of shortest paths among all pairs of nodes in the network that go through that node.For our purposes it is useful to define a modified betweenness where, instead of topological shortest paths, optimal paths are considered.Such a quantity provides a measure of the relevance of users, i.e., how crucial is their presence (and how damaging their removal).Nodes with high betweenness have, just because of their position in the topology, a high impact on the security of the network.In Fig. 6 we plot the histogram of the number of nodes having a given modified betweenness for various α.For α > α c the optimal network is fully connected and the values of the betweenness are all zero.When α becomes smaller than α c a homogeneous distribution appears.As α is progressively reduced the distribution gets more heterogeneous, becoming extremely broad for α → 0. In such a case some nodes are particularly crucial and the network is overall highly vulnerable to external attacks.

A. Optimization algorithm
The task of constructing MQCE networks cannot be addressed using dynamic programming methods such as Dijkstra's [42], Prim's [46] or Pollack's [43] algorithms.Specifically, because of the inherently nonlocal nature of the problem arising from the interplay of topological and geometric terms in the communication efficiency functional, if the optimal path between a and b goes through node c nothing guarantees that the subpath between a and c, belonging to {a → b} * , yields also the optimal path between a and c.Consequently, we have to resort to alternative approaches to tackle this problem.In Ref. [43] Pollack presents, among others, a matrix-based algorithm for solving the maximum capacity route problem, which is equivalent for us to finding the maximum capacitance between any pair of users.Starting from a matrix whose element jk is the capacitance of the link between node j and k given by Eq. ( 1) and Q (0) jj = ∞, an iterative procedure is defined.The elements of Q (m) at step m are defined by where ℓ = 1, . . ., N .In this way the element Q (m) jk is the maximum capacitance of paths between j and k going through at most m intermediate nodes.Iterating, the process, convergence is reached at most when m + 1 = N − 1.Individual elements of Q (m) provide at convergence the maximum capacitance between all node pairs.We modify Pollack's original algorithm as follows.
Given α, at each iteration m we evaluate the quantity This is the maximal communication efficiency of paths between j and k of length at most m + 1.As m is increased, the first term in Eq. ( 15) grows and tends to a constant, while the second is negative and is linear in m.
Hence, for each pair (j, k), ǫ jk reaches a maximum as a function of m for a value m * jk .Note that m * needs not to be the same for all pairs.The communication efficiency of the optimal path between j and k is thus This procedure gives the communication efficiency of the optimal paths between any two users.In order to construct one of these (in principle many) paths we proceed as follows.The capacitance Q (m * jk ) jk associated to the optimal path between j and k necessarily appears in the initial matrix Q (0) , as element Q (0) ln .All entries of Q are assumed to be different.This indicates that the optimal path between j and k necessarily goes through the link between l and n, which, indeed, determines the capacitance of the optimal path.Starting from the matrix Q (0) we construct the unweighted graph A containing an edge between all node pairs such that the corresponding element in Q (0) is larger than Q (0) ln .In this graph A we find the optimal path as the topological shortest path going from j to k with the constraint that it goes through the link (l, n).Clearly, although the link between l and n is uniquely determined there are often many alternative shortest paths going through it; this gives rise to a large number of degenerate optimal paths.

B. The efficiency of the fully connected network
To calculate the efficiency of a fully connected network, which coincides with its capacitance, we need the probability distribution for the distance between any pair of points in a square of size L.This quantity coincides with the distribution of distances between two points randomly distributed in the square, which is a special case of the distribution for a generic rectangular substrate derived in Ref. [47].Note that the quantity N does not play any role.Considering nodes distributed in a square of side L, the distance distribution is where Given this distribution, the value of the capacitance averaged over all node pairs is then: where λ = λ 0 /L.In the limit L ≪ λ 0 one can safely approximate e −z/ λ ≈ 1 − z/ λ, hence In the limit we can write Since for small z we have f (z) ≈ 2πz, then In this regime, the value of Q FC is determined by the contribution of the few links shorter than λ 0 , which have a large capacitance.

C. Optimization regimes for a single pair
We consider N → ∞.In this limit we can always assume that for any pair of users at distance d ab , there are m (∀m) equally spaced intermediate users along the line joining a and b, so that the distance between nearest neighbouring nodes is d ab /(m + 1).The efficiency of the path going through m intermediate nodes (including the direct link, which is the case m = 0) is therefore: (24) For sufficiently large α it is more efficient to use the direct link, m = 0.As α is reduced it becomes more efficient to use indirect paths, with m > 0.
For d ab < λ 0 , if one plots E(m) vs α for m = 0, 1, 2, 3, . . .one observes that the intersections of the lines for m > 0 with the line for the direct link (m = 0) occur for decreasing α as m is increased.As a consequence, starting from α = 1, at a given α 0→1 c ≡ α c it becomes more efficient to follow the path of length 2 (i.e., with m = 1 intermediate nodes) rather than the direct link (with m = 0).Analogously, for a smaller α 1→2 c the path of length 3 becomes more efficient than the path of length 2 and so on.Hence we observe a series of transitions, where it becomes more efficient to use paths with m intermediate nodes with respect to paths with m − 1 nodes, with increasing m = 1, 2, 3, . . .The location α m−1→m c of the m-th transition is given by the condition which, in the limit d ab → 0, yields Eq. ( 12).These transitions are indicated by the solid lines in Fig. 3(a).For d ab ≫ λ 0 instead, the intersection of E(m) with E(0) (efficiency of the direct link) occurs at a value of α that grows initially with m, up to a value m.After this value the position of the intersection decreases with m.This means that, instead of having a transition from the direct link to a path with one trusted node, for α = α 0→m there is a transition from the direct link to a path going through m > 1 intermediate nodes.This first transition is followed by other transitions of the same kind as before, in which the number of intermediate nodes is increased by 1, α m−1→m c for m > m + 1.The value of m is found by determining α 0→m c using the condition and checking, for a given d ab /λ 0 , which of the α 0→m c is the largest.In the limit of large d ab /λ 0 , m gets large as well; in other words, starting from α = 1 one jumps from the direct link to a path of larger and larger topological length, but this happens for smaller and smaller values of α 0→m c , vanishing as 1/d ab .Fig. 3(a) represents the scenario just described.

D. Optimization regimes for the whole network
The previous discussion (and Fig. 3(a)) consider a single pair, with given distance d ab , and is exact in the limit N → ∞.The phenomenology of the whole system of size L is the superposition of what happens for each pair in the system where distances, spanning the range 0 < d ab < √ 2L are distributed according to Eq. ( 18).For L/λ 0 → 0 all distances d ab are necessarily much smaller than λ 0 .In the expression for E(m) one can expand the exponential to first order and the values α m−1→m c obtained by solving the equation E(m) = E(m − 1) do not depend on d ab .Hence the transitions for all pairs occur exactly for the same values of α, given by Eq. ( 12).Thus the average optimal path length L exhibits, as a function of α, steps which are, in the limit L/λ 0 → 0, perfectly sharp (Fig. 2(a)).
For generic L/λ 0 , distances d ab are distributed over the range between 0 and √ 2L.For the smallest of them the scenario just depicted applies and transitions occur for the values written in Eq. ( 12).But for any finite L ≪ λ 0 there are corrections to the values of Eq. ( 12), shown by the decreasing behavior of the curves in Fig. 3(a)).This explains why, for 0 < L ≪ λ 0 , steps are not perfectly sharp but broadened (even for N → ∞): the transitions from m−1 → m intermediate nodes occur, for the various pairs, at slightly different values of α.As m grows the transitions are closer (see the denser lines in Fig. 3(a)); the broadening becomes stronger so that steps of high order m cannot be clearly identified.
For L/λ 0 not infinitesimally small but still smaller than 1, an estimate of the average position of the steps is obtained by using the condition (25), after setting d ab = d ab ≈ 0.52L [47].The values obtained, which are a decreasing function of L. explain why the positions of the observable steps in Fig. 2(b-c), which for L/λ 0 → 0 are given by Eq. ( 12), decrease as L grows.At the same time the increase of L leads to an increased "mixing" of the transitions.As a consequence, the steps get less sharp and the concept of step progressively loses meaning.
For large L/λ 0 , the connection between the regimes for a single pair and the overall behavior of the system is more involved.Indeed, if L/λ 0 ≫ 1 despite the fact that for the overwhelming majority of pairs d ab /λ 0 ≫ 1 there are always some pairs of users whose distance is d ab ≪ λ 0 .For them, the optimal path involves a number m of intermediate nodes growing one at a time for the values of α given by Eq. ( 12).This explains why, for any L, one observes L > 0 as soon as α < α c = [1 − log(1 − p)] −1 (see Fig. 2(d)).However, for L ≫ λ 0 the overwhelming majority of distances are much larger than λ 0 and the length of the optimal path is described by the right part of Fig. 3(a).For a given α < α c the optimal path for these pairs involves m intermediate nodes, with m assuming a range of values depending on the precise value of d ab /λ 0 .For this reason the average length of optimal paths L does not assume integer values but instead it changes continuously with α, thus explaining the lack of steps in this case.This "mixing" involves all distances up to the largest one in the system, d max = √ 2L, for which the transition to optimal paths longer than 1 occurs for the smallest α value.We can therefore estimate that for α < α 0→m c (d max ) all pairs are connected by topologically long paths and the network is essentially a MST.This leads to the identification of the threshold α observed in Fig. 2(d) as E. Capacitance of the Maximum Spanning Tree The length of the longest link (i.e. the link with lowest capacitance) in an Euclidean MST is given by [48] max Assuming that the majority of the optimal paths pass through the link with minimum capacitance, we can estimate Q MST as the capacitance of such a link.Hence we have which is in good agreement with the results in Fig. 2 for L ≪ λ 0 and is increasingly accurate as N grows also in the other cases.

IV. CONCLUSIONS
The realization of large-scale quantum communication networks is a task of crucial relevance for quantum cryptography and quantum computing applications.Existing quantum network implementations employ intermediate trusted nodes as a practical and efficient means to connect remote users, thereby overcoming the limitations imposed by rate/distance bounds.Relying on trusted nodes, however, carries the inherent risk associated with the probability of encountering malicious nodes.Given these constraints, in this work we addressed the problem of designing optimal quantum communication networks connecting a set of users randomly distributed in a square of size L.For each pair of users, we determined the optimal path connecting them by maximizing the quantum communication efficiency of the path and we constructed optimal network, called maximal quantum communication efficiency network as the graph union of the optimal paths.MQCE networks therefore provide the optimal balance between security and quantum communication rate and they interpolate between Maximum Spanning Trees and Fully Connected networks, representing, respectively, the topologies having maximum quantum capacitance and maximum security.We carefully analyzed the performance of the MQCE networks showing that the optimization can largely increase the average capacitance while keeping high levels of security.We also analyzed structural properties of MQCE networks by means of numerical and analytical methods, showing how the tradeoff between capacitance and security affects their topological properties.Our work proposes a systematic and scalable approach for quantum communication network optimization that relies on the construction of a network model and the corresponding quantum communication efficiency functional.So far we considered simple networks featuring only trusted nodes and lossy bosonic links but our work lays the basis for the study of general quantum communication networks.
We expect the performance of MQCE networks to be significantly affected by the spatial distribution of points; for simplicity we assumed a uniform distribution but it would be interesting to consider other possibilities.A further crucial assumption underpinning our work is that of single-path routing; more powerful routing strategies, where systems are transmitted in parallel through different quantum communication channels have been proposed to improve the capacitance [13,49] or the security [41].In these situations, an extension of our algorithm may provide a way to combine the two approaches to fullfill simultaneously well-defined capacitance and security requirements.The degeneracy of the optimal path could then acquire further practical relevance.Eventually, our method could be extended to different quantum key distribution schemes such as entanglement-based quantum key distribution [50-52].
In conclusion, we stress that our freely available code [53] can be straightforwardly used to design optimal quantum communication networks for given location of users.

FIG. 1 .
FIG. 1.The optimal path between two nodes.(a) Distribution of N = 20 points in a square of size L representing the users of a QKD network.The colored lines represent possible paths between users a and b.(b) Maximum spanning tree for N = 40 nodes.Here and in the following panels the red edges represent the optimal path between user a and user b.Nodes are colored according to their degree.(c-f) Maximal Quantum Communication Efficiency networks G * α , obtained using our optimization algorithm, for N = 40, L = λ0 and α = 0, 0.2, 0.3, 1.

c
coincides with the α c defined above.The predictions α 0→1 c = 0.5, α 1→2 c ≈ 0.369 and α 2→3 c ≈ 0.293 are in very good agreement with the positions of the steps for p = 1 − 1/e, appearing in Fig. 2(a).

FIG. 3 .
FIG. 3. The phase diagram and the behavior of the average capacitance.(a) Transitions between the different regimes for p = 1 − 1/e and N → ∞, representing the number of intermediate nodes in the optimal path for a pair of nodes at distance d ab as a function of d ab and α.Note that the curve separating the "direct link region" from the other regions has slope discontinuities corresponding to the dashed vertical lines.(b) Behavior of the average capacitance Q * , and of the minimum capacitance Qmin as a function of L/λ0 with α = 0.1, p = 0.1, N = 100 for the MQCE network , the FC network (computed analytically, see Methods).(c) Plot of the average capacitance of the MQCE network as a function of the average topological length for p = 1 − 1/e, N = 512 (dotted lines), N = 1024 (solid lines) and various values of L/λ0.