An integrity measure to benchmark quantum error correcting memories

Rapidly developing experiments across multiple platforms now aim to realise small quantum codes, and so demonstrate a memory within which a logical qubit can be protected from noise. There is a need to benchmark the achievements in these diverse systems, and to compare the inherent power of the codes they rely upon. We describe a recently introduced performance measure called integrity, which relates to the probability that an ideal agent will successfully ‘guess’ the state of a logical qubit after a period of storage in the memory. Integrity is straightforward to evaluate experimentally without state tomography and it can be related to various established metrics such as the logical fidelity and the pseudo-threshold. We offer a set of experimental milestones that are steps towards demonstrating unconditionally superior encoded memories. Using intensive numerical simulations we compare memories based on the five-qubit code, the seven-qubit Steane code, and a nine-qubit code which is the smallest instance of a surface code; we assess both the simple and fault-tolerant implementations of each. While the ‘best’ code upon which to base a memory does vary according to the nature and severity of the noise, nevertheless certain trends emerge.


I. INTRODUCTION
Large scale quantum algorithms are expected to require hardware that is fault tolerant: small imperfections in the behaviour of physical qubits (whether they are superconducting loops, crystal defects or trapped ions) must be identified and corrected, so that there is no error on the logical level.Recently there has been rapid progress in the implementation of quantum codes, across platforms as diverse as ion traps [1][2][3], superconducting qubits [4][5][6][7], and crystal defect systems [8].
A comprehensively successful quantum code will have been achieved when one can demonstrate a full set of quantum operations on encoded qubits with a fidelity that exceeds that of the best possible unencoded physical qubits [9].However this criterion is very challenging to achieve; it means 'beating' the superb fidelities exceeding 99.9% that can now be achieved with single physical qubits [10][11][12].Even the task of achieving a superior coherence time with a memory based on an encoded qubit, versus a single physical qubit, is not trivial.Individually controlled physical qubits can persist for the order of a minute when not actively manipulated [12], or 10 minutes using dynamical decoupling [13].
It is therefore interesting to find a measure for the efficacy of memories based on small quantum codes, using which we can identify reasonable milestones for nearfuture experimental realisations.Equally importantly we wish to be able to fairly compare memories based on platforms that might have very different inherent timescales.A number of measures of performance might be considered, including the diamond norm, the fidelity in the logical basis, surpassing the pseudo-threshold, and so forth.
Here we show that these measures can be related to a measure called the integrity of the logical qubit, which was recently introduced for assessing the performance of a memory based on the seven-qubit 2D color code (which is also the Steane code) in the context of ion trap quantum computing [14].
Here we will motivate the notion of integrity through its intuitive meaning as "the probability that Bob, receiving a logical qubit from the memory system, can infer its state".We show that in simple cases integrity also corresponds to "the fidelity of a logical qubit after storage in the memory", but that the former meaning based on state inference remains meaningful even when the latter notion of a memory's fidelity becomes ill defined.We offer a set of four milestones based on comparing the integrity of an encoded and actively corrected quantum memory versus either un-corrected variant or with a single physical qubit.The milestones are increasingly challenging with the fourth being a demonstration of 'Strictly superior encoded memory' .We report the results of a wide-ranging set of numerically intensive simulations, where we assess and compare several memories based on the five-qubit code, the seven-qubit Steane code, and the nine-qubit small surface code.We estimate the performance levels required in the error correcting process (performed by an agent we label 'Igor') so that our milestones can be met.We establish that the task of evaluating the integrity of a memory is experimentally feasible when all the phases of the protocol (encoding, memory storage and decoding) are realised by the same imperfect hardware.
We conclude by discussing generalisations: it is straightforward and natural to extend the concept of integrity to encompass systems where a computation takes place.A further study of the properties of integrity appears in a partner paper to the present one [15].

