## Abstract

Medium-scale quantum devices that integrate about hundreds of physical qubits are likely to be developed in the near future. However, these devices will lack the resources for realizing quantum fault tolerance. Therefore, the main challenge of exploring the advantage of quantum computation is to minimize the impact of device and control imperfections without complete logical encoding. Quantum error mitigation is a solution satisfying the requirement. Here, we demonstrate an error mitigation protocol based on gate set tomography and quasi-probability decomposition. One- and two-qubit circuits are tested on a superconducting device, and computation errors are successfully suppressed. Because this protocol is universal for digital quantum computers and algorithms computing expected values, our results suggest that error mitigation can be an essential component of near-future quantum computation.

## INTRODUCTION

Quantum computers are quantum-mechanical devices capable of solving problems that are believed to be intractable for classical computers. The most essential issue in practicing quantum computation is to deal with imperfections of the device and control that cause computation errors. Quantum error correction can suppress the chance of errors to an arbitrarily low level, which, however, is beyond the scope of near-future technologies (*1*, *2*). For shallow algorithms executed on near-future quantum devices (*3*–*9*), quantum error mitigation methods (*10*, *11*) have been proposed recently to attain a computation result with minimal errors. This approach is practical because complete logical encoding is not required. The probabilistic error cancellation (PEC) protocol based on a combination of gate set tomography (GST) and quasi-probability decomposition is one of those methods (*12*), which can be applied to any platform without prior knowledge of imperfections and works for any algorithm that outcomes are expected values of certain observables. In this method, certain quantum circuits are first executed to identify a model of imperfections, and then random circuits are sampled from a distribution according to the model (see Fig. 1A). The theory suggests that the average of these random circuits can provide an accurate computation result. Here, we demonstrate the experimental realization of this method for the first time. The device is a superconducting circuit consisting of 10 frequency-tunable transmon qubits, among which four qubits are actively used in the demonstration. Details of the device can be seen in (*13*). We use single- and two-qubit circuits to test this method and find that, with error mitigation, the computation accuracy is substantially improved.

We use GST (*14*–*16*) to acquire information about the measurement and gate errors in the experiment, which is then used in PEC to decompose any ideal measurement or gate by those experimentally accessible ones with errors. GST can be seen as a self-consistent extension of the quantum process tomography, which takes into account all the errors that occurred in the experimental operations including state preparations, quantum gates, and measurements.

We use Pauli transfer matrix (PTM) representation to notate quantum states, quantum gates, and measurements as commonly adopted in quantum tomography. We define σ* _{i}* as the

*i*th operator from the

*n*-qubit Pauli basis

*I*,

*X*,

*Y*, and

*Z*denote the identity and three Pauli matrices, respectively. In PTM representation, a state ρ is expressed as a column vector ∣ρ〉〉 with elements ∣ρ〉〉

*= Tr(σ*

_{i}_{i}ρ). An observable

*Q*is expressed as a row vector 〈〈

*Q*∣ with elements 〈〈

*Q*∣

*=*

_{i}*Tr*(σ

*)/2*

_{i}Q*. The superoperator U of a gate is expressed as a matrix*

^{n}*Q*in the state ρ going through a sequence of gates

*i*1〉}

^{⊗n}= {ρ

*} as initial states and Pauli operators in P as observables. Using the PTM representation, we can express the set of initial states as the state preparation matrix*

_{j}*g*

^{exp}=

*B*

^{exp}

*A*

^{exp}and the matrix characterizing the superoperator U, i.e.,

Experimental operations of *A*^{exp}, *B*^{exp}, and *g*^{exp} and *g*^{exp} and *A*^{exp}, where the caret symbol is introduced to differentiate an estimate from the physical operation itself. Then, according to the linear inversion method (*14*–*16*), we have the estimates for *B*^{exp} and *A*^{exp} and *12*). With these results obtained from the GST experiment, we can decompose any ideal measurement and gates into experimentally achieved operations.

