Simulation and performance analysis of quantum error correction with a rotated surface code under a realistic noise model

The demonstration of quantum error correction (QEC) is one of the most important milestones in the realization of fully-fledged quantum computers. Toward this, QEC experiments using the surface codes have recently been actively conducted. However, it has not yet been realized to protect logical quantum information beyond the physical coherence time. In this work, we performed a full simulation of QEC for the rotated surface codes with a code distance 5, which employs 49 qubits and is within reach of the current state-of-the-art quantum computers. In particular, we evaluate the logical error probability in a realistic noise model that incorporates not only stochastic Pauli errors but also coherent errors due to a systematic control error or unintended interactions. While a straightforward simulation of 49 qubits is not tractable within a reasonable computational time, we reduced the number of qubits required to 26 qubits by delaying the syndrome measurement in simulation. This and a fast quantum computer simulator, Qulacs, implemented on GPU allows us to simulate full QEC with an arbitrary local noise within reasonable simulation time. Based on the numerical results, we also construct and verify an effective model to incorporate the effect of the coherent error into a stochastic noise model. This allows us to understand what the effect coherent error has on the logical error probability on a large scale without full simulation based on the detailed full simulation of a small scale. The present simulation framework and effective model, which can handle arbitrary local noise, will play a vital role in clarifying the physical parameters that future experimental QEC should target.


