The field of quantum computing has the potential to transform a wide variety of scientific fields including material science and quantum chemistry. Hardware noise in the computation presents a big problem for quantum computing as noise in general destroys coherence and entanglement in the quantum state, which is essential for a successful quantum algorithm. In order to address this problem, quantum error correction uses extra qubits to detect and correct errors introduced by the effects of noise. Error correction is essential in the development of fully functional quantum computers. However, existing hardware does not meet the requirements to implement fault-tolerant quantum error correction, outside of small preliminary studies    . The accuracy of observables produced by current hardware is therefore limited, but many candidate applications require greater precision to outperform classical methods. For this reason, it is widely regarded that error mitigation will be essential in demonstrating near-term quantum advantage .
Error mitigation aims to reduce the effect of noise rather than remove it completely. There are many distinct approaches towards this goal, with two common methods being: optimizing quantum circuits through compilation and machine learning    and classical post-processing. One of the most promising post-processing techniques is zero noise extrapolation  which combines observables evaluated at several controlled noise levels  , enabling extrapolation to the zero-noise limit. Recently several new mitigation methods have been developed that make use of learning from data sets constructed using quantum circuit data   demonstrating the rapid progress in this field.
Errors occur due to a multitude of factors in both the qubits themselves and the control hardware. Qubits are not completely isolated from their environment, leading to thermal relaxation and the decoherence of their state. Gate errors result from miscalibration or imperfections in the control hardware and their interactions with the qubits. Furthermore, the readout procedure can misidentify or alter the final qubit state such that the measured value does not accurately reflect the collapsed state . Despite the widespread success of error mitigation strategies most methods do not directly focus on the effect of imperfect control hardware, which motivates the approach we take in this work.
Here we present a remarkably simple technique to mitigate the effect of over-rotations in short-depth quantum circuits. The method is based on first running diagnostic circuits which quantify the error. Then, using the quantified error the experimenter can run a modified circuit of interest to mitigate the effect of the over-rotation. We show that simple approaches, such as that presented, here can still offer an experimental advantage when implemented in real quantum hardware.
First, we introduce the mathematical description of several basic single qubit. Then we show how over-rotations can be characterised and their effects mitigated. This is followed by a simple experimental demonstration of our method where we measure the CHSH inequalities in real quantum hardware using the IBM cloud quantum computing service. Finally, we present a discussion of our method and the results obtained as well as future directions.
A single qubit pure state can be represented as:
which can be visualized as a point on the Bloch sphere at polar angle and azimuthal angle .
During computation, a given number of one and two qubit gates are performed on a set of qubits. In the zero-noise limit this has the effect of changing the state by some unitary operation U. Any unitary is decomposed into the physical gate set of the device, . When implemented in the IBMQ quantum computer this set is given by , where is any angle. The gate is equivalent to up to a global phase factor and is implemented virtually within IBMQ. This is achieved by using frame changes with near-perfect execution  which does not involve the action of any physical quantum gates. A general single qubit unitary
can be decomposed as follows:
where the gates are implemented virtually (VZ), and the by a pulse .
Once execution of the required gates is complete, the quantum computer measures the qubits, collapsing the state, and outputs the results. The computation is repeated and a vector of counts , length 2n (where n is the number of qubits), is obtained. Relaxation, imperfect coupling of the readout resonator and signal amplification lead to errors in the measurement process . Although major improvements in this area are likely to come from improved hardware, it is possible to mitigate the measurement error through various techniques . A simple strategy currently implemented within IBM’s Qiskit software  uses data from calibration circuits to mitigate the error using classical post-processing. This is achieved using the direct construction of a calibration matrix which for one qubit can be written as:
where and are the probabilities that a prepared is measured as and a prepared state is measured as respectively. This technique can be extended to multi-qubit states using a tensor product or correlated Markov noise approaches . The calibration matrix can also be calculated using maximum likelihood techniques and quantum detector tomography .
The calibration matrix can then be used to mitigate errors associated with the readout either directly by: 1) inversion or through 2) bounded minimization.
1) Inversion is done by inverting the calibration matrix as such: , where are the experimental and ideal vectors of the counts.
2) Bounded minimization uses bounded least squares optimization: , where bounds ensure the probabilities calculated from are positive and correctly normalised.
These techniques share the assumption that the error rate in state preparation is much lower than the readout error. This is not without merit as single gate errors cited in IBM, Google and Rigetti are all below 0.5% while their readout errors are around 1% - 5%   . Yet, any error in state preparation, especially systematic ones, can lead to an inaccurate calibration matrix.
In this paper we highlight a systematic error in the execution of the U3 gate in IBM’s cloud-based computers, which appears as a shift in the angle when implementing the gate . We propose to mitigate the previous error using an angular shift in in the U3 gate. We illustrate the functionality of this mitigation method by measuring the CHSH inequality on data from a real device.
2. Error Characterisation
1) Sweeping a Meridian
To explore the reliability of the U3 gate we applied it to the 0 state with , and various angles in the interval (see Equation (2)).
This represents a rotation about the X axis ( ) on the Bloch sphere that sweeps a whole meridian. The gate is followed by a measurement in the Z basis
IBM’s calibration method consists in measuring the states 0 and , extracting the values of and to build the matrix given in (4). The experimental 0 count for any given ( ), ignoring all errors apart from readout, can be described by
We shall refer to this formula as the IBM-fit. Observe that (5) reproduces by construction the experimental data and for and respectively. To test the reliability of this formula we divide in 30 intervals and measure for with . The results obtained for the qubit 9 of the Cambridge QC, with 8192 shots per angle, are plotted in Figure 1(a) together with the curve (5). One can easily see a significant deviation between the experimental data and the IBM prediction. However, this deviation follows a trend that we characterize with the following ansatz
Figure 1. Sweep of on Cambridge qubit 9. The raw data (blue dots) are fitted with the IBM method (red, dotted) and Shift-fit with (green, solid).
Here, the angle is shifted by a parameter that takes small values, as we shall see below. The probabilities and , appearing in (5), have been replaced by and to allow for a more accurate description of the experimental results in the range . The numerical values of and are determined using a least-square fit of the set using Equation (6). We shall denote this approach as the Shift-fit method. Figure 2 shows that (6) provides a much better fit to the data than (5).
To quantify the performance of the fits we use the coefficient of determination R2 that is defined as
where is the experimental probability of the counts at angle , and its average. The R2 estimator is customarily expressed in percentages, thus a perfect fit, implies a of predictibilty. The data given in Figure 2 yield an R2 equal to 97.6% for the IBM-fit and 99.9% for the Shift-fit.
2) Several Sweeps: Jobs
The results presented in Figure 1 correspond to a single sweep of equally spaced angles along a meridian.
To assess the reliability of the Shift-fit method we consider a set of consecutive sweeps that we denote a job. The number of sweeps can depend on the job (see Figure 2). A given job is run within a time lapse where the quantum computer is assumed to remain approximately under the same experimental conditions.
The result of each job is a set of parameters , which according to the previous assumption, should be similar. Figure 3 shows the distribution of the values of obtained for 15 jobs, amounting to a total of 100 sweeps. We notice that: 1) within each job the parameter takes similar values, 2) the average value of presents large deviations between jobs, as shown in the histogram.
Figure 2. A cartoon describing the way circuits, sweeps and jobs are implemented.
Figure 3. Distribution of fitted values for 100 sweeps for Cambridge qubit 9. The scatter plot shows the values of per job over runtime, with the 15 different jobs with (100 sweeps) denoted by horizontal lines. The bottom displays a histogram of the data.
Item 1) is in rough agreement with the stability assumption made above, while item 2) can be attributed to different calibrations during the time delay between different jobs.
The distribution has a mean of −0.14 (7), where the number in brackets is the standard deviation on the last digit shown. This mean does not properly reflect how behaves within a single job, as for example the single run in Figure 1(a) whose .
We also find that overall the average R2 for the Shift-fit and IBM fit are 99.9% and 97.0% respectively leading to the conclusion that including an shift results in a more accurate description of the raw data in general. Finally it is worth noting that we have not found correlation between the shift observed and IBM quoted errors.
In Table 1 we collect the results of the observed shift for a selection of qubits in the devices Paris, Johannesburg, Rochester, Cambridge and London. The chosen qubits are the ones that exhibit the highest average values of . The largest twenty average values are provided in the supplementary material.
We have also explored other meridians with our the Shift-fit method and found a negligible dependence on the meridian. Through testing the same qubits in the same job in all the computers with ten equally spaced from 0 to we saw a no shifts greater than the standard deviation from the mean and there was no trend of increase with a change in .
As explained above, the parameter represents a systematic error that affects the rotation angle of the gate. A naive way to mitigate it is to replace by , hoping that this displacement will compensate the error. The corresponding mitigated circuit is
Table 1. Table showing average parameters from Equation (6) fitted to data from 100 sweeps over 10 jobs from different IBM quantum computers. Only qubits with the largest shift are displayed. The standard deviation on the last digit is shown in round brackets after the mean value.
To implement the mitigation a python software suite was written to perform these calibrations and implement the shift on subsequent experiments .
Figure 4 shows a selection of results. The values of , obtained with this type of mitigated circuit are much closer to zero that those obtained without the shift. The calibration and mitigated rotation were performed with a job with 10 sweeps. The R2 values for the Shift-fit were above 99% in all cases. These results assess the effect of the mitigation method.
4) Repeated Gates and Different Initial States
We now explore the dependence of the shift with the number of gates applied in a consecutive sequence. To this end we decompose a rotation into M rotations of angle , as shown in the circuit of Figure 5. The results for are given in Figure 6. We find that increases with M, but not linearly as one would naively expect, that is . All the tested computers returned different trends, and they changed between jobs even for the same computer. Sometimes a negative would go closer to zero or further from zero and a positive would sometimes grow or decrease. This fact suggests that the systematic error expressed by has a complex origin that probably involves several components of the machine.
We have also studied sweeps starting, not from , but from the states obtained acting on with , and . The results plotted in Figure 7, show a rough agreement of the values of . This suggests the result is not strongly state dependent.
3. Origin of the Error
In this section we propose an explanation of the shift-fit effect based on a potential error in the implementation of the gates . In the ideal case these gates are realized as , where is the pulse amplitude and . An off resonance error (ORR) in the gate pulse can be modeled as follows :
Figure 4. Box plot of the Shift ( ) determined before (white) and after (blue) mitigation for a subset of qubits from several computers. The box and whiskers encompass 50% and 95% of the results respectively, dots represent outliers. Discrepancies between the data displayed here and that shown in Table 1 are due to it being run within different jobs. Furthermore some qubits are missing as they exhibited very small values at runtime.
Figure 5. Repeated application of rotation gate to complete at full rotation.
Figure 6. Distribution of using the circuits shown in Figure 5. We perform 10 sweeps for each value of , on the Cambridge qubit 9. The R2 value does not appreciably decrease when increasing M, implying the fit stays consistent.
Figure 7. Distribution of values starting the sweep from various initial states on Cambridge qubit 9. We employ 10 sweeps per state. The observed trend is not fully consistent between computers or qubits, hence the state dependence is not consistent.
where . Replacing these gates into (3) we obtain a gate that includes the ORR error. Finally, we apply the calibration matrix , to obtain the probability of measuring the state for various angles
where we have assumed that is a small parameter. Starting from Equation (6) and expanding in powers of gives
These two expressions are equivalent up to assuming and the using the same calibration matrix. This means that the VZ gates can indeed be used to correct for this by replacing the parameter in Equation (3) with , which is equivalent to altering the in the U3 gate.
It appears that the shift observed is well described by the appearance of ORR errors in the gates. However, upon multiple action of these gates, one would expect the errors to accumulate, resulting in a shift that grows proportionally with the number of applied gates. As previously demonstrated, this is not observed (see Figure 6).
We shall show that despite the previous complications, the mitigation improves observed CHSH inequalities, suggesting the simple mitigation strategy we present could be useful in short-depth circuits.
4. Evaluating the CHSH Inequality
The CHSH inequality involves running 4 separate circuits which each consist of a Bell state preparation followed by measurements in four appropriately chosen bases (Figure 8). It is a quintessential experiment in quantum mechanics demonstrating that quantum correlations cannot be explained classically . The correlation function can be expressed as follows:
Figure 8. CHSH circuit, , represent the gates required for the basis changes to go into the , , and bases in order to measure , , and .
Table 2. Shift values and correlation functions showing raw and mitigated implementations of the CHSH inequality circuits for 819,200 shots per basis. Qubits with local connectivity were chosen to minimize the depth of the circuits necessary. The calibration of was calculated with 10 repetitions. In all cases where there is a significant shift we see either a statistical improvement in the measured value for C.
where 4 system observables are shown as and , these letters simply represent different measurement bases of the bipartite system comprising of A and B. is the correlated expectation for two of those observables. For a system with a hidden variable or classical correlations, is bounded at 2. For a system with maximal entanglement, this bound is .
In general the measured mitigated correlations are closer to the theoretical limit as in Table 2, with the least improved cases appearing when is very small in one or both qubits. Therefore, using a simple mitigation strategy can improve measured quantities in a real device.
How this improvement scales with depth and number of qubits in the circuit is an important consideration. We have shown the shift effect does not appear to be consistent with increasing depth as seen in 6. However, when increasing the system size a set of calibration circuits could be run on each qubit to determine the shift whose effect could then be mitigated as outlined above.
5. Discussion and Conclusions
In this paper, we have highlighted the existence of a systematic error, which appears as an angular shift ( ) in the parameter of the U3 gate, and demonstrated its effects can be mitigated by performing a simple calibration before running a set of jobs. This shift was shown to bare characteristics of an ORR error. Therefore, it is now possible to mitigate this component of the total error irrespective of the readout error and other errors. This leads to an increased performance on our benchmark circuits to calculate the CHSH inequality. We found that the systematic shifts are consistent over the time span of a few successive jobs, but not over larger stretches of time.
As the ORR error can be corrected through the use of VZ gates, the change in the parameter of the U3 gate does just this . Although using the “open pulse” capabilities of some IBMQ quantum computers and finely tuning the pulses would result in similar improvements, this is a more complicated procedure and may not completely remove the ORR effect.
We have also shown that although these errors can be corrected for single gates, the application of multiple gates to a single qubit does not follow the expected relation from the ORR treatment which implies a linear growth in the shift with multiple gates. This remains an open question on whether the gates are state-dependent or if other errors come into play once the qubit is not in the ground state and further investigation is left to future work. Despite this, applying this correction still yielded improved results in the CHSH inequalities.
Any simple mitigation strategy can only improve the fidelity of calculations by a small factor. Yet, a modest increase in fidelity for a small upfront computation may be worth the extra time. Although this method could not be applied to deep circuits we envision it could be useful for many qubit, short-depth quantum circuits, especially if combined with other mitigation techniques.
We would like to thank Diego Garca-Martn and Pol Forn for conversations. We also thank the IBM Quantum team for making multiple devices available via the IBM Quantum Experience. The access to the IBM Quantum Experience has been provided by the CSIC IBM Q Hub. We acknowledge support from La Caixa Foundation (DB, MHG), European Union’s Horizon 2020 research and innovation programme under the Marie Skodowska-Curie grant agreement No. 71367 (DB). MHG is supported by “la Caixa” Foundation (ID: 100010434), Grant No. LCF/BQ/DI19/11730056. This work has also been financed by the Spanish grants PGC2018-095862-B-C21, QUITEMAD + S2013/ICE-2801, SEV-2016-0597 of the “Centro de Excelencia Severo Ochoa” Programme and the CSIC Research Platform on Quantum Technologies PTI-001.
1) Coefficient of determination, R2
The coefficient of determination, R2, is defined as
where the total sum of squares and total sum of residuals are
with being a particular data point, being the prediction of and the average of the observed data. If , the fit is an exact match to the experimental data while anything lower implies a progressively worse fit.
In total the statistics of the goodness of fit of our proposed shift with respect to IBM and the ideal curve (setting and ) are tabulated below for an aggregate of all of the sweeps over all computers.
Furthermore the way that we ascertained that there was no correlation between the alpha values and the cited IBM error rate is that we ordered the size of the errors for a given computer’s qubits by magnitude and compared it to the magnitude of associated with a given error rate’s job and there was no polynomial (up to order 4) which gave any appreciable R2 value for any computer.
2) Largest observed shift values
The TableS1 below shows the fitted data for 20 qubits with the largest average after 100 sweeps, with exception of Rochester at 10 sweeps due to the large number of qubits. This process was carried out on the Cambridge, London, Rochester, Paris and Johannesburg computers.
Table S1. Largest 20 shift values found in the computers that were investigated. The parameters correspond to those shown in Equation (6). This was repeated 10 times and errors show the standard deviation, with the error in the last digit shown in brackets.
 Campagne-Ibarcq, P., Eickbusch, A., Touzard, S., Zalys-Geller, E., Frattini, N.E., Sivak, V.V., et al. (2020) Quantum Error Correction of a Qubit Encoded in Grid States of an Oscillator. Nature, 584, 368-372.
 Waldherr, G., Wang, Y., Zaiser, S., Jamali, M., Schulte-Herbrüggen, T., Abe, H., Ohshima, T., Isoya, J., Du, J.F., Neumann, P. and Wrachtrup, J. (2014) Quantum Error Correction in a Solid-State Hybrid Spin Register. Nature, 506, 204-207.
 Kelly, J., Barends, R., Fowler, A. G., Megrant, A., Jeffrey, E., White, T.C., et al. (2015) State Preservation by Repetitive Error Detection in a Superconducting Quantum Circuit. Nature, 519, 66-69.
 Cramer, J., Kalb, N., Rol, M.A., Hensen, B., Blok, M.S., Markham, M., Twitchen, D.J., Hanson, R. and Taminiau, T.H. (2016) Repeated Quantum Error Correction on a Continuously Encoded Qubit by Real-Time Feedback. Nature Communications, 7, Article No. 11526.
 Cincio, L., Subaşı, Y., Sornborger, A.T. and Coles, P.J. (2018) Learning the Quantum Algorithm for State Overlap. New Journal of Physics, 20, Article ID: 113022.
 Murali, P., Baker, J.M., Javadi-Abhari, A., Chong, F.T. and Martonosi, M. (2019) Noise-Adaptive Compiler Mappings for Noisy Intermediate-Scale Quantum Computers. Proceedings of the 24th International Conference on Architectural Support for Programming Languages and Operating Systems, Providence, April 2019, 1015-1029.
 Dumitrescu, E.F., McCaskey, A.J., Hagen, G., Jansen, G.R., Morris, T.D., Papenbrock, T., Pooser, R.C., Dean, D.J. and Lougovski, P. (2018) Cloud Quantum Computing of an Atomic Nucleus. Physical Review Letters, 120, Article ID: 210501.
 He, A., Nachman, B., de Jong, W.A. and Bauer, C.W. (2020) Zero-Noise Extrapolation for Quantum-Gate Error Mitigation with Identity Insertions. Physical Review A, 102, Article ID: 012426.
 Kjaergaard, M., Schwartz, M.E., Braumüller, J., Krantz, P., Wang, J.I.-J., Gustavsson, S. and Oliver, W.D. (2020) Superconducting Qubits: Current State of Play. Annual Review of Condensed Matter Physics, 11, 369-395.
 McKay, D.C., Wood, C.J., Sheldon, S., Chow, J.M. and Gambetta, J.M. (2017) Efficient Z Gates for Quantum Computing. Physical Review A, 96, Article ID: 022330.
 Abraham, H., Akhalwaya, I.Y., Aleksandrowicz, G., Alexander, T., Alexandrowics, G., Arbel, E., Asfaw, A., et al. (2019) Qiskit: An Open-source Framework for Quantum Computing (Version 0.7.2). Zenodo.
 Maciejewski, F.B., Zimboras, Z. and Oszmaniec, M. (2020) Mitigation of Readout Noise in Near-Term Quantum Devices by Classical Post-Processing Based on Detector Tomography. Quantum, 4, 257.
 Bravyi, S., Sheldon, S., Kandala, A., Mckay, D.C. and Gambetta, J.M. (2020) Mitigating Measurement Errors in Multiqubit Experiments. Physical Review A, 103, Article ID: 042605.
 Chen, Y., Farahzad, M., Yoo, S. and Wei, T.-C. (2019) Detector Tomography on IBM Quantum Computers and Mitigation of an Imperfect Measurement. Physical Review A, 100, Article ID: 052315.
 Clauser, J.F., Horne, M.A., Shimony, A. and Holt, R.A. (1969) Proposed Experiment to Test Local Hidden-Variable Theories. Physical Review Letters, 23, Article No. 880.