Given the decomposition formulas (*12*), we randomly generate circuits modified from the original circuit of the computation task and implement these random circuits to obtain the computation result with error mitigated, because errors in random circuits cancel each other when taking the average. Here, we only decompose and replace the measurement and two-qubit gate in the original circuit while the state preparation and single-qubit gates are unchanged. We do this because the error of the previous two is larger than the latter by an order of magnitude. To be explicit, by heralding the ground state for qubit preparation and measuring the heating rate (*17*), we estimate the ground state preparation error to be below 0.25%; error rates of single-qubit gates are calibrated to be below 0.25% in randomized benchmarking (*18*–*20*). In comparison, the readout error is about 3.5% for the ground state and 5.7% for the excited state; the two-qubit gates applied in this paper have errors around 7%. Gate fidelities can be further boosted on our device, however, this is unnecessary for the purpose of PEC demonstration.

## RESULTS

### Mitigating readout error in one-qubit computation

We first test the effect of PEC with a one-qubit computation, whose circuit is shown in Fig. 3A. In this circuit, we initialize the qubit by heralding the state ∣0〉, with a state fidelity above 0.997. Then, the gate *x* axis by π/2, after which the operator *Z* is measured. The measurement is denoted by *M _{Z}* in the circuit, which yields an outcome of −1 or 1. We repetitively implement the circuit 3000 times and take the average as the expected value of

*Z*. We then repeat the same procedure to obtain 100 expected values. Sample numbers are the same in non-PEC and PEC experiments. The histogram analysis of the resulting data is shown in the top panel of Fig. 3F. The average over 100 expected values gives 〈

*Z*〉

^{exp}= 0.027 ± 0.016.

Because the state preparation and single-qubit gate are both quite precise, the relatively large deviation of 〈*Z*〉^{exp} from zero, i.e., the ideal result, is mainly due to the readout error, which we intend to mitigate by decomposing the readout operation. To work out the decomposition formula, we obtain the Gram matrix *g*^{exp} in the experiment, and the result is shown in Fig. 2B. Assuming the error-free state preparation, we can take a reasonable estimate of *A*^{exp} as*I*, *X*, *Y*, and *Z*. With *Z* in the form *q _{i}* are elements of the vector

*Z*in the original circuit is replaced by the measurement of

*q*∣/∑

_{i}*∣*

_{l}*q*∣. In the experiment, measurements of

_{l}*X*- and

*Y*-basis measurements, are implemented by inserting gates

*Y*

_{π/2}and

*X*

_{π/2}, respectively, before the usual

*Z*-basis measurement. Here,

*I*). When taking the average of measurement outcomes, each outcome is multiplied by a weight factor of

*w*= sgn(

_{i}*q*) ⋅ ∑

_{i}*∣*

_{l}*q*∣. We take this weighted average as the expected value of

_{l}*Z*. Then, we repeat the above procedure to obtain 100 expected values, and the average over all these expected values yields 〈

*Z*〉

^{PEC}= 0.003 ± 0.022 as shown in the bottom panel of Fig. 3F. The accuracy of the computation is successfully improved compared with the computation without PEC.

### Mitigating readout and entangling gate errors in two-qubit computation

Now, we turn to a two-qubit computation, taking the deterministic quantum computation with pure states (DQCp) (*21*) as an example. The circuit is shown in Fig. 3C. A main error source in this circuit is the controlled-ϕ-phase gate *U*_{ϕ} (*22*) plus 10 single-qubit gates, as shown in Fig. 1C. The two-qubit dressed state gate essentially achieves a controlled-ϕ-phase gate in the *X* basis, and single-qubit gates are used to transform the *X* basis into the *Z* basis. Fidelities of different *C*_{ϕ} gates are 0.958 ± 0.010, 0.935 ± 0.011, 0.920 ± 0.011, and 0.915 ± 0.011 for ϕ = π/4, π/2, 3π/4, and π, respectively, characterized using GST. Gate fidelities can be further boosted on our device, however, this is unnecessary for the purpose of PEC demonstration.

To mitigate the error in *C*_{ϕ}, we need first to work out the decomposition formula. Given the ideal superoperator U representing *C*_{ϕ}, the decomposition formula reads

In our experiment, 257 operations are used for decomposing an ideal *C*_{ϕ} gate. The first 256 operations are generated from the tensor product of 16 single-qubit operations, which include measurement and reset gates, as listed in Table 1. The 257th operation is the gate *C*_{ϕ} modified by the Pauli twirling as explained in Materials and Methods. We reconstruct the experimental operations of *C*_{ϕ} and single-qubit measurement-reset gates in GST, while we simply assume that single-qubit gates are error-free, because single-qubit gates can be experimentally implemented with high fidelity. Unlike the state preparation, assuming error-free single-qubit gates can potentially cause inaccuracy in the quantum computation with PEC. PTM of the controlled-π-phase gate *C*_{π} obtained using GST is illustrated in Fig. 2C as an example. These 257 operations are linearly independent, which ensures that the decomposition solutions can always be found by solving a system of linear equations. In all solutions, we choose the one with the minimum in

