<<
Home , BQP

Readout Rebalancing for Near Term Quantum Computers

Rebecca Hicks,1, ∗ Christian W. Bauer,2, † and Benjamin Nachman2, ‡ 1Physics Department, University of California, Berkeley, Berkeley, CA 94720, USA 2Physics Division, Lawrence Berkeley National Laboratory, Berkeley, CA 94720, USA (Dated: October 16, 2020) Readout errors are a significant source of noise for near term intermediate scale quantum computers. Mismeasuring a as a |1i when it should be |0i occurs much less often than mismeasuring a qubit as a |0i when it should have been |1i. We make the simple observation that one can improve the readout fidelity of quantum computers by applying targeted X gates prior to performing a measurement. These X gates are placed so that the expected number of in the |1i state is minimized. Classical post processing can undo the effect of the X gates so that the expectation value of any observable is unchanged. We show that the statistical uncertainty following readout error corrections is smaller when using readout rebalancing. The statistical advantage is circuit- and computer-dependent, and is demonstrated for the W state, a Grover search, and for a Gaussian state. The benefit in statistical precision is most pronounced (and nearly a factor of two in some cases) when states with many qubits in the excited state have high probability.

I. INTRODUCTION the simple observation that one can improve the readout fidelity of quantum computers by applying targeted X Quantum computers hold great promise for a variety of gates prior to performing a measurement. These X gates scientific and industrial applications. However, existing are placed so that the expected number of qubits in the noisy intermediate-scale quantum (NISQ) computers [1] |1i state is minimized. Classical post processing can undo introduce significant errors that must be mitigated before the effect of the X gates so that the expectation value of achieving useful output. Error mitigation on a quantum any observable is unchanged. This Readout Rebalancing computer [2–6] is significantly different than classical er- must be combined with additional readout corrections to ror mitigation because quantum bits (‘qubits’) cannot be unfold the migrations. Previous studies have proposed copied [7–9]. Full requires sig- symmetrizing the readout with targeted X gates [44, 45], nificant overhead in the additional number of qubits and but we are unaware of any proposal to introduce asym- gates. This has been demonstrated for simple quantum metric rebalancing. Symmetrizing has the advantage that circuits [10–19], but is infeasible on NISQ hardware due it is independent of the measured state and improves to limited qubit counts and circuit depths. Instead, a va- the fidelity of qubits that are more often in the |1i state. riety of schemes have been proposed to mitigate – without However, symmetrizing will necessarily reduce the fidelity completely eliminating – errors. There are two types of er- for qubits that are more often in the |0i state (this is a rors that are targeted by these schemes: those that affect state-dependent statement). the preparation of the quantum state [20–25] and those This paper is organized as follows. SectionII introduces that affect the measurement of the prepared state [26–43]. readout rebalancing and briefly reviews readout error This paper focuses on the latter type – called readout mitigation. Numerical results are presented in Sec.III and errors – and how one can modify the quantum state prior the paper ends with conclusions and outlook in Sec.IV. to readout in order to reduce these errors. Readout errors typically arise from two sources: (1) measurement times are significant in comparison to de- II. METHOD coherence times and thus a qubit in the |1i state1 can decay to the |0i state during a measurement, and (2) To motivate the rebalancing technique, we start with arXiv:2010.07496v1 [quant-] 15 Oct 2020 probability distributions of measured physical quantities that correspond to the |0i and |1i states have overlapping an illustrative example. Suppose that there is a two qubit support and there is a small probability of measuring system with measurement errors Pr(|0ii → |1ii) = 0 and the opposite value. The first of these sources results in Pr(|1ii → |0ii) = qi for i ∈ {0, 1} with no nontrivial asymmetric errors: mismeasuring a qubit as a |1i when it multiqubit readout errors. When qi → 0, there are no should be |0i occurs much less often than mismeasuring readout errors. For simplicity, assume that qi  1 so that 2 a qubit as a |0i when it should have been |1i. We make terms of O(qi ) can be neglected. Suppose that simple matrix inversion is used to correct readout errors and that the state is measured N times. Define N|iji as the number of true counts in state |iji and Nˆ is the number ∗ [email protected] |iji † [email protected] of reconstructed counts in state |iji following readout ‡ [email protected] error corrections. The readout corrections are estimated 1 We consider two-state systems and denote the excited state as by inverting the 4 × 4 matrix encoding the transition |1i and the ground state as |0i. probabilities between any possible true state and any 2

ˆ possible observed state. By construction, E[N|iji] = N|iji. One can show that the variance of the counts after readout |0i correction are given by (for details, see AppendixA) |0i   ˆ N|iji ˆ Var[N|iji] = N|iji 1 − + ∆Var[N|iji] (1) |0i N −1 Ucircuit |0i with |0i ˆ 2 ∆Var[N|00i] = q0N|10i + q1N|01i + O(q ) ˆ 2 |0i ∆Var[N|11i] = (q0 + q1) N|11i + O(q ) (2)  y

