On the Stochastic Analysis of a Quantum Entanglement Distribution Switch

In this article, we study a quantum entanglement distribution switch that serves $k$ users in a star topology. We model variants of the system as continuous-time Markov chains and obtain expressions for switch capacity, expected number of qubits stored in memory at the switch, and the quantum memory occupancy distribution. We obtain a number of analytic results for systems in which measurements are imperfect, the links are homogeneous or heterogeneous and for switches that have an infinite or finite number of quantum memories or buffers. In addition, we model the effect of decoherence of quantum states and associated cutoff times on their storage using a simple model. From numerical observations, we discover that decoherence-associated cutoff times have little effect on capacity and expected number of stored qubits for homogeneous systems. For heterogeneous systems, especially those operating near the boundaries of their stability regions (i.e., systems that are nearly unstable), buffer size and decoherence can have significant effects on performance metrics. We also learn that in general, increasing the buffer size from one to two qubits per link is advantageous to most systems, whereas increasing the buffer size further yields diminishing returns. The analytical results obtained in this work can serve as a useful guide toward the future design of quantum switches—e.g., by allowing the designer to determine how many quantum memories suffice for a given number of users—as well as provide valuable insight on the performance of these and similar devices.


I. INTRODUCTION
E NTANGLEMENT is an essential component of quantum computation, information, and communication. Its applications range from cryptography (e.g. quantum key distribution [1], quantum error correction [2]) to ensemble sensing (e.g. multipartite entanglement for quantum metrology [3] and spectroscopy [4]). These applications drive the increasing need for a quantum switching network that can supply end-to-end entanglements to groups of endpoints that request them [5], [6], [7]. To realize such quantum systems, architectures have been proposed to support high entanglement generation rates, high fidelity, and long coherence times [8], [9], [10], [11].
In this paper, we study a single quantum switch that serves k users in a star topology. Each user has a dedicated link to the switch, and all sets of users of size n ≤ k, for a fixed n, wish to share an entangled state. To achieve this, link-level entanglements are generated at a constant rate across each link, resulting in two-qubit maximally-entangled states (i.e. Bell pairs or EPR states). These qubits are stored at local G. Vardoyan  quantum memories: one half of a Bell pair at the user and the other half at the switch. When enough of these entanglements are accrued (at least n of them), the switch performs multiqubit measurements to provide end-to-end entanglements to user groups of size n. When n = 2, the switch uses Bellstate measurements (BSMs) and when n ≥ 3, it uses n-qubit Greenberger-Horne-Zeilinger (GHZ) basis measurements [12]. We consider systems in which links may generate entanglements at different rates and where the switch can store one or more qubits (each entangled with another qubit held by a user) per link. Throughout this paper, we refer to these pairs of stored qubits as stored entanglements. Another factor that impacts performance is decoherence of quantum states; we model it and study its effect. The main metric of interest for this network is its capacity C, i.e., the number of end-to-end entanglements served by the switch per time unit. Another metric of interest is the expected number of qubits Q in memory at the switch, E[Q]. Both C and E[Q] depend on the values of k, n, entanglement generation and decoherence rates, number of quantum memories, and the switching mechanism, including the scheduling policy used by the switch.
Contributions of this work are as follows: using continuoustime Markov chains (CTMCs), we derive C and E[Q] for n = 2 for a particular scheduling policy and study how they vary as functions of k, buffer size, and decoherence rate. For n ≥ 3, we derive C and E[Q] for the case where all links are identical, the switch has infinite memory, and there is no decoherence. From our analysis, we gain valuable insight into which factors influence capacity the most, and which ones are of lesser consequence. For instance, we find that when n = 2 and links are identical, the number of links and their entanglement generation rate are the most impactful, while decoherence and buffer size have little effect. However, the same is not true in the case of non-identical links, where the distribution of entanglement generation rates, combined with finite coherence time, can drastically affect both C and E [Q]. Last, we compare our results for the n = 2, identical-link, infinite buffer case against a logically more accurate discretetime Markov chain (DTMC) model and find that (i) they predict the same capacity, and (ii) the difference in predictions of E[Q] is small although relative errors can be large for small values of k. Consequently, we rely on CTMC models as we relax assumptions.
The remainder of this paper is organized as follows: in Section II, we discuss relevant background and related work. In Section III, we cover modeling techniques, assumptions, and objectives. In Section IV, we introduce our CTMC models for n = 2 and present their analyses. In Section V, we introduce and analyze our DTMC model for n = 2 infinitebuffer, homogeneous-link scenario and compare the results to its CTMC analogue. In Section VI, we derive C and E[Q] for the simplest case of n ≥ 3 using a CTMC model. Numerical observations are discussed in Section VII. We conclude in Section VIII.

