Spectral quantum tomography

We introduce spectral quantum tomography, a simple method to extract the eigenvalues of a noisy few-qubit gate, represented by a trace-preserving superoperator, in a SPAM-resistant fashion, using low resources in terms of gate sequence length. The eigenvalues provide detailed gate information, supplementary to known gate-quality measures such as the gate fidelity, and can be used as a gate diagnostic tool. We apply our method to one- and two-qubit gates on two different superconducting systems available in the cloud, namely the QuTech Quantum Infinity and the IBM Quantum Experience. We discuss how cross-talk, leakage and non-Markovian errors affect the eigenvalue data.


INTRODUCTION
A central challenge on the path towards large-scale quantum computing is the engineering of high-quality quantum gates.To achieve this goal, many methods that accurately and reliably characterize quantum gates have been developed.Some of these methods are scalable, meaning that they require an effort which scales polynomially in the number of qubits on which the gates act.Scalable protocols, such as randomized benchmarking, [1][2][3][4][5][6][7][8] necessarily give a partial characterization of the gate quality, for example, an average gate fidelity.Other protocols such as robust tomography 9 or gate-set tomography 10,11 trade scalability for a more detailed characterization of the gate.A desirable feature of all the above protocols is that they are resistant to statepreparation and measurement (SPAM) errors.The price of using SPAM-resistant (scalable) methods is that these protocols have significant experimental complexity and/or require assumptions on the underlying hardware to properly interpret their results.
In this work, we present spectral quantum tomography, a simple non-scalable method that extracts spectral information from noisy gates in a SPAM-resistant manner.To process the tomographic data and obtain the spectrum of the noisy gate, we rely on the matrix-pencil technique, a well-known classical signal processing method.This technique has been advocated in ref. 8 in the context of randomized benchmarking and has also been used in ref. 12 for processing data in the algorithm of quantum phase estimation.It has also been used, under the phrase "linear systems identification," in ref. 13 to predict the time evolution of quantum systems.While the matrix pencil technique leads to explicitly useful estimates of eigenvalues and their amplitudes, we note that the same underlying idea is used in the method of "delayed vectors," which has been proposed in ref. 14 to assess the dimensionality of a quantum system from its dynamics.This "delayed vectors" approach has been applied to assess leakage in superconducting devices in ref. 15 The spectral information of a noisy gate S, which approximates some target unitary U, is given by the eigenvalues of the so-called Pauli transfer matrix representing S.These eigenvalues, which are of the form λ = exp(−γ)exp(iϕ), contain information about the quality of the implemented gate.Intuitively, the parameter γ captures how much the noisy gate deviates from unitarity due to entanglement with an environment, while the angle ϕ can be compared to the rotation angles of the targeted gate U. Hence ϕ gives information about how much one over-or under-rotates.The spectrum of S can also be related to familiar gate-quality measures such as the average gate fidelity and the unitarity.Moreover, in the case of a noisy process modeled by a Lindblad equation, the spectrum can be easily related to the more familiar notions of relaxation and dephasing times.
The main advantage of spectral quantum tomography is its simplicity, requiring only the (repeated) application of a single noisy gate S, as opposed to the application of a large set of gates as in randomized benchmarking, gate-set tomography, and robust tomography.Naturally, simplicity and low cost come with some drawback, namely, the method does not give information about the eigenvectors of the noisy gate, such as the axis around which one is rotating.However, information about the eigenvectors is intrinsically hard to extract in a SPAM-resistant fashion since SPAM errors can lead to additional rotations. 16Another feature of spectral quantum tomography is that it can be used to extract signatures of non-Markovianity, namely, the phenomenon where the noisy gate S depends on the context in which it is applied (e.g., time of application, whether any gates have been applied before it).As we show in this paper, our method can be used to detect various types of non-Markovian effects, such as coherent revivals, parameter drifts, and Gaussian-distributed time-correlated noise.It is also possible to distinguish non-Markovian effects from qubit leakage.For these reasons, we believe that spectral quantum tomography adds a useful new tool to the gatecharacterization toolkit.The method could also have future applications in assessing the performance of logical gates in a manner that is free of logical state preparation and measurement errors, see the "Discussion" section.
For general TPCP maps, it is convenient to use the Pauli transfer matrix formalism.For an n-qubit system (d = 2 n ), consider the normalized set of Pauli matrices P μ for μ = 0, …, N with N + 1 = 4 n = d 2 , where P 0 ¼ I= ffiffiffiffiffi 2 n p and the normalization is chosen such that Tr[P μ P ν ] = δ μν .For a TPCP map S acting on n qubits, the Pauli transfer matrix is then defined as The form of the Pauli transfer matrix S is 17 where T S is a real N × N matrix and s is a N-dimensional column vector.The 1 and 0s in the top row of the Pauli transfer matrix are due to the fact that S is trace-preserving.For a unital S that obeys S(I) = I, the vector s = 0.A few properties are known of the eigenvalue-eigenvector pairs of S, i.e., the pairs ðλ; vÞ with Sv = λv:

•
The eigenvalues of S, and thus the eigenvalues of T S are 1, since the solutions of the equation det(S − λI) = 0 are the solutions of the equation (1 − λ)det(T S − λI) = 0.

