{'fraction_non_alphanumeric': 0.023340068278408694, 'fraction_numerical': 0.009823730230613809, 'mean_word_length': 4.7646586345381525, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Coping with qubit leakage in topological codes

Many physical systems considered promising qubit candidates are not, in fact, two-level systems. Such systems can leak out of the preferred computational states, leading to errors on any qubits that interact with leaked qubits. Without specific methods of dealing with leakage, long-lived leakage can lead to time-correlated errors. We study the impact of such time-correlated errors on topological quantum error correction codes, which are considered highly practical codes, using the repetition code as a representative case study. We show that, under physically reasonable assumptions, a threshold error rate still exists, however performance is significantly degraded. We then describe simple additional quantum circuitry that, when included in the error detection cycle, restores performance to acceptable levels.

Many physical systems considered promising qubit candidates are not, in fact, two-level systems. Such systems can leak out of the preferred computational states, leading to errors on any qubits that interact with leaked qubits. Without specific methods of dealing with leakage, long-lived leakage can lead to time-correlated errors. We study the impact of such time-correlated errors on topological quantum error correction codes, which are considered highly practical codes, using the repetition code as a representative case study. We show that, under physically reasonable assumptions, a threshold error rate still exists, however performance is significantly degraded. We then describe simple additional quantum circuitry that, when included in the error detection cycle, restores performance to acceptable levels.
The threshold theorem of quantum computation states that a finite quantum gate error rate exists below which arbitrarily reliable quantum computation can be performed with only polylogarithmic overhead. The theoretical viability of quantum computation rests on this theorem [1][2][3]. Many different assumptions can be made, and different versions of the theorem proved, however typically it is assumed that qubits do not leak to noncomputational states. Leakage has only been formally considered [4] in a threshold theorem for concatenated quantum error correction (QEC) codes [5][6][7][8][9].
The discussion is organized as follows. In Section I, we show how the repetition code can be viewed as a special case of the surface code [20], and present baseline repetition code simulations without leakage. In Section II, we describe our stochastic model of leakage, and present and discuss repetition code simulations with leakage. In Section III, we describe a simple circuit removing leakage, and present and discuss simulations with this circuitry included. Section IV concludes. Fig. 1 shows a standard surface code. The 2-D structure of the surface code enables it to suppress both logical X and logical Z errors, however for most purposes it is sufficient to study the suppression of only logical X or logical Z errors due to the symmetry of the code. When studying the generic properties of a single type of logical error, it is sufficient to consider just a single vertical strip of qubits as additional width just introduces additional logical error pathways, but does not fundamentally change the need for a significant number of errors effecting at least half of a line of qubits from top boundary to bottom boundary. In this work, we shall therefore focus on the repetition code, which is precisely a code with ZZ stabilizer generators on neighboring pairs of qubits in a line. This will enable us to focus the discussion on the unique properties of leakage, without unnecessarily getting bogged down in the details of the surface code. Fig. 2 shows the quantum circuit required to perform repetition code error detection. In the absence of errors, each measurement reports 0 if the neighboring data qubits are in the +1 eigenstate of ZZ and 1 if they are in the -1 eigenstate. Referring to Fig. 2, a location 1 error will lead to the top measurement differing from its previous value. This change is called a detection event [35]. A location 2 error will lead to two simultaneous detection arXiv:1308.6642v1 [quant-ph] 30 Aug 2013

I. THE REPETITION CODE
A single round of repetition code error detection. Circuit is for a distance three code, corresponding to three data qubits (the three horizontal lines). The code distance can be increased by repeating the vertical pattern, adding additional data qubits. Rounds of error detection repeat indefinitely. events. A location 3 error will lead to a single detection event associated with the lower measurement qubit. Location 4 errors are more complex, with an immediate detection event associated with the top measurement qubit but the detection event associated with the lower measurement qubit not occurring until the next round of error detection. An erroneous measurement, location 5, will lead to two sequential measurement value changes, namely 010 or 101, meaning a pair of sequential detection events. All possible errors fall into one of these five geometric classes.
Each geometric class of potential error can be represented as a line connecting a pair of dots at the spacetime locations of potential detection events as shown in Fig. 3a. Each line is given a weight proportional to −ln p, where p is the total probability of all errors leading to detection events at the endpoints of that line. This means that all line weights are strictly positive, and low probability lines are associated with high weights. Fig. 3b shows a possible sequence of measurement values and the associated inferred pattern of detection events. Given dots, lines, and detection events, the minimum weight perfect matching algorithm [36][37][38][39] can be used to find a set of paths of lines that connects all detection events in pairs or individually with a boundary such that the total weight of all lines in the set is minimal. This corresponds to a high probability pattern of errors leading to the observed detection events. Fig. 3c shows a minimum weight perfect matching of Fig. 3b. The two class 5 matched lines result in a classical bit-flip each. The class 4 matched line results in the belief that an X error must now be present on the central data qubit. If all data qubits were now measured and the measurement string 010 returned, our belief that an X error is present on the central qubit would mean that we interpret this string as 000. If we had initially prepared our data qubits in 000, this would imply successful storage. Specific sequence of measurement results leading to specific detection events (filled circles). c.) Minimum weight perfect matching of the detection events and correction of two classical measurement results and insertion of a Pauli frame X operator.
In simulations, we can perform many rounds of error detection and regularly check whether logical errors have occurred, thus calculating the probability of logical error per round of error detection. In this work we assume all gates, namely initialization, measurement, identity, Hadamard, and CZ, have equal depolarizing error rate p. Our open source simulation software Autotune [35] can also handle arbitrary asymmetric Pauli error models for each gate. Fig. 4 shows the probability of logical X error p L as a function of p for a range of code distances d. The code distance d of a repetition code is simply the number of data qubits used. In theory, a distance d code should only fail if at least d/2 errors occur. This can be observed with the low p asymptotic forms of the d = 3, 5, 7, 9 curves being quadratic, cubic, quartic, and quintic, respectively.