In particular, if N = N|11i (i.e. the other states have zero |0i X X true counts), one finds Var[Nˆ ] = 0, while Var[Nˆ ] 6= |00i |11i |0i 0, for non-vanishing qi. On the other hand, if N = ˆ ˆ N|00i, both Var[N|00i] = 0 and Var[N|11i] = 0 vanish. |0i This suggests that if one is trying to measure a state −1 Ucircuit R dominated by |11i, it would be more effective to first |0i invert 0 ↔ 1, perform the measurement, and then swap back the classical bits afterward. |0i X X The readout rebalancing protocol is illustrated in Fig.1. First, the probability mass function over states p(x) is |0i estimated using a small fraction of the total number of intended measurements. Then, a rule is used to determine FIG. 1. An illustration of the Readout Rebalancing protocol. which qubits should be flipped prior to being measured, Here Ucircuit represents the state preparation that must hap- with the goal of switching those qubits that are predomi- pen for each measurement, and the readout error mitigation nantly in the |1i state. There are multiple possible rules, represented by an inverted response matrix R−1 (in practice, and in this paper we use a simple and effective approach. a more sophisticated readout error mitigation scheme may be used) is performed on an ensemble of measured states. From In this approach one first computes hqii, the average value for each qubit i. If this value is greater than 0.5, the qubit the measured values of the qubits of the first circuit which i is set to be flipped and otherwise it is untouched. A uses a small fraction of the total number of runs one then determines which qubits have hq i > 0.5 and should therefore modified circuit is then prepared where single qubit X i be flipped (the first and fifth in our example). One then runs gates are applied at the end of the circuit to the qubits the remaining large fraction of the runs on the modified second set to be flipped. Using this modified circuit one then circuit. performs the intended measurements. These data are corrected for readout errors (more on this below) and then post-processed with classical X gates to undo the quantum X gates. estimate of the response matrix. The simplest readout ˆ −1 As stated earlier, the reason that the readout rebal- error correction approach is simply tmatrix = R t. For a ancing protocol is expected to be effective is that errors variety of reasons, this may be suboptimal and so multi- are asymmetric. While we are not aware of other pro- ple alternative methods have been proposed [39, 47, 48]. posals for biased (circuit-specific) rebalancing, Google In this paper, we will use Iterative Bayesian Unfolding (IBU) [49–51] as described in the context of quantum AI Quantum [44] (through its software [46]) and Rigetti (through its software pyQuil [45]) have proposed computing in Ref. [39]. This iterative procedure starts ˆ0 nqubits symmetric rebalancing whereby the result from a circuit with ti = Pr(m = i) = 1/2 and then is averaged with a version of its complement that uses some pre-determined (non-state-specific) set of X gates. n+1 X tˆ = Pr(t = i|m = j) × mj (3) This approach improves the fidelity of qubits that are i j mostly in the one state, but it degrades the performance ˆn of measuring states where a qubit is mostly in the zero X Rjiti = × mj. (4) P R tˆn state. We will compare to a version of symmeterized read- h k jk k out where measurements are averaged using a nominal circuit and a circuit with X gates. ˆ ˆ100 There are many options for readout error corrections, We will use 100 iterations and label t ≡ t , but the indicated by R−1 in Fig.1. Let m and t represent the results do not depend strongly on this number. raw and true probability mass functions of the state, - The next session will illustrate readout rebalancing for spectively. Furthermore, Rij = Pr(m = i|t = j) is an several example states by combining it with IBU. 3

III. RESULTS 40000 t Simulator 35000 IBMQ Tokyo Readout Errors t Inverted W state To demonstrate readout error corrections, we utilize 30000 m the software package by IBM [52]. Readout errors Qiskit 25000 from the IBM Q Tokyo machine (see Ref. [53]) are im- ported for illustrating the impact of readout rebalancing. 20000 Counts The corresponding response matrix is presented in Fig.2. 15000

Most of the probability mass in the response matrix is 10000 along the diagonal, which represents the probability for 5000 a particular state to be correctly measured. However, there are significant off-diagonal terms, which are more 0 pronounced in the lower right part of the matrix. To 1.2 illustrate this feature, the bottom plot in Fig.2 shows the probability for a state to be correctly measured organized 1.0 by the number of 0’s in the state bitstring. As advertised 0.8 Extracted / Truth 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