I. INTRODUCTION
Quantum error correction (QEC) is essential for the realization of quantum computers because physical qubits suffer from errors due to decoherence caused by undesirable interactions with the environment.QEC protects them from such errors by encoding logical information of qubits on many physical qubits [1].With the progress of quantum hardware, it is becoming possible to precisely control tens to a hundred qubits, leading to experimental demonstrations of simple QEC codes on a variety of physical systems [2][3][4][5][6][7].Surface codes proposed by Kitaev [8] has attracted much attention as a method to implement an error correction with superconducting qubits due to their relatively high threshold for local errors and their implementability using a two-dimensional lattice of qubits.By using the rotated surface code [9], we can make one logical qubit with code distance d using only 2d 2 − 1 qubits.This means that we can implement d = 3 and d = 5 surface codes with 17 and 49 physical qubits, respectively.Currently available devices such as the ones presented in [10,11] can handle qubits of this scale.Experimental efforts are underway to demonstrate QEC with the surface codes using the superconducting qubits.Ref. [7] has achieved exponential suppression of the logical error probability with the onedimensional repetitive code, which is a one-dimensional substructure of the surface code.Moreover, Refs.[12][13][14] have implemented all of the operations necessary for the implementation of QEC in a two-dimensional surface code with d = 3, while they do not achieve the break-even point, that is, the logical error probability is smaller than the physical error probability.
To demonstrate that QEC can actually achieve a logical error probability lower than the physical one, it is essential to implement a surface code with a code distance of d = 5 that can correct up to two errors.This is because two-qubit operations inevitably introduce two-qubit correlated errors on physical qubits.However, successful experimental realizations of surface codes [7,[12][13][14][15] are still up to d = 3 [12][13][14] possibly due to the limited fidelity of gates and readouts in present quantum devices.
To clarify what ultimately limits the experimental implementation of the error correction, detailed numerical analyses are required; we need to determine how much performance is necessary for which parameters, and how much the logical error probability can be reduced if they are achieved.
Numerical experiments of surface codes have been car- In this case, the Gottesman-Knill theorem [16] allows us to simulate even large systems efficiently.In real experimental systems, unfortunately, there is a noise that has coherence and cannot be described by stochastic Pauli errors originating from, for example, over-rotation with a systematic control error, global external fields, cross-talk and so on.Simulating QEC with these noises is as difficult as simulating a universal quantum computer in general.However, in certain limited cases, it is possible to numerically evaluate their performance.For example, a mixture of coherent and incoherent noise on the one-dimensional repetition code has been analysed in detail by making use of its exact solvability mapping it to free-fermionic dynamics [17].The d = 3 rotated surface code with amplitude damping and dephasing [18] has been analysed by exact simulation of the system, which is possible due to its small number of qubits.A sophisticated technique for contraction of 2D tensor networks has been used to simulate surface codes with arbitrary local noise on the data qubits, while the syndrome measurements are assumed to be ideal [19].It is not clear if this method can be extended to simulate circuit-level noise, where each elementary operation is subject to noise.More recently, quasiprobability decomposition of non-Clifford channels into Clifford channels is utilized to simulate surface codes with a small coherent noise [20].This method is, however, not applicable to arbitrary noise because the coherence of the noise increases its sampling overhead exponentially.Given the finite precision of control systems in actual experiments, the existence of coherent errors is inevitable.A detailed simulation of the surface code with d = 5, which is the near-term milestone of QEC, is still challenging for classical computers.A framework to realize such simulations and to obtain knowledge on the impact of a coherent error on QEC is highly demanded.
In this work, we fully simulate the QEC under a realistic noise model, including incoherent and coherent noise, in the d = 5 rotated surface code with 49 physical qubits, and analyzed the effect of coherent errors on the logical error probability.The main obstacle to its analysis is that a straightforward simulation of 49 qubits would require a complex vector of dimension 2 49 .This prevents us from simulating the dynamics with a realistic computational resource.We overcome this obstacle by exploiting the structure of the syndrome measurement and reusing the measured qubits in the simulation.This allows us to achieve a full simulation of the d = 5 rotated surface code by simulating only 26 qubits, thus making it feasible to analyze the effects of arbitrary local noise models on this QEC code.In particular, assuming its implementation on superconducting qubits, we use a realistic gate set and noise model, such as coherent errors in one-qubit operations and cross resonance gates in addition to naive stochastic Pauli errors.Moreover, we develop an effective model of physical error probability for incorporating the effects of coherent errors in rotated surface codes combining the simulation results and the previous analysis of coherent errors in 1D repetitive codes [17].Using this model, we investigate the possible regime of coherence time, gate time, coherent error ratio, etc., required for maintaining the quantum information of a logical qubit beyond the coherence time of a physical qubit.The results show that if the ratio of gate operation time to coherence time is below 0.005, the lifetime of the logical qubit exceeds that of the physical qubit, even if coherent errors occur with the same magnitude as their incoherent counterparts.On the other hand, it was also found that if the magnitude of the coherent error can be reduced to 20% of the incoherent one, the ratio of gate operation time to coherence time is acceptable up to 0.007.The present simulation framework for QEC would provide an important guideline for future experimental demonstrations of QEC to extend the lifetime of logical qubits.

II. SIMULATION METHODS FOR d = 5
ROTATED SURFACE CODE A. Circuits for syndrome measurements The d = 5 rotated surface code, which is the target in this work, is shown in FIG.1a.White circles and black circles in Fig. 1a represent data qubits and ancilla qubits for the sydrome measurements, respectively.The list of stabilizers of this code is summarized in Table I.In this table, X i , Z i mean Pauli operators acting on the i-th data qubit.These stabilizers are also illustrated in Fig. 1a.X-type stabilizers correspond to yellow plaquettes, and Z-type stabilizers do to ocher ones.These stabilizers are measured with the circuits shown in Figs.1b  and 1c, respectively.
The order of CNOT gates is important to determine the minimum depth of the syndrome measurement circuit.In this work, we choose the following order.In the case of X-type stabilizers, they are applied clockwise from the bottom right, while in the case of Z-type it is  clockwise from the top right.For example, if Z 1 Z 2 Z 6 Z 7 is to be measured, we apply CNOT gates with the order of 2,7,6,1.We have to make a special treatment for the measurement qubits on the boundary as they have fewer CNOT gates than the other measurement qubits.
In this work, we make them "wait" if their target data qubit doesn't exist.While "waiting", one-qubit noise is applied.For example, the sequence for measuring X 1 X 2 is "2, 1, wait, wait", and for measuring X 22 X 23 is "wait, wait, 22, 23".

B. Reducing the number of qubits for simulation
If we straightforwardly simulate 49 qubits, we need to reserve a 2 49 -dimensional complex vector on a classical memory.It prohibits us to simulate the error correction procedure with a practical computational resource.To overcome this obstacle, we reduce the number of qubits that have to be simulated by reusing the measured qubits.As an illustrative example of this, we show the case for the one-dimensional repetition code in FIG. 2. While in the actual experiment, the syndrome measurements are done in parallel for each measurement qubit, we delay them so that one syndrome measurement runs at a time.This strategy allows us to reuse one measurement qubit for multiple stabiliser measurements without changing the system to be simulated.Note that the same effect can be obtained by analytically calculating a set of POVM operators corresponding to each syndrome measurement and applying them with appropriate probabilities.However, the circuit-based noise model with coherent error considered here is somewhat complicated and hence we avoid this approach.
When applying the proposed method to surface codes, we have to take care of the order of the two-qubit gates in the three-dimensional arrangement so that each syndrome measurement circuit can be delayed without any collision.A three-dimensional unit block corresponding to the syndrome measurements for X-and Z-type stabilizers is shown in FIG.3a.The unit block consists of two types of rectangular blocks stacked on a time axis.The rectangle block of 1 × 1 × 1 represents a one-qubit gate applied to a measurement qubit and the rectangle block of 2 × 1 × 1 represents a two-qubit gate between a measurement qubits and an adjacent data qubit.Using these 3D blocks, we construct a syndrome measurement circuit for the whole surface code as in FIG.3b.As you can see, the blocks are assembled in such a way that they can be delayed without any collision.This indicates that the measurement qubits can be reused as same as the one-dimensional case by delaying the syndrome measurements appropriately.Specifically, the numbers written in black circles in FIG.1a correspond to the order in which the measurements are to be executed.Each syndrome measurement circuit is complied for parallel X-and Z-type syndrome measurements on the surface codes.Note that each syndrome measurement circuit can be delayed without any collision following the order shown in each block so that the syndrome measurements are done sequentially to reduce the number of qubits in simulation.

III. NUMERICAL EXPERIMENT A. Simulated system
The simulation method in Sec.II allows us to effectively perform the full-vector simulation of d = 5 rotated surface code, and therefore to evaluate its performance under any local noise model.We consider a situation where two types of noise, incoherent and coherent, act on physical qubits in a syndrome measurement circuit.Here, we describe the concrete gateset and noise model that are used in the simulation.
To conduct a realistic simulation, we consider a hardware-native gateset common to the superconducting devices and compile the syndrome measurement circuit with those gates.More concretely, we use a gate- to perform the syndrome measurements.This gateset is commonly used in the superconducting qubits with cross resonance gate [21,22].With these gate sets, the syndrome measurement circuit can be rewritten as in FIG. 4, where three changes are made from the circuit shown in FIG.1b and FIG.1c.Firstly, we replace CNOT gates in FIG.1c with R zx (π/2) gates.Second, for the two Hadamard gates in the circuit of FIG.1b, we replaced the former one by the R † x (π/2) gate and the latter one by the R x (π/2) gate.Finally, we apply R x (π/2) gates to the data qubits after the circuit shown in FIG.1b and R z (π/2) gates to the data qubits after the circuit in FIG.1c.These one-qubit rotation gates restore the errors transformed to Y error by R zx (π/2) gates.
Next, let us define the noise model used in the simulation and see how incoherent noise is incorporated.We assume that the single-qubit depolarizing noise, acts on every qubit at each step of the measurement circuit in FIG. 4. Same noise occurs in the "waiting" qubit where the gate does not act.For the two qubits after the cross-resonance gates, we apply the two-qubit depolarizing noise: We call the parameter p the physical error probability.In this paper, the probability of each Pauli error is set to be equal, but it is not difficult to reflect the actual distribution of stochastic errors.Next, we describe coherent noise.The coherent noise was modelled as an (unintentional) increase in the rotation angle of each rotation gate.This increase is referred to as an over-rotation error.Since this is associated with the rotation gate, it does not act on the "waiting" data qubit.In this study, we want to model the error probability with the single parameter p.To this end, we introduce a coherent error ratio c and set the over-rotation angle to be θ = 2c √ p.In other words, for a rotation gate generated by a Pauli operator A, we add the coherent noise channel in the form of: The reason why we set θ = 2c √ p is as follows.Consider the expectation value of Since θ 1, the bit-flip probability p flip associated with this over-rotation is, Or equivalently, if the coherence of noise is destroyed at each step, for example, by using the twirling operation, then such a decohered noise map corresponds to a probabilistic Pauli error with probability c 2 p.If the coherent errors experience constructive or destructive interferences, then the effect of the coherent error would be increased or decreased against c 2 p.The parameter c controls the magnitude of the coherent error compared to the incoherent one.

B. Numerical simulation
We employ one of the fastest classical simulators of quantum circuits, Qulacs [23].In the simulation, all data qubits are first initialised to |0 and projected to the surface code state by performing noise-free syndrome measurements with zero outcomes.Next, we run syndrome measurement circuits with circuit-level noise as explained above for five rounds.After completing five rounds of measurements, all data qubits were subjected to projective measurements in the Pauli Z basis.The above procedure was repeated 10000 times.In decoding, as usual, we took the XOR of the syndrome of the adjacent rounds to determine the position where the syndrome is flipped.With this information, we estimated the error positions using the minimum weight perfect matching (MWPM) algorithm implemented in NetworkX [24].After applying the recovery operation using the estimated errors, we finally calculate the eigenvalue of the logical Pauli Z operator Z L = Z 1 Z 7 Z 13 Z 19 Z 25 from the final projective measurement.The logical error probability p L is estimated by dividing the number of Z L = 1 occurrences by 10000.We varied p from 10 −3 to 7.0 × 10 −2 and c from 0.0 to 1.0 by 0.25.For each parameter pair (p, c), the calculation took 18 hours in the absence of coherent errors and up to 80 hours in their presence using an NVIDIA A100 GPU.
The obtained p L is shown in FIG. 5.For p smaller than about 3.0 × 10 −3 , we can see that p L decreases if p is decreased.Furthermore, p L satisfies p L = Ap ξ at value of c within the statistical error.By fitting the numerical values of p L at c = 0 for = 1.0 × 10 −3 3.0 × 10 p L = Ap ξ using two parameters ξ), we obtain A = 6.5 10 5 ξ = 2.92.The value of ξ is consistent with the expectation that it should be d+1 2 = 3.One might think that the contribution coherent error is small because such a small angle rotation can be frozen by repetitive projections for the syndrome measurements.However, even for a small ratio c = 0.25, it has a negligible contribution to the logical error probability.This result clearly shows that the effect of the coherence error is important to estimate the experimentally achievable logical error probability accurately.