II. SIMULATING LEAKAGE
The simulations of the previous section included only the qubit error states I, X, Y , Z. We now wish to extend our simulations to include leakage L. We shall model leakage as only potentially occurring after Hadamard and CZ as in many quantum technologies initialization, measurement, and identity do not have the potential to cause leakage. It would be straightforward to associate leakage with other gates, if deemed appropriate. We shall set the probability of leakage per Hadamard and CZ to be 0.1p, which we consider a high probability of leakage. The two qubits involved in a CZ gate shall each have independent probability 0.1p of leakage.
After a qubit leaks, further errors X, Y , Z, L will be modeled as leaving the qubit in L. We model the decay of leaked states back to computational states with a fixed 1% probability per identity, Hadamard, and CZ gate of decaying from L to a randomly chosen I, X, Y , Z error state. Measurement of a qubit in L shall give a random classical result with no indication that leakage had occurred.
When CZ occurs between a qubit in L and a qubit not in L, the latter will be scrambled to a randomly chosen I, X, Y , Z error state. This severe model of leakage can be made more severe by decreasing the decay probability, making leakage longer lived. Note that it is important that leakage errors do not propagate to other qubits as this would lead to a catastrophic cascade of leakage errors ending only when all qubits in the computer had leaked.  It is immediately apparent from Fig. 5 that leakage has severely degraded the performance of the repetition code. The reason for this is simple -a single leakage event has the potential to cause a logical error. Consider leakage of the central data qubit in Fig. 2. Each time the neighboring measurement qubits interact with this data qubit, they will be randomized, leading to random measurement values. Suppose after a period of time the leaked data qubit decays to an error state X. Fig. 6 shows how randomized measurement values can lead to a logical error in a distance 3 code from a single leakage event. Note critically that this pattern of detection events could just have easily have been generated by two data qubit errors, and there is no way to distinguish between these two cases with the available information.
Similar random patterns of measurement values can lead to logical errors in higher distance codes, however longer and longer chains of specific measurement values are required and these chains become increasingly unlikely, resulting in logical error suppression with increasing code distance, preserving the existence of a threshold error rate. The specific pattern of random measurements shown in Fig. 6 could be made correctable by inserting some longer range lines, enabling the detection events to be matched with low weight, however this would lead to a logical error if these two detection events were in fact generated by two data qubit errors. Furthermore, no matter how the matching problem is restructured, there will always be random patterns of measurements arising from single leakage events that lead to logical failure, resulting in poor performance unless specific hardware steps are taken to regularly remove leakage from the system.

III. SUPPRESSING LEAKAGE
Given leakage of the form described in the previous Section, the simple circuitry shown in Fig. 7 can be used to convert leakage errors L into standard Pauli errors I, X, Y , Z which can then be handled with regular error correction. In a distance 3 code, which typically has three data qubits q 1 q 3 q 5 and two measurement qubits q 2 q 4 , we can add an additional qubit q 6 and after the standard error detection circuit of Fig. 2 teleport each data qubit to the qubit below, removing leakage errors. The next round of error detection proceeds with data qubits q 2 q 4 q 6 and measurement qubits q 3 q 5 followed by data qubit teleportation to the qubit above, after which the entire cycle repeats.
The performance of this alternating error detection and teleportation cycle is shown in Fig. 8. It can be seen that while a high power of p suppression of logical error is observed for high distances, a significant improvement on Fig. 5, the suppression is only linear at distance 3 and quadratic at distance 5. This is due to leakage errors on measurement qubits, which can corrupt both neighboring data qubits, creating a two-qubit error chain out of a single leakage error. This means that the logical error rate will be proportional to d/4 at low p, not proportional  to d/2 as was observed in Fig. 4 without loss.

IV. CONCLUSION
Long-lived leakage is highly detrimental to the performance of topological codes, making logical error rates linear in p at arbitrary code distances, however this does not prevent the arbitrary suppression of logical error as even a very long-lived leakage event is still a local error in time and hence correctable using topological techniques. It is highly advisable to use hardware techniques to periodically remove leakage from the system rather than rely on the weak natural suppression of leakage errors inherent in a topological code as even very low probability leakage, if long-lived, will lead to logical errors with high probability unless an excessive number of qubits are used.
The teleportation circuit of Fig. 7, used once per data qubit per error detection cycle, improves logical error suppression to O(p d/4 ). One could in principle insert a teleportation step in the middle of the stabilizer measurement procedure to remove spatially correlated errors arising from leakage, however it is possible, and desirable, that a deeper understanding of the physical leakage process in specific systems could lead to better and simpler techniques restoring the theoretical maximum O(p d/2 ) suppression. We shall search for such techniques for superconducting qubits in future work.

V. ACKNOWLEDGEMENTS
This research was funded by the US Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA), through the US Army Research Office grant No. W911NF-10-1-0334. Supported in part by the Australian Research Council Centre of Excellence for Quantum Computation and Communication Technology (project number CE110001027) and the US National Security Agency and the US Army Research Office under contract number W911NF-13-1-0024. All statements of fact, opinion or conclusions contained herein are those of the authors and should not be construed as representing the official views or policies of IARPA, the ODNI, or the US Government.