earlier, more 1’s in the bitstring correlates with a lower 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 probability of being measured correctly. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 50000 t Qiskit Simulator IBMQ Tokyo Readout Errors |00000 90 5 10 1 7 1 1 0 15 1 2 0 5 0 1 0 5 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 |10000 2 87 0 10 0 6 0 1 0 14 0 2 0 4 0 0 0 4 0 1 0 1 0 0 0 1 0 0 0 0 0 0 t Grover with 11111 oracle |01000 1 0 81 5 0 0 6 0 0 0 14 1 0 0 4 0 0 0 5 0 0 0 0 0 0 0 1 0 0 0 0 0 40000 |11000 0 1 2 78 0 0 0 5 0 0 0 13 0 0 0 4 0 0 0 4 0 0 0 0 0 0 0 1 0 0 0 0 80 m |00100 2 0 0 0 85 5 10 1 1 0 0 0 15 1 2 0 0 0 0 0 5 0 1 0 0 0 0 0 1 0 0 0 |10100 0 2 0 0 2 82 0 9 0 1 0 0 0 14 0 2 0 0 0 0 0 5 0 0 0 0 0 0 0 1 0 0 |01100 0 0 2 0 1 0 76 4 0 0 0 0 0 0 14 1 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1 0 30000 |11100 0 0 0 2 0 1 2 75 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 1 70 |00010 2 0 0 0 0 0 0 0 76 4 8 0 13 1 2 0 1 0 0 0 6 0 1 0 5 0 1 0 1 0 0 0 |10010 0 2 0 0 0 1 0 0 1 74 0 8 0 13 0 2 0 1 0 0 0 5 0 1 0 5 0 0 0 1 0 0 0 0 2 0 0 0 0 0 1 0 68 4 0 0 12 1 0 0 1 0 0 0 5 0 0 0 5 0 0 0 2 0 |01010 60 Counts |11010 0 0 0 2 0 0 0 0 0 1 2 67 0 0 0 11 0 0 0 1 0 0 0 5 0 0 0 5 0 0 0 1 20000 |00110 0 0 0 0 2 0 0 0 1 0 0 0 60 3 6 0 0 0 0 0 2 0 0 0 0 0 0 0 4 0 0 0 |10110 0 0 0 0 0 2 0 0 0 2 0 0 1 58 0 6 0 0 0 0 0 2 0 0 0 0 0 0 0 4 0 0 |01110 0 0 0 0 0 0 2 0 0 0 1 0 1 0 53 3 0 0 0 0 0 0 2 0 0 0 0 0 0 0 4 0 50 |11110 0 0 0 0 0 0 0 2 0 0 0 1 0 1 1 52 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 3 |00001 2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 87 5 10 1 6 0 1 0 13 1 2 0 6 0 1 0 10000 |10001 0 2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 2 84 0 9 0 6 0 1 0 13 0 1 0 6 0 1 40 |01001 0 0 2 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 78 4 0 0 6 0 0 0 12 1 0 0 5 0 Measured |11001 0 0 0 2 0 0 0 0 0 0 0 1 0 0 0 0 0 1 2 76 0 0 0 6 0 0 0 12 0 0 0 5 |00101 0 0 0 0 2 0 0 0 0 0 0 0 1 0 0 0 2 0 0 0 70 4 8 1 0 0 0 0 13 1 1 0 0 |10101 0 0 0 0 0 2 0 0 0 0 0 0 0 1 0 0 0 2 0 0 1 67 0 8 0 0 0 0 0 12 0 1 30 |01101 0 0 0 0 0 0 2 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 63 3 0 0 0 0 0 0 11 1 Pr(Measured | True) [%] |11101 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 60 0 0 0 0 0 0 0 10 1.2 |00011 0 0 0 0 0 0 0 0 3 0 0 0 1 0 0 0 2 0 0 0 2 0 0 0 75 4 8 0 15 1 2 0 |10011 0 0 0 0 0 0 0 0 0 3 0 0 0 1 0 0 0 2 0 0 0 2 0 0 1 72 0 8 0 15 0 2 20 |01011 0 0 0 0 0 0 0 0 0 0 3 0 0 0 1 0 0 0 2 0 0 0 2 0 1 0 68 3 0 0 14 1 |11011 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 1 0 0 0 2 0 0 0 2 0 1 1 66 0 0 0 13 1.0 |00111 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 5 0 0 0 1 0 0 0 57 3 6 1 10 |10111 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 5 0 1 0 1 0 0 1 53 0 6 |01111 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 4 0 0 0 1 0 1 0 51 2 0.8 |11111 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 4 0 0 0 1 0 1 1 50 Extracted / Truth 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | True

90 FIG. 3. The inverted W state (top) and Grover state with 11111 oracle (bottom) for the truth counts (t), the raw counts 85 (m) and the readout corrected counts (tˆ). 80

75

70

65

60 Measured counts from sampling ψW,I are shown in the