II. BACKGROUND
In [10], Herbauts et al. implement an entanglement distribution network intended for quantum communication applications. The fidelities of entanglements generated in this network were 93% post-distribution, and fidelities of 99% were shown to be achievable. The demonstration entails distributing bipartite entanglements to any pair of users wishing to share entanglement in a multi-user network (there were eight users in the experimental setup). Delivering multiple bipartite entanglements was shown to be possible virtually simultaneously. The authors specifically cite a possible application of the network in a scenario where a single central switch dynamically allocates two-party entanglements to any pair of users in a static network. In this paper, we study variants of this system, where we assume that the switch has the ability to store entangled qubits for future use, and that successfully-generated entanglements have fidelity one (a reasonable assumption based on the results in [10]).
In [13], the authors use Markov chains to compute the expected waiting time in quantum repeaters with probabilistic entanglement swapping. While this work considers an arbitrary number of links, explicit expressions are only provided for up to four links. In contrast, the scheduling policy used in our work simplifies the construction of the Markov chains, allowing us to derive closed-form expressions for a diverse set of systems. Further, in some cases we also consider extra memory at the switch and study its effect on performance.
In [14], we analyze the capacity region of a quantum entanglement switch that serves users in a star topology and is constrained to store one or two qubits per link. The problem setup is quite similar to that of this work, with the exception that the switch has the ability to serve bipartite and tripartite end-to-end entanglements. We examine a set of randomized switching policies and find policies that perform better than time-division multiplexing between bipartite and tripartite entanglement switching. As new quantum architectures and technologies emerge, we expect quantum networks to be more prevalent and suitable for practical use. With linklevel and especially end-to-end entanglements being a valuable commodity in these networks, proper resource management will be imperative for reliable and efficient operation.

III. MODEL AND OBJECTIVES
Consider first a fairly general setting of the proposed problem: k users are attached to a quantum entanglement switch via k dedicated links. At any given time step, any set of n users (with n ≤ k) wish to share an end-to-end entangled state. The creation of an end-to-end entanglement involves two steps. First, users generate pairwise entanglements with the switch, which we call link-level entanglements. Each of these results in a two-qubit Bell state, with one qubit stored at the switch and the other stored at a user. Once at least n links have created entanglements, the process enters step two: the creation of an end-to-end entanglement. The switch chooses a set of n locally-held qubits (that are entangled with n qubits held by n distinct users) and performs an entangling measurement. If such a measurement is successful, the result is an n-qubit maximally-entangled state between the corresponding n users. If after this step more link-level entanglements are available, the switch repeats the second step until there are fewer than n local qubits left.
The reason that we focus on the case where any n users wish to share an entangled state is that in this work, we would like to obtain a bound on the aggregate capacity of the switch for any workload. Hence, it is helpful if the switch has no restrictions on which measurements to perform whenever n distinct link-level entanglements are available. The results of this analysis can then be used as a comparison basis for other types of scenarios, in which, for example, each ngroup of users may specify a desired rate of communication with each other through the switch. Another utility of this analysis is that by examining a switch that operates at or near maximum capacity, one may gain insight on the practical memory requirements of a switch.
Both link-level entanglement generation and entangling measurements can be modeled as probabilistic phenomena [15]. In this work, we model the former as follows: at each time step of length τ seconds, all k users attempt to generate link-level entanglements. In general, link l succeeds in generating an entanglement with probability p l ≈ e −βL , where L is the length of the link (e.g. optical fiber) and β its attenuation coefficient. We refer to the special case of p l = p m , ∀l, m ∈ {1, . . . , k} as a homogeneous system, and when they are not necessarily equal, as a heterogeneous system. We assume that whenever a link-level entanglement is generated successfully, it always has fidelity one, but in certain cases we will consider decoherence post-generation. We also assume that measurements performed by the switch succeed with probability q 1 .
If at any time there are fewer than n link-level entanglements, the switch may choose to store the available entangled qubits and wait until there are enough new ones generated to create an end-to-end entanglement. We assume that the switch can store B ≥ 1 qubits in its buffer, per link. If on the other hand, there are more than n link-level entanglements, the switch must decide which set(s) of them to use in measurement(s). Such decisions can be made according to a pre-specified scheduling policy: for example, a user or a set of users may be given higher priority for being involved in an end-to-end entanglement. Other scheduling policies may be adaptive, random, or any number of hybrid policies.
In this work, we utilize a hybrid scheduling policy. First, we assume that the switch adheres to the Oldest Link Entanglement First (OLEF) rule, wherein the oldest link-level entanglements have priority to be used in entangling measurements. A practical reason for this rule is that quantum states are subject to decoherence, which is a function of time; hence, our goal is to make use of link-level entanglements as soon as possible. Second, we assume that as long as the switch follows the OLEF rule, sets of link-level entanglements are chosen at random for measurements, provided that each set consists of n entanglements belonging to n distinct links. The state space of this system can be represented by a vector Q(t) ∈ {0, 1, . . . , B} k , where the lth element corresponds to the number of stored entanglements at link l at time t. Note that one consequence of the OLEF rule and the assumption that any set of n users always wish to share an entangled state is that at most n − 1 distinct users will store entanglements at any time.
One way to model a system as described above is to construct a DTMC on the appropriate state space. Unfortunately, this method is not the most scalable (in terms of k or n) and is not the easiest to analyze even in the simple setting of homogeneous links and infinite switch buffer size. Further obstacles arise when one considers, for example, accounting for decoherence in a DTMC model. Another possibility is to use a CTMC: instead of viewing a link-level entanglement as a Bernoulli trial, view it as an exponential random variable (r.v.) with successful generation rate equal to µ l = p l /τ . The analysis is significantly less challenging, and we can easily incorporate decoherence by modeling coherence time as an exponential r.v. with mean 1/α. Under this assumption, an entanglement's fidelity goes from one directly to zero upon decoherence, i.e., the fidelity does not degrade while the entanglement is in storage. A disadvantage is that a discrete model describes the operation of our systems more accurately. However, in Section V-C, we argue that using CTMCs as an approximation is quite reasonable: at least in the homogeneous case with infinite buffer, not much is lost in terms of accuracy.
Our goal in this work is to derive the system capacity C (i.e., the number of end-to-end entanglements produced per time unit) and the expected number of stored qubits E[Q]. A note on mathematical notation: in this paper, we will use the convention that for any y > x, the term x y = 0. Throughout the paper, we also use the result that if the balance equations of an irreducible CTMC have a unique and strictly positive solution, then this solution represents the stationary distribution of the chain.

