Precise certification of a qubit space

We demonstrate an implementation of the precise test of dimension on the qubit, using the public IBM quantum computer, using the determinant dimension witness. The accuracy is below $10^{-3}$ comparing to maximal possible value of the witness in higher dimension. The test involving minimal independent sets of preparation and measurement operations (gates) is applied both for specific configurations and parametric ones. The test is be robust against nonidealities such as incoherent leakage and erroneous gate execution. Two of the IBM devices failed the test by more than $5$ standard deviations, which has no simple explanation.


Introduction
The basic building block of a quantum computer is a qubit, a generic two-level system.Since the goal is to manipulate accurately many qubits, it is necessary to ascertain whether or not the qubit space is reliable, i.e. not combined with a larger space.The most promising implementations of qubits keep them detuned from environment and other states, operating each qubit at a unique and isolated transition frequency, believed to cause only small incoherent disturbances.The assumption of two-level states is necessary for any successful fault-tolerant quantum computation performed on noisy devices, as the error mitigation relies on the controlled space of noise [1][2][3].In some systems the effect of extra states can be identified and erased because of known mechanism and transition parameters [4][5][6][7].On the other hand, the potential unknown contribution of external states can lead to systematic errors, which are hard to correct [8][9][10][11].Such a leakage has been directly observed in the delay test [12] at the level of 3.5 variances, but its origin has not been yet identified.Due to anharmonicity, the leakage to known higher states of the transmon [13] becomes significant for very fast gates, where additional measures are necessary to reduce it [14][15][16].
The dimension of the quantum space can be checked by a dimension witness [17][18][19][20][21][22].The construction of the witness is based on the two-stage protocol.The initial preparation preceeds the final measurement, with both chosen from independent sets of operations, as we schematically illustrate in Fig. 1.The precise witness is a quantity, which is exactly zero for systems up to a certain dimension, and nonzero otherwise.A good witness certifies the linear independence of specific dichotomic outcome probability p(M|N) for the preparation N and measurement M and so it is expressed by a suitable determinant [23][24][25].This type of witness was tested on optical states [26].
The tests of dimension are robust against many deficiencies of real quantum gates.Physical operations on qubits are realized by microwave pulses and suffer from distortions due to nonlinearities of waveform generators [27].Therefore a simple deviation of the probability distribution from the theoretical prediction [28,29] is insufficient to test for an extra qubit space.
In this paper, we apply the optimal witness [25] to test several IBM quantum devices.Most of the results agree with the 2-level model.However, after taking a large statistics, we find clear signatures of the test failure.We reveal a device, which systematically produces more than 5 standard deviations away from the reference zero.Of course, it does not immediately mean a larger space, but the problem needs urgent further investigation.The cause, which may be also another assumption of the test (e.g.lack of independence of the operations) points to deeper problems, which can make promises of near-term quantum noisy devices fruitless.