Pr(measure correct string) 55 top plot of Fig.3. The true distribution has five spikes corresponding to the five stats with non-zero amplitude 50 in Eq.5. The raw data have non-trivial probability mass 0 1 2 3 4 5 Number of 0's in bitstring for other states due to readout errors (the off-diagonal elements in Fig.2). Readout error corrections successfully ˆ FIG. 2. Top: An example response matrix for the IBM Q morph the raw data m into t which closely resembles the Tokyo machine with five qubits. Bottom: the probability to true distribution t. measure the correct string (diagonal elements of the top plot) as a function of the number of 0’s in the bitstring. The impact of of our method can be seen by comparing the statistical uncertainty of a particular expectation The first example to demonstrate readout rebalancing value obtained with and without readout rebalancing. uses a circuit Ucircuit producing the inverted W state: Statistical uncertainties are determined by repeating the above procedure many (1000) times and then computing 1 ψW,I = √ (|01111i + |10111i + ··· + |11110i) . (5) the mean and standard deviation. To be concrete, we 5 choose the average value of the integer obtained from the 4 bitstring 50000 Qiskit Simulator 1 X IBMQ Tokyo Readout Errors hOi = ns(s0 + 2s1 + 4s2 + 8s2 + 16s3 + 32s4) , Gaussian states N 40000 s = 1.00 = 0.11 (6) = 0.78 = 0.33 = 0.56 = 0.56 as a representative observable. Here si ∈ {0, 1} is the 30000 = 0.33 = 0.78 th = 0.11 = 1.00 value of the i qubit in state s, ns is the number of times P the state is measured to be in state s, and N = s ns Counts is the total number of measurements in one iteration 20000 of the procedure. For the inverted W state, the exact value of this observable is given by hOi = 124/4 = 24.8. Computing the average value of hOi from repeating the 10000 procedure 1000 times reproduces this result with and without readout symmetrization and readout rebalancing. This is expected, since the post-processing step should 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

not affect the central value. In contrast, the standard 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | deviation across the 1000 runs of the procedure depends on the level of fidelity improvement one applies. Without 30 Qiskit Simulator any fidelity improvement, the standard deviation is given IBMQ Tokyo Readout Errors Gaussian states by 0.0232±0.0005, with symmetrized readout it is 0.0214± 25 0.0005, while for readout rebalancing one finds a standard deviation of 0.0189 ± 0.004. This means that one can use fewer measurements with readout rebalancing to achieve 20 the same statistical precision as the nominal approach or for the same number of measurements, the statistical 15 uncertainty is smaller with readout rebalancing included.

In particular, reducing the statistical uncertainty by 20% Binary Value Mean 10 √is equivalent to having 50% more measurements (since 1.5 ∼ 1.2). As a second example we use Grover’s [54], 5 Readout Rebalancing shown in the bottom plot of Fig.3. In general, given Symmetrized Readout Default an oracle, Grover’s algorithm is able to find the inputs 0 that produce a particular output value. In our case, 1.00 0.75 0.50 0.25 0.00 0.25 0.50 0.75 1.00 Gaussian Mean the oracle is the Boolean function (x0 ∨ x1 ∨ x2 ∨ x3 ∨ th Qiskit Simulator x4), where the input to xi would be the i bit of our IBMQ Tokyo Readout Errors bitstring. For this function to equal 1 our desired input Gaussian states would be the state |11111i, so instead of Eq. (6), we 0.014 use the counts in the |11111i state as our observable for 105 measurements. As with the previous example, all three approaches achieve the consistent central values 0.012 (2.57×104). However, the standard deviations are 210±4 (default), 185 ± 4 (symmetrized readout), and 160 ± 4 (readout rebalancing). This 30% improvement in precision 0.010 is equivalent√ to a 70% larger number of measurements (since 1.7 ∼ 1.3). A third example is a one-dimensional Gaussian state, Binary Value Standard Deviation 0.008 which arises in the context of a 0 + 1 dimensional non- Readout Rebalancing Symmetrized Readout interacting scalar quantum field theory (as the ground Default state of the Harmonic Oscillater) [55–62]. In order to 0.006 1.00 0.75 0.50 0.25 0.00 0.25 0.50 0.75 1.00 illustrate the impact of readout rebalancing, a Gaussian Gaussian Mean random variable with mean µ and standard deviation 0.1 is digitized with 5 bits where |00000i 7→ −1 and FIG. 4. Top: the true counts for the truncated Gaussian states |11111i 7→ 1, where µ ranges from −1 to 1. Probability with fixed variance and shifted means. Middle (right): the mass functions of these Gaussian states are presented in average value (standard deviation) of the state when converting the top plot of Fig.4. the bitstring to base 10 as a function of the Gaussian mean. The mean and standard deviation of hOi are shown in Error bars represent statistical uncertainties. the middle and bottom plots of Fig.4, respectively. As expected, hOi increases monotonically with µ and is the 5