IV. CTMC FOR BIPARTITE ENTANGLEMENTS
In this section, we introduce and analyze a CTMC model of a bipartite entanglement switch serving k users. We first assume that memories do not decohere and obtain expressions for capacity and the expected number of qubits stored at the switch. We then modify the models to incorporate decoherence and analyze it. Last, we derive an upper bound for the capacity of the switch.

A. The Heterogeneous Case
Assume µ l depends on l, i.e. the links are heterogeneous. For subsequent analysis, it is useful to define γ := k l=1 µ l , the aggregate entanglement generation rate over all links. Also, let e l be a size k vector with all zeros except for the lth component, which is 1, and let 0 be a vector of size k with all entries equal to 0.
We are interested in the stationary distribution and stability conditions for a heterogeneous system with infinite and finite buffers. As discussed in Section III, in bipartite entanglement switching, only one link will store entanglements, but since links generate entanglements at different rates, we must keep track of which link is associated with the stored entanglement(s). Let Q(t) = (Q 1 (t), . . . , Q k (t)) ∈ {0, 1, 2, . . . } k represent the state of the system at time t, where Q l (t) is the number of entanglements stored at link l, l ∈ {1, . . . , k}, at time t. As a consequence of the scheduling policy described in Section III, if Q i (t) > 0 for some i, then Q j (t) = 0, j = i. In other words, Q(t) only takes on values 0 or je l , l ∈ {1, . . . , k}, j ∈ {1, 2, . . . }. Here, 0 represents the state where no entanglements are stored, and je l represents the state where the lth link has j stored entanglements.
Define the following limits when they exist: Once we obtain expressions for π 0 and π (j) l , we can derive expressions for capacity and the expected number of stored qubits E[Q].
1) Infinite Buffer: Figure 1 presents the CTMC for an infinite buffer. Consider state 0 (no stored entanglements). From there, a transition along one of the k "arms" of the CTMC occurs with rate µ l , when the lth link successfully generates an entanglement. For a BSM to occur, any of the k − 1 other links must successfully generate an entanglement: this occurs with rate γ − µ l . The balance equations are From above, we see that for j = 1, 2, . . . , It remains to obtain π 0 ; we can use the normalizing condition: Now, assume that for all l ∈ {1, . . . , k}, ρ l < 1. This implies that for all l, µ l < γ/2. This is the stability condition for this chain.
Then, π 0 = 1 + k l=1 ρ l 1 − ρ l −1 and the capacity is See Appendix B-A for a proof of the last equality. The distribution of the number of stored entanglements is The expected number of stored entanglements is 2) Finite Buffer: In the case of heterogeneous links and a finite buffer of size B, the CTMC has the same structure as in Figure 1, except that each "arm" of the chain terminates at Be l , ∀l ∈ {1, . . . , k}. The balance equations are where ρ l is defined as in the infinite buffer case. Then, , and the capacity is The distribution of the number of stored qubits is given by The expected number of stored qubits is The rate received by user l (connected to link l) is given by where the first term represents the production of entanglements by link l (which get consumed by other links at rate γ − µ l ) and the second term represents the consumption by link l of stored entanglements at other links. Note then, that if we were to sum all C l , each end-to-end entanglement would be doublecounted. Hence, C l = 2C.

B. The Homogeneous Case
Suppose all links (or users) have the same entanglement generation rates, i.e. µ l = µ, ∀ l ∈ {1, . . . , k}. We can take advantage of this homogeneity as follows: since only one link can be associated with stored qubits at the switch at any given time, and all links have equal rates, it is only necessary to keep track of the number of stored entanglements, and not the identity of the link (or user). Hence, the state space of the CTMC can be represented by a single variable taking values in {0, 1, . . . , B} where B = ∞ corresponds to the infinite buffer case, and B < ∞ the finite buffer case. We discuss each of these in detail next.

Fig. 2:
A CTMC model with k users, infinite buffer, and homogeneous links. µ is the entanglement generation rate. Fig. 3: A CTMC model with k users, finite buffer of size B, and homogeneous links. µ is the entanglement generation rate.
1) Infinite Buffer: Figure 2 depicts the CTMC for k homogeneous links and B = ∞. When no entanglements are stored (system is in state 0), any of the k links can generate a new entanglement, so the transition to state 1 occurs with rate kµ. Let S represent the link associated with one or more stored entanglements. From states 1 and above, transitioning "forward" (or gaining another entanglement in storage) occurs whenever link S generates a new entanglement. This event occurs with rate µ. Finally, moving "backward" through the chain (corresponding to using a stored entanglement, when the switch performs a BSM) occurs whenever any of the k−1 links other than S successfully generate an entanglement; this event occurs with rate (k−1)µ. It is easy to show that when there are two links, the system is not stable (and a stationary distribution does not exist). Henceforth, we only consider k ≥ 3.
Note that the CTMC in Figure 2 is a birth-death process whose stationary distribution can be obtained using standard techniques found in literature (e.g. [18]). The steady-state probability of being in state 0 is π 0 = (k − 2)/(2(k − 1)) and of being in state j is π j = k(k − 2)/(2(k − 1) j+1 ). The capacity is The expected number of stored entangled pairs is given by .
2) Finite Buffer: Figure 3 illustrates the CTMC for a system with k homogeneous links being served by a switch with finite buffer space B. When there are B stored entanglements and a new one is generated on link S, we assume that the switch drops the oldest stored entanglement, adhering to the OLEF policy. This CTMC is also a standard birth-death process whose solution can be found in literature (e.g. [18]) and has Using the fact that B i=1 π i = 1 − π 0 , the capacity is Note that as B → ∞, C for the finite buffer case approaches C for the infinite buffer case. The expected number of stored qubits is

