Error Correlations in Photonic Qudit-Mediated Entanglement Generation

Generating entanglement between distributed network nodes is a prerequisite for the quantum internet. Entanglement distribution protocols based on high-dimensional photonic qudits enable the simultaneous generation of multiple entangled pairs, which can significantly reduce the required coherence time of the qubit registers. However, current schemes require fast optical switching, which is experimentally challenging. In addition, the higher degree of error correlation between the generated entangled pairs in qudit protocols compared to qubit protocols has not been studied in detail. We propose a qudit-mediated entangling protocol that completely circumvents the need for optical switches, making it more accessible for current experimental systems. Furthermore, we quantify the amount of error correlation between the simultaneously generated entangled pairs and analyze the effect on entanglement purification algorithms and teleportation-based quantum error correction. We find that optimized purification schemes can efficiently correct the correlated errors, while the quantum error correction codes studied here perform worse than for uncorrelated error models.


I. INTRODUCTION
Quantum networking enables new primitives such as information-theoretically secure communication [1], quantum sensing networks [2][3][4], and distributed quantum computation [5][6][7].Furthermore, it provides a promising route towards scalable quantum computers via modular designs [8].A prerequisite for these applications is the distribution of high-fidelity entanglement between the network nodes to enable reliable transfer of quantum information by quantum teleportation.
Entanglement purification [9,10] and quantum error correction [11,12] are promising means to suppress the effect of noise in the generation of entanglement.Both methods require the generation of many entangled pairs between the nodes, which are combined to enable highfidelity transfer of quantum information.
Recently, several entanglement distribution protocols based on time-bin photonic qudit encoding were proposed for the simultaneous generation of multiple entangled pairs between network nodes [13][14][15][16].In general, they follow the setup outlined in Fig. 1.First, a single photonic qudit encoded in time-bins is entangled with Alice's qubit registers.The photon is transmitted to Bob, where the same entangling operation is performed.A successful run of the protocol is heralded by the detection of the photon via a high-dimensional X-basis measurement.If a photon is detected, all qubits in the registers of Alice and Bob are entangled.This contrasts with conventional schemes based on photonic qubits, where entangled pairs are generated independently of each other.This leads to conventional schemes having much more demanding requirements on the coherence times of the qubits for the generation of multiple entangled pairs.arXiv:2312.01519v2[quant-ph] 12 Jan 2024 A significant experimental challenge of the schemes in Refs.[13][14][15][16] is the requirement of fast optical switches for routing of the photon to ensure the correct interaction with the qubits and to interfere the time-bins in the X-basis measurement of the photon.The schemes also require a single photon to interact with all qubits, which can cause correlated errors between the entangled pairs.The extent of correlated errors and their effects on key applications such as entanglement purification and teleportation-based error correction have not been studied in detail.
In this paper, we propose a photonic qudit-mediated entanglement protocol that circumvents the use of optical switches, making it more accessible to the near-term hardware.We model and characterize the effect of correlated errors on the quality of the generated Bell pairs and apply optimized entanglement purification protocols [17] to distill high-fidelity entanglement.We also study the performance of teleportation-based quantum error correction, focusing on the [ [5,1,3]] and [[4,2,2]] code [18][19][20][21].We show that the optimized purification protocols can remove the correlated errors efficiently while they have a more negative impact on the error correction codes.