Symmetrized Rebalanced In particular, support comes from Inverted W (85 ± 6)% (66 ± 5)% Science Enabled Discovery (QuantISED) for High En- Grover (78 ± 5)% (58 ± 5)% ergy Physics (KA2401032) and the Office of Advanced Gaussian (µ = −0.11) (98 ± 6)% (56 ± 5)% Scientific Computing Research (ASCR) through the Ac- Gaussian (µ = 0.78) (80 ± 6)% (41 ± 4)% celerated Research for Program. This research used resources of the Oak Ridge Leadership TABLE I. Table summarizing the three examples given in the Computing Facility, which is a DOE Office of Science User text. We show the fraction of events needed to obin the same Facility supported under Contract DE-AC05-00OR22725. statistical power as for readout correction without any readout fidelity improvements. Appendix A: Detailed Derivation of Analytic Example same with and without readout rebalancing. However, due to the larger number of 1’s on the right side of the Given a state containing 2 qubits there are 4 possible digitized domain of the Gaussian, readout rebalancing states |00i, |01i, |10i, and |11i. Prior to readout error results in a smaller statistical uncertainty than the nomi- corrections (PRC), the measured count for the state |iji nal approach. Readout rebalancing results in a relatively is given by Nˆ PRC. The expectation values [Nˆ PRC] = constant statistical precision as a function of µ, with a |iji E |iji ˆ PRC slight increase in the middle of the domain due to a bal- N|iji /N of those counts are related to the expectation anced number of 0’s and 1’s. With readout rebalancing, values of the true counts via the right side of the domain is equivalent to the left side. ˆ PRC For µ close to one, the improvement in the statistical E[N|00i ] = E[N|00i] + q0E[N|10i] + q1E[N|01i] (A1) uncertainty is nearly a factor of two. [Nˆ PRC] = (1 − q ) [N ] + q [N ] (A2) We summarize the results of the three examples in E |01i 1 E |01i 0E |11i ˆ PRC TableIII. In this table we present the results by showing E[N|10i ] = (1 − q0)E[N|10i] + q1E[N|11i] (A3) the fraction of events that are required to achieve the [Nˆ PRC] = (1 − q − q ) [N ] + O(q2) . (A4) same statistical power compared with the case where no E |11i 0 1 E |11i rebalancing is performed before readout error correction. One can therefore obtain the expectation values of the One can see that the Rebalanced approach propsed in true counts by computing the reconstructed counts from this work outperforms the Symmetrized result, and that the measured counts as by performing readout rebalancing one can save about a factor of 2 in the number of measurements required. ˆ ˆ PRC ˆ PRC ˆ PRC 2 N|00i = N|00i − q1N|01i − q0N|10i + O(q ) (A5) ˆ ˆ PRC ˆ PRC 2 N|01i = N|01i (1 + q1) − q0N|11i + O(q ) (A6) IV. CONCLUSIONS ˆ ˆ PRC ˆ PRC 2 N|10i = N|10i (1 + q0) − q1N|11i + O(q ) (A7) ˆ ˆ PRC 2 We have introduced a modification to readout error N|11i = (1 + q0 + q1)N|11i + O(q ) . (A8) mitigation that can be combined with other approaches ˆ to readout error corrections. While the benefit of this and requiring E[N|iji] = E[N|iji]. readout rebalancing scheme are circuit-dependent and ˆ The variance of N|iji determines how many overall may be modest, there is minimal computational cost runs are required to obtain E[N|iji] with a given accuracy. and when states with many 1’s are frequent, the gain in One way of viewing Nˆ PRC is as a multinomial random statistical precision can be significant. |iji variable with total number N and probabilities given by ˆ PRC Eq. (A1)-(A4) via pij = E[N|iji ]/N. Therefore, CODE AND DATA ˆ PRC Var[N|iji ] = pij(1 − pij)N (A9) PRC PRC The code for this paper can be found at https: ˆ ˆ 0 0 Cov[N|iji , N|i0j0i] = −pijpi j N (A10) //github.com/LBNL-HEP-QIS/ReadoutRebalancing. Quantum computer data are available upon request. Using the fact that

Var[aX + bY ] = a2Var(X) + b2Var(Y ) ACKNOWLEDGMENTS + 2ab Cov(X,Y ), (A11)

We would like to thank Miro Urbanek and Bert de Jong one can derive for useful discussions and feedback on the manuscript.   ˆ N|iji ˆ This work is supported by the U.S. Department of Energy, Var[N|iji] = N|iji 1 − + ∆Var[N|iji] (A12) Office of Science under contract DE-AC02-05CH11231. N 6