C. Decoherence
Assume now that quantum states in our system are subject to decoherence. Further, assume that all states decohere at the same rate α, even in the case of heterogeneous links, since coherence time is dependent on the quantum memories at the switch and not on the links themselves. Under the assumption that coherence time is exponentially distributed with rate 1/α, incorporating decoherence does not change the structure of the CTMC; it merely increases "backward" transition rates. Specifically, in the homogeneous case, the transition from any state j ≥ 1 to state j −1 now has rate (k −1)µ+jα, where jα represents the aggregate decoherence rate of all j stored qubits. In the heterogeneous case, the transitions are modified in a similar manner for any state je l , l ∈ {1, . . . , k}, j ≥ 1. The derivations of stationary distributions, capacities, and expected number of qubits stored are very similar to those for models without decoherence; we present the final relevant expressions here and leave details to Appendix B-B. All expressions below can be computed numerically.
Heterogeneous Links: For finite buffer B, For infinite buffers, let B → ∞ in all expressions above. Homogeneous Links: For finite buffer B, For infinite buffers, let B → ∞ in all expressions above. 6  probability of using j of the stored entanglements P j,0 probability of going from state j ∈ {0, . . . , k − 1} to 0 P j,1 probability of going from state j ∈ {0, . . . , k} to 1

V. DTMC FOR BIPARTITE ENTANGLEMENTS
In this section, we describe the DTMC model and analyze the simplest switch variant: a switch that serves only bipartite entanglements, has infinite buffer space, and whose quantum states are not subject to decoherence. By studying this basic system, we learn that the DTMC model exhibits limitations such that introducing additional constraints to this model, such as finite buffers or quantum state decoherence, makes the resulting model exceedingly difficult to analyze, and therefore not a viable option for modeling more complex entanglement switching mechanisms. Nevertheless, the results of our study of this basic DTMC scheme serve as a valuable comparison basis against the CTMC model and justify the latter's use as a reasonable approximation model.

A. Model Description
We model a switch serving k users, each of whom has a separate, dedicated link to the switch, as a slotted system where each slot is of length τ seconds. Each user (or link) attempts a two-qubit entanglement in each time slot. We assume links are homogeneous, so that the success probabilities of all entanglements are equal and do not depend on the links. Let p denote the probability that an entangled pair is successfully established on a link, and define p ≡ 1 − p. Then the expected time to successfully create a link entanglement is given by τ /p. We assume that the switch can store an infinite number of qubits. Moreover, we assume that any successful entanglement has fidelity one, and that states do not decohere.
As before, we assume that any pair of users wishes to "communicate" (i.e., share an entangled state) as long as entanglements are available. The switch serves users based on the hybrid OLEF and random policy as described in Section III. We also assume that any time the switch performs a BSM, it succeeds with probability q.
Note that only one link will have stored entanglements, since whenever a distinct pair of users have entanglements, they are immediately paired up for a BSM. As a consequence of this, as well as the link homogeneity assumption, it is not necessary to keep track of which link has stored entanglements: one need only keep track of how many are stored. Hence, the state space is given by Ω = {0, 1, 2, . . . }. Let S denote the link that has at least one stored entanglement. Figure 4 illustrates the possible transitions from a state i ≥ k +1 (as we will see later, transitions for states i ∈ {0, 1, . . . , k} require special consideration). Table I provides a notation reference that is used in the analysis. Fig. 4: A DTMC model with k users, infinite buffer, and homogeneous links. Here, i ≥ k + 1, P f is the probability of advancing forward in the Markov chain, P s is the probability of remaining in the current state, and P (j) is the probability of going back j states.