Theory
We test the qubit space d = 2 with the witness constructed from the measurement probabilities p(M|N) = tr MN , where the preparation operator is N = N † ≥ 0, tr N = 1 and the measurement is M = M † (both M and 1 -M are positive semi-definite).In Appendix A we write the explicit form of N j , M k for 5 preparations j = 1..5 and 4 measurements k = 1..4.
We construct the 5 × 5 matrix p with entries p kj = p(M j |N k ) and supplement it with p 5j = 1.Then the witness determinant W = det p must be equal to zero if all N j and M k represent the same two-level space [12,25].In addition, it remains zero also if all preparations contain some constant incoherent leakage term, i.e.N j = N j + Ñ, with Ñ in an arbitrary space, independent of j.In this way, the uncontrolled leakage to an extra space does not affect the test [12].For d = 2 we have W = 0, but d = 3 gives maximally 27 √ 2/64 0.6 in the real space and 0.632 in the complex space [25].For d = 4 the maximum (real and complex) is 2 12 /3 7 1.87, even higher dimensions saturate the classical bound 3.
The IBM Quantum Experience cloud computing offers several devices, collections of qubits, which can be manipulated by a user-defined set of gates (operations) -either single qubit or two-qubit ones, equipped with a general parametrization.One can put barriers (controlling the order of operations) or additional resets (nonunitary transition to the ground state).These features are necessary to implement our tests.The qubits are physical transmons [30], the artificial quantum states existing due to interplay of superconductivity (Josephson effect) and capacitance (Coulomb charging effect).Controlled anharmonicity allows to limit the working space to two states.The decoherence time (mostly environmental) is long enough to perform a sequence of quantum operations and read out reliable results.
Gates are implemented by time-scheduled microwave pulses prepared by waveform generators and mixers (time 30 -70 ns with sampling at 0.222 ns), tuned to the drive frequency (energy difference between qubit levels) [31] (about 4 -5 GHz).The single-qubit rotation Z γ is not a real pulse, but it is realized by an instantaneous virtual gate VZ(γ ), which adds a rotation between in-and out-of-phase components of the pulse for the next gates [32].The readout is performed by coupling the resonator to another long microwave pulse at a frequency different from the drive and finally measuring the populated photons The quantum circuit for the dimension test.The initial state |0 and four gates S γ , split into preparation and measurement stages, are followed by the final dichotomic measurement [31,33].The ground state |0 can be additionally assured by a reset operation applied after the measurement.
In the following, we assume the two-level description of the qubits, expecting W = 0 up to a statistical error.Larger deviation would be an evidence that this description is inaccurate.In a two-dimensional Hilbert space the states and the operators are constructed with the standard Pauli matrices defined in the computational basis |0 , |1 .Then the initial pure state is A microwave pulse tuned to the interlevel drive frequency allows one to apply the parametrically controlled gates.The native gate is the π/2 rotation: The rotation for a given angle θ is realized with the native gate S and two gates Z(θ ): Physically the experiment is a sequence of initialization in the state |0 , two gates S α , S β applied for the preparation, then the two gates S φ , S θ , and the readout pulse for the measurement of the state |0 again, see Fig. 2.There are 5 pairs of angles α j , β j (j = 1..5) to be chosen independently of the 4 pairs represent the state preparation and measurement operators correspondingly.The actual pulse waveform of a sample sequence of gates is depicted in Fig. 3.
The states and measurements of a two-level system can be equivalently represented in the Bloch sphere.The initial state |0 0| corresponds to the vector (0, 0, 1).In Appendix A we write explicit formulas for the Bloch vector n αβ corresponding to our preparations and m θφ corresponding to the measurements.The Bloch vectors are used for illustration purposes in Fig. 4. Heuristically, one needs evenly spread vectors over the Bloch sphere to provide a more discriminative test [25].

Experiment
In a perfect theory, we can predict a probability for every choice of α, β, θ , φ.The experimental results can differ for a variety of reasons.Firstly, the test is random and we have Figure 4 The Bloch vectors for the preparations (red) and measurements (blue) corresponding to the angles from Table 1, top ' and bottom ".For the case ' , the four measurement direction are identical to four preparations to estimate the error due to finite statistics.For T times the experiment is repeated, the variance of W was derived in Ref. [25] as: where Adj is the adjoint matrix (matrix of minors of p, with crossed out a given row and column, and then transposed).Note that the identity p -1 det p = Adj p does not apply here as W = det p = 0 in the limit T → ∞.We circumvent the limitations of statistical errors by accumulating a vast statistics of the data.We use the finite data estimate of W 2 to monitor accuracy of our results.Secondly, the implementation of gates may be not faithful.Our test is not affected the standard local sources of depolarizing and relaxation errors, and general gate and readout errors, as they are assumed to remain within the two-level space.Moreover, the test accounts for a leakage to external states (e.g.|2 ) as long as it is incoherent and does not depend on the circuit parameters α, β, θ , φ, as it adds a global constant to eacht p jk .Lastly, we have to assume that the pulse does not depend on the previous ones.In other words, we can only test the following combination of assumptions: dimension of the space and independence of operations.
We have calculated W in two ways: (i) determining p for each job and then finding W (see the values for each job in Fig. 10) and finally averaging W , and (ii) averaging first p from all jobs and then finding W . Results are consistent within statistical error, the details are depicted in Fig. 6.
There is no a priori best selection of preparations and measurements but they should not lie on a single Bloch circle.Otherwise the qubit becomes a rebit (reduced to real subspace).We decided to make two kinds of tests: (I) two special configurations corresponding to either the same Bloch vectors for preparation and measurements or maximal W 2 for a given T; (II) a family of configurations with one preparation vector at one of the 5 directions on the Bloch circle.In both cases the corresponding Bloch vectors are derived explicitly in Appendix A. The sets of angles in the case (I) are given in the Table 1, and the corresponding Bloch vectors are visualized in Fig. 4.
We have run the test (I) on lima and lagos, qubit 0. The probability matrix, compared to the ideal expectation is depicted in Fig. 5.The deviation from zero and the statistical error is given in Fig. 6.The total number of experiments is T = #jobs • #shots • #repetitions.Technically, one sends a list of jobs to execute, each job contains up to 300 circuits, to be distributed between experiments repeated the same number of times.The number of shots specifies how many time the preprogrammed sequence of circuits is repeated within a single job.The readout counts for each circuit is the value returned after the job execution is accomplished.In this case the results agree with the assumption or the qubit space within the statistical error.
The sets of angles in the case (II) are prepared differently.Four preparations and measurements are fixed while the last preparation is parameter-dependent.The fixed angles are specified in Table 2.The last preparation angles are α 5 = 2πi/5 = β 5π/2 for i = 0..4.The corresponding Bloch vectors are depicted in Fig. 7.We have run the test (II) on nairobi Table 1 The angles for the special two special cases, ' and ", with η = acos(1/3) and 1 = 1' = 1" for preparations in the test (I) Figure 5 Results of the test (I) with probabilities p kj for the angles from Table 1, for lima and lagos, compared to the ideal expectation.Lagos: 60 jobs, 32000 shots, 15 repetitions.Lima: 521'/194" jobs, 20000 shots, 5 repetitions

