## Introduction

It is generally expected that for specific tasks already the first generations of quantum computers will have the potential to significantly outperform classical hardware1,2. This relies on the fact that the quantum computational space is exponentially larger than the classical logical state space3,4,5.

In classical computers, Landauer’s principle assigns a characteristic thermodynamic cost to processed information – namely to erase (or write) one bit of information at least $${k}_{B}T\,\mathrm{ln}\,(2)$$ of thermodynamic work (or heat) have to be expended6,7,8,9,10. Recent years have seen the rapid advent of thermodynamics of information9,11,12,13,14, which is a generalization of thermodynamics to small, information processing systems that typically operate far from equilibrium. In their description, tools and methods from stochastic thermodynamics have proven to be versatile and powerful. In particular, the fluctuations theorems enabled to generalize and specify Landauer’s principle to a wide variety of systems15,16,17.

In stochastic thermodynamics work is essentially a concept from classical mechanics, and it is given by a functional along a trajectory of the system18,19,20. For quantum systems the situation is significantly more involved, since quantum work is not an observable in the usual sense21,22. Thus, progress in the development of “quantum thermodynamics of information” has been hindered by the conceptual difficulties arising from identifying the appropriate definition of quantum work23,24,25,26,27,28,29.

The most prominent approach relies on two projective measurements of the energy, one in the beginning and one at the end of the process30,31. If the system is thermally isolated, then the difference of the measurement outcomes can be considered as thermodynamic work performed during the process21,22,32,33,34,35. This notion of quantum work fulfills a quantum version of the Jarzynski equality30,31, which has been verified in several experiments36,37,38. However, the question remains whether such a notion of quantum work, and the corresponding fluctuation theorem is useful in the sense that something can be “learned” about the system that one did not know already – before the experiment was performed.

Since projective measurements are an important tool in quantum information and quantum computation5, it was only natural to generalize the quantum Jarzynski equality to a more general fluctuation theorem for arbitrary observables. The resulting theorem, $$\langle \exp \,(\,-\,{\rm{\Delta }}\omega )\rangle =\gamma$$, is formulated for the information production, $${\rm{\Delta }}\omega$$, during arbitrary quantum processes39,40,41. Here, γ is the quantum efficacy that encodes the compatibility of the initial state, the observable, and the quantum map, and it is closely related to Holevo’s bound40. Remarkably, γ becomes a constant independent of the details of the process for unital quantum channels33,40. Physically, unital dynamics can be understood as systems which are subject to information loss due to pure decoherence42, but do not experience thermal fluctuations38.

In the following, we propose and exemplify the applicability of the general quantum fluctuation theorem in the characterization of the accuracy of quantum annealers. In particular, we show that the fluctuation theorem40 can be utilized to test whether the quantum annealer is prone to noise induced computational errors. To this end, we will see that (i) if the quantum annealer is isolated from thermal noise, i.e., its dynamics is unital the fluctuation theorem is fulfilled, (ii) if the dynamics are unitary and adiabatic the probability density function of $${\rm{\Delta }}\omega$$ is a δ-function, i.e., a unique outcome of the computation is obtained.

Our conceptual proposal was successfully tested on two generations of the D-Wave machine (2X and 2000Q). Our findings allow to quantify the resulting error rates from decoherence and other noise sources. It is worth emphasizing that in our analysis we are not interested in a detailed analysis the physics of the D-Wave machine. Rather, the purpose of the work is the conceptual proposal of the quantum fluctuation theorem as a tool for the accuracy diagnostics of any quantum annealer. Our experimental trials on the D-Wave machine merely illustrate that the quantum fluctuation theorem and its related methods provide a powerful tool in the characterization of quantum computing hardware and their computational accuracy.

Remarkably, we identified one D-Wave machine (2X) that posses an optimal regime of parameters for which the dynamics is unital. To the very best of our knowledge, our experiment provides thus also the first verification of the integral fluctuation theorem for an interacting, many-body quantum system.

## General Information Fluctuation Relation