B. Analysis
First, we fully define the transition probabilities for this chain. We expect the stationary distribution to have a geometric form and show this to be true. However, a closed-form solution is not obtainable for large k, as it requires solving a polynomial of degree k − 1 for an unknown factor, β. On the other hand, not having a closed-form solution for the stationary probability vector does not preclude us from deriving a simple expression for the capacity of the switch -it is qkp/2. Finally, we also obtain a simple expression for the expected number of qubits in memory at the switch, but are constrained to compute it numerically due to its dependence on β.
1) Transition Probabilities: Figure 5 presents the transition probability matrix P for this DTMC. Note that repetition begins after the kth row of the matrix. We derive expressions for all non-zero transition probabilities. In the discussion that follows, we say that a link "succeeds" or "fails" for brevity, when referring to a link that successfully generates an entanglement or fails to do so, respectively. First, consider any state i > 1. The transitions for this state are described as follows: i → i + 1: the only way to advance forward in the chain is if S successfully generates a new entanglement, but all other links fail to do so. This probability is given by i → i: there are two ways to remain in the current state: (a) all links fail or (b) S succeeds and only one of the k − 1 other links succeeds. This occurs with probability Here, M signifies the maximum number of stored entanglements that can be used up when starting from state i. Note that even in the case all k links succeed and i ≥ k, only k − 1 of the stored entanglements get used: the entanglement that was generated by S cannot be paired with another entanglement from S. As stated above, we compute transition probabilities to states 0 or 1 separately, since they require special consideration. This is why M = i − 2 for states i < k + 1. Keeping these constraints in mind, the transition from i to i − j occurs in two types of events: (a) S fails and exactly j of the k − 1 other links succeed, Next, we discuss transitions to states 0 and 1, which, unlike the probabilities above, depend on the value i of the state from which the transitions occur. To help with this task, we will first need to be able to compute two types of probabilities: the first is the probability that out of k events, j ≥ i succeed, where j is either zero or an even number, and we call this probability P e (i, k); and the second is the probability that out of k events, j ≥ i succeed, where j is an odd number, and we call this P o (i, k). To compute these, we will make use of two indicator functions: 1{j is 0 or even} : Now, for any state i, 1 ≤ i ≤ k, the transition to state 1 occurs under the following conditions: If i is even: 1. S fails and j ≥ i − 1 others succeed, j odd. 2. S succeeds and j ≥ i others succeed, j even.
If i is odd: 1. S fails and j ≥ i − 1 others succeed, j even. 2. S succeeds and j ≥ i others succeed, j odd.
Similarly, for any state i ∈ {1, . . . , k − 1}, transitioning to state 0 occurs under the following conditions: If i is even: 1. S fails and j ≥ i others succeed, j even. 2. S succeeds and j ≥ i + 1 others succeed, j odd.
If i is odd: 1. S fails and j ≥ i others succeed, j odd. 2. S succeeds and j ≥ i + 1 others succeed, j even.
In the special case of 0 → 0, either all must fail or there must be an even number of entanglements. Hence, P 0,0 = P e (0, k). Finally, in the special case of 0 → 1, there must be an odd number of entanglements, given by P 0,1 = P o (1, k).
2) Stationary Distribution: The balance equations for the DTMC are as follows: For any state i ≥ 2, the balance equations have the form: and finally, the normalizing condition is We postulate that π i = β i−1 π 1 for i ≥ 2, with β ∈ (0, 1). Introducing this value of π 1 in Eq. (5) yields (see A-A1 for a proof) To show that π i = β i−1 π 1 for i ≥ 2 is indeed the solution to this system, we must prove that: 1. There exists β ∈ (0, 1) satisfying Eq. (7), and that this β is unique, 2. Given the solution above, note that both Eqs (3) and (4) can be written in terms of only π 1 and π 0 . Hence, for the proposed solution to be valid, one of these equations must be redundant, i.e., we must show that Eq. (3) is equivalent to Eq. (4).
We prove the first statement above in A-A2 and the second in A-A3, and conclude that the proposed form for π i , i ≥ 2 is valid. Moreover, we can derive expressions for π 0 and π 1 in terms of β. From the normalizing condition (6), we have In A-A3, we rearranged (3) to look as follows: and also showed that the left side of Eq. (9) equals and therefore, Eq. (9) becomes βπ 0 π 1 P 0,1 = 1 2 Next, we compute Substituting this into Eq. (10), Now, we can compute π 0 in terms of only β: 3) Capacity and Qubits in Memory: As with the CTMC models let Q represent the number of stored qubits at the switch. Let N denote the number of entanglement pairs generated in one time step of the DTMC. Then the capacity is defined as follows: To compute this expression, we consider two separate cases: case 1 is when i ≥ k − 1 and case 2 is when i < k − 1. In case 1, there can be at most k − 1 entanglements; the expected number is given by For case 2, we can have up to i + m entanglements, where m = k−i 2 + . The expected number is then given by For the sum above, consider first j ∈ {0, . . . , i}. Here, we are looking for the probability that there are fewer new entanglements than the number stored, so the probability that we generate j pairs is given by However, note that the case j = i is a special one: another way we can generate i entanglements is if there are a total of i + 1 successes from the k − 1 links that have nothing stored, while S fails. Then, the extra entanglement has no pair, and the total number of pairs generated is still i. This is given by Next, we focus on the case where j ∈ {i + 1, . . . , i + m}.
After the first i successes, there need to be anywhere from 2 to at most k − i "extra" successes to generate new pairs. Denote the number of these extra successes by the variable l ∈ {2, . . . , k − i}, and the number of new pairs (or BSMs) generated from them is l 2 . Then we can write the second sum as follows: Combining everything we have learned, we obtain In A-B, we show that the above evaluates to Next, we derive the expected number of qubits stored at the switch, E[Q]. This is given by C. Comparison of DTMC models with CTMC models Recall that in the discrete model, the amount of time it takes to successfully generate a link entanglement is given by τ /p. In the continuous model, the rate of successful entanglement generation is µ, so the time to generate an entanglement is 1/µ. Hence, τ /p = 1/µ or equivalently, µ = p/τ . Then, note that the DTMC capacity that we derived in Section V-B3 is the capacity per time slot of length τ seconds. Therefore, in order to make a comparison against the CTMC capacity, we must perform a unit conversion: divide the discrete capacity by τ in order to obtain the number of entanglement pairs per second, as opposed to per time slot. This yields We conclude that the capacities produced by the DTMC and CTMC models match exactly. Next, we compare the expected number of qubits in memory at the switch, E[Q] as predicted by the DTMC and the CTMC models. Figure 6 compares numerically the discrete and continuous E[Q]'s as the number of users k and probability p vary. For each value of p and k, we use Eq. (7) to numerically solve for β. For each value of k, we report the maximum relative error, defined as where E[Q] DTMC and E[Q] CTMC are the discrete and continuous functions for E[Q], respectively. We observe that the error is largest when p is close to 1. Note that Since f (β) = 0, we conclude that as p → 1 and k → ∞, β → 0 (note: β = 1 is always a root of f (β), but we always discard this root because it is not in (0, 1)). As β → 0, E[Q] → 1/2 according to Eq. (14), which is consistent with the numerical observations. Meanwhile, as k → ∞, the continuous E[Q] also approaches 1/2. We conclude that as k → ∞, maxRelErr → 0, which can be observed in Figure 6. Also, the largest maxRelErr occurs for the lowest value of k = 3, when p → 1. But even in this (worst case), although the error is maxRelErr(3) = 2, it corresponds to discrete and continuous versions of E[Q] differing by a prediction of only a single qubit. From these analytic and numerical observations, we conclude that the CTMC model is sufficiently accurate so as to be used to explore issues such as decoherence, link heterogeneity, and switch buffer constraints.
Recall that in Section IV, we introduced CTMCs for systems where the switch has buffer constraints, links are heterogeneous, and coherence time is finite. The construction and analyses of these models is relatively simple compared to the DTMC model of this section. Even if one were to introduce a finite buffer into this model, several changes would be required to state transitions and balance equations, resulting in even more complex expressions for the stationary distribution (recall that even in the infinite-buffer case, we must solve for it numerically). Attempting to model decoherence in discrete time would require one to consider all possible combinatoric settings of stored qubit decoherence, further complicating the transition probabilities, but also increasing the number of possible transitions from each state. Consider, for instance, state i in Figure 4: each of the existing "backward" transitions P (j) , j ∈ {1, . . . , k − 1} would have to be modified based on the number of ways that l qubits can decohere and m new entanglements can be generated such that l + m = j, and in addition, extra transitions must be added from state i to states {0, 1, . . . , i − k + 2} because any number of the stored qubits can decohere. This process is highly cumbersome and prone to mistakes, quickly outweighing the advantages of using DTMCs. On the other hand, by using CTMCs we gain much in modeling power and lose little in accuracy.