II. SWITCH-FREE PROTOCOL
We show an overview of the switch-free implementation proposed in this paper in Fig. 2. We circumvent the need for optical switches in two ways.Firstly, each time-bin pulse generated by Alice will interact with all register qubits of both Alice and Bob through a singlesided cavity-mediated CZ-gate between the photon (logical states |0⟩ / |1⟩ corresponding to absence/presence of the photon) and the qubits (logical states |0⟩ / |1⟩ corresponding to a cavity non-coupled/coupled spin state).We further discuss the physics of the CZ-gate below.
Through single qubit Hadamard gates, we can control whether the presence of the photon in a time-bin pulse will flip the state of the qubit or not.This is because the CZ-gate will only have an effect if the qubit state has a non-zero amplitude in the |1⟩ state.Thus, there will be no effect if the qubit is in state |0⟩, while if it is prepared in state |+⟩, the scattering of the photon will flip the state to |−⟩.The Hadamard gates will be applied at each time-bin following a binary logic as detailed below.
Secondly, in Ref. [13], the final deterministic photon measurement also requires optical switches to map the time-bin encoding to a spatial encoding, allowing for interference of the different modes and erasure of the timebin information.We show how the time-bin information can be erased probabilistically with a concatenated array of beamsplitters and delay lines.
We now go through the steps of the protocol in more detail.First, Alice generates a time-bin photonic qudit with dimension 2 m where m is the number of entangled pairs we want to generate.We model this generation assuming a cavity-assisted Raman scheme similar to the approach in Ref. [22].
We consider a 3-level system consisting of two stable ground states |g 0 ⟩, |g 1 ⟩ and one excited state |e 1 ⟩.The transition |e 1 ⟩ ↔ |g 1 ⟩ is coupled to an optical cavity for efficient photon extraction, while the transition |e 1 ⟩ ↔ |g 0 ⟩ is driven by a pulsed laser.
The system is initialized in state |g 0 ⟩.At each timebin, we drive with pulsed excitation such that there is a small probability that the system is transferred from the ground state |g 0 ⟩ to |g 1 ⟩ with the emission of a cavity photon.By carefully tuning the amplitude of the driving pulses, a time-bin encoded photonic qudit of the following form will be emitted in the ideal case: where |n⟩ ph denotes a single photon in the n'th time-bin and vacuum in the rest.The amplitudes α n ∈ R + can be tuned through the amplitude of the driving pulses.This becomes important later on as the probabilistic time-bin erasure step at the end of the entanglement generation protocol will affect the amplitude of the time-bins differently.This, as well as the general asymmetric loss in the setup, can be compensated by tuning the initial amplitudes.We discuss the exact form of α n below.
Next, the generated photonic qudit interacts with the qubits in Alice's register.The register qubits of Alice and Bob are all initialized in state |0⟩.Each time-bin pulse will interact with all register qubits through a cavitymediated CZ-gate [23,24].This interaction ensures reflection of the photon from the cavity-spin system with (without) a π phase shift if the spin is in an uncoupled (coupled) state to the cavity.
Suppose that the spin state is α |0⟩ + β |1⟩, where only state |1⟩ is coupled to an excited state via the cavity field.Reflecting a single photon in the first time-bin (|0⟩ ph ) will result in the transformation ). Ideally, r 0 = −1 and r 1 = 1, which corresponds to a perfect CZ-gate up to a global phase.
We can control whether the scattering of a photon will flip the state of a qubit through the application of Hadamard gates.This is done according to a binary encoding of the time-bin number.As an example, we consider the case of m = 3. Starting from the initial state 7 n=1 α n |n⟩ ph |000⟩, the procedure would be: FIG. 2. The main elements of the switch-free qudit-mediated entangling protocol.On the top, left, we show the qubitqudit entangling operation that Alice and Bob perform.The initial states of the qubits are |0⟩ and Hadamard gate(s) are applied to specific qubits at each time-bin to ensure the correct qudit-qubit interactions.On the top, right, we show the final measurement of the photon, which erases the time-bin information and heralds successful entanglement generation.Upon arrival at the symmetric beam splitter, the photon is either reflected and detected or transmitted and delayed by exactly one time-bin.To boost the probability of a successful time-bin erasure, a concatenated series of beamsplitters and delay loops can be used as illustrated at the bottom of the figure.
• At time-bin |1⟩ ph : 1. Apply Hadamard on the first qubit 2. Second time-bin pulse is reflected

Apply Hadamard on the first qubit
Resulting state: 1. Apply Hadamard on the second qubit 2. Third time-bin pulse is reflected

Apply Hadamard on the second qubit
Resulting state: 1. Apply Hadamards on the first two qubits 2. Fourth time-bin pulse is reflected