The measurement-reset operation is occasionally used in random circuits (see Table 1). To minimize the time of reset, we realize the reset gate using ancilla qubits QA1 and QA2 on the same chip (see Fig. 1B). Each reset operation uses an ancilla qubit initially prepared in the ground state ∣0〉, and then a swap gate is applied to reinitialize the target qubit when the reset is requested (*13*), following which a single-qubit gate *G* with the fidelity above 0.997 rotates the qubit to the state ∣ψ〉, as shown in Fig. 1D. The whole measurement-reset operation typically has a fidelity of around 0.916.

In the two-qubit computation with PEC, to mitigate both readout and two-qubit gate errors, the gate *C*_{ϕ} is randomly replaced by the gate *X* is replaced by the measurement of

In the experiment, we adjust the phase ϕ of *C*_{ϕ} and measure the expected value of *X*. When implementing the computation with PEC, we randomly sample a circuit according to the decompositions of both *C*_{ϕ} and the observable *X*. Representative decomposed sampling circuits are shown in Fig. 3E. The experiment result is shown in Fig. 3G, which demonstrates a substantial improvement on the computation accuracy.

The most substantial improvement is obtained at ϕ = π/2, in which case the difference between the computation result and the ideal value is reduced from 0.1690 to 0.0102 by using PEC. To estimate the fidelity required to achieve the same computation accuracy, we consider a quantum system with depolarizing error channels (*23*) and assume that the state preparation and single-qubit gates are ideal. The depolarizing error channel either preserves or completely destroys the information with certain probabilities (see the Supplementary Materials), which does not characterize our device. We choose the depolarizing model because it takes all possible errors into account with equal probability. In the depolarizing model, the two-qubit gate and measurement with the fidelity ∼99.3% are required to achieve the computation accuracy 0.0102, which is comparable to the highest fidelity reported in the superconducting qubit system (*20*, *24*).

## DISCUSSION

For multiqubit devices, GST of the entire device is not practical, because the experiment time increases exponentially with the qubit number. Similarly, the number of operations for decomposing a multiqubit gate also increases exponentially with the qubit number. Single- and two-qubit gates are sufficient for the universal quantum computation. Therefore, if errors are uncorrelated, then we only need to implement GST up to two qubits and decompose two-qubit gates, as demonstrated in our experiment. Errors are uncorrelated if the evolution of two qubits under a two-qubit gate is independent from the evolution of other qubits. As a result of the evolution, the quantum operation on the entire device can be factorized into the product of an operation on the two qubits and operations on other qubits. It is similar for single-qubit gates. In our device, the primary dephasing noise is dominated by fluctuators in the form of magnetic moments, whose influence is local in each individual physical qubit, and therefore, the dephasing-induced errors are uncorrelated between qubits. In our experiment, we have neglected error correlations in GST so that single-qubit operations are characterized in single-qubit tomography even in the two-qubit experiment. Neglecting error correlations sacrifices accuracy of PEC. A notable effect of correlations on the computation result is not observed in our experiment.

We have experimentally demonstrated that PEC, a universal quantum error mitigation protocol, can substantially reduce the error in quantum computation on a noisy quantum device. The protocol in our experiment does not require subthreshold error rate or tremendous additional physical qubit resources. Compared with the algorithm-specified protocol (*7*) and the extrapolation of gate time (*9*), the combination of GST and quasi-probability decomposition is not restricted to the algorithm or error model. A few techniques in PEC are explored: estimate of the state preparation matrix according to ideal states, Pauli twirling for randomizing the error, approximate GST, and decomposition neglecting error correlations. An important factor limiting the circuit depth in our demonstration is the variance of computation result, which depends on the error rate of quantum gates. Improvement in gate fidelity can extend the circuit depth, and relatively deep circuits can be implemented on intermediate-scale devices with a feasible fidelity (*12*, *25*). By demonstrating the power of error mitigation techniques on the superconducting quantum device, our results highlight the potential of using such techniques in computation tasks on near-future quantum devices.