•
The eigenvalues of S, and thus the eigenvalues of T S , come in complex-conjugate pairs.This is true because T S is a real matrix.
If T S is diagonalizable as a matrix, it holds that T S = VDV −1 where D is a diagonal matrix and V a similarity transformation.Generically, T S will be diagonalizable, in which case there are N eigenvalue-eigenvector pairs for T. A sufficient condition for diagonizability is, for example, that all the eigenvalues of T S are distinct.In section "Single-qubit case with non-diagonalizable matrix T," we give examples and discuss what it means if T S is not diagonalizable.
For some simple single-qubit channels, we can explicitly compute the spectrum.For instance, for a single-qubit depolarizing channel with depolarizing probability p, the eigenvalues of the submatrix T S of the Pauli transfer matrix are {1 − p, 1 − p, 1 − p}.For a single-qubit amplitude-damping channel with damping rate p, they are f ffiffiffiffiffiffiffiffiffiffiffi Relation to gate-quality measures.The eigenvalues of the Pauli transfer matrix of a noisy gate S can be related to several other known measures of gate quality, such as the average gate fidelity F ðS; UÞ, the gate unitarity uðSÞ and, for a single qubit (n = 1), the gate unitality.The average gate fidelity is defined as F ðS; UÞ ¼ R dϕ ϕ h jU y S ϕ j i ϕ h j ð ÞU ϕ j i.This fidelity relates directly to the entanglement fidelity F ent ðS; UÞ via F ¼ F ent dþ1 dþ1 , 19 where the entanglement fidelity is defined as where Ψ j i ¼ Thus, for the (entanglement) fidelity of a noisy gate S with respect to the identity channel U = I, one has F ent ðS; , implying a direct relation to the spectrum {λ i } of T S .A more interesting relation is how the eigenvalues of T S bound the fidelity with respect to a targeted gate U.In section "Upper bound on the entanglement fidelity with the targeted gate," we prove that the entanglement fidelity can be upper bounded as where the eigenvalues of T U with U the targeted unitary, ordered such that the sum j P j λ ideal j λ Ã j j is maximal.This upper bound is not particularly tight, but for the case of a single qubit we can make a much stronger numerical statement, see section "Upper bound on the entanglement fidelity with the targeted gate".
Another measure of gate quality, namely, the unitarity or the coherence of a channel 5 on a d-dimensional system, is defined as where S 0 ðρÞ :¼ SðρÞ À Tr½SðρÞI= ffiffiffi d p .A more convenient but equivalent definition is where {σ i } are the singular values of the matrix T S .The unitarity captures how close the channel is to a unitary gate.A lower bound on the unitarity is given by Proposition 2 in ref. 16 : where {λ i } are the eigenvalues of T S .For a single qubit, an upper bound on the unitarity can also be given in terms of a non-convex optimization problem, see section "Upper bound on the entanglement fidelity with the targeted gate".The unitality of a TPCP map is defined as 1 − ||s|| 2 with s in Eq. (2).Specifically, for single-qubit channels, one can derive the bound 16 s j j j j 2 Relation to relaxation and dephasing times.We consider the eigenvalues of a superoperator induced by a simple Lindblad equation modeling relaxation and decoherence of a driven qubit, as an example.We have a Lindblad equation with timeindependent Lindbladian L: The formal solution of Eq. ( 8) is given by ρðtÞ ¼ e tL ðρðt ¼ 0ÞÞ, where e tL is a TPCP map for every t.We are interested in the total evolution after a certain gate time τ and set S τ ¼ e τL .We assume a simple model in which a qubit evolves according to a Hamiltonian H = (h x X + h y Y + h z Z)/2 and is subject to relaxation and pure dephasing processes, according to the Lindbladian: We define the relaxation, respectively, dephasing rates Γ 1 = 1/T 1 and Γ 2 = 1/T 2 = 1/(2T 1 ) + 1/T ϕ .The Pauli transfer matrix L L of L then takes the form We will denote the eigenvalues of L L by Ω j for j ∈ {0, …, 3} and the eigenvalues of S τ by λ j for j ∈ {0, …, 3}.As expected, Ω 0 = 0 implying that λ 0 = e 0 = 1 is an eigenvalue of S τ .The other three eigenvalues of L L can be found from the 3 × 3 submatrix in the lower-right corner.Here we consider some simple cases.Case 1: h x = h y = h z = 0.In this case, for j = 1, 2, 3 the three eigenvalues of L and S τ are clearly Ω j 2 fÀΓ 2 ; ÀΓ 2 ; ÀΓ 1 g; λ j 2 fe ÀΓ2τ ; e ÀΓ2τ ; e ÀΓ1τ g; thus relating directly to the relaxation and dephasing rates.
Case 2: h x = h y = 0.In this case, we have e ÀΓ2τ e Àihz τ ; e ÀΓ1τ g; where we have separated the decaying part of the λ j (corresponding to the real part of the Ω j ) and their phases (corresponding to the imaginary part).If we work in the rotating frame of the qubit, h z can be understood as an over-rotation along the z axis, which would appear in the spectrum as an extra phase imparted to two of the eigenvalues.Again we see that the decaying part of the eigenvalues directly relates to the relaxation and dephasing rates.Case 3: h y = h z = 0.This case shows that over-rotations can also modify the decay strength of the eigenvalues.We analyze the eigenvalues as a function of h x .From L L in Eq. ( 9), we see that Ω 1 (h x ) = −Γ 2 for all h x .For the other eigenvalues, we have We see that if jh x j < jΓ 1 À Γ 2 j=2 h cr x , only the moduli of λ 2 and λ 3 are affected as compared to Case 1, in other words, λ 2 and λ 3 only decay with no extra phases.On the contrary, the phases of these eigenvalues become non-zero when the driving is sufficiently strong: jh x j> h cr x .It implies that, if we look at the dynamics induced by the Lindblad equation, real oscillations, not only decay, will be present as a function of τ.Hence, these two scenarios represent, respectively, the overdamped (jh x j < h cr x ) and underdamped regime (jh x j> h cr x ), similar to the dynamics of a vacuum-damped qubit-oscillator system, see, e.g., ref. 20 At jh x j ¼ h cr x , the system is critically damped and L L does not have four linearly independent eigenvectors, meaning that the Pauli transfer matrix of S τ is not diagonalizable.In this case, the dynamics also has a linear dependence on t besides the exponential decay with t, see the discussion in section "Single-qubit case with non-diagonalizable matrix T".