VI. CTMC FOR n-PARTITE ENTANGLEMENTS
Consider a switch that exclusively serves n-partite entanglements to its users, i.e., whenever there are enough available link entanglements, the switch performs n-way GHZ measurements according to the OLEF policy. We assume that at any time, any group of n users wishes to "communicate", or share an entangled state. In this work, we consider the simplest variant of this system, in which all links are homogeneous, the switch has infinite buffer, and there is no decoherence. Note that in such a system, at most n−1 links can have stored entanglements at any given time. Let the vector i = (i 1 i 2 . . . i n−1 ) represent the number of stored entanglements at the links, where some entries may equal 0 (in cases where fewer than n−1 links have stored entanglements). We construct a CTMC with state space S := {(i 1 i 2 . . . i n−1 ) : i 1 ≥ 0, . . . , i n−1 ≥ 0}, which can be partitioned as follows: where S j contains the set of states i wherein j entries are 0 and n − 1 − j entries are ≥ 1. We will borrow some of the notation from Section IV to describe the non-zero transitions for this CTMC. First, from any state i ∈ S 0 , in which n − 1 distinct links have at least one entanglement each, an n-partite entanglement will be generated when the nth link generates one; this occurs with rate (k − (n − 1))µ. Now, consider a state i ∈ S j , for j ∈ {1, . . . , n − 1}. Note that due to the j zero entries, some of these states are "equivalent" in the sense that their steady-state probabilities are equal. For instance, for j = n − 2, states e l , l = 1, . . . , n − 1, are all equally likely in steady state. To account for this symmetry, whenever a link with no stored entanglements generates one, we divide the rate of transition by j. Hence, for example, the chain transitions out of state 0 with rate kµ into one of states e l , l ∈ {1, . . . , n − 1}, but since there are n − 1 such states, each individual transition has rate kµ/(n − 1). In general, for a state with j zero entries in i, note that there are a total of k − (n − 1 − j) links with no stored entanglements. Hence, when one of these links generates one, the rate is given by (k − (n − 1 − j))µ/j. Finally, for any state in S \ S n−1 , a link with an already-stored entanglement may generate another one; this occurs with rate µ. Now, let Q l t be the number of stored qubits at the switch for link l at time t, and consider the DTMC X := {Q t := (Q 1 t Q 2 t · · · Q n−1 t ), t = 1, 2, . . . } that results from the uniformization of this CTMC. The non-zero transition probabilities for the DTMC are as follows: Note that X is irreducible and aperiodic. When in addition X is positive recurrent (i.e. stable), we denote by Q the stationary version of the vector Q t .

Proposition 1. If X is stable and if in steady state
Further, if X is stable, k > n, and if in steady state See proof of Proposition 1 in Appendix C-A. We conjecture that X is stable for k > n. We prove this conjecture for n = 3 in Appendix C-B.
The result in Eq. (15) can be interpreted as follows: in a system with k links, link-level entanglements are generated at rate kµ. For each n-partite entanglement, n link-level entanglements are consumed, hence, we divide kµ by n, and since measurements succeed with probability q, multiply by q to obtain the number of successfully-generated n-partite entanglements per time unit. The quantity qµk/n is an upper bound on the capacity of the switch, and we are able to achieve it as a consequence of the OLEF policy and the assumption that any n users wish to share an entangled state at any time, which allows the switch to line up link-level entanglements in any configuration. For this reason, it follows that OLEF is an optimal policy. The same argument can be used in systems with heterogeneous links and systems with decoherence to prove that the resulting capacity is a tight upper bound.