Figure 6
Results of the test (I) the witness W = det p, for the angles from Table 1, for lima and lagos, with the error given by (4).Red -W for p from each job and then averaged, blue -p averaged from all jobs to give W and perth, qubit 0. The probability matrix, compared to the ideal expectation is depicted in Fig. 8.The deviation from zero and the statistical error is given in Fig. 9.This time, the results are away from 0 by more than 5 standard deviations, in opposite directions, com-Table 2 The angles for the parametric test (II) for preparations and measurements 1..4

Discussion of nonidealities
There are several factors that can affect the correctness of the experiment.(A) The daily calibration.The drive frequency and the gate waveforms are corrected so different jobs can rely on different realizations of gates.There first order effect of calibrations is cancelled out.Nevertheless, we made more detailed estimates on second order effects in Appendix B. Only large, unexpected failures could be a problem.(B) The leakage to higher states, e.g.|2 is negligible [12,29], of the order 10 -13 , according to IBM data, see details in Appendix C. (C) Memory of the waveform between successive gates.Highly unlikely, a residual voltage amplitude can persist up to the next gate.In principle it can be mitigated by delay-separated gates if the effect fades out with time.(D) Other qubits.They are usually detuned but some crosstalk may remain.We expect the crosstalk to be incoherent and so irrelevant for the witness.

Conclusions
A test of linear independence of quantum operations reveals subtle deviations, invisible in more crude tests.We demonstrated an experimental feasibilty and usefullness of the theoretical test.Further tests are necessary to identify the origin of the deviations, to exclude some sophisticated technical issues (e.g.lack of independence between the gate pulses) and more exotic options many worlds/copies theories [35,36].Even when the technical  2, for nairobi and perth, with the error given by (4).Red -W for p from each job and then averaged, blue -p averaged from all jobs to give W  2, for nairobi and perth noise models.Note that the two ways of calculation of W almost coincide (the blue one covers the red one), which is consistent with our explanation of averaged out first order difference in Appendix B Figure 13 Results of the simulations of the test (II) the witness W = det p, for the angles from Table 2, for nairobi and perth noise models, for individual jobs m θ = ⎛

Figure 1 Figure 2
Figure 1 Preparation and measurement scenario; the state is prepared as N and measured by M to give an outcome of either 1 or 0

Figure 3
Figure 3 The actual waveform of the pulse on IBM quantum computer (nairobi), with four subsequent gates S γ , with γ = α, β, φ, θ , consecutively.The discretization unit time is dt = 0.222 ns.Driving (level gap) frequency is denoted by D0.The light/dark shading corresponds to in-phase/out-of-phase amplitude component, respectively.The element VZ(ξ ) is a zero-duration virtual gate Z ξ for subsequent gates S γ S δ with

3 Figure 7
Figure 7The Bloch vectors for the parametric case (II) with fixed preparations (red) and measurements (blue) corresponding to the angles from Table1, and a parametric preparation (green)

Figure 8 Figure 9
Figure 8 Results of the test (II) with probabilities p kj for the angles from Table2, for nairobi and perth, compared to the theory expectation.Nairobi/perth: 115/93 jobs, both 100000 shots and 8 repetitions

Figure 10 Figure 11 Figure 12
Figure 10Results of the test (II) the witness W = det p, for the angles from Table2, for nairobi and perth, for individual jobs.Two values for nairobi are beyond the picture boundaries, (3, 0.0023) and (4, 0.003)