Spectral tomography
In this section, we describe the spectral tomography method, which estimates the eigenvalues of S, where S is a TPCP implementation of a targeted unitary gate.
We model state-preparation errors as a perfect preparation step followed by an unknown TPCP map N prep .Similarly, measurement errors are modeled by a perfect measurement preceded by an unknown TPCP map N meas .We assume that, when we apply the targeted gate k times, an accurate model of the resulting noisy dynamics is S k .The spectral tomography method can be applied without this assumption but the interpretation of its results is more difficult, see section "Leakage and non-Markovian noise" for a discussion.The method works by constructing the following signal function, for k = 0, 1, …, K for some fixed K: Gathering the data to estimate g(k) requires (1) picking a traceless n-qubit Pauli P μ , ( 2) preparing an n-qubit input state in one of the 2 n basis states corresponding to this chosen Pauli, (3) applying the gate k times and measuring in the same chosen Pauli basis, and ( 4) repeating (1-3) over different Paulis, basis states, and experiments to get good statistics.As in standard process tomography, 21 one takes linear combinations of the estimated probabilities for the outcomes to construct an estimator of a Pauli operator on a Pauli input.This gives an estimate of g(k) for a fixed k.Repeating this process for k ∈ {0, …, K}, we reconstruct the entire signal function.In section "Resources to relaxation and dephasing times," we discuss the cost of doing these experiments as compared to randomized benchmarking.
Let us now examine how g(k) depends on the eigenvalues of the matrix T. When there are no SPAM errors, that is, N meas and N prep are identity channels, we have where {λ j } are the eigenvalues of T. The last step in this equality follows directly when T is diagonalizable, but it can alternatively be proved using the so-called Schur triangular form of T (we give this proof in section "Single-qubit case with non-diagonalizable matrix T").
When N meas and N prep are not identity channels, we have where T meas and T prep are, respectively, the T-submatrices of the Pauli transfer matrix of N meas and N prep .Here we assume that T = VDV −1 is diagonalizable and the matrix A SPAM = V −1 T prep T meas V captures the SPAM errors.One may expect that A SPAM is close to the identity matrix in the typical case of low SPAM errors, in particular one may expect that A j ≠ 0 for all j so that all eigenvalues of T are present in the signal g(k).
In principle, one could take more tomographic data and consider a full matrix-valued signal c μν ðkÞ ¼ Tr½P μ N meas S k N prep ðP ν Þ instead of only Eq. ( 11).This requires doing many more experiments and there is no clear advantage in terms of the ability to determine the spectrum.
Signal analysis or matrix-pencil method for extracting eigenvalues.In this section, we review the classical signal-processing method that reconstructs, from the (noisy) signal gðkÞ ¼ P N j¼1 A j λ k j for k = 0, …, K, an estimate for the eigenvalues λ j and the amplitudes A j .Note that we have gðkÞ 2 R due to Eq. (11).Not surprisingly, this signal-processing method has been employed and reinvented in a variety of scientific fields.We implement the so-called ESPRIT analysis described in ref. 22 but see also ref. 23 .In the context of spectral tomography, we know that the signal g(k) will in principle contain N eigenvalues (which are possibly degenerate).However, we can vary the number of eigenvalues we use to fit the signal to see whether a different choice than N gives a significantly better fit.This is relevant in particular when the implemented gate contains leakage or non-Markovian dynamics, see section "Leakage and non-Markovian noise".
We require at least K ≥ 2N − 2 in order to determine the eigenvalues accurately.This implies that, for a single-qubit gate with N = 3, we need at least K = 4, and for a two-qubit gate with N = 15, we need at least K = 28.However, the signal g(k) has sampling noise due to a bounded N samples and in practice it is good to choose K larger than strictly necessary to make the reconstruction more robust against noise.We study the effect of varying K in Fig. 1 (left panel).
The method goes as follows and relies on picking a so-called pencil parameter L.
Let us assume for now that each g(k) is learned without sampling noise.One constructs a (K − L + 1) × (L + Note that rank(Y) ≤ N since Y is a sum of at most N rank − 1 matrices when there are N eigenvalues.Consider two submatrices of Y: the matrix G 0 is obtained from Y by deleting the last column of Y, while the matrix G 1 is obtained by deleting the first column of Y.When L ¼ K 2 , the matrices G 0 and G 1 are square matrices of dimension For this choice of L, the smallest value of K so that M = N is 2N − 2. We seek a time-shift matrix T such that TG 0 ¼ G 1 .When M ≥ N, there certainly exists a matrix T such that for all j ∈ {1, …, N}: Furthermore, if G À1 0 exists, which is the case when rank(G 0 ) = M, this matrix T will be uniquely given as G 1 G À1 0 .Hence, in this case there is a unique matrix T, obtained by constructing G 1 G À1 0 from the data, which is guaranteed to have {λ j } as eigenvalues.When the pencil parameter L> K 2 , one needs to ensure that there are at least N rows of the matrix Y: if not, T would be of dimension <N, not giving N eigenvalues.This implies K ≥ N + L − 1.
The general method for a non-square Y, which includes an additional sampling-noise reduction step, then goes as follows.The choice for N in the procedure can be varied from its minimal value equal to d 2 − 1 to a larger value, depending on a goodnessof-fit.

Construct a singular-value decomposition of the matrix Y,
i.e., Y ¼ R 1 ΣR T 2 and replace the diagonal matrix Σ by a diagonal matrix Σ clean with only the largest N singular values.
2 .This step is to reduce sampling noise.2. Take the submatrices G 0 and where G þ 0 is the Moore-Penrose pseudo-inverse of the matrix G 0 so that T is a matrix with at most N non-zero eigenvalues.4. Compute the eigenvalues of T: these will be the estimates λ est j of λ j for all j ∈ {1, …, N}.Formally, the linear matrix pencil is G 0 − λG 1 and the eigenvalues of this matrix pencil, i.e., the values where det(G 0 − λG 1 ) = 0, are the λ est j .We have first applied this method on the signal g(k) of a randomly chosen single-qubit channel: by varying K and L we want to understand the role of the matrix-pencil parameter L and the choice for a larger K.The results are shown in Fig. 1 (left panel).Note that the chosen Ks are quite far above the bound K ≥ N + L − 1 to effectively suppress sampling noise.For each K, there is a flat region in L where Δ 2 is roughly constant.In the remainder, we will choose L = K/2, putting ourselves in the middle of this region.Figure 1 (right panel) shows how increasing N samples lowers the total variance of the estimated eigenvalues.
We see that, as long as the matrix-pencil parameter L is chosen away from 0 or K, the accuracy of the reconstructed signal is nearly independent of L. Furthermore, we see that higher K's can achieve a lower Δ 2 .(Right) We generate a random single-qubit channel and set L = K/2.We plot Δ 2 as a function of K for two different values of N samples = 1000 and N samples = 5000, showing how a larger N samples suppresses the total variance.We see that for constant N samples the accuracy of the method increases rapidly at first when K is increased, but it increases more slowly if K is already large.This can be explained by the fact that the signal decreases exponentially in K and so data points for large K have much lower signal-to-noise ratio.For both figures, random channels were generated using QuTip's random TPCP map functionality, and measurement noise was approximated by additive Gaussian noise with standard deviation equal to 1= ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi N samples p An additional processing step is the determination of the (complex) amplitudes {A j }.Viewing g(k) as a set of K + 1 inner products between the vector (A 1 , …, A N ) and the linearlyindependent vectors ðλ k 1 ; λ k 2 ; ; λ k N Þ, it is clear that, given perfect knowledge of g(k), the {A j } are uniquely determined when K + 1 ≥ N. Since g(k) is known with sampling noise, the {A j } can be found by solving the least-squares minimization problem min Aj P k jgðkÞ À The optimal values in this minimization A est j and λ est j together form the reconstructed signal g est (k) and the error is given by Resources.It is interesting to consider the amount of experiments that must be done to perform spectral quantum tomography.One must estimate the function g(k) defined in Eq. ( 13).This reconstruction process requires running 2 n × N × (K + 1) different experiments and repeating each experiment N samples times.For a single-qubit gate, we need 6(K + 1).Note that, while the number of experiments scales exponentially with qubit number (not surprising for a tomographic protocol), the number of experiments needed for performing spectral tomography on single-and two-qubit gates is comparable to the number of experiments that must be performed in randomized benchmarking on one or two qubits (which provides only average gate information).In randomized benchmarking, one must sample M random sequences for each sequence length k ∈ [0 : K], yielding M × (K + 1) experiments.This M is independent of the number of qubits. 24In experiments, M is often chosen between M ≈ 40 25,26 at the low end and M ≈ 150 at the higher end. 27Values of K reported in randomized benchmarking experiments are also comparable to (or even higher than, see ref. 25 where K ≈ 300 is considered) the values of K used for single-and two-qubit spectral tomography (section "Spectral tomography on two superconducting chips").

Spectral tomography on two superconducting chips
We have executed the spectral tomography method on a singlequbit π/4 rotation around the x axis: R x (π/4) = exp(−iπX/8).For this gate, the ideal matrix T Rx ðπ=4Þ should have eigenvalues 1, exp(iπ/4), and exp(−iπ/4).We execute this gate on two different systems available in the cloud: the two-qubit Quantum Infinity provided by the DiCarlo group at QuTech (for internal QuTech use) and the ibmqx4 (IBM Q5 Tenerife) available at https://quantumexperience. ng.bluemix.net/qx/editor.The results of this experiment are shown in Fig. 2 (left panel) in a polar plot, which we refer to as the "spectral footprint" of the gate.For clarity, in Fig. 2 (right panel) we have also plotted the phase deviation from ideal for the implemented gates.
On the two-qubit (q 0 and q 1 ) Quantum Infinity chip, we perform the single-qubit gate experiment on q 0 twice to study cross-talk: in one case, the undriven qubit q 1 on the chip is in state |0〉, in the other case q 1 is in state |1〉.Since the residual off-resonant qubit coupling, mediated through a common resonator, is non-zero, we observe a small difference between these two scenarios, see Fig. 2. For the Quantum Infinity chip, when q 1 is |0〉 we estimate λ est j 2 f0:691 þ 0:719i; 0:691 À 0:719i; 0:997g, while λ est j 2 f0:687 þ 0:7239i; 0:687 À 0:724i; 0:998g when q 1 is |1〉.Using the single-qubit fidelity bound given in section "Upper bound on the entanglement fidelity with the targeted gate", we can compute that the fidelity with respect to the targeted gate R x (π/ 4) can be no more than 0.999 regardless of the state of q 1 .We can also compute upper and lower bounds on the unitarity (see sections "Eigenvalues of Trace-Preserving Completely Positive (TPCP) maps" and "Upper bound on the entanglement fidelity with the targeted gate") which yields 0.994 ≤ u ≤ 0.996 regardless of the state of q 1 .
Regarding the ibmqx4 chip, the data are taken when all other qubits are in state |0〉.The reconstructed eigenvalues λ est j 2 f0:735 þ 0:671i; 0:735 À 0:671i; 0:996g turn out to be lower in magnitude.From these numbers, we can conclude that the fidelity to the target gate is no higher than 0.998 and the unitarity lies between 0.988 and 0.991.
For all these numbers, a two-way 95% confidence interval (for both real and imaginary parts) deviates by <0.005 from the quoted values.The confidence intervals are obtained through a Wild resampling bootstrap with Gaussian kernel. 28e have considered whether the data can be better fitted with >N = 3 eigenvalues.For each experiment, we fit the data using N eigenvalues with N ∈ {4, …, 15} and we test whether there is a significant increase in goodness-of-fit using a standard F-test [ref. 29, section 2.1.5].For no experiment and value of N does the resultant p value drop <0.05, leading us to conclude that increasing the number of eigenvalues does not significantly increase the accuracy of the fit.We have also executed a two-qubit CNOT gate on ibmqx4 (Fig. 3).The T matrix of the ideal CNOT gate has 15 eigenvalues and a very degenerate spectrum: 6 eigenvalues are equal to −1 and 9 eigenvalues are equal to 1, but our data, taking K = 50, show that a best fit is obtained using 4 instead of 2 eigenvalues.Using an Ftest shows that the goodness-of-fit is significantly improved using 4 eigenvalues rather than 2 or 3, whereas adding more eigenvalues beyond 4 does not significantly improve the goodness-of-fit (p > 0.05).We have not tried using larger K (which may lead to a resolution of more eigenvalues) since this would break the requirement that our experiments are executed as a single job performed in a short amount of time on the IBM Quantum Experience.The eigenvalues are λ est j ∈ f0:939 þ 0:059i; 0:938 À 0:059i; À0:961 þ 0:067i; À0:961 À 0:067ig , all with a 95% confidence interval <±3 × 10 −3 for both real and imaginary parts.It is important to note that these 4 eigenvalues, coming in 2 complex-conjugate pairs, cannot be the spectrum of a two-qubit TPCP map S, for the following reasons.As observed in section "Eigenvalues of Trace-Preserving Completely Positive (TPCP) maps," the submatrix T S of the Pauli transfer matrix of S is a real matrix of odd (4 2 − 1 = 15) dimension.Since any complex eigenvalues of a real matrix come in conjugate pairs, T S must have at least one real eigenvalue.Moreover, the data cannot be explained by allowing for leakage, as any eigenvalues associated with a small amount of leakage must have small associated amplitude, as we discuss in section "Leakage and non-Markovian noise".This is not the case for the eigenvalues plotted in Fig. 3 as all their amplitudes have comparable magnitude A est ∈ {3.34 − 1.70i, 3.34 + 1.70i, 1.57 + 0.91i, 1.57 − 0.91i}.In section "Frame mismatch accumulation," we propose a simple model based on a frame mismatch accumulation that qualitatively reproduces these eigenvalues.This model is not stochastic but coherent, and it violates the assumption that the applied CNOT gate can be fully modeled as a TPCP map.A possible physical mechanism producing a frame mismatch accumulation can be a drift in an experimental parameter.
We do not compute bounds on the fidelity or unitarity of the CNOT gate since the bounds in section "Relation to gate-quality measures" do not apply when the evolution is non-Markovian.

Leakage and non-Markovian noise
In this section, we consider how spectral tomography behaves under error models that violate the assumptions that go into Eq.(13).
Three common mechanisms for gate inaccuracy are (1) crosstalk, meaning the gate depends on or affects the state of other "spectator" qubits; (2) leakage, meaning that the dynamics of the gate acts outside of the computational qubit subspace and (3) non-Markovian dynamics, meaning that the assumption that k applications of the noisy gate are equal to S k for some TPCP map S is incorrect.Characterizing gates with respect to these features is important for assessing their use in multi-gate/multi-qubit devices for the purpose of quantum error correction or plainly reliable quantum computing. 4,30ne can see that all three scenarios are due to the dynamics taking place in a larger Hilbert space than the targeted computational qubit space.In the case of leakage, the larger space is an extension of the computational space, while in the other cases the larger space is the tensor product of the computational space with the state space of spectator qubits (1), as explored in section "Spectral tomography on two superconducting chips," or other quantum or classical degrees of freedom in the environment (3).
Leakage.Let us consider how gate leakage affects the signal g(k), making the analysis for one or two qutrits.One can choose an operator basis for the qutrit space such as the basis of the 8 traceless (normalized) Gell-Mann matrices σ GM μ for μ = 1, …, 8, together with the normalized identity σ GM 0 ¼ 1 ffiffi 3 p I 3 .For a single qutrit, we can consider the "Pauli" transfer matrix in this Gell-Mann basis, i.e., S GM μν ¼ Tr½σ GM μ Sðσ GM ν Þ and its submatrix T GM .For a single qutrit, the signal g NO SPAM (k) in Eq. ( 12) then equals Tr comp [(T GM ) k ] where Tr comp [A] represents the trace over a 3 × 3 submatrix of A, corresponding to the Gell-Mann matrices, which act like X, Y, and Z in the two-dimensional computational space.In other words, we can see the matrix T GM as being composed of blocks: where the upper-left block is the submatrix whose trace we take in g NO SPAM (k).In the absence of other noise sources, T GM corresponds to the evolution of a unitary gate and (assuming it is diagonalizable) it can be diagonalized by a rotation V as T GM = VDV −1 , where D is a diagonal matrix with all the eigenvalues {λ j }.If we assume that leakage is low, meaning that T leak and T seep have small norm of OðϵÞ, then at lowest order in ϵ the diagonalizing transformation V will be block-diagonal, i.e., V ≈ V comp ⊕ V beyond .This means that g NO SPAM ðkÞ = Tr comp OðϵÞ.Thus, at lowest order, the signal will have large amplitude on three relevant eigenvalues of the spectrum of T GM and these eigenvalues could have been perturbatively shifted from their ideal location by low leakage.If the leakage is stronger, we can more generally write Here |σ j 〉 is a vector notation for one of the eight Gell-Mann matrices σ j and Π comp is the projector onto the basis spanned by the three Gell-Mann matrices, which are the Paulis in the computational space.From this expression, we see that the effect Fig. 3 Spectral footprint of the CNOT gate for K = 50 and N samples = 8192.Even though the CNOT gate has only two (degenerate) eigenvalues, we find that the spectrum of the noisy gate can be best described using four distinct eigenvalues.The fact that none of them are real suggests that the data cannot be due to the repeated execution of the same noisy gate.In section "Frame mismatch accumulation," we propose a simple coherent non-Markovian model that offers a possible mechanism for the absence of real eigenvalues of leakage is the contribution of more eigenvalues to the signal g (k).For low leakage, we may expect three dominant eigenvalues with relatively large amplitude Ãj and five eigenvalues with small amplitude.
For a gate on two qutrits, identical remarks apply, except that an additional basis transformation is required from the orthogonal Gell-Mann basis to the computational qubit Pauli basis in order to keep the same division of T GM as in Eq. ( 17).If we have two qutrits, the 80-dimensional traceless subspace is spanned by the matrices σ GM μ σ GM ν for μ, ν = 0, …, 8 except μ = ν = 0.The issue is related to terms such as σ GM 0 σ GM ν≠0 since the normalization of the qutrit identity σ GM 0 ¼ 1 ffiffi 3 p I 3 is different from the normalization of the qubit identity (P 0 ¼ 1 ffiffi 2 p I 2 ).This suggests that for two qutrits it is better to write T GM in a basis that includes the Pauli matrices in the computational subspace (P μ ⊗ P ν for μ, ν = 0, …, 3 except μ = ν = 0) as a sub-basis.For two qutrits, the signal may then contain up to 80 eigenvalues of which all but 15 are expected to have small amplitude in case of low leakage.
Non-Markovianity: time-correlated noise.Non-Markovian behavior of a gate can be due to temporal correlations in the classical or quantum environment of the driven qubit(s).Abstractly, we can include the environment in the gate action so that the evolution for each gate application is a unitary given by some U total acting on system and environment.We can expand the Pauli transfer matrix of U total in a Pauli basis for system and environment and view T comp as a sub-block of T total , similar as in the case of leakage.Diagonalizing T total and taking the trace over the computational space will result in an expression such as Eq.(18).For example, an additional spectator or environment qubit can lead to a signal g(k) of a single-qubit gate having contributions from 15 eigenvalues.Choosing a sufficiently large K may allow one to resolve these eigenvalues, even those with small amplitude.
A more malicious, but physically reasonable, 30 form of classical non-Markovian noise makes gate-parameters temporally correlated.In order to numerically study the effect of non-Markovian noise, we consider a toy example in which a perfect CZ gate is followed by a rotation around the x axis on one qubit.For a series of k repetitions of a perfect CZ gate, we assume that each one is followed by the same rotation R x (ϕ) acting always on the same qubit.We assume that the angle ϕ is Gaussian-distributed with mean 0 and standard deviation σ: P σ ðϕÞ ¼ expðÀϕ 2 =2σ 2 Þ= ffiffiffiffiffi ffi 2π p σ.The time evolution for k repetitions is then given by Note that S k ≠ ðS 1 Þ k since this noise is correlated across multiple repetitions of the gate.Furthermore, we assume perfect state preparation and measurement.In this case, one can represent the noisy gate by some unitary U total acting on the two qubits and on a classical state in a Gaussian stochastic mixture of angles ϕ.The continuous nature of this classical environment state leads to a lack of a hard cut-off on the number of eigenvalues in g(k).
We apply the matrix-pencil method to the corresponding signal g NO SPAM (k) and we use an F-test to determine the optimal number of eigenvalues for each σ (Fig. 4).For σ = 22.9°andK = 50, we find eigenvalues with modulus clearly >1.Those are unphysical but not excluded by the matrix-pencil method.We expect that such |λ est | > 1 disappear when considering a longer signal, since g(k) does not increase exponentially in k.In other words, this is a sign that the signal contains more spectral content than can be resolved from the time scale set by K. Indeed, for σ = 22.9°we have made the same analysis for larger Ks up to K = 200 and we find that those eigenvalues get closer and closer to 1.If instead we fix K = 50 and consider different σs, we find that for a low σ (e.g., 5.7°) unphysical eigenvalues are not present (Fig. 4), whereas for σ > 22.9°(e.g.40.1°) they get again closer and closer to 1.This latter fact can be understood by noting that increasing σ is analogous to enlarging the time scale set by K, as the characteristic time scale of dephasing gets shorter for a fixed K. Based on these observations, we conclude that there is a certain intermediate time scale at which eigenvalues >1 are extrapolated from the data in the presence of sufficiently strong non-Markovian noise of the kind described in this section.Section "Frame mismatch accumulation" discusses a model with a different kind of time correlation leading to a spectral footprint which is incompatible with that of a TPCP map.
Non-Markovianity: coherent revivals.In order to better understand the occurrence of eigenvalue estimates |λ est | > 1, we apply the matrix-pencil method on a signal (of a somewhat different physical origin), which has a revival over the time period set by K.
It is well known that, in the exchange of energy between a twolevel atom with a bosonic mode, the Rabi oscillations of the twolevel atom are subject to temporal revivals.These revivals are due to the fact that the bosonic driving field is not purely classical but rather gets entangled with the state of the qubit via the Jaynes-Cummings interaction.In particular, for a coherent driving field with coherent amplitude α with average photon number n ¼ jαj 2 , the probability for the atom to be excited equals (see section 3.4.3 in ref. 20 ): with p α ðnÞ ¼ expðÀjαj 2 Þ jαj 2n n! .We consider n ¼ 5 and sample the damped oscillatory function P e ðtÞ À 1 2 at regular intervals kΩδt with Ωδt = 0.05 and k = 0, …, K = 900.The signal function gðtÞ ¼ P e ðtÞ À 1 2 contains eigenvalues equal to λ n ¼ expð ± i 0:05  19).For each σ, we use an F-test (p value 0.01) to find the number of eigenvalues that best fit the simulated g NO SPAM (k) with K = 50.We find, respectively 7, 12, and 11 eigenvalues for σ = 5.7°, 22.9°, and 40.1°(here we show only the eigenvalues with modulus >0.9).We observe eigenvalues with modulus >1 if σ is sufficiently large.These results are qualitatively stable if we add a small amount of sampling noise mean photon number n.
We observe that the matrix-pencil method finds eigenvalues >1, see Fig. 5, which contribute significantly (p < 0.01 via F-test) to the reconstructed signal.We can understand this feature of eigenvalues >1 as a way in which the matrix-pencil method handles revivals: the signal has more spectral content than what can be resolved from the window of time given by K, in particular there is no hard cut-off on the number of eigenvalues that contribute.We have observed that an analysis of the signal over a longer period of time, that is, a larger K up to K = 5000, gives eigenvalues whose norm converges to at most 1.