with ˆ ∆Var[N|00i] = q0N|10i + q1N|01i (A13) ˆ ∆Var[N|01i] = q0N|11i + q1N|01i (A14) ˆ ∆Var[N|10i] = q1N|11i + q1N|10i (A15) ˆ ∆Var[N|11i] = (q0 + q1) N|11i , (A16)

where Eqs. (A13) - (A16) have all been expanded to linear 2 order in the qi, and therefore have corrections of order qi .

[1] J. Preskill, Quantum Computing in the NISQ era and Phys. Rev. Lett. 119, 180501 (2017). beyond, Quantum 2, 79 (2018). [16] J. Roffe, D. Headley, N. Chancellor, D. Horsman, and [2] D. Gottesman, An introduction to quantum error cor- V. Kendon, Protecting quantum memories using coherent rection andfault-tolerant quantum computation, (2009), parity check codes, Quantum Sci. Technol. 3, 035010 arXiv:0904.2557 [quant-ph]. (2018). [3] S. J. Devitt, W. J. Munro, and K. Nemoto, Quantum [17] C. Vuillot, Is error detection helpful on IBM 5Q chips?, error correction for beginners, Reports on Progress in Quantum Inf. Comput. 18, 0949 (2018). Physics 76, 076001 (2013). [18] D. Willsch, M. Willsch, F. Jin, H. De Raedt, and [4] B. M. Terhal, Quantum error correction for quantum K. Michielsen, Testing quantum fault tolerance on small memories, Rev. Mod. Phys. 87, 307 (2015). systems, Phys. Rev. A 98, 052348 (2018). [5] D. A. Lidar and T. A. Brun, Quantum Error Correction [19] R. Harper and S. T. Flammia, Fault-tolerant logical gates (2013). in the IBM Quantum Experience, Phys. Rev. Lett. 122, [6] M. A. Nielsen and I. . Chuang, Quantum Computation 080504 (2019). and Quantum Information: 10th Anniversary Edition, [20] A. Kandala, K. Temme, A. D. Córcoles, A. Mezzacapo, 10th ed. (Cambridge University Press, New York, NY, J. M. Chow, and J. M. Gambetta, Error mitigation ex- USA, 2011). tends the computational reach of a noisy quantum pro- [7] J. L. Park, The concept of transition in quantum mechan- cessor, Nature 567, 491 (2019). ics, Found. Phys. 1, 23 (1970). [21] E. F. Dumitrescu, A. J. McCaskey, G. Hagen, G. R. [8] W. K. Wootters and W. H. Zurek, A single quantum Jansen, T. D. Morris, T. Papenbrock, R. C. Pooser, D. J. cannot be cloned, Nature 299, 802 (1982). Dean, and P. Lougovski, Cloud quantum computing of [9] D. Dieks, Communication by epr devices, Phys. Lett. A an atomic nucleus, Phys. Rev. Lett. 120, 210501 (2018). 92, 271 (1982). [22] Y. Li and S. C. Benjamin, Efficient variational quantum [10] M. Urbanek, B. Nachman, and W. de Jong, incorporating active error minimization, Phys. error detection improves accuracy of chemical calculations Rev. X 7, 021050 (2017). on a quantum computer, (2019), arXiv:1910.00129 [quant- [23] K. Temme, S. Bravyi, and J. M. Gambetta, Error mitiga- ph]. tion for short-depth quantum circuits, Phys. Rev. Lett. [11] J. R. Wootton and D. Loss, Repetition code of 15 qubits, 119, 180509 (2017). Phys. Rev. A 97, 052313 (2018). [24] S. Endo, S. C. Benjamin, and Y. Li, Practical quantum [12] R. Barends, J. Kelly, A. Megrant, A. Veitia, D. Sank, error mitigation for near-future applications, Phys. Rev. E. Jeffrey, T. C. White, J. Mutus, A. G. Fowler, B. Camp- X 8, 031027 (2018). bell, Y. Chen, Z. Chen, B. Chiaro, A. Dunsworth, C. Neill, [25] A. He, B. Nachman, W. A. de Jong, and C. W. Bauer, P. O’Malley, P. Roushan, A. Vainsencher, J. Wenner, A. N. Zero-noise extrapolation for quantum-gate error mitiga- Korotkov, A. N. Cleland, and J. M. Martinis, Supercon- tion with identity insertions, Phys. Rev. A 102, 012426 ducting quantum circuits at the surface code threshold (2020). for fault tolerance, Nature 508, 500 (2014). [26] R. C. Bialczak, M. Ansmann, M. Hofheinz, E. Lucero, [13] J. Kelly, R. Barends, A. G. Fowler, A. Megrant, E. Jef- M. Neeley, A. D. O’Connell, D. Sank, H. Wang, J. Wenner, frey, T. C. White, D. Sank, J. Y. Mutus, B. Campbell, M. Steffen, A. N. Cleland, and J. M. Martinis, enQuan- Y. Chen, Z. Chen, B. Chiaro, A. Dunsworth, I.-C. Hoi, tum process tomography of a universal entangling gate C. Neill, P. J. J. O’Malley, C. Quintana, P. Roushan, implemented with Josephson phase qubits, Nature Physics A. Vainsencher, J. Wenner, A. N. Cleland, and J. M. Mar- 6, 409 (2010). tinis, State preservation by repetitive error detection in a [27] M. Neeley, R. C. Bialczak, M. Lenander, E. Lucero, superconducting , Nature 519, 66 (2015). M. Mariantoni, A. D. O’Connell, D. Sank, H. Wang, [14] N. M. Linke, M. Gutierrez, K. A. Landsman, C. Figgatt, M. Weides, J. Wenner, Y. Yin, T. Yamamoto, A. N. Cle- S. Debnath, K. R. Brown, and C. Monroe, Fault-tolerant land, and J. M. Martinis, enGeneration of three-qubit quantum error detection, Sci. Adv. 3, e1701074 (2017). entangled states using superconducting phase qubits, Na- [15] M. Takita, A. W. Cross, A. D. Córcoles, J. M. Chow, and ture 467, 570 (2010). J. M. Gambetta, Experimental demonstration of fault- [28] A. Dewes, F. R. Ong, V. Schmitt, R. Lauro, N. Boulant, tolerant state preparation with superconducting qubits, P. Bertet, D. Vion, and D. Esteve, enCharacterization of 7