To begin we briefly review notions of the general quantum fluctuation theorem40 and establish notations. Information about the state of a quantum system, $${\rho }_{0}$$, can be obtained by performing measurements of observables. At $$t=0$$, i.e., to initiate the computation, we measure $${{\rm{\Omega }}}^{{\rm{i}}}={\sum }_{m}\,{\omega }_{m}^{{\rm{i}}}{{\rm{\Pi }}}_{m}^{{\rm{i}}}$$. Note that the eigenvalues $${\omega }_{m}^{{\rm{i}}}$$ can be degenerate, and hence the projectors $${{\rm{\Pi }}}_{m}^{{\rm{i}}}$$ may have rank greater than one. Typically $${\rho }_{0}$$ and $${{\rm{\Omega }}}^{{\rm{i}}}$$ do not commute, and thus $${\rho }_{0}$$ suffers from a measurement back action5. Accounting for all possible measurement outcomes, the statistics after the measurement are given by the weighted average of all projections,

$${M}^{{\rm{i}}}[{\rho }_{0}]=\sum _{m}\,{{\rm{\Pi }}}_{m}^{i}\,{\rho }_{0}\,{{\rm{\Pi }}}_{m}^{i}.$$
(1)

After measuring $${\omega }_{m}^{{\rm{i}}}$$, the quantum systems undergoes a generic time evolution over time $$\tau$$ which we denote by $${{\mathbb{E}}}_{\tau }$$. At time $$t=\tau$$ a second measurement of observable $${{\rm{\Omega }}}^{{\rm{f}}}={\sum }_{n}\,{\omega }_{n}^{{\rm{f}}}{{\rm{\Pi }}}_{n}^{{\rm{f}}}$$ is performed Accordingly, the transition probability $${p}_{m\to n}$$ reads40

$${p}_{m\to n}={\rm{tr}}\,\{{{\rm{\Pi }}}_{n}^{{\rm{f}}}\,{{\mathbb{E}}}_{\tau }[{{\rm{\Pi }}}_{m}^{{\rm{i}}}{\rho }_{0}{{\rm{\Pi }}}_{m}^{{\rm{i}}}]\}.$$
(2)

Our main object of interest is the probability distribution of all possible measurement outcomes, $${\mathscr{P}}\,({\rm{\Delta }}\omega )$$, which we can write as40

$${\mathscr{P}}({\rm{\Delta }}\omega )=\sum _{m,n}\,\delta \,({\rm{\Delta }}\omega -{\rm{\Delta }}{\omega }_{n,m})\,{p}_{m\to n},$$
(3)

where $${\omega }_{n,m}\equiv {\omega }_{n}^{{\rm{f}}}-{\omega }_{m}^{{\rm{i}}}$$. It is then easy to see40

$$\langle \exp \,(\,-\,{\rm{\Delta }}\omega )\rangle =\gamma .$$
(4)

The quantum efficacy γ plays a crucial role in the following discussion and it can be written as

$$\gamma ={\rm{tr}}\,\{\exp \,(\,-\,{{\rm{\Omega }}}^{{\rm{f}}})\,{{\mathbb{E}}}_{\tau }\,[{M}^{{\rm{i}}}({\rho }_{0})\,\exp \,({{\rm{\Omega }}}^{{\rm{i}}})]\}.$$
(5)

Note that γ is constant, (i.e. process independent), for unital quantum dynamics40, in particular γ becomes independent of the process length $$\tau$$. For such cases, it is always possible to redefine $${{\rm{\Omega }}}^{{\rm{i}}}$$ and $${{\rm{\Omega }}}^{{\rm{f}}}$$ such that $$\gamma =1$$. Thus, one could say that Eq. (4) constitutes a general fluctuation theorem for unital dynamics. On the contrary, for non-unital dynamics the right hand side depends on the details of the dynamics, and thus Eq. (4) is not fluctuation theorem in the strict sense of stochastic thermodynamics43.

## Fluctuation Relation for the Ideal Quantum Annealer