C. Effective model incorporating the coherent error
In order to understand the effect of coherent noise on p L , we consider how to effectively incorporate the effect of coherent error as a leading order correction to the incoherent error p.Since we expect that the leading-order contribution of the coherent error to the effective error p eff is proportional to c 2 p, we model p eff as, This is because while the probability amplitude for the coherent error is ∼ c √ p, such an error becomes a detectable event if and only if such an error occurs twice on either ket or bra spaces in the density operator picture [17].The coefficient α takes into account the fact that the coherent errors can interfere with each other and therefore their contribution to p eff can be not exactly c 2 p.As mentioned before, if the coherence is destroyed at each step, then α should be a unit.Then, we assume that the logical error probability under the coherent error is given by replacing the physical probability p in the case of c = 0 with p eff .More pre-cisely, the logical error probability p L should be obtained by replacing p in Eq. ( 9) with p eff : where A and ξ are thought to be the same as those with c = 0.The validity of this model is confirmed by detailed numerical calculations carried out on the 1D repetition codes in the previous study [17].To test this assumption for the two-dimensional case, we estimate the value of α by the following procedure.First, we fit p L obtained at various c's in the range of p = 1.0 × 10 −3 to 3.0 × 10 −3 with p L = A(Bp) ξ using B as the fitting parameter while using the fixed A and ξ obtained at c = 0.Then, we fit B with 1 + αc 2 .As a result we obtain α = 0.872 and the ratio p eff /p shown in FIG.6 implies that this fitting goes well supporting our assumption.Another interesting fact is the coefficient α = 0.872 is smaller than a unit meaning the coherent error interferes in a destructive way.This implies that the coherent error modelled in this work is not so damaging for QEC, since the logical error probability is increased when the coherence is destroyed at each step by twirling.Since this behaviour of leading order contribution of the coherent error is a local property of the noise, the effective model obtained is to be valid not only when p is reduced for 5, but also when the distance d is further increased.this is we can estimate the logical error probability under the coherent error by combining a limited size of full simulation and a large size of simulation with stochastic Pauli noise.