Apply Hadamards on the first two qubits
Resulting state: Repeating this process for all time-bins, Alice's register qubits will be entangled with the photonic qudit in the following way: after the scattering of the final (8th) time-bin up to a global phase.This can be extended straightforwardly to general m. Bob will perform the same procedure upon receiving the transmitted qudit from Alice.
After the scattering of the final time-bin at Bob's side, the total state of the qudit and Alice and Bob's register qubits will be: where [n] 2 is the inverse of the binary formation of i in digit size m.For example, when Next, we need to unentangle the qudit from the spin qubits by measuring the qudit in a manner that erases the time-bin information.By measuring the photon we also herald that the protocol was successful.
A single-loop, switch-free photon measurement approach is shown at the top, right half of Fig. 2. A symmetric beamsplitter will either transmit a time-bin pulse into a delay loop or reflect it to a single photon detector.The delay is tuned such that a delayed time-bin will interfere with the successive time-bin at the beamsplitter.
To see how this can erase the time-bin information, we consider an example with only two time-bins.In this case, a detection at a time corresponding to the second time-bin will erase the information about whether the photon was initially in the first or second time-bin.Note, however, that the process is probabilistic since a detection at the first time-bin determines that the photon was initially in the first time bin.
This can be extended to interfering all time-bins through careful tuning of the initial qudit amplitudes, as we will show later.However, since the photon erasure is probabilistic, we can also connect multiple photon loops to increase the measurement success probability, as shown in the bottom of Fig. 2. Nevertheless, the connected delay loops lead to several interference effects not present in the single-loop case: • Destructive interference.We find that due to destructive interference, certain detection times later than the 2 m 'th time-bin will not project into a superposition of 2 m spin states but only a subset of these.
• The tuning of α n depends on the specific detection time and number of loops.For the single loop, the tuning of the coefficients α n does not depend on the exact detection time as long as this is later than or at the 2 m 'th time bin.However, in the connected loops, this is no not the case.
• Phase correction problem.For the single loop, the phase due to the beam splitter transformation can always be corrected by single-qubit gates.For the connected loops, this is not always the case, depending on the specific detection time and the number of loops.
We will now go through these setups in more detail and also refer the reader to Appendix A 3 for additional information.For a setup with s ≥ 1 delay loops and a detection time of u ≥ 2 m (in units of the time-bin duration), we define: One has to choose s and u such that Y (s, u, n) have the same sign throughout all n, i.e., to ensure that we can find suitable coefficients α n such that the final qubit state following the photon detection is equivalent to m copies of the Bell state 2 up to single qubit gate corrections.The tuning of the coefficients is determined by In this way, after the successful photon detection, we have the state: where the extra phase i −2 n can be easily corrected by applying single qubit gates.The probability to detect the photon at time u is: It is important to note that, in the single loop case of s = 1, there are no interference effects and measuring every time-bin after time-bin 2 m − 1 leads to success.FIG. 3. The photon measurement success probability under for a single loop and concatenated loops.For the single loop, the success probability is the sum over all Psucc(s = 1, m, u ≥ 2 m ).For the connected loops, the success probability shown here is the maximum probability within the ranges of (s, u) shown above.The optimal (s, u) for each number of entangled pairs is marked on the plot.
Therefore, one can find that in this case, the measurement always succeeds when u ≥ 2 m , and the success probability for the single loop scenario should be the sum over all P succ (s = 1, m, u ≥ 2 m ).
To illustrate the increase in probability by connecting more loops, we have plotted the success probabilities of measurements under both single loops and interconnected loops in Fig. 3.In this plot, we demonstrate that connecting loops can substantially enhance the success probability, especially for a larger number of Bell pairs, despite the fact that in the single-loop cases, all instances where u ≥ 2 m can be considered as successful.

III. ERROR ANALYSIS AND ERROR CORRELATIONS
So far, we have not considered the effect of noise and general experimental imperfections.These will affect both the success probability of the protocol and the fidelity of the generated Bell pairs.To analyze this, we model the effect of the following possible imperfections on our protocol: 1) imperfections in the generation of the photonic qudit due to phase and amplitude fluctuations of the laser drive; 2) imperfect cavity scattering in the spin-photon CZ-gate; 3) single-qubit gate errors; 4) spin qubit decoherence; and 5) photon losses.
Photon loss is different from the other imperfections as we herald on the detection of a photon.In our analysis, we assume dark counts to be negligible and that the loss is accurately characterized such that we can compensate the effect on the fidelity of the generated entanglement by tuning the initial amplitudes of the photonic qudit (see Appendix A 3 for details).Photon loss will therefore only affect the success probability of the protocol.
The other imperfections will decrease the fidelity of the generated Bell pairs since they are not heralded.Moreover, they can lead to correlated errors, which means that some errors may be propagated to multiple generated Bell pairs.This can occur since all register qubits are entangled with one single photon and any imperfections of the photon and operations may lead to correlated errors.The details of our error modeling are presented in Appendix A. The decrease in the average fidelity of the generated Bell pairs is shown in Fig. 4 (a) for a specific range of error parameters.
To quantify the amount of error correlation between the Bell pairs, we use the following approach.Suppose the probabilities that a Pauli error happens on qubits a and b are ϵ a (≪ 1) and ϵ b (≪ 1), respectively, while the probability that a Pauli error happens on both qubits a and b is ϵ ab .If ϵ ab = ϵ a ϵ b , the errors on qubits a and b are independent and we call them "uncorrelated" throughout this paper, while if ϵ ab ̸ = ϵ a ϵ b holds, the errors are dependent and we refer to them as "correlated" errors.
In general, an independent error model is of the form where Λ denotes the corresponding Pauli error channel (I, X, Y, Z) on each register qubit (2m in total).In this case, multi-qubit errors happen with very low probability since ϵ ab ≪ ϵ a ,ϵ b .However, if ϵ ab ̸ = ϵ a ϵ b , the errors among the pairs are correlated.We quantify the amount of error correlations for the qudit-mediated entanglement generation in the following way.
Let ρ correlated be the output density matrix of the qubits after a successful entanglement generation of the qudit protocol for a specific choice of error parameters.The fidelity between this state and the perfect output state (collection of m Bell pairs) is denoted by F (ρ correlated ).Similarly, the fidelity between the perfect state and the output of the uncorrelated error channel in ( 9) is F (ρ uncorrelated ).We then let |F (ρ correlated ) − F (ρ uncorrelated )| ≤ ϵ for sufficiently low ϵ (we choose ϵ = 10 −4 in this work) quantify how large the error correlation is.Fig. 4 (b) shows how the amount of error correlations in the qudit protocol increases as the general errors increase.Furthermore, we see how the amount of correlation increases with the number of pairs.In the following two sections, we consider two strategies for mitigating the effect of the errors and obtain high-fidelity Bell pairs: entanglement purification and quantum error correction.