We will now see that, on the one hand, the quantum fluctuation relation (4) provides simple means to benchmark the accuracy of the hardware. On the other hand, quantum annealers such as the D-Wave machine provide optimal testing grounds to verify fluctuation relations in a quantum many body setup.

To this end, we will assume for the remainder of the discussion that the quantum system is described by the quantum Ising model in transverse field44,

$$H(t)/\mathrm{(2}\pi \hslash )=-\,g(t)\,\sum _{i=1}^{L}\,{\sigma }_{i}^{x}-{\rm{\Delta }}(t)\,(\sum _{i=1}^{L-1}\,{J}_{i}{\sigma }_{i}^{z}{\sigma }_{i+1}^{z}+\sum _{i=1}^{L}\,{h}_{i}{\sigma }_{i}^{z}).$$
(6)

Although, the current generation of quantum annealers can implement more general many body systems45, we focus on the simple one dimensional case for the sake of simplicity46. An implementation of the latter Hamiltonian on the D-Wave machine is depicted in Fig. 1a. On this platform, users can choose couplings Ji and longitudinal magnetic field hi, which in our case are all zero. In general, however, one can not control the annealing process by manipulating g(t) and $${\rm{\Delta }}(t)$$. In the ideal quantum annealer the quantum Ising chain (6) undergoes unitary and adiabatic dynamics, while $${\rm{\Delta }}(t)$$ is varied from $${\rm{\Delta }}(0)\approx 0$$ to $${\rm{\Delta }}(\tau )\gg 0$$, and g(t) from $$g(0)\gg 0$$ to $$g(\tau )\approx 0$$ (cf. Fig. 1a).

The obvious choice for the observables is the (customary renormalized) Hamiltonian in the beginning and the end of the computation, $${{\rm{\Omega }}}_{i}={\mathbb{I}}-H(0)/[2\pi \hslash g(0)]$$ and $${{\rm{\Omega }}}_{f}=-\,H(\tau )/[2\pi \hslash J{\rm{\Delta }}(\tau )]$$. Consequently, we have

$${{\rm{\Omega }}}_{{\rm{i}}}={\mathbb{I}}-\sum _{i=n}^{L}\,{\sigma }_{n}^{x}\,{\rm{and}}\,{{\rm{\Omega }}}_{{\rm{f}}}=-\,\sum _{n=1}^{L-1}\,{\sigma }_{n}^{z}{\sigma }_{n+1}^{z},$$
(7)

where we included $${\mathbb{I}}$$ in the definition of $${{\rm{\Omega }}}_{{\rm{i}}}$$ to guarantee $$\gamma =1$$ for unital dynamics.

For the ideal computation, the initial state, $${\rho }_{0}$$, is chosen to be given by $${\rho }_{0}=|\,\to \,\rangle \langle \,\to \,|$$, where $$|\,\to \,\rangle :\,=|\cdots \to \to \to \cdots \rangle$$ is a non-degenerate, paramagnetic state – the ground state of H(0) (and thus of $${{\rm{\Omega }}}_{{\rm{i}}}$$), where all spins are aligned along the x-direction. As a result,

$${M}_{i}[{\rho }_{0}]={\rho }_{0}\,{\rm{and}}\,{\omega }_{i}=L-1,$$
(8)

as $${{\rm{\Omega }}}_{{\rm{i}}}$$ and H(0) commute by construction (Unfortunately, the D-Wave system does not allow us to test the accuracy of the initial preparation that leads to Eq. (8)).

Moreover, if the quantum annealer is ideal, then the dynamics is not only unitary, but also adiabatic. In general, we can write $${{\mathbb{E}}}_{\tau }\,[\rho ]={U}_{\tau }\rho {U}_{\tau }^{\dagger }$$, where

$${U}_{\tau }={{\mathscr{T}}}_{ > }\,\exp \,(-\frac{i}{\hslash }\,{\int }_{0}^{\tau }\,H\,(s)\,ds)$$
(9)