DISCUSSION
We have introduced spectral quantum tomography, a simple method that uses tomographic data of the repeated application of a noisy quantum gate to reconstruct the spectrum of this quantum gate in a manner resistant to SPAM errors.We have experimentally validated our method on one-and two-qubit gates and have also numerically investigated its behavior in the presence of temporally correlated non-trivial error models.
The effective upshot of leakage and non-Markovian noise is that the signal will have more spectral content than what can be resolved given a chosen sequence length K, leading to unphysical features in the spectrum such as an eigenvalue estimate >1, or the absence of a real eigenvalue.Even though we have seen in our examples that a physical spectrum can be regained by going to larger K, depending on the noise model, this convergence may be very slow requiring much data-taking time.Hence, these unphysical features are useful markers for deviations from our model of repeated TPCP qubit maps S k .We view it as an open question how well one can reliably distinguish different sources of deviations.
An interesting application of the spectral tomography method could be the assessment of logical gates on encoded quantum information in a SPAM-resistant fashion.In this logical scenario (for, say, a single logical qubit), one first prepares the eigenstates of the logical Pauli operators X; Y, and Z.One then applies a unit of error-correction k = 0, …, K times: a single unit could be, say, the repeated error correction for L rounds of a distance-L surface code.Or a unit is the application of a fault-tolerant logical gate, e.g., by means of code-deformed error correction or a transversal logical gate followed by a unit of error correction.After k units, one measures the logical Pauli operators fault-tolerantly and repeats experiments to obtain the logical signal gðkÞ.Studying the spectral features of such logical channel will give information about the efficacy of the quantum error correction unit and/or the applied logical gate while departures from the code space or a need to time-correlate syndrome data beyond the given QEC unit can show up as leakage and non-Markovian errors.