IV. PURIFICATION PERFORMANCE
Entanglement purification is a method that aims to produce one (or possibly more) high-fidelity entangled pair(s) from a collection of noisy pairs [9,10,25].It is a key element to reducing noise in first-generation quantum repeaters [26].
To search for optimal purification protocols, we use the evolutionary algorithm from Ref. [17], which enables m-to-one purification for any number of generated noisy Bell pairs m.The performance of the optimized purification circuits is shown in Fig. 5 (a) and (b).We see that the purification protocol successfully produces a higher fidelity entangled pair from the collection of noisy pairs.We also investigate how well this optimized purification protocol can mitigate the error correlations.For each error data point, we find the matching uncorrelated error channel following the approach outlined in Sec.III.We find the optimal purification protocol for the uncorrelated error channel and compare it with the performance of the optimized purification of the quditmediated entangled state.The result is shown in Fig. 5 (a).We see that for the purification of a few pairs, the purification of the qudit-mediated entanglement performs slightly worse.However, the performance difference decreases as the number of pairs increases since the purification circuit has more freedom to target the dominant error terms.Thus, it seems that optimizing the purifica- tion circuit allows to target the dominant errors regardless of whether they are correlated or not.Note that we assume perfect operations in the purification circuit in Fig. 5 (a) and (b) to focus on the ability to target the errors from the entanglement generation procedure.

V. TELEPORTATION-BASED QUANTUM ERROR CORRECTION
Teleportation-based quantum error correction is another method to correct for noisy connections in a quantum network, as exploited in so-called second generation quantum repeaters [11,12,26] and modular quantum computing [27].In the teleportation-based setting, Alice wishes to teleport an encoded message to Bob via multi-qubit quantum teleportation [28,29] requiring the simultaneous availability of multiple entangled pairs [18][19][20][21].
We consider two simple codes: the [[5,1,3]] and the [[4,2,2]] codes requiring 5 and 4 Bell pairs, respectively, for teleportation.The former is the smallest code that can perform quantum error correction [30], and the latter only detects the errors [31].The Bell pairs are generated with the qudit protocol, and we assume perfect operations in the encoding and decoding of the message to focus on the ability of the code to correct errors from the noisy Bell pairs.
The simulation results are shown in Fig. 6, where we compare the fidelity of the encoded transmission to the fidelity of teleporting unencoded qubits.We sample the qubit states (1-qubit teleportation for [ [5,1,3]] code and 2-qubit for [[4,2,2]]) to be teleported at random, and each data point denotes the average result over all sam-pled random cases.Notably, for [ [5,1,3]] code, there is a threshold above which the encoding performs worse than the unencoded transmission.This threshold is for errors ∼ 10 −3 .For [ [4,2,2]] code, however, teleporting the perfect code will always win if considering the transmitted message fidelity only.However, since the [[4,2,2]] code cannot correct the errors but only detect them, the transmitted message will fail if an error is detected, resulting in a non-deterministic transfer.
We also investigate the effect of correlated errors on the performance of the error correction, following the same approach as for entanglement purification.We see from Fig. 6 that the codes perform worse on the errorcorrelated states.In contrast to the purification circuit, these codes are also not designed for correlated errors, which might be a subject for further study.