VII. NUMERICAL OBSERVATIONS
In this section, we investigate the capacity and buffer requirements of a bipartite entanglement switch based on our model. In particular, we are interested in how the buffer capacity B and number of users k affect capacity and E[Q]. We then examine the effect of decoherence on homogeneous and heterogeneous switches with infinite buffer capacity.
Throughout this section, we denote the distance of user l from the switch as L l (measured in km). We assume that each user is connected to the switch with single mode optical fiber of loss coefficient β = 0.2 dB/km. We also assume that the switch is equipped with a photonic entanglement source with a raw (local) entanglement generation rate of 1 Giga-ebits 2 per second. So, in every (1 ns long) time slot, one photon of a Bell state is loaded into a memory local to the switch, and the other photon is transmitted (over a lossy optical fiber) to a user, who loads the received photon into a memory (held by the user), which has a trigger which lets the user know the time slots in which their memory successfully loads a photon. Let us denote τ = 1 ns as the time duration of one qubit of each entangled pair, and the entanglement generation rate between the switch and the user l, µ l = cη l /τ ebits per second. Here, we take c = 0.1 to account for various losses other than the transmission loss in fiber, for example inefficiencies in loading the entangled photon pair in the two memories (at the switch and at the user), and any inefficiency in a detector in the memory at the user used for heralding the arrival of a photon (e.g., by doing a Bell measurement over the received photon pulse and one photon of a locally-generated two-photon entangled state produced by the user). Here, η l , the transmissivity of the optical fiber connecting user l and

A. Effect of Buffer Size: Homogeneous Links
In homogeneous-link systems, all users are equidistant from the switch (i.e. L l = L m , ∀l, m ∈ {1, . . . , k}). In Figure 7, we compare models with infinite and finite buffer sizes as the number of links k is varied. Note that when links are homogeneous, qµ is simply a multiplicative factor in the expressions for C, and does not factor into formulas for E[Q]. Hence, we set qµ = 1 for Figure 7 (left), and with µ = 1, the links are 100 km long. For the finite buffer models, B is varied from one to five. Recall from Section IV-B2 that as B → ∞, the capacity of the finite-buffer model approaches that of the infinite-buffer model, as expected, and note that the same is true when k → ∞. Interestingly, this convergence seems to occur quite rapidly, even for the smallest value of k (3), and the maximum relative difference between the two capacities is 0.25 (even as µ increases). From this, we conclude that buffer does not play a major role in capacity for homogeneous systems under the OLEF policy and only a small quantum memory is required. Figure 7 (right) shows the behavior of E[Q] for infinite and finite buffer sizes and different values of k. As with capacity, the effect of buffer capacity on E[Q] diminishes as k grows, and largest relative difference occurs for k = 3 and B = 1, and equals 1.5 -less than two qubits. Note from the expressions for E[Q] in Sections IV-B1 and IV-B2 that as k → ∞, E[Q] → 1/2. Numerically, we observe that convergence to this value occurs quickly: even for k = 25, E[Q] is already 0.54 for both the infinite and finite models. for heterogeneous systems: recall from Section IV-A1 that for all l ∈ {1, . . . , k}, µ l must be strictly less than half the aggregate entanglement generation rate. For all experiments, q = 1 since it only scales capacity. For each value of k, the ratio of class 1 to class 2 links is 1:2 (so k = 3, 6, 9 have one, two, and three class 1 links, respectively). As with the homogeneous-link systems, we observe that the slowest convergence is for smaller values of k and the largest relative difference is for smaller values of B. However, the rate of convergence speeds up quickly as k increases from 3 to 6: with the latter, convergence is already observed for B < 10. Meanwhile, when k = 9, there is little benefit in having storage for more than two qubits. Another interesting observation is that quantum memory usage is large when k = 3 but not for larger values of k. This is due to the system operating closer to the stability constraints for k = 3 than larger values of k. In the next section, we will see another example of a system that operates close to its stability constraints. In such cases, C and E[Q] can be affected significantly as B is varied.