Single-qubit case with non-diagonalizable matrix T
In general, a matrix T can be brought to Jordan normal form by a similarity transformation, i.e., T = VJV −1 with J = ⊕ i J i where each Jordan block J i is of the form see, e.g., Theorem 3.1.11in ref. 31 .T is diagonalizable when each Jordan block is fully diagonal.An example of a non-diagonalizable Lindblad superoperator on a single qubit has been constructed in ref. 32 .Using this, one can easily get a singlequbit superoperator S for which the traceless block of the Pauli transfer matrix is a non-diagonalizable matrix T as follows.Let with LðρÞ ¼ Ài½ yZ 2 ; ρ þ D½ð2xÞ 1=2 σ À ðρÞ þ D½y 1=2 XðρÞ with D½AðρÞ ¼ AρA y À 1 2 fA y A; ρg and real parameters x, y ≥ 0. This implies that S has the 4 × 4 Pauli transfer matrix Taking some small ϵ and x ≠ 0, one can check that the submatrix T does not have 3 eigenvectors and it has a pair of degenerate eigenvalues, so T is not diagonalizable.When we take x = 0, S is unital, that is, S(I) = I, and the submatrix T is not diagonalizable either.Even though a matrix T is not always diagonalizable, there still exists the so-called Schur triangular form for any matrix T. 31 This form says that T ¼ WðD þ EÞW y , with W a unitary matrix, D a diagonal matrix with the eigenvalues of T, and E a strictly upper-triangular "nilpotent" matrix with non-zero entries only above the diagonal.Since the N × N matrix E is strictly upper-triangular, one has Tr[D i E j ] = 0 for all j ≠ 0. If we use this form in Eq. ( 12), one obtains for any k Fig. 5 Study of the reviving signal given in Eq. ( 20) for k ⋅ Ωδt = k ⋅ 0.05, n ¼ 5, and K = 900.We find that the reviving signal is well reconstructed by a fit with 15 eigenvalues, some of which are distinctly separated as can be seen in the spectral footprint.Some of the eigenvalues are estimated to be >1.This is another example in which the matrix-pencil method gives unphysical eigenvalues in the presence of non-Markovian behavior (revivals here, time-correlated parameters in Fig. 4) since any product of the form D l1 E l2 D l3 E lm with some non-zero l i > 0 is a matrix with zeros on the diagonal.In case of SPAM errors and nondiagonalizable T, we consider where W y T prep T meas W is not the identity matrix due SPAM errors, implying that g(k) can depend on E and have a non-exponential dependence on k.Thus, in the special case of a non-diagonalizable matrix T, the signal g(k) would not have the dependence on the eigenvalues as in Eq. ( 13).
In particular, we can examine the physically interesting nondiagonalizable Case 3 in section "Relation to relaxation and dephasing times" in this light, taking h y = h z = 0 and a critical h cr x ¼ Γ1ÀΓ2 2 .The dynamics of the Lindblad equation after time t induces a superoperator S t , which will have the following action on the Pauli operators: Here we can note the linear dependence on t due to the system being critically damped.If we consider the signal gðtÞ ¼ P μ Tr½P μ S t ðP μ Þ, we see that this linear dependence on t drops out in accordance with Eq. ( 22), i.e., this trace only depends on the eigenvalues and has an exponential dependence on t.In the presence of SPAM errors, some of the linear dependence could still be observable for such critically damped system.In addition, coefficients such as c μν ðtÞ ¼ Tr½P μ S t ðP ν Þ can depend linearly on t, making such tomographic data less suitable to extract eigenvalue information.
Upper bound on the entanglement fidelity with the targeted gate In this section, we show how to relate the eigenvalues of the Pauli transfer matrix of a TPCP map S to an upper bound on the entanglement fidelity (and hence the average gate fidelity) with the targeted unitary gate U. Naturally, one can only expect to obtain an upper bound on the gate fidelity, since the eigenvalues do not provide information about the eigenvectors of S. If the actual eigenvectors deviate a lot from ideal, the actual gate fidelity could be very low, so one can certainly not derive a lower bound on the fidelity based on the eigenvalues.Lemma 1.Let the eigenvalues of the N × N matrix T S be fλ i g N i¼1 with N = d 2 − 1 for a d-dimensional system.Let U be the targeted gate with eigenvalues fλ ideal i g N i¼1 and let there be permutation π of ith eigenvalue λ i , which maximizes j P i λ Ã πðiÞ λ ideal i j so that 0 ξ max ¼ max π 1 where uðSÞ is the unitarity of S.
Proof.We write T S in Schur triangular form as T S ¼ WðD S þ EÞW y with W a unitary matrix, D S a diagonal matrix with the eigenvalues of T S , and E a strictly upper-triangular "error" matrix with non-zero entries only above the diagonal. 31Using the Cauchy-Schwartz inequality, one has Note that for a unitary gate U, T U y ¼ ðT U Þ T ¼ ðT U Þ y and T U y T U ¼ I implying that T is an orthogonal matrix with unit singular values.We thus have E y EÞ, using the strict upper-triangularity of E. In other words, Tr½E y E ¼ Tr½T Sy T S À P i jλ i j 2 where λ i are the eigenvalues of T S .Recognizing that 1 N Tr T Sy T S Â Ã ¼ uðSÞ, we obtain an upper bound on the second term in Eq. (25).Now let us upper bound the first term in Eq. ( 25) for unknown unitary W. Assume w.l.o.g. that T U and D S are diagonal in the same basis (the additional rotation between these eigenbases can be absorbed into W).Let T U ¼ P i λ ideal i P i and D S ¼ P i λ i P i with orthogonal projectors P i and P i P i ¼ I. Define the matrix M with entries M ij ¼ Tr½P i WP j W y .The matrix M is doubly stochastic, since , which implies that M ¼ P m q m π m with q m !0; P m q m ¼ 1 (Birkhoff-von Neumann theorem 31 ) with permutation matrix π m .With these facts and the convention ijλ S ¼ λ i , we can bound jTr½T Uy WD S W y j X m q m jλ ideal π m λ S j Nξ max : These bounds together then lead to Eq. ( 24).An immediate corollary of Lemma 1 is since uðSÞ 1 for TPCP maps.However, this is in general not a very strong upper bound on the fidelity.We can do better in the single-qubit case by realizing that there are strong relations between the singular values σ i of T S and the absolute values of the eigenvalues |λ i | of T S .Ordering both the singular values and the eigenvalue magnitudes in descending order, we have the following (weak majorization) inequalities for arbitrary matrices For single-qubit channels, we can also impose TPCP constraints to the singular values of the channel.In particular, we have [ref. 33, Eq. ( 4)] σ i 1; 8i 2 f0; 1; 2; 3g; (29) Using these relations, we can upper bound the unitarity of a single-qubit  3 and critically matching the lack of real eigenvalues observed in Fig. 3 channel S, given its eigenvalues, using the optimization: minimize σ1;σ2;σ3 This is a non-convex optimization problem in three variables, for which a global minimum can be numerically computed given λ 1 , λ 2 , λ 3 .This gives an upper bound on the unitarity of S and hence on the entanglement fidelity of S to the target unitary U.In the main text, we use this optimization to give non-trivial upper bounds on the fidelities of singlequbit gates realized on superconducting chips and analyzed using the spectral tomographic method.