## MATERIALS AND METHODS

Our device is a superconducting circuit consisting of 10 frequency-tunable transmon qubits, among which four qubits are actively used in the demonstration. Details of the device can be seen in (*13*).

Pauli twirling converts the error in a gate into stochastic Pauli errors (*26*–*28*), which can reduce the variance of the computation result (*12*). The circuit of the gate *C*_{ϕ} with Pauli twirling is shown in Fig. 3D. We sandwich *C*_{ϕ} in between four Pauli gates (two for each qubit), which are randomly chosen but conserve the gate *C*_{ϕ} up to a global phase difference. If all gates are error free, then the two-qubit gate realized in this way is still *C*_{ϕ}, i.e., [*C*_{ϕ}] = ∑_{a,b}*p*_{a,b}[σ* _{c}* ⊗ σ

_{d}*C*

_{ϕ}σ

*⊗ σ*

_{a}*]. Here, we used the bracket notation to denote a superoperator [*

_{b}*C*](ρ) =

*C*ρ

*C*

^{†}, {σ

*} are single-qubit Pauli gates chosen to satisfy σ*

_{i}*⊗ σ*

_{c}

_{d}C_{ϕ}σ

*⊗ σ*

_{a}*= η*

_{b}*C*

_{ϕ}, η can be any phase factor, and

*p*

_{a,b}is the probability. If gates have errors, then the two-qubit gate will be effectively changed by the Pauli twirling. Using the twirled gate as the 257th operation in the decomposition, we need the estimate of the twirled gate, which is

*C*

_{ϕ}obtained in GST. For

*C*

_{π}, the distribution of Pauli gates is uniform, i.e.,

*p*

_{a,b}= 1/16. For other

*C*

_{ϕ}gates where ϕ ≠ π, Pauli gates are chosen from a subset: We take

*p*

_{a,b}= 1/4 if σ

*⊗ σ*

_{a}*∈ {*

_{b}*I*,

*Z*}

^{⊗2}, and

*p*

_{a,b}= 0 otherwise.

## SUPPLEMENTARY MATERIALS

Supplementary material for this article is available at http://advances.sciencemag.org/cgi/content/full/5/9/eaaw5686/DC1

Randomized benchmarking for single-qubit gates

Heating rate measurement

Readout error for Q1 and Q2

One-qubit QEM experiment

Measurement and reset gates

Decomposing *C*_{ϕ} gate

Depolarizing error channels

Fig. S1. Randomized benchmarking data.

Fig. S2. Heating rate measurement.

Fig. S3. One-qubit QEM experiment.

Fig. S4. Measurement-reset gate.

Fig. S5. Decomposition of the *C*_{π} gate.

Table S1. Error rates of readout measured by repeatedly preparing the state ∣0〉 or ∣1〉 and measuring the probability of incorrect output.

Table S2. Gate fidelities for all measurement-reset gates used in this paper.

This is an open-access article distributed under the terms of the Creative Commons Attribution-NonCommercial license, which permits use, distribution, and reproduction in any medium, so long as the resultant use is **not** for commercial advantage and provided the original work is properly cited.

## REFERENCES AND NOTES

**Acknowledgments:**We thank X. Zhu and D. Zheng for providing the device.

**Funding:**This work was supported by the National Basic Research Program of China (grant no. 2017YFA0304300) and the National Natural Science Foundation of China (grant nos. 11434008 and 11725419). Y.L. is supported by the National Natural Science Foundation of China (grant no. 11875050) and NSAF (grant no. U1730449).

**Author contributions:**Y.L. conceived the experiment. C.S., supervised by H.W., carried out the experiment. C.S. and J.C. analyzed the data with support from Y.L. C.S., H.F., and J.H. set up the electronics for measurement. C.S., H.W., and Y.L. co-wrote the paper.

**Competing interests:**The authors declare that they have no competing interests.

**Data and materials availability:**All data needed to evaluate the conclusions in the paper are present in the paper and/or the Supplementary Materials. Additional data related to this paper may be requested from the authors.

- Copyright © 2019 The Authors, some rights reserved; exclusive licensee American Association for the Advancement of Science. No claim to original U.S. Government Works. Distributed under a Creative Commons Attribution NonCommercial License 4.0 (CC BY-NC).