C. Effect of Decoherence
In this section, we study the effect of decoherence on capacity and expected number of stored qubits E[Q]. We set q = 1 for all experiments since it only scales capacity. Figure 9    presents C and E[Q] for homogeneous systems with µ = 1 (corresponding to 100 km long links), B = ∞ and different values of k, as decoherence rate α varies from 0 (the equivalent of previous models that did not incorporate decoherence) to µ = 1. Note that in practice, α is expected to be much smaller than µ. We observe that even as α approaches µ decoherence does not cause major degradation in capacity for homogeneous systems, and likewise does not introduce drastic variations in E[Q]. Figure 10 presents the effects of α in a set of heterogeneous systems with infinite buffer. In these experiments, entanglement generation rates are set in a similar manner to that of Section VII-B, with two classes of links configured so that the first class generates entanglements almost twice as fast as the second class (here, µ 1 = 0.99 and µ 2 = 0.5, corresponding to 100.2 km and 115 km long links for class one and two, respectively), and the number of links in class one to those in class two is 1:2. In these experiments, for each value of k, capacity behaves much as it would in a homogeneous system with µ set as the average of the µ l from the heterogeneous system. Note that for k = 3, E[Q] is very large when α = 0; similar to the experiment in Figure 8 this is because the system is operating close to the stability constraints. In all other cases, E[Q] is close to 0.
In Figure 11(a), we focus on a heterogeneous system that operates close to the stability constraints and observe the effects of both decoherence and buffer size on C and E[Q]. There are five links, with entanglement generation rates (35 15 15 3 3) Mega-ebits/sec, corresponding to link lengths of 22.8, 41.2, 41.2, 76, and 76 km, respectively. For this system, γ/2 = 35.5, so the fastest link is just below the constraint when α = 0. The average of the µ l is 14.2, so α is varied from 0 to this value. B is varied from 1 to 100, with the latter being close enough to mimic infinite buffer behavior for C and E[Q]. Figure 11(b) presents a homogeneous system with k = 5 and µ = 14.2 for a comparison. We observe that the homogeneous system achieves better capacity for all values of B, even though the average entanglement generation rate is the same for both systems. Further, the homogeneous system is more robust to changes in buffer size than the heterogeneous system: for the former, B = 5, 10 are equivalent to B = 100. Further, note that for B = 100 and α = 0 the heterogeneous system performs almost as well as the homogeneous system in terms of capacity, but the memory usage is much higher for the former. Finally, for this buffer size, as α increases, the homogeneous system is more robust to the effects of decoherence: capacity degrades by 7.35 Mega-ebits/sec for the heterogeneous system between α = 0 and α = 14, while it degrades by 4.54 Mega-ebits/sec for the homogeneous system.

VIII. CONCLUSION
In this work, we examine variants of a system with k users who are being served by a quantum entanglement switch in a star topology. Each user is connected to the switch via a dedicated link; we consider both the case of homogeneous and heterogeneous links. We also analyze cases in which the switch has finite or infinite buffer space for storing entangled qubits. For all variants of the problem, we focus on a specific scheduling policy, where the oldest entanglements are given priority over more recently-generated ones. We obtain simple and intuitive expressions for switch capacity, as well as for the expected number of qubits in memory.
In the case of bipartite entanglement switching, we make numerical comparisons of these two metrics while varying the number of users k and buffer sizes B. We observe that in most cases, little memory is required to achieve the performance of an infinite-memory system. We also make numerical observations for models that incorporate decoherence and conclude that the degradation of quantum states in homogeneous systems has little effect on performance metrics, while it can have more significant consequences in heterogeneous systems that operate close to their stability constraints. We also obtain expressions for capacity and expected number of stored qubits for a homogeneous system with infinite buffer and no decoherence. The results hold when the system is stable; we conjecture that this occurs whenever k > n and prove the conjecture in the case of n = 3. Finally, we argue that the entanglement switching policy presented in this work achieves a tight upper bound on the switch capacity.
3) Equivalence of Eqs (3) and (4): We start by rearranging (3): Then, we rearrange (4) in a similar fashion: Hence, to show that one of (3) and (4) is redundant, it suffices to show that or equivalently, Before we continue, we derive a few useful expressions. The first is as follows: Next, we have Finally, Now, consider the left side of Eq. (18): Next, we look at Summing these two expressions, we obtain Next, we compute Finally, the left side of Eq. (19) becomes Recall from (19) that the expression above must equal to β. Using Eq. (7), we know that (pβ + p) k−1 (p + pβ) = β, and therefore,

B. Proof of DTMC Capacity
For simplicity, let us first derive C with the assumption that q = 1. Since q simply scales the capacity, we will multiply the resulting expression by q at the end. Consider the first term of Eq. (12): Next, keeping in mind that k − 1 ≥ 2, the last term of Eq. (12) is Hence, so far, Next in Eq. (20) we have the term Substituting this into Eq. (20), we have Consider the remaining sum above. Let m = i + l. Then The inner sum above can be rewritten as follows: Now, we can use the fact that π 0 + π 1 /(1 − β) = 1 to obtain Using the same relation, we have From Eq. (11), we know that π 1 = (1 − β 2 )/2. Using this,
Using the normalizing condition, we have The capacity and E[Q] can be computed numerically using the following formulas: Homogeneous, Finite Buffer: The derivations are very similar to the previous case, with the only difference being that the balance equations are truncated at state i = B. The resulting expressions are almost identical to those above, with the exception of i being in {1, . . . , B} instead of {1, 2, . . . }: Heterogeneous, Infinite Buffer: The balance equations are: l (γ − µ l + α), l ∈ {1, . . . , k}, π (j−1) l µ l = π For j = 1, 2, . . . , we can write Using the normalizing condition, we obtain The capacity and E[Q] can be computed numerically using Heterogeneous, Finite Buffer: The derivations are similar to the previous case, with the only difference being that j is now in {1, . . . , B} instead of in {1, 2, . . . }. The resulting relevant expressions are: µ l γ − µ l + iα .

A. Capacity and Expected Number of Qubits
This section contains the proof of Proposition 1. Recall that k ≥ n. We assume that the irreducible and aperiodic DTMC X is positive recurrent (i.e. stable), with π its stationary distribution. Assume that it is in steady state at time t = 1 (which implies that it is in steady state for t > 1). For every mapping V : {0, 1, . . .} n−1 → [0, ∞) such that E[V (Q 1 )] < ∞, we have .

B. Stability for Tripartite Switching
In this section, we prove that the DTMC X is ergodic for k > 3 when n = 3. Recall that k ≥ 3 when n = 3. From Section VI, we see that its non-zero transition probabilities are p i,j;i−1,j−1 = k − 2 2 , p i,j;i+1,j = p i,j;i,j+1 = 1 k i, j ≥ 1,