II. INTRODUCTING INTEGRITY
One can think of any memory as a channel for communicating information from the present (t = 0) to a specified future time (t = τ ).The simplest notion of an ideal memory would be one where no change whatsoever happens to the stored information.Presently we will wish to generalise from this simple notion, but it is arXiv:1707.09951v1[quant-ph] 31 Jul 2017 useful to begin by asking how we would benchmark performance against this basic standard: We could compare the state at t = 0 with the state at t = τ , using either the fidelity or the trace distance.Let us briefly review these two quantities.
There are two definitions of fidelity commonly used in the literature; one is the square of the other.Here we use the squared quantity, formally defining fidelity as This definition uses the trace norm, itself defined as and this is also the sum of the singular values of σ.
In the case that ρ 0 is a pure state |ψ 0 ψ 0 |, the fidelity then has a simple physical interpretation: if we measure state ρ 1 in a basis where one of the possible outcomes is |ψ 0 , the fidelity is precisely the probability of this outcome.When both states are pure, we have simply While the fidelity measures the similarity of two states, the trace distance measures the degree to which two states differ.It is defined as Ranging from 0 to 1, the trace distance has a remarkably clear intuitive meaning: it tells us the probability that two states ρ 0 and ρ 1 could be told apart by an ideal experimentalist.Suppose that we present to an experimentalist, Bob, a theoretical description of both ρ 0 and ρ 1 , and we also prepare a physical system in one of these two states (with a 50/50 prior probability) and present this to the Bob.He must guess whether the physical state is ρ 0 or ρ 1 .Using his optimal strategy, his probability p g of guessing correctly is simply We will make extensive use of this idea presently.The functions D(ρ 0 , ρ 1 ) and 1 − F(ρ 0 , ρ 1 ) can both be regarded as measures of how distinct two states are.However it is important to note that these quantities are fundamentally different, and can give very different 'scores' in experimentally relevant cases.We opt to employ the trace distance, for various reasons described later but most particularly because Eqn. (4) leads to straightforward experimental realisations.
Our simple notion of an ideal memory -one permitting no change -is rather unsatisfactory.Certain changes are in fact harmless and do not practically reduce the quality of a memory.Any deterministic, known and anticipated change to the stored information is harmless if we can easily compensate: an example is the continuous phase evolution which occurs within any physical qubit if the states |0 and |1 are non-degenerate eigenstates.For the present case of a memory that employs a quantum code to protect logical qubit(s) we can go further: Any correctable error is also relatively harmless in the sense that a ideal agent can recover the logical qubit with certainty.We would like our measure of the quality of a memory to incorporate these principles; additionally, we have a notion of a 'useless' memory, one that should score zero, as a memory that fails to preserve any recoverable information whatsoever.
Suppose that some qubit with density matrix ρ is to be stored in a code-based memory channel for a specified period of time.We will use the symbol Φ to denote the memory channel itself.The initial state ρ maps to the final state ρ through this process: • Setup: At t = 0 Alice (taken to be perfect) encodes the single qubit ρ into an n-qubit logical code: where E is the encoding map.
• The memory channel: Evolution and degradation of the logical qubit occurs while it is stored.This may include the effects of actively applied error correction cycles (involving a non-ideal agent, whom we label 'Igor' and discuss presently).We have ρ n = N(ρ n ) where N is the noise map.
• Conclusion: At t = τ , Bob (taken to be perfect) performs an error correction cycle, and then reverses Alice's encoding process to obtain a single physical qubit: ρ = D(ρ n ) where D is the decoding map.
It is the second step that we are interested in; steps one and three (Alice and Bob) merely frame the process.We can write the entire channel as Φ = D • N • E, thus incorporating Alice's encoding E, the noise N, and Bob's decoding D. This overall map Φ takes as input a single qubit state (Alice's initial choice ρ) and ultimately returns another single qubit state ρ = Φ(ρ), i.e.Bob's single qubit after decoding.
For an initial concept of an ideal memory as one causing no change at all, we would desire Φ(ρ) = ρ, and so (for example) 1 − D(ρ, Φ(ρ)) could suffice as a good metric for the performance of our memory.However we have noted that a much broader notion of 'ideal' is needed, for instance to accommodate systemic phase evolution.Fortunately, there is a natural way to proceed: instead of focusing on the changes suffered by a single logical qubit between t = 0 and t = τ , we can instead focus on the idea that a memory should preserve the distinguishability of different states.This notion can incorporate both fixed, known evolutions and random-but-correctable errors.Conversely it will properly recognise that all forms of memory which leave us with no recoverable information, are equally and entirely useless.
Consider two pure states ψ = |ψ ψ| and ψ ⊥ = |ψ ⊥ ψ ⊥ | which are orthogonal to one another.Orthogonal states have trace distance of unity, since they can certainly be told apart.Let Alice choose ψ at random, uniformly from all possible single-qubit states, and then opt to encode either ψ or instead the antipodal state ψ ⊥ .Then Φ(ψ) or Φ(ψ ⊥ ) will describe the state after it has passed through the memory channel and been decoded by Bob.If the channel has caused the same fixed evolution to occur to each (logical) state, or indeed if it has introduced errors but they are correctable, then these states will still be completely distinguishable -they will still have trace distance equal to unity.Therefore we define the integrity of the memory as Note that we take the minimum over all possible choices of ψ made by Alice.We do this to account for the fact that certain memory channels may have no detrimental effect on special choices of the state, as for example a dephasing channel leaves |0 and |1 unchanged.To provide a measure which guarantees at least some quality of storage for all states, we consider the performance in the worst case.Note that for many environmental noise models, including pure depolarising noise, Bob's performance does not vary with Alice's choice.
In the partner paper [15] this definition is obtained from a more basic starting point where orthogonality is not imposed.Our discussion proceeds from Eqn. (5) for the sake of brevity.
It is worth emphasising that R(Φ) is a function on the memory channel Φ itself, thus one should speak of the integrity of the memory (including the specific choice of error correction technology).It is understood that the memory channel is used for some defined time τ , and that if the same memory system were used for a longer time then its integrity would be lower; typical channels will have zero integrity as τ → ∞.
The integrity of the memory has a highly intuitive and natural meaning through the following scenario: We suppose that Bob initially knows nothing about Alice's choice of qubit to encode, but after Bob has completed his decode process to obtain the single qubit we then describe to him two choices: either Alice's initial qubit was ψ or it was ψ ⊥ .Bob then makes a measurement of his choice to try to determine whether it is Φ(ψ) or Φ(ψ ⊥ ) that he has received.The integrity R(Φ) tells us Bob's probability p g of guessing successfully according to Here the label 'worst' reminds us that this is the lowest success probability, i.e. when the options ψ, ψ ⊥ are the ones least well preserved by the memory (if indeed there is any variation).The integrity therefore describes the best possible guarantee that can be made on how well a memory preserves the distinctiveness of different states.
Notice that we constrain Bob to use a specific method to identify the received state.He must map the logical qubit back to a single physical qubit by first applying a standard round of error correction for the code in question, then applying the inverse of Alice's encoding circuit.Bob's sole freedom is that he can choose how to measure that final physical qubit.As we explain in Appendix C, by constraining Bob this way we ensure that his performance is associated with the code structure and its capacity to protect information.In the Appendix we discuss the performance of a more powerful agent who is given full information about the error channel and complete license to perform any operations on all n received qubits; this agent actually has very similar (sometimes identical) performance to our constrained Bob.
For some memories Φ (although not for all conceivable memories) Bob's correct strategy for his final step is the obvious one: just measure in the basis {|ψ , |ψ ⊥ } and make the guess correspondingly.Then Bob's success probability is simply the fidelity of the state Φ(ψ) with respect to Alice's initial state ψ, since the fidelity of any state with respect to a pure state is the probability of obtaining that outcome in a measurement (as we remarked following Eqn.( 1)).So in this case Bob's probability of guessing correctly is simply p g = F(ψ, Φ(ψ)).Moreover his worst performance is But given Eqn.(6) we can now offer a precise meaning to the idea of "the (worst case) fidelity of a logical qubit stored in the memory" for any channel where Bob would opt to measure in the basis {|ψ , |ψ ⊥ }.For such a channel, Loosely, F logic is the fidelity after we project into the logical subspace of the code with a perfect round of error correction.For memory channels with sufficiently complex noise maps N that Bob's choice of measurement basis would not be {|ψ , |ψ ⊥ }, the very idea of the "fidelity of a logical qubit stored in the memory" becomes ill defined.Thus, integrity is a general measure which relates to the notion of logical fidelity when the latter notion makes sense.However integrity remains well-defined and meaningful even when the logical fidelity does not: it is the more general and robust concept.
Importantly, it is eminently practical to directly measure integrity in an experimental setting.Notice that although the definition Eqn.(5) refers to two different states, we would evaluate the integrity R through a series of single uses of the memory -we simply follow our scenario described above involving Bob guessing between options and employ Eqn.(6).Consequently the costly process of performing full state tomography is not required.Equally importantly, while the definition describes the encoding and decoding as occurring perfectly (conceptualised by saying that Alice and Bob are perfect), we will show that in practice they can be made imperfect and yet the experiment can gauge the integrity with good accuracy.These features are discussed in more detail in Section V and Appendix F.
Theoretical protocol for measuring integrity 1a Alice (perfect) prepares a single qubit state |ψ or |ψ ⊥ .1b Alice perfectly encodes it into the n physical qubits. 2 From t = 0 to τ the n qubits are in the memory; noise occurs from environment and possibly error correction.3a Bob (perfect) performs error correction on the n qubits, then decodes (inverse of 1b) the state to a single qubit.3b Bob is told Alice's qubit was either |ψ or |ψ ⊥ .He measures his qubit and guesses, success probability pg.

TABLE I.
Evaluating the integrity of a memory system.See also Fig. (1).

III. MILESTONES TOWARD SUCCESSFULLY PROTECTED MEMORIES
Armed with this notion of the integrity R of a memory channel Φ, in essence the worst-case probability that the state of a stored qubit can be inferred by Bob, we now identify milestones towards the goal of superior codebased quantum memories.
For convenience of exposition we may imagine that a third party, besides Alice and Bob, is responsible for the cycle(s) of error correction performed during the memory period: since this individual is effectively a flawed assistant for Bob, we use the name Igor after the famous fictional lab assistant.We initially focus on the case where at most one error correction cycle is used during the entire period τ where memory operates, i.e. in between Alice (t = 0) and Bob (t = τ ).We therefore now specify Step 2 of Table I in more detail, setting it out in Table II.
The key idea will be to compare the integrity of the memory channel without error correction (no Igor) to the case with EC (Igor participates) and determine whether the latter is superior.
Let us use the symbol Φ m to label the memory channel when Igor performs m rounds of error correction, so that Φ 0 labels the channel when no QEC is performed (i.e.noise sources are purely environmental).Then we say that a round of error correction is beneficial if Bob's probability of subsequently discriminating the state correctly is higher when Igor indeed performs that round, i.e. when This criterion for successful error correction can be summarised as, "Is Igor a help or a hinderance to Bob?".This seems entirely straightforward but there is a subtlety: the question of whether Eqn. ( 7) is satisfied will depend on the duration τ of the memory channels (here we would naturally set the same τ for both Φ 1 and Φ 0 for a fair comparison).Since we are interested in defining a first milestone for experimental efforts, we say that error correction can be beneficial if R(Φ 1 ) > R(Φ 0 ) for some value of τ. (8) t = 0 encode t = τ decode memory: noise occurs FIG. 1. Adapted from [14]: Cartoon of the protocol for assessing the integrity of an error-corrected memory.Alice and Bob perfectly perform the encoding and measurement, respectively, of a logical qubit.Meanwhile Igor is an imperfect agent attempting error correction to fight noise.
We will refer to the challenge of satisfying Eqn.(8) as milestone M1: Beneficial error correction.
One might wonder if we should consider a stronger condition: R(Φ 1 ) > R(Φ 0 ) for all values of the common duration τ .It is interesting and important to note that this condition will be impossible to satisfy in physical devices where the process of error correction is very fast compared to the rate of environmental decoherence.This applies, for example, to ion trap devices with clocktransition qubits where the environmental decoherence time can be on the order of minutes but gate operations are sub-millisecond.We need only assume that environmental decoherence is a continuous process to see that R(Φ 0 ) → 1 as τ → 0, i.e. the integrity of the simple memory channel is arbitrarily close to unity for a sufficiently short value of the memory duration τ .In other words, finite environmental noise needs finite time to occur.We can inspect the equivalent limit for Φ 1 if we assume that Igor's error correction cycle is instantaneous (whereas if it takes finite time δ then we cannot employ memory channel Φ 1 for time durations less than τ < δ).But given instantaneous error correction, we find R(Φ 1 ) → as τ → 0, where is non-zero and is related to the inevitable imperfections in the cycle of error correction, i.e. the circuit elements such as state initialisations, one-and two-qubit gates, and measurements will all have finite infidelity.What we are noticing is that it is not desirable to perform error correction 'as frequently as possible' -we should wait for a finite time before applying an error correction cycle, so that its negative impact on the memory is justified by the positive gain.This is made very apparent by Fig. 3 in the next section.Of course, if the time required for error correction is comparable to the environmental decoherence rate, as may be the case for superconducting qubits, then one never has the luxury of waiting until the optimum time to perform error correction; cycles should indeed be performed 'back to back'.
While Eqn. ( 8) is an important first milestone for an error-correcting quantum memory, further milestones can also be identified.For a sufficiently high performing Igor, and a long memory duration τ , it will be beneficial to have multiple rounds of correction.This will be a signature of further progress toward a practical quantum memory.We would then find that Here we understand this need only be satisfied for some particular m > 1 (it seems likely that it would be achieved first for m = 2 but we do not insist on this).We will refer to the challenge of meeting the condition in Eqn. ( 9) as milestone M2: Beneficial multi-round error correction.Equations ( 8) and ( 9) involve comparisons between memories which both employ encoded qubits.There is of course another type of comparison we can make, one which directly addresses the question of whether it is 'worth' using encoded memories at all: we should contrast such a memory channel to a simple, single qubit memory.Let us use the symbol Θ for that memory channel.We can consider its integrity R(Θ) easily enough.Alice prepares a single qubit, again choosing between ψ and ψ ⊥ , but does not encode it into multiple qubits.It exists as a memory from t = 0 to t = τ , and finally Bob receives it but of course he has no decoding to do.The qubit he receives, Θ(ψ) or Θ(ψ ⊥ ), differs from Alice's qubit only because of environmental noise.But as before Bob must measure it to guess between the two possible states, and as before his probability of success is simply For our actively-corrected encoded memory to 'beat' the simple single-qubit memory, we require R(Φ m ) > R(Θ) for some τ Θ , while using τ Φ = ατ Θ .
(10) Here we require only that this is true for some specific value of m > 0 (it seems likely that m = 1 would be the first demonstration).Note the more complex condition on the channel durations.In Eqn.(8) and Eqn. ( 9) it was clear that the duration τ of the two memory channels should be the same for a fair comparison.This is not necessarily true of the Eqn.(10) since one can argue that the meaningful time scale for a quantum memory is not 'wall clock' time but rather the time required to perform an active gate operation (perhaps the average time, given that circuit operations will differ in their time requirements, or perhaps the slowest time to be strict).Depending on the hardware platform and architecture, the time required to perform a gate operation on an encoded qubit may be longer than the time to perform the equivalent operation on an unencoded qubit.This would then suggest that τ Φ should be longer than τ Θ , and the factor α ≥ 1 is included in Eqn.(10) to reflect this.We will refer to the challenge of satisfying Eqn.(10) as milestone M3: Beneficial encoded memory.
Here we can make contact with the concept of a 'pseudo-threshold' (see e.g.Ref. [16]).This concept is typically used in the context of concatenated codes, where there may be several levels of concatenation required before error rates fall sufficiently for deep quantum algorithms (such as Shor's or particularly Grover's algorithm).In the present context, we restrict our interest to the lowest level of concatenation where a process involving unencoded qubit(s) is compared to a process with a single level of encoding.The pseudo-threshold has been surpassed if a circuit performs to a higher standard with the encoded qubits, i.e. logical qubits, versus using the physical qubits directly.One might demand that for a complete universal set of operations, each operation at the encoded level outperforms the analogous operation using unencoded qubits.Alternatively one might speak of the pseudo-threshold for a specific operation, such as a single-qubit gate, a CNOT operation, a measurement or indeed a memory.In essence Eqn.(10) represents the (lowest tier) pseudo-threshold for memory, i.e. for the identity operation in a circuit.
Assuming that Eqn. ( 10) can be satisfied, there is a higher goal which might be achieved namely for all τ Θ , and using τ Φ = ατ Θ .(11) Here the maximum is over a family of memory channels having the same duration τ Φ but with differing numbers of error correction cycles m.Importantly, we permit m = 0.If this condition is satisfied, it means that for any desired duration we can sustain our encoded quantum memory at a higher integrity than a single physical qubit memory.We do so by applying a suitable number of error correction cycles.Moreover this is true even allowing for the factor α discussed above.This is therefore the 'gold standard' for demonstrating a quantum memory and it is the most challenging of the criteria we have presented in this section.We will refer to the task of satisfying Eqn.(11) as milestone M4: Strictly superior encoded memory.
We have presented four milestones in an order which we expect may represent an increasing degree of challenge.It is not necessarily the case that each is more difficult than the last -for example, conceivably M3 may be achieved before M2 in a given physical device.However the fourth milestone is clearly the most demanding and we should expect that the inequalities in Eqns.( 8), ( 9) and ( 10) must all be satisfied before Eqn.( 11) can be achievable.

IV. NUMERICAL STUDIES
In this section we present our simulation results under the Alice-Igor-Bob framework described in Tables I and II.The simulation technique is based on the Monte Carlo method, the advantage of which has been described in [14].We emphasise that the integrity benchmark we have described is appropriate for any and all error models, including coherent noise, non-Markovian noise and so on.As specified in Appendix A, in this paper we have used the simple canonical Pauli depolarising noise model (on all elements including state preparations, gates, measurements, and environmental noise) since it is a standard model to use in a first investigation.We aggregate a large number of individual runs, in each of which a pure state undergoes a specific trajectory: after every circuit element is applied, a classical random number is generated and compared with the error rate for that circuit element in order to decide whether an error is applied and if so its type.Each data point presented in this paper is a result of at least one million runs, and in order to make a smooth curve, at least 50 data points are generated for a single curve.The hardware used for this work is a cluster of approximately 100 nodes, which are connected by Intel TruScale QDR Infiniband.Each node is based on a motherboard with two Intel E5-2640v3 CPUs and has between 64 and 256GB of memory.
For all the simulations presented in this paper, we use the Alice-Igor-Bob scenario that has been discussed in Tables I and II.The circuit level description is shown in Figure 11, where we take the five-qubit code as an example.Igor performs his error correction cycle halfway through the duration of the memory channel (or for a channel with n correction cycles, at points t = m/(n + 1) with m = 1..n ).Igor measures a complete set of stabiliser measurements and applies error correction based on the error syndrome.We take Igor's action to be instantaneous although it is of course trivial to assign it a finite time δ as indicated in Table II.If Igor's analysis indicates that a correction is necessary, then the appropriate correction is applied perfectly -this is a proxy for the reality that one can simply note the need for correction and update future operations to allow for it, thus never needing to apply an imperfect physical operation to the identified qubit.Note however that altering this principle to instead apply a noisy fix would make negligible difference to the observed integrity, since it is merely one additional operation for Igor's circuit which at minimum involves over a dozen gates.
Presently we evaluate the integrity metric for three different well-known codes: the five-qubit code which is the smallest possible error correcting code [17], the seven-qubit Steane code [18] and the nine-qubit surface code [19].We will compare the inherent properties of these codes, both in their simple and fault-tolerant variants, and we will show examples where the various milestones described in the previous section are (or are not) met.
We begin by explaining the nature of the graphs shown in this section.Typically they are of the general form exemplified by Fig. 2(a).On the vertical axis we show the integrity, as defined earlier, which of course is equal to unity for an ideal memory.The horizontal axis shows the duration τ of the memory channel(s) in question; the duration is shown as a ratio with respect to the environmental decoherence rate T which is the decoherence time of an isolated single physical qubit (see error model specification in Appendix A).Each point along a curve in the figure is thus the integrity of a specific kind of memory when operating for the specific duration indicated by the horizontal axis.
There are four types of memory channels shown in Fig. 2(a): The simple one-qubit memory Θ (shown in blue), an encoded channels without Igor's error correction, Φ 0 (red), and two channels where Igor does perform one round of correction Φ 1 (yellow, green).The last two differ only in that Igor's error correction circuits have error rates 0.2% and 0.7%, respectively.In all cases the encoded channels are using the five-qubit code.Encoding and decoding tasks, performed by Alice and Bob, are perfect as per the definition of integrity (we defer the discussion of noisy Alice and Bob, an unavoidable reality in real benchmarking experiments, to later in this section).
Igor's error rate of 0.2% is low enough for him to perform well and consequently we observe two desirable line crossings in the figure.For all durations τ > 0.16 T we see that the error corrected memory Φ 1 (yellow) is superior to the un-corrected memory Φ 0 (red).Thus for any τ > 0.16 T we meet the M1: beneficial error correction milestone specified earlier in Eqn.(8).Furthermore, for all durations τ between τ 0.035 T and τ 0.49 T the corrected memory Φ 1 (yellow) has superior integrity to the single-qubit memory Θ (blue).Note however that in comparing the single-qubit channel Θ to the encoded channels, we have not introduced any scaling factor to adjust their relative durations (i.e.we have set α = 1 in Eqn.(10)).This might be considered unreasonable unless the physical platform embodying the memory system is capable, in principle, of performing transversal gates in one step so that operations on logical qubits are on the same timescale as operations on physical qubits.With this important caveat, we can say that for any duration in the range 0.035 T < τ < 0.49 T we can meet the M3: beneficial encoded memory milestone, Eqn.(10).
In order to discover whether we can meet the remaining two milestones, and in particular the highly-desirable M4: strictly superior encoded memory milestone, we would need to consider channels with multiple rounds of error correction; this is shown presently.
The green line, corresponding to the higher per-gate error rate of 0.7% during Igor's error correction, never surpasses the integrity of the single physical qubit memory; therefore this channel does not meet milestone M3: beneficial encoded memory.However when the duration τ > 0.55 T it does (barely) surpass the integrity of the Φ 0 channel.Therefore milestone M3: beneficial error correction is met.Three points labelled A, B, and C have been high-lighted in Fig. 2(a).They lie at a value of the duration, τ = 0.4 T for which the high-fidelity corrected channel is superior to the single physical qubit memory Θ, which in turn is superior to the encoded-but-uncorrected channel Φ 0 .One might wish to understand how the integrity varies over the course of the duration of those memory channels.In fact, the question is not entirely proper since integrity is only defined as a property of the entire channel; but we can ask what would happen if Bob were to 'step in early' at any time between t = 0 and t = τ = 0.4 T .We suppose that Bob would perform his usual decoding, measurement and guess using the state of the memory system at that premature point.From his performance we can infer an 'integrity so far', so to speak, which we might also call the 'integrity at interruption'.Fig. 2(b) shows this quantity.The blue and red lines, which correspond to the single-qubit memory Θ and the encoded memory without correction Φ 0 , do not reveal anything interesting.Indeed they precisely correspond to the same lines in the region 0 < τ < 0.4 T in the upper panel (in effect, we have just 'zoomed in').
For these two cases the noise on the memory is simply a continuous process; when Bob interrupts our channel that should have had duration τ = 0.4 T , it is exactly equivalent to having a memory of the shorter duration.The green line in Fig. 2(b) corresponding to the errorcorrected channel Φ 1 is far more interesting.It is exactly coincident with the Φ 0 line until t = 0.2 T because in these cases Bob interrupts before Igor performs his error correction cycle.But then the 'integrity at interruption' falls sharply, i.e. there is a significant difference between Bob interrupting immediately before Igor's effort, versus doing so immediately afterwards.The reason is that Bob's process of decoding the memory begins with a round of error correction and his error correction is perfect; thus it can only be worse to have Igor apply his own flawed effort at correction immediately beforehand.However despite the sharp step down, the eventual integrity at full duration is higher.This is because Igor's efforts have reset the accumulation of errors, lowering the overall chance of an uncorrectable set of errors (i.e. 2 or more errors, for the five-qubit code) over the course of the complete memory channel.We see this evidenced by the inverted parabolic curve immediately after Igor's action: in effect the environment must 'start again' to build up significant probability of weight-2 errors.
It is interesting to reflect further on the observation that error correction cannot increase the quantity 'integrity at interruption', assuming we have no knowledge of the initial encoded qubit (given such knowledge we can trivially increase integrity by erasing the memory and reinitialising it).Any form of error correction, with whatever code and however well performed, is a process that merely 'delays the inevitable' in the sense that integrity must fall; we can only alter the rate at which it falls.For the ultimate goal of fault tolerant quantum computing, we must slow the decay of integrity to such an extent that the entire calculation can take place be- fore an error becomes likely.The fact that integrity is a non-increasing function of time is a merit versus over other measures (such as the simple fidelity with respect to an ideal state) which can both fall and rise, so creating the false impression that quantum information is somehow being regenerated.A related observation is the following: The rate at which we should apply error correction cycles has some optimum which depends on the relative severity of environmental decoherence per unit time versus the error rate within our error correction process (the noise in Igor's circuits).We should not apply error correction more frequently than this rate, or else the loss of the integrity will be dominated by the noise we introduce in our error correction cycles.This is made apparent by the simulation results shown in Fig. (3) where we again plot the 'integrity at interruption' as in Fig. 2(b), but now for three different channels of common duration τ = 0.5 T , the channels being the single qubit memory Θ, and memories using three or nineteen error correction cycles (Φ 3 and Φ 19 ).From the right hand side of the graph we find the integrities of the three memory channels: they are approximately 0.74, 0.78 and 0.63 respectively, i.e. the memory channel featuring nineteen correction cycles is by far the worst, while three cycles (which is in fact the optimum here) provide a superior integrity versus the single qubit memory.The reason is clear from inspecting the curves: the 'integrity at interruption' reveals that the decay of the over-corrected channel is indeed dominated by the step-like drops associated with noise from Igor.
With that introduction, we now present a series of simulations which contrast different codes, and also compare fault-tolerant versus non-fault-tolerant implementations Here the duration of our memory is set to zero, in order to directly inspect the negative impact of an imperfect error correction performed by Igor.The horizontal axis shows the level of noise associated with each circuit element of Igor's circuits.We analyse memories based on the five-qubit, the Steane, and the nine-qubit codes.Igor's error correction is performed either in a simple, non-fault tolerant fashion or with full fault tolerance.As explained in the text, the various line shapes and the relative levels of performance are straightforward to understand qualitatively.
of error correction circuits.Unless otherwise noted we use the standard error model of homogeneous Pauli noise occurring without correlation, and for Igor's circuits the noise occurs on all circuit operations with equal probability.It is worth stressing that the relative performance of the codes may differ greatly when this error model is substantially varied.
The appendix shows the various encoding, decoding, and error correction circuits which we use in the simulations described here.As a first step toward comparing the efficacy of different codes, we begin by reporting a special case which is achieved by setting the memory duration to zero, and simply investigating the impact of the error correction process itself.Thus, we take a perfectly encoded qubit prepared by Alice and present it directly to Igor who performs an (entirely unnecessary!) error correction cycle before passing the encoded qubit directly to Bob for his analysis.The reduction in integrity is thus purely due to Igor's action.The results are shown in Fig. 4. Notice that in contrast to all other figures in this paper, the horizontal axis here is not time (since the duration is zero) but rather Igor's error rate.
Figure 4 includes eight different options for the encoding and correction of a logical qubit.Three different codes are considered: the five-qubit code, the seven-qubit Steane code (which is also the smallest 2D color code), and the nine-qubit surface code.For each of these, the performance of a non-fault-tolerant (non-FT) Igor is plotted.For the nine-qubit code, a second curve shows the performance when Igor employs a specific FT error correction circuit (see Fig. 12(e)).For each of the other two codes, we display the performance of two different FT circuits: The standard 'Shor' approach using four ancilla and an alternative method very recently proposed by Chao and Reichardt [20] which requires only two ancillas, see Fig. 12 panels (c) and (d).
There are several interesting general observations to be made from Fig. 4. Firstly, it is reassuring to note that two logically-necessary features are indeed present: One observes that all the cases which employ non-fault-tolerant (non-FT) error correction for Igor have the expected linear decay as Igor's error probability p increases from zero: integrity goes as 1 − c p for some constant c because non-FT circuits are vulnerable to single errors.Meanwhile the scenarios featuring FT error correction all have the expected inverted-parabolic shape: the integrity goes approximately as 1 − k p 2 when Igor's error probability p is small.Circuits of this kind are 'immune' to single errors and vulnerable only to weight two (or higher) errors.Note that for higher (but still sub-1%) error rates for Igor, the fault tolerant circuits become inferior to the simpler non-FT circuits.The reason is essentially combinatorial scaling: the FT-circuits are generally considerably more complex with far more gates, thus as gate failure probability p increases the risk of a double error in these complex circuits eventually outweighs the risk of a single error in the simple non-FT circuits.Thus one should not suppose that 'fault tolerant circuits are always better'for small codes and appreciable rates of gate error, they may not be.
The different gradients in the various linear and parabolic curves can be qualitatively understood by considering two desiderata.The first is the portion of all possible weight-2 errors that actually prove to be correctable.For example, the five-qubit code is corrupted by all weight-2 errors, but the seven-qubit Steane code can correct any pair of errors if (and only if) one is of type X and one of type Z.The nine-qubit surface code has the highest portion of 'harmless' weight-2 errors in this sense.The relative ordering of the non-FT codes can be explained by this feature alone.However for the FT codes, there is another competing feature: as noted above the complexity of the FT error correction circuits is what 'kills' their performance, so simpler circuits are superior.Consistent with this principle, we see wherever an appreciable performance gap exists between the 'two-ancilla' variant of a FT code versus the 'Shor' variant of the same code, the former is always superior.Moreover the FT circuits for the five-qubit code are more simple than those the seven-qubit Steane, thus among the FT curves the five-qubit outperforms the Steane.Remarkably FT circuits for the nine-qubit code exist which are actually very simple (as previous authors have noted [21,22]), and thus the FT surface code benefits from both desirable features described here, and is unconditionally su- perior to all other codes in the plotted error range.However, it does require the largest number of qubits: the 9 data-qubits themselves, and Igor also requires 6 ancillas in order to perform stabiliser evaluation without error propagation.Thus one might argue that the FT five-qubit code, in its two-ancilla variant, provides better 'value per qubit' since it requires a device with only 7 qubits in total.
It is important to remember that the comparison made in Fig. 4 is for zero environmental error.The relative performance of different codes will change once we deploy them properly into a memory channel where environmental noise is degrading the encoded qubit.Figure 5 shows the integrity change of the memory under our standard memory channel scenario Φ 1 i.e. 'one use of Igor's error correction midway' where the code employed is either the five-qubit, Steane, or nine-qubit code (all with non-FT In the upper panel (a) Igor's gate-level error rate is 0.3%.As explained in the main text, the system meets milestones M1, M2 and M3 but fails to meet M4.In the lower panel (b) Igor's error rate is now 0.1% and we see that by choosing a suitable n we can select a five-qubit encoded memory that will beat the single-qubit memory for any desired duration τ , so meeting milestone M4: Strictly superior encoded memory.
correction).See Fig. 11 for the explicit circuit used in the five-qubit code case; circuits for the other cases differ simply by substituting the appropriate stabiliser checks.All curves in this figure correspond to an internal error rate for Igor's operations of 0.5%.Thus the far left of the figure, with τ = 0, gives us the same set of three data points as can be read from Fig. 4 when the x−axis, the error rate, is 0.5%.We see that the Steane code is marginally superior to the five-qubit code, but both are markedly inferior to the nine-qubit code.However, as we move away from the hard left of Fig. 5 to consider increasing duration of the memory, we find that the fivequbit code surpasses first the Steane and then even the nine-qubit code.The reason is that as more environmental error accrues, a code with a larger number of physical qubits will reach the point where two-or-more errors are present, i.e. the situation where the logical qubit may be corruptted, at an earlier time.
In preceding figures we have focused on cases where a single round of error correction is applied during a memory channel, and we have identified points where our milestones M1 and M3, would be satisfied.In Figure 6 we show how the use of multiple rounds of error correction (equispaced within the duration of the memory channel) may allow us to meet milestone M2: Beneficial multiround error correction associated with Eqn.(9), or even milestone M4: Strictly superior encoded memory associated with Eqn.(11).In the upper panel, Igor's error rate suffices for the former but not the latter; in the lower panel Igor's error rate is set to 0.1% which proves to be sufficient to achieve the fourth milestone.
Before concluding this comparison of different codes, we should stress that our intention is not to identify "best and worst" codes but rather to show the circumstances in which various codes can be the better choice.We also recognise that there are other merits beyond the question of how well a code preserves channel integrity -for example, the Steane code (which is also the smallest instance of the 2D color code) has the significant merit versus the smaller five-qubit that all Clifford operations can be applied transversally.

V. ASSESSING INTEGRITY IN A REAL EXPERIMENT
In all the theory and the numerical simulations described above, Alice and Bob are perfect agents: they provide the framework within which we assess the memory channel.However, if we are to assess integrity in an experiment -i.e. if it is to be a practical measure for benchmarking quantum memories -then we must tackle the reality that Alice and Bob are merely phases of an experiment within which all operations are imperfect.Bearing this in mind, to what extent can one can still assign an integrity to the memory channel?And more importantly can we still confidently assert that the integrity of one channel is superior to another, in order to determine whether milestones such as those identified in Section III have been met?
In the simulations reported in this section, we apply the same error model and error severity to the actions of Alice and Bob, as we do to Igor's error correction cycle.It is crucial now to specify the particular circuits that Alice and Bob use to perform their functions (whereas before, since they were perfect agents, any circuit performing the desired function was equivalent).
In the idealised case we spoke of Alice preparing any encoded qubit she wished, i.e. she used a general encoding circuit such as those displayed in Fig. 9. Bob used a complex procedure involving a full round of er-ror correction followed by inverting Alice's general encoder to map an arbitrary encoded qubit back to a single physical qubit.However, the definition of integrity corresponds to Bob's performance when Alice opts for the worst possible choice of qubit state to encode (or rather, when she picks between the two states |ψ and |ψ ⊥ , which Bob has the most difficulty differentiating post-memory).If we have foreknowledge of which states these are, we need only find circuits for Alice and Bob to use which perform equivalently to their general purpose circuits in these special cases.Fortunately for a broad family of error models (see Appendix F) we know that the worst case choice Alice can make will correspond to Pauli basis states, i.e. {|ψ , |ψ ⊥ } will be either {|0 , |1 } or {|+ , |− } or {|y+ , |y− }.Our challenge is therefore to find specific encoder circuits for Alice and analysis circuits for Bob for these special cases.This must be done in such a way that we recover the ideal performance of Alice and Bob when they are indeed error-free, but we obtain best-possible performance for Alice and Bob when they are error-burdened.In short, we look for compact fault-tolerant realisations of Alice and Bob for the cases where |ψ and |ψ ⊥ are Pauli basis states.
We emphasise that once we equip Alice and Bob with suitable circuits, we have a full prescription for an experimental test of integrity: the experimental protocol is simply to follow the process listed in Tables I and II, with the sole modification that Alice randomly picks between Pauli eigenstates, and given this pick both her encoding circuit and Bob's decoder are selected accordingly from optimised circuits such as those in Fig. 10.Thus integrity is evaluated without state tomography.
The data plotted in Fig. 7 and Fig. 8 show the effect of allowing Alice and Bob to become noisy, for the Steane code and the five-qubit code respectively.Circuit details are given in the captions.
For Steane code(Fig.7) we observe an excellent agreement between the 'true' integrity that would be measured if one were able to use ideal agents Alice and Bob, and the estimate of the integrity that results from using imperfect agents.We note that there is only a slight variation in the location of the crossing point, and that if a crossing occurs in the true integrity (as for the case when Igor's error is 0.5%) then a crossing also occurs in the estimate; the specific crossing shown here is that which would show milestone M1 has been met.Conversely when a crossing does not occur in the true integrity, it also fails in the estimate (here, for the case when Igor's error is 1%).The reason for the excellent agreement is that both Alice and Bob's circuits are robust against errors.Note we adopt the recently proposed protocol from Ref. [23] -by using a single additional qubit in her encoding process, Alice is able to detect many errors, and if such errors are detected the encoding process is restarted again until no error is detected.This we are free to do since Alice is 'not on trial here' so to speak; our goal is to fairly evaluate the memory channel involving the environmental noise and Igor's imperfect attempt(s) at error correction.Similarly, The scenario in the upper panel (a) corresponds to three different memory channels each using the Steane code to protect information.The encoder Alice and the analyser Bob are both ideal, as required in the definition of integrity.We mark the meaningful line crossing which corresponds to meeting milestone M1 (for the orange line) or just failing to do so (blue line).In the lower panel (b) we present the same analysis but now with errors during Alice and Bob's circuits at the same level as Igor's.Specifically, Alice uses the circuits shown in Fig. 10 to encode her qubits into |0 L. Fig. 10 also shows how Bob differentiates between |0 L and |1 L by simply measuring all qubits in the z-basis, performing classical error correction, and checking the parity of a certain subset.Note that the key crossing (and failure to cross) from the upper panel are well approximated in the lower, indicating that experimental evaluation of integrity is achievable.
it would be legitimate to employ circuits for Bob which reject some outcomes completely and do not count them towards the estimate of his guess success rate, if those cases definitely correspond to some failure within Bob's own processes.An example would be, if a measuring device fails to return any result at all.
In our second example of noisy Alice and Bob, shown in Fig. 8 we employ the five-qubit code and, crucially, we do not employ fault tolerant procedures for Alice and Bob.For the five-qubit code there is relatively little literature describing fault tolerant state preparation  In contrast to Fig. 7 there is now a profound difference between two panels and one could not directly assert that a line crossing in the lower panel implies a crossing would exist in the upper panel.
and measurement (in contrast to the Steane code where there are numerous circuits exhibited in the literature, and progress [23] has been made as recently as 2016).
Moreover the smaller size of the five-qubit code itself may mean that it is targeted by the very earliest experiments where the additional complexity associated with making Alice and Bob fault tolerant is an unwelcome obstacle.Unfortunately, when the tasks performed by Alice and Bob become vulnerable to single gate failures, the resulting memory integrity estimates become very poor approximations to the true integrity.In the lower panel of Fig. 8 we see that the line shapes have changed, losing the inverse-parabola shape for short memory durations.We do still see line crossings, but they occur at significantly different locations.Most troublingly, a line crossing can occur in the experimental data when no such crossing would occur if Alice and Bob were ideal.Thus, the observation of a crossing in the data is not, in of itself, strong evidence that the actual memory channel has met a meaningful milestone (such as M1: Beneficial error correction in this case).Despite these issues, it can be possible to make use of data such as that in Fig. 8.One would need to perform additional theoretical analysis in order to justify the claim that any observed crossing is indeed meaningful.For example, if the errors in the various circuit elements are well characterised then one could perform simulations equivalent to those presented in this paper.Essentially one would produce a version of Fig. 8(b) calculated with an accurate error model in order to compare with the observed data; if the match proved to be good, one could use further simulation to discover the integrity that would have been observed with ideal Alice and Bob.In order words, if the data closely matches a simulation such as Fig. 8(b), one might fairly state that this is strong evidence that the integrity is as shown in Fig. 8(a).
In summary, we can say that integrity can be assessed experimentally in a straightforward protocol: Acting as Alice we choose a qubit state then we perform a series of experimental runs where each run ends in a measurement from which, as Bob, we 'guess' the original state with the binary outcome 'succeeded' or 'failed'.We continue until we have a good estimate of Bob's probability of success p g ; if the system is such that p g depends on Alice's choice, then we find the least-favourable choice.The integrity of the memory is then simply R(Φ) = 2p g − 1.In this section we have shown that the creation of the logical qubit, i.e.Alice's circuit, as well as Bob's analysis circuit, can both be noisy and yet we can obtain an excellent estimate of the integrity of the memory channel itself (factoring out Alice and Bob).

VI. GENERALISATIONS
The analysis presented here has defined the integrity of a memory channel, where that channel stores a single logical qubit.The specific codes we have considered are distance three (a single physical qubit error is correctable) but the definition applies equally to higher distance codes.For cases where a memory channel stores several logical qubits, it is straightforward to generalise our integrity metric: a natural choice for an m logical qubit memory would be to have Alice choose a state of m qubits, encode and transmit to Bob as in our canonical picture (including optionally error correction from Igor) and then Bob decodes and is finally informed of two options -Alice's true state and a randomly chosen orthogonal state -between which he must guess.The memory channel's integrity will relate to Bob's worst case performance within this framework.
One can also generalise the notion of integrity beyond memory systems to actual computations.For a single logical qubit the natural generalisation would be to perform multiple transversal gates between the Alice and Bob stages, i.e. in lieu of the pure environmental noise periods.As with the memory channel, this computational process could include one, or more rounds of error correction from our agent Igor.

VII. CONCLUSION
To conclude: we have described and assessed a measure called integrity as a means to benchmark the performance of a code-based quantum memories.Integrity measures how well a memory preserves the distinctiveness of different states.It was introduced recently to assess ion trap based memories in Ref. [14], but is generically applicable to any technology platform.Integrity is a property of the memory channel itself (including any active memory correction routines) independently of the inevitable encoding and measurement stages.Importantly the integrity of a memory can be assessed experimentally in a straightforward manner without the need for full state tomography.We have identified links between integrity and quantities such as 'fidelity of the logical qubit' or the 'pseudo-threshold'.
(5-qubit code) (7-qubit code) (9-qubit code) FIG. 9. General encoding circuits suitable for the fivequbit, Steane, and nine-qubit codes.In all cases the physical state of ψ is encoded into the logical state |ψ L by applying the gates used in encoding in reverse before measuring the decoded physical qubit, while for the Steane code, since each stabiliser check detects only one type of error, we can simply measure all the four physical qubits in the corresponding basis and check the parity of the measurement results.
The alternative fault-tolerant circuits with only two ancilla qubits are shown in Figure 12 (c) and (d) for the five-qubit and seven-qubit codes, respectively.Here we are employing the ideas recently introduced in Ref. [20].The first ancilla qubit acts the same as that in the nonfault-tolerant circuit, and the second ancilla qubit acts as the flag qubit: once any weight-2 error occurs, the measurement of it will turn from 0 to 1.For both the five-qubit and seven-qubit codes, each weight-2 error corresponds to a unique error syndrome if applying a set of normal stabiliser checks, thus we can detect any weight-2 error by measurement of the flag qubit and correct by mapping the stabiliser measurement results with the unique error syndrome.
The nine-qubit code has the unusual and desirable property that the techniques described above, involving multiple ancillas, are not needed for fault tolerance.As shown in Fig. 12(e), weight-2 errors can be avoided simply by taking care to measure the stabilisers in a certain order (as has been discussed in Ref. [21] and Ref. [22]).
Since only one round of stabiliser checks is to be preformed, fewer gates compensate the cost of six ancilla qubits required.
The full diagram for evaluating the memory with faulttolerant error correction is shown in Figure 12 (f), where we take the Shor-type five-qubit code (Figure 12 (a)) as an example -analogous circuits apply for the other cases.Compared with the non-fault-tolerant error correction as shown in Figure 11, three rounds of stabiliser measurements are required in order to avoid additional errors introduced by error correction based on wrong error syndromes.Firstly five physical qubits are encoded into the logical state, then the logical qubit is subjected to environmental noise for a time period of T /2, followed by a cycle of stabilizer measurements and error correction, and then the logical qubit is again subjected to environmental noise for T /2.Lastly the logical qubit is decoded and measured.Here we use the Shor's method, with which four ancilla qubits are entangled into the cat state with some error probability and an additional qubit is used to verify the cat state is successfully prepared.After the stabilizer measurement, the ancillas are decoded, followed by measurement in x-basis.(b) a round of fault tolerant stabilizer checks with the seven-qubit Steane code, again using Shor's method.Since each stabilizer check detects either phase or bit flips, results can be obtained by checking the parity of measurement results of all four ancillas without decoding.(c) the circuit to achieve fault tolerant correction of the five-qubit code with only two ancillas.The first ancilla is used for stabilizer measurement, while the other one acts as the flag qubit: it returns -1 once any weight 2 errors occurs, and all such errors render a unique error syndrome thus can be corrected.(d) the same approach as in (c), but for for the seven-qubit Steane code.(e) stabilizer measurements of ancillas following a particular order to achieve fault tolerance with the rotated nine-qubit surface code.The large circles stand for the data qubits and the small circles are ancillas.The stabilizer measurement should follow the order denoted by the colour orange, blue, green and finally purple.Since the ancilla labelled 3 can physically act as the ancilla labelled 2 after finishing the measurement in the blue half-circle and that also works for ancilla 4, which can act as ancilla 1 after the measurement in the yellow half-circle, in total six ancillas are required to demonstrate fault tolerance.(f) schematic view of the whole cycle of Shor-type fault-tolerant Alice-Igor-Bob scenario with the five-qubit code ((a) in this figure).The same procedure also works for all the others described above.Three rounds of a full set of stabilizer measurements are required to obtain the correct error syndrome as to avoid artificially introducing new errors through error correction based on the wrong syndrome.The probability of guessing correctly in the definition of integrity, Eqn. 5, is redundant in the sense that the minimum and maximum are the same.
In order to show that this will not generally be true, and that therefore it is indeed necessary to specify the minimum, we need only switch from a pure depolarising enviroment to a pure dephasing environment.
The results of such simulations are shown in Fig. 15 which shows a Steane-code protected memory as in earlier plots (c.f.Fig. 7) but now with all environmental noise being pure dephasing.The interesting point is that now Bob's ability to guess the original encoded state varies dramatically with Alice's choice of initial state.If she chooses either |0 or |1 then the logical qubits are in fact immune to phase noise, so that Bob's performance impaired only by the noise introduced by Igor -the corresponding line (red) is therefore flat i.e. not a function of the memory duration.In contrast Bob's 'worst case' performance is obtained when Alice's choice for the encoded state is |+ or |− as shown by the yellow line, and it is this that would define the integrity of memory channel.
In the following section we explain for many common environmental noise models the 'worst case' will be found among the Pauli eigenstates.In this figure we plot the 'integrity at interruption' to look inside a memory process, as discussed earlier for Figs. 2 and 3. We compare three memory channels all of the same duration τ = 0.2 T .The blue line is our standard reference, the single-qubit memory.The other two are based on the five-qubit code, with the error rate of all the gates involved in the error correction process to be 0.1%.The data shown in orange are for the memory channel protected by Igor using a non-FT error correction, and the optimal number of such cycles is 2. The data shown in green is for a more sophisticated Igor using the fault tolerant circuit shown in Fig. 12(c).It is interesting to note that the optimal number of error correction cycles is now 4. However the overall performance is near-identical (i.e.lines are very close on the far right).Plot shows the integrity for a memory channel using a the seven-qubit Steane code, and and single round of Igor's error correction procedure with a gate error rate of 0.5%.Whereas all other plots in this paper correspond to a pure depolarising environment, here we have a pure dephasing environment.Consequently Bob's ability to guess the nature of the received state depends strongly on Alice's choice of which qubit to send: If she sends a z-basis eigenstate then Bob's success is certain.Note that while the y-axis is labelled 'Integrity' only the blue and yellow lines conform to the definition, Eqn.(5).
We may denote such a channel by Φ(ρ) =
A weak i.i.d.Pauli channel is such a channel which consists of a tensor product Φ 1 ⊗ Φ 1 ⊗ • • • ⊗ Φ 1 of identical channels.We are more generally interested in maps Φ = D • N • E which consist of an ideal encoder E for a stabiliser code (encoding one qubit into M qubits), a noise process N weak i.i.d.Pauli channel on M qubits, and an ideal decoder D which performs one round of correction decodes the M qubit state again to a single-qubit state.It is not difficult to show that Φ will be a weak Pauli channel when N is a weak i.i.d Pauli channel, in which case the worst-case performance will be achieved by Pauli eigenstates in this case as well.
This motivates the following procedure to experimentally assess the quality of an isolated quantum memory on a weak Pauli channel: prepare a state ϕ (j) ± = |φ φ|, apply Φ to it, and test the probability with which we obtain the outcome |φ φ| when a σ (j) measurement is performed on it.Performing the above many times for each Pauli operator σ (j) , we may determine with some level of confidence for which operator σ (j) this fails most often.This determines the pair of orthogonal states which Φ does the poorest job at keeping distinguishable; using Eqn.(6), we may then compute R(Φ).

FIG. 2 .
FIG. 2. The integrity of different types of memory channel (upper), and the integrity change during a given memory channel (lower).(a) Memory integrityassessed over many different durations τ ranging from zero to T , the single-qubit decoherence time.Blue line: A single physical qubit, i.e. no encoding.Red: a memory using the five-qubit code for the stored qubit, but without active correction during the channel.Orange: the same five-qubit code, but now with a round of error correction performed mid-way through the memory duration, i.e. at time t = τ /2.Error rate in operations during the correction cycle is 0.2%.Green: As for orange, but error rate 0.7%.(b) We plot the 'integrity at interruption' in order to look inside three specific memory channels during their operation.The three channels all have duration τ = 0.4 T. As explained in the text, the interesting feature is the step-like decline occurring at t = τ /2 = 0.2 T when Igor performs imperfect error correction.

FIG. 3 .
FIG. 3. Integrity change during three different memories, each of duration τ = 0.5T .This figure is equivalent to Fig. 2(b), but with three rounds (pink) or nineteen rounds (green) of error correction (gates error rate 0.2%) applied during the period of memory storage.Clearly three rounds of error correction sustains the logical qubit while too many rounds corrupt the logical qubit.

FIG. 4 .
FIG. 4. Integrity change with increasing gate error rate.Here the duration of our memory is set to zero, in order to directly inspect the negative impact of an imperfect error correction performed by Igor.The horizontal axis shows the level of noise associated with each circuit element of Igor's circuits.We analyse memories based on the five-qubit, the Steane, and the nine-qubit codes.Igor's error correction is performed either in a simple, non-fault tolerant fashion or with full fault tolerance.As explained in the text, the various line shapes and the relative levels of performance are straightforward to understand qualitatively.

FIG. 5 .
FIG. 5. Comparison between the 5/7/9 qubit codes.The data shown are for our canonical Alice-Igor-Bob scenario where total memory duration τ during which pure environmental decoherence occurs continuously and a single (imperfect) round of error correction occurs midway at t = τ /2.See e.g.Fig.11.The error rates used for all the gate operations during the error correction procedure are 0.5%.The lower panel (b) presents the same data but now with respect to the the Steane code performance, so that the integrity of that channel now lies along the horizontal axis.

FIG. 6 .
FIG. 6.Multiple rounds of quantum error correction(EC).The integrity of a family of memory channels all employing the five-qubit code but differing in the number n of rounds of error-correction performed during the memory, where n = 0, 1, 2, 3, 4 or 6.Our imperfect agent Igor performs error correction cycles at times t = mτ /(n + 1) for m = 1..n.In the upper panel (a) Igor's gate-level error rate is 0.3%.As explained in the main text, the system meets milestones M1, M2 and M3 but fails to meet M4.In the lower panel (b) Igor's error rate is now 0.1% and we see that by choosing a suitable n we can select a five-qubit encoded memory that will beat the single-qubit memory for any desired duration τ , so meeting milestone M4: Strictly superior encoded memory.

FIG. 7 .
FIG. 7. Imperfect, but fault tolerant, Alice and Bob.The scenario in the upper panel (a) corresponds to three different memory channels each using the Steane code to protect information.The encoder Alice and the analyser Bob are both ideal, as required in the definition of integrity.We mark the meaningful line crossing which corresponds to meeting milestone M1 (for the orange line) or just failing to do so (blue line).In the lower panel (b) we present the same analysis but now with errors during Alice and Bob's circuits at the same level as Igor's.Specifically, Alice uses the circuits shown in Fig.10to encode her qubits into |0 L. Fig.10also shows how Bob differentiates between |0 L and |1 L by simply measuring all qubits in the z-basis, performing classical error correction, and checking the parity of a certain subset.Note that the key crossing (and failure to cross) from the upper panel are well approximated in the lower, indicating that experimental evaluation of integrity is achievable.

FIG. 8 .
FIG.8.Imperfect, and non fault tolerant, Alice and Bob.The comparison made here is similar to that in Fig.7except that now the memory channels employ the five-qubit code and moreover in the lower panel (b) the circuits used by Alice and Bob are not fault tolerant.Here, Alice uses the circuits specified in Fig.10to encode qubits into |− L and Bob uses the circuit shown in that figure to differentiate between |+ L and |− L. In contrast to Fig.7there is now a profound difference between two panels and one could not directly assert that a line crossing in the lower panel implies a crossing would exist in the upper panel.

2 FIG. 10 .
FIG.10.Encoding circuits for imperfect encoding procedures with the five-and seven-qubit codes.For the five-qubit code shown in the upper panel, the encoded state |− L is prepared in a non-fault-tolerant fashion, and Bob subsequently identifies the received state by measuring three of the received qubits and computing their parity (again, a nonfault-tolerant process).For the seven-qubit code shown in the lower panel, physical qubits are encoded into |0 L using additional qubit for detection of errors: if returns 1, Alice restarts the encoding until it returns 0. Such method reduces propagation of some errors in a noisy encoding process.Bob is also fault tolerant: he measures all 7 qubits, and may opt to flip one of the outcomes if it is necessary to do so in order to produce a legitimate outcome; the parity of subsets 4,5,6,7; 1,3,5,7; 2,3,6,7 should all be the same as to allow him to guess between |0 L and |1 L.

FIG. 11 .
FIG. 11.Diagram of one whole cycle of Alice-Igor-Bobscenario with the five-qubit code.Firstly five physical qubits are encoded into the logical state, then the logical qubit is subjected to environmental noise for a time period of T /2, followed by a cycle of stabilizer measurements and error correction, and then the logical qubit is again subjected to environmental noise for T /2.Lastly the logical qubit is decoded and measured.

AFIG. 12 .
FIG.12.Circuits and diagrams for fault tolerant error correction.(a) a round of fault tolerant stabilizer measurement with the five-qubit code.Here we use the Shor's method, with which four ancilla qubits are entangled into the cat state with some error probability and an additional qubit is used to verify the cat state is successfully prepared.After the stabilizer measurement, the ancillas are decoded, followed by measurement in x-basis.(b) a round of fault tolerant stabilizer checks with the seven-qubit Steane code, again using Shor's method.Since each stabilizer check detects either phase or bit flips, results can be obtained by checking the parity of measurement results of all four ancillas without decoding.(c) the circuit to achieve fault tolerant correction of the five-qubit code with only two ancillas.The first ancilla is used for stabilizer measurement, while the other one acts as the flag qubit: it returns -1 once any weight 2 errors occurs, and all such errors render a unique error syndrome thus can be corrected.(d) the same approach as in (c), but for for the seven-qubit Steane code.(e) stabilizer measurements of ancillas following a particular order to achieve fault tolerance with the rotated nine-qubit surface code.The large circles stand for the data qubits and the small circles are ancillas.The stabilizer measurement should follow the order denoted by the colour orange, blue, green and finally purple.Since the ancilla labelled 3 can physically act as the ancilla labelled 2 after finishing the measurement in the blue half-circle and that also works for ancilla 4, which can act as ancilla 1 after the measurement in the yellow half-circle, in total six ancillas are required to demonstrate fault tolerance.(f) schematic view of the whole cycle of Shor-type fault-tolerant Alice-Igor-Bob scenario with the five-qubit code ((a) in this figure).The same procedure also works for all the others described above.Three rounds of a full set of stabilizer measurements are required to obtain the correct error syndrome as to avoid artificially introducing new errors through error correction based on the wrong syndrome.

FIG. 14 .
FIG. 14. Comparing memories employing FT verus a non-FT error correction.In this figure we plot the 'integrity at interruption' to look inside a memory process, as discussed earlier for Figs.2 and 3. We compare three memory channels all of the same duration τ = 0.2 T .The blue line is our standard reference, the single-qubit memory.The other two are based on the five-qubit code, with the error rate of all the gates involved in the error correction process to be 0.1%.The data shown in orange are for the memory channel protected by Igor using a non-FT error correction, and the optimal number of such cycles is 2. The data shown in green is for a more sophisticated Igor using the fault tolerant circuit shown in Fig.12(c).It is interesting to note that the optimal number of error correction cycles is now 4. However the overall performance is near-identical (i.e.lines are very close on the far right).

FIG. 15 .
FIG.15.Integrity in a pure dephasing environment.Plot shows the integrity for a memory channel using a the seven-qubit Steane code, and and single round of Igor's error correction procedure with a gate error rate of 0.5%.Whereas all other plots in this paper correspond to a pure depolarising environment, here we have a pure dephasing environment.Consequently Bob's ability to guess the nature of the received state depends strongly on Alice's choice of which qubit to send: If she sends a z-basis eigenstate then Bob's success is certain.Note that while the y-axis is labelled 'Integrity' only the blue and yellow lines conform to the definition, Eqn.(5).
convex combination of the scalars α 2 j , which is minimised by setting r 2 j = 1 for the smallest coefficient α j and r j = 0 otherwise.Thus R(Φ) = min j

Without Error Correction: Memory
Φ 0 2a The n physical qubits are subjected to environmental noise for a time τ .With Error Correction: Memory Φ 1 2a The n physical qubits are subjected to environmental noise for a time (τ − δ)/2.2b Optionally, Igor is asked to apply a full round of imperfect error correction, taking time δ.2c The n physical qubits are subjected to environmental noise for a further time (τ − δ)/2.

TABLE II .
Expanding onStep 2 of TableIwhen we wish to assess the benefits of error correction.
The solid lines here correspond to the performance of Bob as we have specified him within our definition of integrity.The vertical axis here is Bob's probability of making a successful guess, and the solid lines correspond to memory channels with a single round of Igor's error correction with error rate 0.5%.The dotted lines are the performance of a more powerful Bob as described in the text; the dotted and solid lines are essential identical except for the nine-qubit code.
FIG.13.Effect of a 'more powerful' Bob.