D. Experimental consideration
concrete usage of this model, here we argue in what situation an experimental QEC can achive a longer lifetime t L of logical quantum information against a physical coherence time t c by calculating t L /t c .First, we rewrite the error probability p using the coherence time t c and time t g required for each gate operation.For clarity, we assume that the error probability is well approximated by: This is the situation where a quantum gate is wellcalibrated and the coherence-time-limited fidelity is achieved.Second, we rewrite the logical lifetime t L using the logical error probability p L .Letting N steps = 11 be the number of steps in one cycle of the syndrome measurement (see Fig. 4), it takes physical time dN steps t g to conduct d cycles of syndrome measurements.Since the logical error occurs with probability p L in this time, the logical lifetime is roughly given by Finally, combining Eqs. ( 10)-( 12), we obtain the following relation: A graph plotting t L /t c as a function of c and t g /t c is shown in the FIG. 7. The part of the graph marked in red is the parameter region where t L /t c is below 1.In this region, the error correction procedure itself damages the lifetime and therefore is meaningless for protecting the quantum information.To t L /t c 1, the gate and coherence time ratio t c depends on the amount of coherent error and ranges from 0.005 to 0.007.If the ratio is reduced to t g /t c = 0.001, the lifetime of the logical qubit is improved by a factor of tens against the coherence time even in the presence of the coherence error with c = 1.In this case, the over-rotation angle is θ ∼ 0.06, which would be experimentally detectable and hopefully can be calibrated [25].
Finally, let us discuss the experiments on the rotated surface code with code distance 3 carried out by different research groups in 2021 [12,13].The main parameters of each experimental system are given in TABLE II.For p 1Q , p 2Q in the table, Krinner's group evaluated it by Interleaved Randomized Benchmarking (Interleaved RB) and Zhao's group evaluated it by Cross Entropy Benchmarking (XEB).Note that while these are great progress toward experimental QEC, neither group has succeeded in QEC in a strict sense.Krinner's group has implemented a QEC protocol, but was unable to make the lifetime of the logical qubit T 1,L longer than the lifetime of the physical one T 1 .Zhao's group has only implemented the error detection and postselection.The main reason for the lack of successful error correction would be the short code distance.The distance 3 code cannot correct two-qubit errors that occur during two-qubit gates.
Let us see whether or not a successful QEC is reachable if the code distance is increased to 5 and consider what elements should be improved if it is not the case.Since p 2Q is 1.5 %, 1.035 %, which is outside the region where p L = Ap holds in Figure 5, QEC is expected to fail even if the code distance is increased to 5. The ratios of the two-qubit gate and coherence time are T g,2 /T 1 = 0.003 and = 0.001 for Krinners' and Zhaos' groups, respectively.This is sufficiently small from our analysis.However, p 2Q are, respectively, given by 1.5 % and 1.035 %, which is much higher than those limited by the coherence time.This implies that this infidelity caused by a systematic control error or cross-talk resulting in coherent errors.Therefore, by improving their control strategies, there would be a great possibility to achieve a breakeven point by experimental QEC in the near future; at least the coherence time does not become the main obstacle for it.In this study, we constructed a framework to fully simulate QEC on the distance 5 rotated surface code under an arbitrary local noise.Furthermore, we have constructed an effective model that explains the behaviour of the logical error probability under the coherent errors within the stochastic Pauli noise model with an appropriate modification.Therefore, combining our numerical result and the effective model, we can analyse the behaviour of the logical error probability with smaller a physical error probability or larger code While we only modelled the over-rotation caused by a systematic control error, there are plenty of sources of coherent errors such as unintended interactions in Hamiltonian, cross-talk, global fields and so on.These sources of noise would be straightforwardly incorporated into our framework.The performance analysis under a realistic noise model is becoming increasingly important, and our framework will provide a vital guideline for future improvements on experimental sides.