Frame mismatch accumulation
In section "Spectral tomography on two superconducting chips," we noted that the data gathered for the CNOT gate cannot be explained by a model of a noisy TPCP map S repeated k times.Here we propose a simple coherent model that qualitatively reproduces the features observed in Fig. 3 and we call this the frame mismatch accumulation model.Let S 0 be a TPCP map that is a good approximation of the targeted gate applied exactly once (in the main text, this was the CNOT) and let V be some unitary.In the frame mismatch accumulation model, we assume that k consecutive applications of the gate are equal to: Intuitively, this can be interpreted as an increasing mismatch between the frame in which S 0 was defined and the frame in which the gate was implemented at the ith repetition, up to i = k.We apply this model to a CNOT gate, choosing S 0 to be an ideal CNOT gate and choosing V ¼ expðÀi θ 2 I YÞ with θ = 0.05 deg.In the case of the cross-resonance CNOT gate performed on ibmqx4, this may correspond to an imperfect cancellation of the I ⊗ Y term. 34In Fig. 6, we see that this example closely reproduces the eigenvalues shown in Fig. 3.At the same time, we note that the qualitative features observed in Fig. 6 do not depend on the choice of the rotation axis of V (for either qubit), as long as the rotation does not commute with S 0 (which would leave the gate unaffected by the frame mismatch).