VI. CONCLUSION
In this paper, we have proposed a novel implementation of qudit-mediated entanglement generation protocols that completely circumvents the use of optical switches.Notably, we show how probabilistic erasure of the photon time-bin information can be implemented with passive linear optics elements and how the success probability can be increased through the concatenation of beam splitters and delay loops.
In addition, we have simulated the amount of error correlation that the qudit protocol introduces between the simultaneously generated Bell pairs and its impact on key applications such as entanglement purification and quantum error correction.We found that significant error correlations are introduced, but through optimization of the purification circuit [17], the errors can still be efficiently targeted.For the two quantum error correcting codes, the [ [5,1,3]] and [[4,2,2]] codes that we considered for teleportation negatively impact the performance.
Given the significantly reduced memory requirements for the spin qubits [13], this protocol can be used to boost the performance of current quantum hardware for quantum networking.In particular, quantum repeaters, where the distillation of high-fidelity Bell pairs through entanglement purification is a key requisite, necessitate the availability of multiple Bell pairs at the same point in time.Importantly, we have shown that high-fidelity entanglement can indeed be distilled from the simultaneously generated Bell pairs in the qudit protocol, even in the presence of correlated errors.
At the beginning of the switch-free implementation, Alice should generate a photonic time-bin qudit with 2 m pulses.We consider a Raman scheme for photonic qudit generation, which has been experimentally realized in quantum dot [32] and silicon-vacancy diamond system [33].The setup is shown in Fig. 7 (a).We initialize the emitter in state |g 0 ⟩.At each time-bin, a laser pulse drives with a tunable probability the transition from |g 0 ⟩ to |g 1 ⟩ with the emission of a cavity photon.
Here, we illustrate an example.Suppose we would like to generate an 8-time-bin photonic qudit illustrated in Eqs.(1) (where m = 3): • At time-bin |0⟩ ph , the pulse P 0 drives |g 0 ⟩ to |g 1 ⟩ with the emission of |0⟩ ph resulting in the state: • At time-bin |1⟩ ph , the pulse P 1 drives again |g 0 ⟩ to |g 1 ⟩ with the emission of |1⟩ ph such that: • At time-bin |2⟩ ph , the pulse P 2 drives |g 0 ⟩ to |g 1 ⟩ with the emission of |2⟩ ph such that: Continuing the procedures until the final time-bin |7⟩ ph , we will have removed all the amplitude of the |g 0 ⟩ state such that the emitter is in state |g 1 ⟩ and the photonic state is: where This procedure can readily be extented to any qudit dimension.
Note that at each time-bin, different laser driving strengths should be applied to generate each time-bin pulse, as shown in Fig. 7 (b).For example, as shown for the 8-time-bin case in figure 7: . For a general 2 mtime-bin case, we have: and Imperfect cavity coupling will predominantly lead to loss of the photon or dephasing of the qudit state through spontaneous decay from the excited state |e 1 ⟩ followed by re-emission.The first can be absorbed in the general transmission probability of the photon in the scheme.In addition, phase and amplitude fluctuations of the laser drive can also lead to dephasing and modulation of the amplitudes of the desired qudit state in addition to dephasing of the spin states.
All the errors considered above lead to dephasing and modulation of the amplitudes of the desired qudit state.We choose a simplified model where we model these imperfactions as random Gaussian fluctuations applied to the laser drive since this will lead to the same effect.The output qudit state is thus modelled as: For simplicity, we consider θ n ∼ N (0, σ 2 ) and ζ n ∼ N (0, ).This is to make sure that the total amplitude error gives:

Cavity Scattering
In the main text, we discussed that after scattering of a photon, the qubit state α |0⟩ + β |1⟩ will become αr 0 |0⟩ + βr 1 |1⟩, and ideally, r 0 ≈ −1 and r 1 ≈ 1, which forms a perfect control-Z gate.In the non-ideal case, however, one may consider the four-level cavity system with two ground states |0⟩, |1⟩ and their excited states |e 0 ⟩, |e 1 ⟩ shown in Fig. 8 [13,[34][35][36], as this is a good model for realistic hardware such as quantum dots and group IV diamond vacancy systems.
Here, we briefly introduce the model used in this work.One may refer to Ref. [13] for more details.We denote ĉ the annihilation operator of the cavity field and ∆ 0 (∆ 1 ) is the detuning between the transitions |0⟩ ↔ |e 0 ⟩ (|1⟩ ↔ |e 1 ⟩) and the cavity mode.The coupling rate of the two transitions is g 0 and g 1 , respectively.The Hamiltonian H of the system is: Considering the spin-photon interaction in the weakdriving regime, one can derive the reflection coefficients r 0 (r 1 ) for the state |0⟩ (|1⟩): where K in is the decay rate of the cavity field into the collected mode and K loss is the cavity loss rate.Thus, the total cavity decay rate is K = K in + K loss .We also define the cooperativities C 0 and C 1 as: For example, if the atomic qubit state is in a perfect |+⟩ = 1 √ 2 (|0⟩ + |1⟩), after the cavity scattering, we get the following state (normalization omitted): Therefore, in the ideal cases, this interaction will form a control-Z gate applying to the atomic qubit in the cavity.

Photon Measurement a. Single Delay Loop
We first calculate the case where there is one delay loop in the time-bin erasure.The right-hand side of Fig. 2 (b) shows an overview of this setup.We write the state (3) as follows Here, index n denotes the time-bin and We denote i as the imaginary unit.As shown in Fig. 2, the indices 0, 1, 2, and 3 denote the operator positions at the four ports of the symmetric beamsplitter τ : Therefore, for the four ports of the symmetric beamsplitter τ , we have: Here j denotes the time-bin.The delay line between â † 3,j and â † 0,j+1 moves a pulse in time-bin j to time-bin j +1.Ideally, this achieves â † 3,j → â † 0,j+1 .However, there can be an additional probability of losing photons in the delay loop which will affect the amplitude of the pulses.We model this with a beam splitter with the following transfer matrix τ η .
where η is the probability to the lose a photon in the delay loop.Taking into account the lossy beam splitter we find the following recurrence relations: For the operator going to the detector (denoted as â † 2 in Fig. 2 (b)), we keep calculating the initial input operator â † 1,j denoted by â † 2 in different time-bin n.Then we have: Since â † 1,j is carrying the qubit state S j , one can calculate the final state as: where we denote x = 2 m .Obviously, only when the detector clicks at or after time-bin x, the final qubit states can be written in a nicely formed summation without information loss.In order to get the compensation α n , we first define: and it must satisfy the following relation: Therefore, we have: In this way, we can successfully compensate the losses.The extra phases can be corrected by applying phase gates on Bob's qubits.Therefore, we finally achieve m copies of the Bell state Note that this photon erasure approach is probabilistic instead of deterministic, unlike the one introduced in [13].
According to A20, the success probability P succ for the switch-free implementation is: (A24)

(A28)
One can continue the calculations and get the general formula for any s ∈ Z + : Now, we perform the actions on the state, i.e., the final state, after the detector clicks.According to the state before photon measurement in A13, we can calculate the resulting state for each clicking moment.Similar to the single loop scenario, we obtain the final state: where we define: Note that the index k is upper bounded by min[s, u − n] since practically, we do not have an infinitely large number of loops s.Thus, some of the terms in (A29) may be truncated.Still, we have the terms in a nicely-formed summation until the clicking time-bin is at or after |x⟩ ph .However, it does not guarantee that we have good states.
In order to make the state without information loss and phase correctable (i.e., the terms before each S n are nonzero and have the same sign), we must choose a suitable integer set (s, u) such that Y (s, u, n) has the same sign throughout all n, i.e., In this way, we can compensate the amplitude of the photonic pulses, which should satisfy: Therefore, according to the equation above and the normalization condition we can obtain the amplitude compensation term: In this way, when the detector clicks at time-bin u, we can acquire the state (7) and transform it to m copies of the Bell state by applying phase correction single-qubit gates.According to (A30), when we fix the number of connected loops s and the clicking time-bin u, the corresponding photon erasure success probability (regardless of qubit-qudit entanglement local losses and transmission loss) is: Note that in this case, since α n depends on u and s and we need to generate the pulses according to α n at the very beginning of the protocol, we need to choose only one clicking time-bin as the success flag.Therefore, one needs to find the best (s, u) set that outputs the maximum P succ (s, u, m).
Additionally, the above calculations for the concatenated loops also fit the case for the single loop where s = 1.The only change to make is that one needs to sum over all the success probabilities P succ for the clicking time u ⩾ x as the erasure success probability for the single loop, i.e., Generally, the loss of the photon can happen during the local qubit-qudit interaction, the transmission between Alice and Bob, and the delay loop of the photon erasure.
The fidelity of the resulting state will not be affected by the previous two losses since the photon is subject to the same amount of losses regardless of which time-bin it is in.Therefore, they do not contribute any correlated errors but will only lower the success probability of the protocol.The local losses increases with the number of entangled pairs such that the total loss probability from the qudit-qubit interactions is (1 − η AB ) m , where η AB is the loss per interaction.The transmission probability between Alice and Bob is denoted as 1−η 0 and we assume fiber loss at telecom frequencies.
For the third kind of photon losses -the losses in the delay loops of the photon erasure, they lower the success probability but they also affect the fidelity of the generated pairs since each qudit pulse may also experience a different number of delay loops.Nevertheless, we can choose the compensation coefficients α n in Eqs.A34, which will vary with the loss on each delay loop η as well.As a result, the success probability for photon measurement will change correspondingly.The overall success probability P total is: where P succ is defined in (A36) for s = 1 and (A35) for s ≥ 2. Now, we can input some moderate loss parameters for η, η AB and η 0 to discuss the P total .
Firstly, we assume the photon wavelength is in the range of 600 ∼ 800nm corresponding to typical optical transitions of realevant quantum hardware such as group-IV diamond defect centers.For the transmission betweeen Alice and Bob, the photon will have to be frequency converted to the telecom band for efficient transmission in low loss optical fibers before being converted back to 600 ∼ 800nm for interaction with Bob's qubits.We assume that after interaction with Bob's qubits, the wavelength is kept at 600 ∼ 800nm for the erasure measurement.Assuming fiber delay lines, the loss is 5 ∼ 10dB/km [37] for this wavelength range.
Assuming that the time-bin duration is approximately 70ns [24,33] and the transmission velocity of the photon in the fiber is 2 × 10 5 km/s, we find that the dB loss on each delay loop is around 0.07 ∼ 0.14dB and the corresponding loss percentage is η = 0.0160 ∼ 0.0317.FIG. 9.The total success probability of the photon erasure with respect to the number of generated pairs (m = 2 ∼ 5) is shown.We consider both the single loop and the connected loops cases.We define the possible parameter ranges for the losses, s and u, and then find the maximum P total .The applied (s, u)-s are marked on the plot.Connecting photon loops increases the total measurement success probability compared with the case where only one single photon loop is placed.Note that for single photon loop, the success probability refers to (A36).The cases where no loss occurs are also plotted for the comparisons.
Assuming frequency conversion to the telecom band for the transmission between Alice and Bob the transmission loss will be 0.15 ∼ 0.25dB/km [38] and resulting in a transmission of η 0 = 0.499 ∼ 0.684 for 20km separation.We also assume η AB = 0.05 ∼ 0.10 for a general approximation of the local losses.
With these parameters and according to P total , one can find the total photon measurement success probability as shown in Fig. 9.We can find that P total will, of course, drop when the number of generated pairs increases.Moreover, for the single photon loop, the P total drops drastically, which will make the measurement vulnerable to the detector's dark count rate (around 10 −7 ∼ 10 −6 ).However, with photon loops connected, the drop of the P total can be slightly mitigated, making the measurement more resistant to the dark count.

Quantum Memory
Qubits are vulnerable to decoherence.To simulate qubit decoherence during transmission, we employ a dephasing and generalized amplitude damping channel.Suppose the distance between Alice and Bob is L the speed of photon transmission between them is represented by c.In this scenario, Alice must send the photon to Bob and wait for the heralding information to return.Additionally, we define the success of the protocol based on Alice receiving Bob's heralding message.Therefore, the waiting time t for Alice is: and for Bob: Suppose the dephasing time is T p , then the Kraus operators of the dephasing channel are: where I and Z denote the Identity and Pauli-Z matrix respectively.Also, by indicating the relaxation time T 1 , the Kraus operators of the amplitude damping channel are: where: and ∆E, k B and T denote the energy difference between |0⟩ and |1⟩, Boltzmann constant and system temperature, respectively.Therefore, by applying the two kinds of Kraus operators, the output density matrix ρ becomes: We set L = 20km, T 1 = 10ms, T p = 5ms and a β = 0.5.Note that this is the case for only one qubit.For a multi-qubit system, since the decoherence channels on each qubit are uncorrelated, we can apply Eqs.(A43) on each qubit independently.
Notably, despite the errors mentioned above, qubit gate errors should also be considered, especially for the latter one -since we put a lot of Hadamard operations inside.

Appendix B: Genetic Purification Protocol
In this appendix section, we show the basic idea of the optimized purification protocol proposed by [17].

Error Detection by Measurement
Consider the noises on the entangled pairs are described as depolarizing errors: Similar to the conventional depolarizing channel, we input I (no errors), X, Y , or Z errors into the perfect state with the corresponding possibilities.For the Bell pair case, the desired perfect state is |Φ + ⟩ and the other three erroneous states are: Note that in the output states, there may also exist some coherent errors (e.g., |Φ + ⟩ ⟨Ψ − |).These errors can be eliminated by using the twirling error mitigation technique [39].However, for the discussions in our work, we will not add the twirling process but implement the purification only.
If Alice and Bob then measure their own register qubits separately, they will know if their previous shared entangled pair has errors or not.There are three possible measurement blocks that Alice and Bob can choose: • Measurement in Z basis, and there are two possible measurement results from Alice and Bob: Note that the measurement on one certain basis can only detect two kinds of errors.For example, by applying X-basis measurement, only Y and Z can be detected.Also, one should always preserve |Φ + ⟩ and cannot consider it as one of the erroneous states.Therefore, if Alice and Bob want to know whether their previous shared ρ AB is possibly in |Φ + ⟩, their measurement results and measurement basis should obey the criteria as follows: • Measurement in X basis: Coincidence result → |Ψ − ⟩ and |Φ − ⟩ detectable.
If the measurement result of Alice and Bob violates the criteria above, Alice and Bob will know that their previous shared pair ρ AB is in one of the erroneous states.

Error Propagation
By directly measuring the entangled pair, we are indeed able to detect the errors inside the Bell pair, but in the meantime, also destroy the entanglement.In order to make errors detectable without entanglement demolition, one should introduce another sacrificial entangled pair.Alice and Bob can then apply CNOTs locally to connect the preserved and sacrificial pair and propagate the errors in the preserved pair to the sacrificial pair as shown in Fig. 10 (a).The final measurement check will be applied to the sacrificial pairs to detect and eliminate errors.
Consider the simplest purification protocol, the Bennett protocol [9].Suppose both two pairs are modeled as the depolarizing channel as shown in Eqs.(B1), and the error map is shown in Fig. 10 (b).The CNOT will change the error map according to the error propagation in Fig. 10 (a).The final Z-basis measurement will eliminate the blocks with X and Y errors on the sacrificial pair.

Error Permutation
The error propagation indeed provides the approach to send the larger errors to the sacrificial pair and eliminate them by measurements.However, the freedom of controlling the error flow is still limited.
The error permutation is a technique that permutes the error coefficients by letting Alice and Bob apply corresponding operations locally.The coefficient permutation and the corresponding single-qubit gate operations on Alice and Bob are shown in Fig. 11.For example, if Alice and Bob apply nothing, the density matrix will remain the same as Eqs.(B1).However, if Alice and Bob  which applies the exchange between x 0 and z 0 .Suppose z 0 is much larger than x 0 and z 0 and we still keep the Z-basis measurement.In Eqs.(B1), we can only eliminate |Ψ + ⟩ and |Ψ − ⟩ affiliated with x 0 and y 0 .However, if we apply the permutation shown above, still, |Ψ + ⟩ and |Ψ − ⟩ will be eliminated but they are affiliated with z 0 and y 0 .In this way, we flow the erroneous states with the largest coefficient into the error detection part without changing the measurement basis.

Evolutionary Algorithm
We have different measurement blocks, error propagation, and permutation techniques already.Now, we should assemble these components to find the optimal purification circuit.The evolutionary algorithm is adopted to search for an optimized purification protocol.The procedure is shown as follows: • Completely randomize the initial circuit group by stochastically assembling the CNOTs, permutation gates, and measurement blocks.• Input the Bell pair state with the specific error model in the purification circuits, and output the fidelity of the purified Bell pair for all purification circuits.Select the best purification circuits (more than one).• Consider that the selected circuits are the parent circuits, and the operations on the circuits are their genes.Let the parent circuits reproduce baby circuits by randomly mixing the genes from their parents.• The selected circuits and the baby circuits form the new circuit group.• Since no new genes (operations) are involved, the mutations should be introduced, which is, some of the operations are mutated to another random different operation with relatively low probabilities among all circuits in the newly-formed group.• Output the purified fidelity in the circuits from the mutated group.• Loop it back to the parent circuit selection step and continue the loop hundreds of times until the maximum purified fidelity reaches convergence.
• The purification circuit with the converged fidelity will be the optimized purification circuit for the specific error model.
Note that all the purified circuits and the following output results are under the condition of the minimum en-tanglement requirement.The minimum entanglement requirement means using the minimum number of CNOTs to connect all shared Bell pairs without leaving one pair unoperated.One can indeed set the purified circuits to a larger size and run the algorithm, but with more local two-qubit gate consumptions.

FIG. 4 .
FIG. 4. (a) Raw fidelity of the generated Bell pairs using the switch-free qudit protocol.(b) Error correlations under the specified error environment.One can notice that in (a) and (b), the raw fidelity will decrease and the error correlations will grow when increasing errors and the number of generated pairs.

FIG. 6 .
FIG.6.The performance of teleportation-based [[5,1,3]] and[[4,2,2]] code under the switch-free implementation.The x and y axes refer to the Bell pair infidelity and the transmitted message infidelity, respectively.The blue dots denote the data points with direct message teleportation i.e. without encoding and using a single Bell pair.The orange and green dots denote the data with the correction code, teleported by multiple Bell pairs with correlated (real) and uncorrelated error models, respectively.The rightmost plot for each simulating code indicates the data with lower correlated errors.The inset plot depicts the failure probability of the[[4,2,2]] code, indicating the likelihood of detecting errors.We assume perfect encoding and decoding operations.

FIG. 7 .
FIG. 7. (a) Schematic of the photonic qudit.The laser pulses drives a cavity-asssited Raman transition from the initial state |g0⟩ to |g1⟩ with the emission of a photon.(b) Example of how varying the amplitude of the laser pulses affect the amplitude of the resulting qudit state.