a Two- Processor with Individual Single-Shot [42] M. R. Geller and M. Sun, Efficient correction of multiqubit Qubit Readout, Physical Review Letters 108, 057002 measurement errors, arXiv:2001.09980 [quant-ph] (2020), (2012). arXiv: 2001.09980. [29] E. Magesan, J. M. Gambetta, A. Córcoles, and J. M. [43] M. R. Geller, Rigorous measurement error correction, Chow, enMachine Learning for Discriminating Quan- Quantum Science and Technology 5, 03LT01 (2020). tum Measurement Trajectories and Improving Readout, [44] F. Arute et al., Quantum approximate optimization of Physical Review Letters 114, 200501 (2015). non-planar graph problems on a planar superconducting [30] S. Debnath, N. M. Linke, C. Figgatt, K. A. Landsman, processor (2020), arXiv:2004.04197 [quant-ph]. K. Wright, and C. Monroe, enDemonstration of a small [45] Rigetti Forest Software Development programmable quantum computer with atomic qubits, Kit, Source code for pyquil.noise, Nature 536, 63 (2016). http://docs.rigetti.com/en/stable/noise.html. [31] C. Song, K. Xu, W. Liu, C.-p. Yang, S.-B. Zheng, H. Deng, [46] The Cirq Contributors, Cirq, a python frame- Q. Xie, K. Huang, Q. Guo, L. Zhang, P. Zhang, D. Xu, work for creating, editing, and invoking Noisy D. Zheng, X. Zhu, H. Wang, Y.-A. Chen, C.-Y. Lu, S. Han, Intermediate Scale Quantum (NISQ) circuits, and J.-W. Pan, en10-Qubit Entanglement and Parallel https://github.com/quantumlib/Cirq (2020). Logic Operations with a Superconducting Circuit, Physi- [47] S. Y. Yanzhu Chen, Maziar Farahzad and T.-C. Wei, cal Review Letters 119, 180511 (2017). Detector tomography on ibm 5-qubit quantum computers [32] M. Gong, M.-C. Chen, Y. Zheng, S. Wang, C. Zha, and mitigation of imperfect measurement, arXiv (2019), H. Deng, Z. Yan, H. Rong, Y. Wu, S. Li, F. Chen, Y. Zhao, arXiv:1904.11935 [quant-ph]. F. Liang, J. Lin, Y. Xu, C. Guo, L. Sun, A. D. Castellano, [48] Z. Z. Filip B. Maciejewski and M. Oszmaniec, Mitigation H. Wang, C. Peng, C.-Y. Lu, X. Zhu, and J.-W. Pan, of readout noise in near-term quantum devices by classi- Genuine 12-qubit entanglement on a superconducting cal post-processing based on detector tomography, arXiv quantum processor, Physical Review Letters 122, 110501 (2019), arXiv:1907.08518 [quant-ph]. (2019), arXiv: 1811.02292. [49] G. D’Agostini, A Multidimensional unfolding method [33] K. X. Wei, I. Lauer, S. Srinivasan, N. Sundaresan, D. T. based on Bayes’ theorem, Nucl. Instrum. Methods Phys. McClure, D. Toyli, D. C. McKay, J. M. Gambetta, and Res. A 362, 487 (1995). S. Sheldon, Verifying Multipartite Entangled GHZ States [50] L. B. Lucy, An iterative technique for the rectification of via Multiple Quantum Coherences, Physical Review A observed distributions, Astron. J. 79, 745 (1974). 101, 032343 (2020), arXiv: 1905.05720. [51] W. H. Richardson, Bayesian-based iterative method of [34] V. Havlicek, A. D. Córcoles, K. Temme, A. W. Harrow, image restoration, J. Opt. Soc. Am. 62, 55 (1972). A. Kandala, J. M. Chow, and J. M. Gambetta, Supervised [52] IBM Research, Qiskit, https://qiskit.org (2019). learning with quantum enhanced feature spaces, Nature [53] B. Nachman, M. Urbanek, W. A. de Jong, and C. 567, 209 (2019), arXiv: 1804.11326. W. Bauer, Unfolding quantum computer readout noise, [35] Y. Chen, M. Farahzad, S. Yoo, and T.-C. Wei, Detector (2019), arXiv:1910.01969 [quant-ph]. Tomography on IBM 5-qubit Quantum Computers and [54] L. K. Grover, A fast quantum mechanical algorithm for Mitigation of Imperfect Measurement, Physical Review database search, in Proceedings of the Twenty-Eighth An- A 100, 052315 (2019), arXiv: 1904.11935. nual ACM Symposium on Theory of Computing, STOC [36] M.-C. Chen, M. Gong, X.-S. Xu, X. Yuan, J.-W. Wang, ’96 (Association for Computing Machinery, New York, C. Wang, C. Ying, J. Lin, Y. Xu, Y. Wu, S. Wang, NY, USA, 1996) p. 212–219. H. Deng, F. Liang, C.-Z. Peng, S. C. Benjamin, X. Zhu, [55] S. P. Jordan, H. Krovi, K. S. M. Lee, and J. Preskill, C.-Y. Lu, and J.-W. Pan, Demonstration of Adiabatic BQP-completeness of Scattering in Scalar Quantum Field Variational Quantum Computing with a Superconduct- Theory, (2017), arXiv:1703.00454 [quant-ph]. ing Quantum Coprocessor, arXiv:1905.03150 [quant-ph] [56] S. P. Jordan, K. S. M. Lee, and J. Preskill, Quantum (2019), arXiv: 1905.03150. Computation of Scattering in Scalar Quantum Field [37] F. B. Maciejewski, Z. Zimborás, and M. Oszmaniec, Miti- Theories, (2011), [Quant. Inf. Comput.14,1014(2014)], gation of readout noise in near-term quantum devices by arXiv:1112.4833 [hep-th]. classical post-processing based on detector tomography, [57] S. P. Jordan, K. S. M. Lee, and J. Preskill, Quantum Quantum 4, 257 (2020), arXiv: 1907.08518. for Quantum Field Theories, Science 336, [38] M. Urbanek, B. Nachman, and W. A. de Jong, Quantum 1130 (2012), arXiv:1111.3633 [quant-ph]. error detection improves accuracy of chemical calculations [58] S. P. Jordan, K. S. M. Lee, and J. Preskill, Quantum Al- on a quantum computer, Physical Review A 102, 022427 gorithms for Fermionic Quantum Field Theories, (2014), (2020), arXiv: 1910.00129. arXiv:1404.7115 [hep-th]. [39] B. Nachman, M. Urbanek, W. A. de Jong, and C. W. [59] R. D. Somma, Quantum simulations of one dimensional Bauer, Unfolding Quantum Computer Readout Noise, quantum systems, Quantum Info. Comput. 16, 1125?1168 arXiv:1910.01969 [physics, physics:quant-ph] (2020), (2016). arXiv: 1910.01969. [60] A. Macridin, P. Spentzouris, J. Amundson, and R. Harnik, [40] K. E. Hamilton and R. C. Pooser, Error-mitigated -phonon systems on a universal quantum com- data-driven circuit learning on noisy quantum hardware, puter, Phys. Rev. Lett. 121, 110504 (2018). arXiv:1911.13289 [quant-ph] (2019), arXiv: 1911.13289. [61] A. Macridin, P. Spentzouris, J. Amundson, and R. Harnik, [41] P. J. Karalekas, N. A. Tezak, E. C. Peterson, C. A. Digital quantum computation of fermion-boson in- Ryan, M. P. da Silva, and R. S. Smith, A quantum- teracting systems, Phys. Rev. A98, 042312 (2018), classical cloud platform optimized for variational hybrid arXiv:1805.09928 [quant-ph]. algorithms, Quantum Science and Technology 5, 024003 [62] N. Klco and M. J. Savage, Digitization of scalar fields (2020), arXiv: 2001.04449. for quantum computing, Phys. Rev. A99, 052335 (2019), 8 arXiv:1808.10378 [quant-ph].