FIG. 1 .
FIG. 1. (a)The d = 5 rotated surface codes.Yellow faces( ) corresponds to X-type stabilizer and ocher ones( ) corresponds to Z-type stabilizer.White circles( ) means data qubits with their index, and black circles( ) means ancilla qubits used for measurement and the order in which the measurement circuits are run.(b)Circuit for the X-type stabilizer measurement (c)Circuit for the Z-type stabilizer measurement.

FIG. 2 .
FIG. 2. A method to reduce the number of qubits in simulation in the case of the one-dimensional repetition code.(a) The original syndrome measurement circuit.(b) A timeshifted version of the original one.

FIG. 3 .
FIG. 3. (a)Left and right blocks represent the syndrome measurement circuits for X-and Z-stabilizers, respectively.(b) Each syndrome measurement circuit is complied for parallel X-and Z-type syndrome measurements on the surface codes.Note that each syndrome measurement circuit can be delayed without any collision following the order shown in each block so that the syndrome measurements are done sequentially to reduce the number of qubits in simulation.

FIG. 4 .
FIG.4.A syndrome measurement circuit for the rotated surface codes consisting of cross resonance gates and Virtual-Z gates.The rotation angle of the Rx, Rz, Rzx gates is π/2 and that of the R †x gate is −π/2.

FIG. 5 .
FIG. 5.The logical error probability is plotted as a function of the physical error probability p with coherent-noise parameters c = 0, 0.25, 0.5, 0.75, 1.0.The dotted lines correspond to the results of the fitting.

FIG. 7 .
FIG. 7. The lifetime tL of a logical qubit, calculated from the coherent noise parameter c, the gate operation time tg and the coherent time tc of the physical qubit, divided by tc.The upper graph is a three-dimensional representation of tL/tc, while the lower graph shows the relationship between tg/tc and c in more detail.The red area in the upper graph and the shaded area in the lower graph show the area where tL < tc.
out under various noise models.The simplest, albeit not truly realistic, model is the stochastic Pauli errors where Pauli operators act on the qubits probabilistically.

TABLE II .
Parameters of experiments which are implemented by two different groups.