and as a result $${{\mathbb{E}}}_{\tau }\,[{\rho }_{0}]=|{\boldsymbol{f}}\rangle \langle {\boldsymbol{f}}|$$ for the adiabatic evolution. Here, $$|{\boldsymbol{f}}\rangle$$ is the final state, a defect-free state where all spins are aligned along the z-direction. Therefore, $${\omega }_{{\rm{f}}}={\omega }_{{\rm{i}}}$$.

In general, however, due to decoherence47, dissipation48 or other (hardware) issues49, the evolution may be neither unitary nor adiabatic and thus $${{\mathbb{E}}}_{\tau }\,[\rho ]={\rho }_{\tau }$$. Nevertheless, for the computation to succeed there has to be a finite probability on the ground state, $$p=\langle {\boldsymbol{f}}|{\rho }_{\tau }|{\boldsymbol{f}}\rangle > 0$$. Therefore, the quantum efficacy (5) in the adiabatic limit becomes

$$\gamma ={e}^{-{\rm{\Delta }}\omega }\langle {\boldsymbol{f}}|{\boldsymbol{f}}\rangle =p+\sum _{n\ne 0}\,{p}_{n}\to 1,$$
(10)

that is, a process independent quantity.

The D-Wave annealer prepares the initial state by thermal relaxation, thus the initial state is at best a thermal state with a hight weight on the ground state of H(0), $$|\to \rangle$$. Therefore, we can further write

$${p}_{m\to n}\approx {\delta }_{0,m}\,{p}_{n|m}={\delta }_{0,m}\,{p}_{n|0},$$
(11)

where pn|0 is the probability of measuring $${\omega }_{n}^{{\rm{f}}}$$, conditioned on having first measured the ground state. Since we assume the latter event to be certain, $${p}_{n\mathrm{|0}}\equiv {p}_{n}$$ is just the probability of measuring the final outcome $${\omega }_{n}$$ (we dropped the superscript). Therefore,

$$\langle {e}^{-{\rm{\Delta }}\omega }\rangle ={e}^{-{\rm{\Delta }}\omega }\,{p}_{0}+\sum _{n\ne 0}\,{e}^{-{\rm{\Delta }}{\omega }_{n}}\,{p}_{n}.$$
(12)

Comparing this equation with Eq. (10) we finally obtain a condition that is verifiable experimentally:

$${p}_{n}={\mathscr{P}}(|{\omega }_{n}|)=\{\begin{array}{ll}1 & {\rm{if}}\,|{\omega }_{n}|=L-1,\\ 0 & {\rm{otherwise}}.\end{array}$$
(13)

The probability density function $${\mathscr{P}}(|{\omega }_{n}|)$$ is characteristic for every process that transforms one ground state of the Ising Hamiltonian (6) into another. It is important to note that the quantum fluctuation theorem (4) is valid for arbitrary duration $$\tau$$ – any slow and fast processes. Therefore, even if a particular hardware does not anneal the initial state adiabatically, but only unitally (which is not easy to verify experimentally) Eq. (13) still holds – given that the computation starts and finishes in a ground state, as outlined above.

As an immediate consequences, every $$\tau$$-dependence of $${\mathscr{P}}$$ must come from dissipation or decoherence. This is a clear indication that the hardware interacts with its environment in a way that cannot be neglected.

## Experimental Test on the D-Wave Machine

We generated several work distributions $${\mathscr{P}}(|{\omega }_{n}|)$$ – (3) through “annealing” on two generations of the D-Wave machine (2X and 2000Q), which implemented an Ising chain as encoded in Hamiltonian (6). All connections on the chimera graph have been chosen randomly. A typical example is shown in Fig. 1b, where red lines indicate nonzero zz-interactions between qubits. The experiment was conducted $$N={10}^{6}$$ times. Figure 3 shows our final results obtained for different chain lengths L, couplings between qubits Ji and annealing times $$\tau$$ on 2X, and Fig. 4 for 2000Q. The current D-Wave solver reports the final state energy which is computed classically from the measured eigenstates of the individual qubits. In Fig. 2 we show the resulting exponential averages, $$\langle \exp \,(\,-\,{\rm{\Delta }}\omega )\rangle$$.

## Discussion of the Experimental Findings

We observe, that there are cases for which the agreement is almost ideal. In particular, this is the case on 2X for $$J=-\,1$$ and slow anneal times $$\tau$$, see Fig. 3. In this case the $${\mathscr{P}}(|{\omega }_{n}|)$$ is close to a Kronecker-delta, and the dynamics is unital, see Fig. 2. Note that the validity of the fluctuation theorem (4) is a very sensitive test to aberrations, since rare events and large fluctuations are exponentially weighted.

However, in the vast majority of cases $${\mathscr{P}}(|{\omega }_{n}|)$$ is far from our theoretical prediction (13) and the dynamics is clearly not even unital, compare Fig. 2. Importantly, $${\mathscr{P}}$$ clearly depends on $$\tau$$ indicating a large amount of computational errors are generated during the annealing. Similar conclusions have been obtained in the literature, and it has been suggested that D-Wave’s dynamics can be described by a quantum master equation32,50,51,52,53,54. Note, however, that an analysis of the source of error in the D-Wave machine is not the purpose of the present work. Rather, our experimental findings prove the utility of the quantum fluctuation theorem in the diagnostics of quantum annealers.

Interestingly, the D-Wave 2X we tested (This machine is based in Los Alamos National Laboratory) produces asymmetric results. The work distributions for ferromagnetic ($$J > 0$$) and antiferromagnetic ($$J < 0$$) couplings should be identical. On the other hand, the newest 2000Q D-Wave machine exhibits less asymmetrical behavior, however, its overall accuracys is not as good as its predecessor’s (see Fig. 4).

Complicated optimization problems involve both negative and positive values of the coupling matrix Jij. That makes debugging “asymmetric” quantum annealers a much harder task. Our proposal for diagnosing the hardware with the help of the quantum fluctuation theorem allows users to asses to what extent a particular hardware exhibits this unwanted behavior. Moreover, our test is capable of detecting any exponentially small departure from “normal operation” that may potentially result in a hard failure. We believe this to be the very first step to create fault tolerant quantum hardware55.

As a final note, we emphasize that any departure from the ideal distribution $${\mathscr{P}}$$ (13) for the Ising model indicates that the final state carries “kinks” (topological defects). Counting the exact number of such imperfections allows one to determine by how much the annealer misses the true ground state56. In a perfect quantum annealer this number should approach zero.

The Ising model (6) undergoes a quantum phase transition44. Near the critical point, i.e., at tc where $${\rm{\Delta }}({t}_{c})=g({t}_{c})$$, the gap – energy difference between the ground and a first accessible state – scales like 1/L. Thus, one could argue that the extra excitations come from a Kibble-Zurek like mechanism57,58. However, even the fastest quench ($$\tau \sim 20\,\mu s$$) exceeds the adiabatic threshold59,

$${\tau }_{{\rm{ad}}}\sim \frac{{L}^{2}}{{\rm{\Delta }}({t}_{c})}\sim 10\,\mu s,$$
(14)

for the system sizes of order L ~ 102. The error observed are due to decoherence54.

## Concluding Remarks

In the present analysis we have obtained several important results: (i) We have proposed a practical use and applicability of quantum fluctuation theorems. Namely, we have argued that the quantum fluctuation theorem can be used to benchmark the accuracy of quantum annealers. Our proposal was tested on two generations of the D-Wave machine. Thus, (ii) our results indicate the varying accuracy of distinct machines of the D-Wave hardware, and our method can be used to identify underperforming machines, which are in need of re-calibration. Finally, (iii) almost as a byproduct we have performed the first experiments and verification of quantum fluctuation theorems in a many particle system.

An interesting and immediate application of our present work would be to diagnose the accuracy of the D-Wave machine when applying quantum error correction. In particular in this case, the exponential sensitivity to computational errors of the fluctuation theorem might provide a guideline for developing optimal strategies.