Fig. 1
Fig. 1 Preliminary study of the numerical accuracy of the matrix-pencil method as a function of L, K and N samples .(Left) We use the matrixpencil method with different Ls and Ks to estimate the eigenvalues of a random single-qubit channel, for N samples = 1000.On the vertical axis, we give the variance in the estimate of the eigenvalues: Δ 2 ¼ 1 3 ð

Fig. 2 (
Fig. 2 (Left) Spectral footprints for single-qubit R x (π/4) gates on the ibmqx4 (IBMQ) and the Quantum Infinity (QI) chips at K = 50, L = 30, and N samples = 8192.The modulus of the eigenvalues is plotted in the radial direction, and in particular, it decreases from the center to the outside and it is equal to 1 on the (most inner) black circumference.The angular coordinate corresponds to the phase of the eigenvalues.(Right) Precise value of the deviation of the phases of the three eigenvalues from the ideal ones

Fig. 4
Fig.4Spectral footprint of a simulated CZ gate affected by non-Markovian noise quantified by σ, see Eq.(19).For each σ, we use an F-test (p value 0.01) to find the number of eigenvalues that best fit the simulated g NO SPAM (k) with K = 50.We find, respectively 7, 12, and 11 eigenvalues for σ = 5.7°, 22.9°, and 40.1°(here we show only the eigenvalues with modulus >0.9).We observe eigenvalues with modulus >1 if σ is sufficiently large.These results are qualitatively stable if we add a small amount of sampling noise