Experimental verification of fluctuation relations with a quantum computer

Inspired by the idea that quantum computers can be useful in advancing basic science, we use a quantum processor to experimentally validate a number of theoretical results in non-equilibrium quantum thermodynamics, that were not (or were very little) corroborated so far. In order to do so, we first put forward a novel method to implement the so called two point measurement scheme, which is at the basis of the study of non-equilibrium energetic exchanges in quantum systems. Like the well-established interferometric method, our method uses an ancillary system, but at variance with it, it provides direct access to the energy exchange statistics, rather than its Fourier transform, thus being extremely more effective. We first experimentally validate our ancilla-assisted two point measurement scheme, and then apply it to i) experimentally verify that fluctuation theorems are robust against projective measurements, a theoretical prediction which was not validated so far, ii) experimentally verify the so called heat engine fluctuation relation, by implementing a SWAP quantum heat engine. iii) experimentally verify that the heat engine fluctuation relation continues to hold in presence of intermediate measurements, by implementing the design at the basis of the so called quantum-measurement-cooling concept. For both engines, we report the measured average heat and work exchanged and single out their operation mode. Our experiments constitute the experimental basis for the understanding of the non-equilibrium energetics of quantum computation and for the implementation of energy management devices on quantum processors.


I. INTRODUCTION
With the tremendous and fast advancements of quantum technologies, quantum computers have recently become a reality. Their development proceeds fast both in terms of the increasing number of quantum logical units (the qubits) that compose the processors, and in terms of the decreasing error accompanying the quantum information processing [1]. In the effort of improving the efficacy of quantum processors, understanding and mastering the disturbing thermal effects occurring during their operation is of crucial importance. In this regard quantum computation can largely benefit from a field of investigation that has become recently known as quantum thermodynamics [2][3][4]. Quantum thermodynamics is concerned with all the thermodynamic phenomena that may occur at the quantum level, ranging from thermal transport, to the fluctuations of thermodynamic quantities (notably heat and work), and in the way those can be mastered, e.g., by realising nano-scale quantum heat engines and refrigerators.
Most notably, not only can quantum computing benefit from quantum thermodynamics, but also the latter can benefit from the former: A number of theoretical results in quantum thermodynamics, that can be experimentally checked with current quantum processors, are in fact still little if not at all corroborated by experimental evidence. * asolfane@sissa.it † asantini@sissa.it ‡ michele.campisi@nano.cnr.it Among them are the fluctuation relation for arbitrary open quantum systems [5], the robustness of fluctuation relations against perturbation induced by projective measurements [6,7], the fluctuation relation for heat engines [8] [9], the realisation of two-qubit/two stroke engines, e.g., the SWAP engine [10], and the so called quantum measurement cooling [11], whereby a refrigeration mechanisms is set by the very action of quantum measurement, without the aid of any feedback mechanism. With this work we substantially fill that gap by reporting the results of a number of new experiments that we performed on IBM quantum processors.
All our experiments are based on the so-called twopoint measurement scheme [12] whereby the energy of the quantum system of interest is measured before and after an interaction with other agents (e.g., an external work source, another quantum system, a thermal environment or a measuring apparatus) has taken place. One problem that needs to be faced when implementing such a scheme is that often projective measurements are so invasive that they destroy the possibility to continue the experiment after the outcome of the measurement has been recorded. One way to circumvent this problem is to implement a Ramsey-like interferometric schemes where the information on the statistics of energy changes that would be obtained by subtracting final and initial measurement outcome are encoded in the state of an ancillary qubit [13,14] that is probed only at the end of the protocol. One drawback of this method is that it actually measures the characteristic function of the wanted statistics. That function needs to be sampled at a great number of points, in order for its inverse Fourier transform (i.e., the wanted arXiv:2106.04388v1 [quant-ph] 8 Jun 2021 statistics) to be efficiently extracted, and a great number of runs of the same experimental protocol must be repeated in order to collect sufficient statistics to achieve a good estimation of the characteristic function at each specific value of its argument.
Another problem that one typically faces when experimentally addressing quantum thermodynamics results is that normally they are based on the assumption that the quantum systems that are being manipulated and measured are initially in an equilibrium thermal state, while quantum technologies, including quantum processors, typically allow for the initialisation of quantum systems in a specific pure state. This problem is customarily circumvented by randomly initialising the system in a certain eigenstate of energy with the according Gibbs probability, thus emulating, rather than creating, a genuine thermal state. This strategy, that might be considered as not fully satisfactory has been implemented for example in [15][16][17], and has the advantage of being immune from the initial measurement issue mentioned above [18].
Here we propose a new method to effectively implement the two measurement scheme on a thermal state, that at once overcomes both issues in a most effective way. Like the interferometric method, our method, which we call the ancilla-assited two-point-measurement (AATPM) scheme, uses an ancilla qubit, but gives the energy change statistics directly (not its Fourier transform), thus requiring an enormously smaller amount of processor time to be efficiently executed, compared to the interferometric method. The ancilla, in our method serves as well to initialise the system in a thermal state, which at once cancels the necessity of emulating it. As will be detailed below, the trick is to prepare system and ancilla in a state that is the purification of the wanted thermal state for the system alone.
We implement our method on IBM quantum processors, and illustrate its employment for experimentally studying a number of problems in non-equilibrium quantum thermodynamics. We remark that IBM has recently added the possibility to insert projective measurement within a quantum circuit (not only at its end), thus allowing for a direct implementation of the two-(in fact many-) point measurement scheme, a possibility that is not yet available on other existing quantum computing platforms, which we used to experimentally validate our method.
In Sec. II we illustrate the theory at the basis of our AATPM scheme, implement it on IBM quantum processors and validate its efficacy against the native IBM scheme, by using the accuracy with which the Jarzynski identity is reproduced as an experimental benchmark. In Sec III we experimentally verify the validity of the fluctuation relation in presence of intermediate projective measurements, a result that has been predicted in Ref. [6,7]. In Sec. IV A we report the implementation of the twostroke two-qubit SWAP engine [10] and use it to verify the quantum heat engine fluctuation relation predicted in [8]. We characterise the mode of operation of the device by measuring the actual energy exchanges occurring in the engine. In Sec. IV B we report on the implementation of the heat engine design at the basis of the so-called quantum measurement cooling [11], whereby a qubit is refrigerated as a consequence of the act of being measured along with a hotter qubit (in an appropriate measurement basis). We experimentally validate the prediction that the heat engine fluctuation relation should be obeyed in this case as well, and characterise the mode of operation of the device as we did for the SWAP engine design.
II. ANCILLA ASSISTED TWO-POINT MEASUREMENT: THEORY AND EXPERIMENTAL VALIDATION

A. Theory
We start by considering the prototypical nonequilibrium quantum thermodynamics scenario of a quantum system prepared in a thermal state at some inverse temperature β and being subjected to a measurement-driving-measurement (MDM) protocol, where the measurement stages are projective measurements of the system Hamiltonian, and the driving stage is the application of some external forcing that induces some unitary evolution U [12]. The extension to more complex situations where, for example, the system is multipartite and each part is initialised at its own initial inverse temperature β i , or the evolution is not unitary (e.g. a unitary interrupted by projective measurements) is straightforward.
We are interested in the statistics P(W ) of the energy change of our quantum system (i.e., the work W ), as recorded in a single realisation of the MDM protocol. It reads [12] where p n = e −βEn /Z is the probability to find the system at energy E n in the first measurement, and p m|n [U ] is the probability of finding the system at energy E m in the second measurement given that it was found at E n in the first measurement. Its expression in terms of U and the system Hamitonian eigenprojectors Π s k (such that HΠ s k = E k Π s k ) reads here Tr S denotes the trace operation in the system Hilbert space. Our approach to experimentally obtain the joint probability p mn = p m|n [U ]p n consists in first imprinting the information about the initial state of our system in an ancillary quantum system (which is a copy of the system itself), let then the system evolve under U , and finally measure both ancilla and system energies, so as to obtain, respectively E n and E m .
The information imprinting stage is achieved by creating the entangled state: In practice the state |ψ can be created by preparing the system and ancilla in some factorised state |ψ 0 s ⊗ |ψ 0 a and then applying an appropriate entangling unitary V . Quite remarkably, by designing the unitary V in such a way that c n = √ p n one can so simultaneously achieve the task of physically preparing the wanted mixed state for the system: with the populations p n = e −βEn /Z relative to the system energy eigenstates |n s (here Tr A denotes trace over the ancilla Hilbert space).
With the preparation in Eq. (3) the joint probability Q mn of measuring E n in the ancilla and E m in the system equals the joint probability p mn = p n p m|n [U ], Eq. (2): Here Π a n are the ancilla eigenprojectors, and 1 a denotes the identity operator in the ancilla Hilbert space. In going from the first to the second line we used the salient equation which reflects the essential feature of entanglement. In going from the second to the third line we used the rule Tr = Tr A Tr S and assumed the projector operators have unit trace, specifically Tr A Π a n = 1. Note that, as can be seen from the above derivation, since the measurement operators of the ancilla 1 s ⊗ Π a n commute with the operators Π s m U s ⊗ 1 a , whether they are performed before, after or simultaneously with the final system measurement is irrelevant. The information on the initial state of the system is encoded in the ancilla once and for all, and can be retrieved later at any time, without influencing the system.
We remark that the method does not rely on the fact that the evolution of the main qubit is unitary, hence our derivation continues to hold for a generic evolution described by a generic quantum channel. In the following we shall, in fact demonstrate it both for unitary and non-unitary channels, e.g., when a qubit is subject to projective measurements, or when it interacts with other qubits.
FIG. 1. Quantum circuit representation of the AATPM scheme. The two-qubit operation in the blue box creates the purified state, Eq. (9), that both prepares the main qubit q0 in a thermal mixture, and imprints the information about its state in the ancilla qubit q1. The main qubit evolves according to a generic map E, pink box. Finally, both qubits are read, providing information about the state of the main qubit before and after the evolution. Figure 1 shows the quantum-circuit representation of the AATPM scheme, for the case of a system being composed by a single qubit with Hamiltonian with ω the energy level spacing. The qubit of interest is denoted as q 0 while q 1 is the ancilla. The first block, consisting of a rotation of an angle along the X direction of the qubit q 1 followed by a CNOT gate prepares the entangled state: Here |k i denotes the energy eigenstates of the system (i = 0), and ancilla (i = 1). Accordingly the qubit of interest is prepared in the Gibbs state of rescaled inverse temperature βω = ln tan(φ/2).
Subsequently it evolves according to a generic evolution E, and finally both qubits are read in their respective σ z basis. By repeating the circuit N times one can experimentally determine the probabilities p k qi to find qubit q i in the eigenstate |k i , and hence measure the joint probability p mn as p mn = Q mn = p m q1 p n q0 .

B. Experimental validation
It is well known that quantum systems prepared in a thermal state and then evolving under a unitary driving, satisfy the celebrated Jarzynski identity where β is the initial inverse temperature, W is the work exchanged during the driving protocol, the average ... is taken with respect to the work statistics defined in Eq.
(1), while −∆F is the difference between the initial free energy and the free energy the system would have if it was in equilibrium, at inverse temperature β, at the end of the protocol. In order to validate our AATMP method we implemented it on IBM quantum processors and used it to study the validity of the Jarzynski equality. In our implementation, after preparation in the thermal state, the qubit of interest q 0 was evolved according to a Hadamard gate, and ∆F = 0. We collected the qubits statistics over a sample of size N = 8192, and repeated the experiments for various vales of the angle φ.
The results were benchmarked against the results obtained by directly implementing the TPM scheme using the newly added IBM capabilities. Figure 2, panel a) shows the measured values of the probabilities P + . = Q 01 , P − . = Q 10 and P 0 . = Q 00 + Q 11 , that the qubit undergoes, respectively, the energy changes ω, −ω, 0, as function of the rescaled inverse temperature βω = ln tan(φ/2), Eq. (11). The error bars in Fig. 2 represent the statistical error due to the finiteness of our samples, and were accordingly calculated as: Figure 2, panel c), shows the same quantities as in panel a) but for the standard TPM scheme, i.e., obtained by replacing the measurement on the ancilla, with a direct measurement on the qubit of interest, before the application of the driving (Hadamard gate).
Panels a) and c) of Fig. 2 evidence a systematic discrepancy between observed and theoretical data, for both methods. This is due to a mismatch between the nominal rescaled inverse temperature βω, Eq. (11) and the actual rescaled inverse temperature acquired by the qubits after the purification step. In the AATPM scheme the latter can be read-off the measured populations of the ancilla as Similarly, in the standard TPM scheme, they are read off the populations of the first measurement of the qubit of interest. Panels b) and d) of Fig. 2 report the measured probabilities P ± , P 0 as function of the measured rescaled inverse temperature β m ω. Good agreement with the theoretical expectations is now achieved for both methods. This demonstrates the validity and efficacy of the AATPM scheme.
In Fig. 3 we plot the quantity e −βmW for the two methods, blue triangles refer to the AATPM scheme while the red crosses are obtained with the standard TPM scheme. As in Fig. 3, the statistics is generated for each value of β m ω from a sample of size N = 8192. In order to estimate the statistical uncertainty on our estimation of the above quantity we have selected a few values of temperature, have repeated the estimation of e −βmW k = 225 times, and have taken the standard deviation of the obtained values as measure of the statistical error affecting our data. Such value of statistical error is reported for 4 values of β m ω in the inset of Fig.  3. Note how the error tends to increase with increasing β m ω. Excellent agreement with Eq. (12) is found for small values of β m ω. As the temperature decreases (β m increases) the quantity e −βmW tends to be underestimated.
This fact may be due to environmental energy dissipation. In such a case, the qubit is not only exchanging energy with the work-source during the driving gate in the form of work W , but also in the form of heat Q with all other uncontrolled agents. This means that we cannot identify the measured qubit energy change ∆E as work, W , but should identify it as work plus heat ∆E = Q+W . Then, assuming small heat exchange βQ 1, If this picture is correct, by comparison with the experimental data, it means that Q is positive, namely the qubit gets heated during the experimental run. The above formula, featuring a correction term being (approximately) linear in β also provides a possible explanation of the observed increasing error with increasing β m .

III. ROBUSTNESS OF FLUCTUATION THEOREMS TO INTERMEDIATE PROJECTIVE MEASUREMENTS
With Refs. [6,7] it has been established that the Jarzynski equality, Eq. (12), continues to hold true even if, during the driving protocol, an arbitrary number of projective measurements of observables which possibly do not commute with the system Hamiltonian [7], are performed. Here we experimentally check the validity of that prediction, by taking advantage of the newly added possibility to perform projective measurements at any time during the execution of a quantum circuit, on IBM processors.
The quantum circuit employed to experimentally validate the robustness of the Jarzynski identity to intermediate measurements is depicted in Fig. 4. The circuit starts with the creation of the pure state, Eq. (9), according to the procedure described above.
The qubit of interest q 0 is then first measured in the computational basis σ z (that implements the first measurement of the standard TPM scheme), and then undergoes a sequence of identical unitary evolutions U , spaced out by by projcetive measurements of some observable A. Specifically, in our experiments, we chose U and A as not commuting with each other: We remark that the IBM hardware is equipped with the possibility of performing measurements in the σ z basis of each qubit, only. In order to preform a measurement in a different basis one should accordingly first apply the basis-change unitary gate V that maps the σ z eigenbasis onto the wanted measurement basis, then measure along σ z , and finally apply the inverse unitary gate V −1 [11]. To see that, note that if Π k are the eigenprojectors associated to the measurement basis which is available in a certain set-up, and π k are the eigenprojectors associated to the wanted measurement basis (i.e., A = k a k π k , with a k the eigenvalues of A), it is Specifically, the σ x measurement is implemented in the present architecture, by sandwiching the σ z measurement between two Hadamard gates (see green gates in Fig. 4).
After the train of intermediate projective measurements both qubit of interest and ancilla are measured in their respective σ z basis to collect the AATPM probabilities p k qi as in the previous section. As discussed in Refs. [6,7], the conditional probability p m|n that qubit q 0 is found in state |m at the last measurement, provided that it was found in state |n in the first measurement, reads: where the p a k+1 |a k = | a k+1 |U |a k | 2 are the condition probabilities that the output of the k +1-th measurement is a k+1 , given that the output of the k-th measurement is a k , while p m|a N = | m|U |a N | 2 and p a1|n = | a 1 |U |n | 2 . With our choice of U and A, the transition probabilities p m|n , read, for N > 1, For N = 1, they read: p 0|0 = p 1|1 = 0, p 0|1 = p 1|0 = 1 if N = 1). These analytical expressions are used to compute the values of P + , P − , P 0 entering the statistics of energy change of the qubit, as in the previous section. Those are plotted for different values of N and fixed nominal inverse temperature β = 1/ω , in Fig. 5 panel a), and compared with the values obtained from our experiments. Sample size and errors are evaluated as in the previous section. Figure 5 panel b) shows the quantity e −βm∆E and its statistical uncertainty (shown in the inset), estimated as in the previous section. Note that we now denote the energy change of the qubit as ∆E, rather than W , because now the qubit not only exchanges energy in the form of work (during the unitary gates) but also in the form of so-called "quantum heat" (during the measurements) [19]. Note that there is a very good agreement between the ancilla assisted results, blue triangles, and those obtained with the standard two point measurement scheme, red crosses.
We notice that a better agreement is found for larger number of intermediate measurements, for both plots in Fig. 5. In our understanding this fact has a two-fold origin. On one hand, in the limit of large N it is, in our case, see Eq. (19) lim N →∞ namely, as a consequence of the protocol applied on the qubit, the latter gets randomised into the completely mixed state ρ = 1/2. The phenomenon of randomisation induced by a train of measurements has been observed and discussed earlier, see e.g., [7,[20][21][22], but here it occurs as a consequence a different mecahnism. After preparation in a state that is diagonal in the σ z basis, the qubit undergoes a rotation of a vanishingly small angle in the large N limit. That is in the limit of infinite N it remains along z, and the subsequent measurement in the σ x basis fully randomise it, leaving in the fully mixed state 1/2. The subsequent evolution interrupted by further measurements in the same basis of σ x , is frozen due to the quantum Zeno effect [23,24], i.e., the system does not evolve at all, thus remaining at all times in the fully mixed state 1/2. As a consequence all correlations between initial and final energy measurements are lost and the joint probability factorises p mn = p n p m = p n /2. Accordingly, the average exponentiated energy change is not subject to the sources of error that typically affect the conditional probability p m|n : On the other hand, we notice that rotations of angles close to π are afftected by larger error, see Fig. 6. It shows the measured values of σ z as a function of the rotation angle α against its theoretical expectation, for a single qubit that is initialized in |0 and is rotated according to the gate R Y (α), for different values of α. The figure evidences that larger deviations are found for angles close π. In our experiment, the lower is N , the closer are rotation angles to π, hence the larger is the error brought up by each single rotation. This could be another reason why better agreement was observed for large N .

IV. HEAT ENGINE FLUCTUATION RELATION
Any driven bi-partite system subject to a cyclic driving and evolving from tensor product of Gibbs states for each subsystem obeys the following multivariate fluctuation relation [10,12,25] e −β1∆E1−β2∆E2 = 1.
When the work W , i.e., the sum of energy changes ∆E 1 + ∆E 2 of the two parts of the system, is not negligible, as in the case of heat engines, the above is often referred to as the heat engine fluctuation relation [8,10]. The average ... is now over the joint statistics of the energy exchanges ∆E 1 and ∆E 2 , reading where E i ni are the subsystem i eigenenergies, are the initial populations of the system, and with |n 1 n 2 and the eigenstates of the total Hamiltonian. The heat engine fluctuation relation (22) has been experimentally investigated only very recently with an NMR platform (using a quantum Otto heat engine design) by means of interferometric techniques that allow for the measurement of the characteristic function of the statistics P [∆E 1 , ∆E 2 ] [26]. Here we further corroborate it by implementing a SWAP quantum heat engine on an IBM quantum processor. We remark that the current AATPM is extremely more effective, in terms of quantum processing time, than the interferometric method, employed in Ref. [26].
We further, for the first time, establish that the heat engine fluctuation relation continues to hold for quantum heat engines that rather than being fuelled by unitary gates, are fuelled by projective measurements, such as the quantum measurement cooling device reported in [16].

A. SWAP quantum heat engine
The SWAP quantum heat engine, first introduced in Refs. [27][28][29] is a two-qubit/two-stroke heat engine design that has recently become more and more popular as a prototype of a quantum heat engine, see e.g., [10,30,31]. Despite its broad interest, its experimental implementation has not been reported so far. Using the methods and tools developed above, we have implemented it on the IBM architecture. The working substance of a SWAP quantum heat engine is made of two Quantum circuit implementation of the SWAP quantum heat engine. The main qubits q1, q2 are first prepared in thermal states at different temperatures with the aid of their ancillas q0, q3 and then undergo a SWAP evolution. Finally their initial states are read-off the ancillas, and their final states are read directly.

qubits. Let
denote their Hamiltonians, where σ z i denotes the z Pauli sigma matrix of the i-th qubit. At the beginning of the cycle the qubits are decoupled and each at thermal equilibrium at inverse temperatures, β i , i = 1, 2, respectively. Their initial state is then with Z i = Tr i e −βiHq i . In the first step of the cycle, the two qubits undergo a unitary evolution according to the SWAP gate In the second step, the qubits interact each with a thermal bath at inverse temperature β i , until they thermalize and the initial state ρ is re-established, thus closing the cycle. Fig. 7 shows how we implemented the SWAP engine on the IBM architecture. Qubits q 1 and q 2 constitute the working substance, while the qubits q 0 and q 3 are their respective ancillas, which we employ to prepare them in thermal state according to Eq. (27) and to provide the AATPM capability, as describe above. We then apply the SWAP gate on the main qubits (q 1 , q 2 ), and finally measure all qubits in their respective σ z basis. One could now apply appropriate gates (depending on the outcomes of the measurements) that re-establish the initial state and so close the cycle. For our purposes that is not necessary, since the outcome of the measurements already contains all the information regarding the joint statistics of the energy gained by each qubit, which is sufficient for a full thermodynamic characterisation of the engine [10].
For each fixed value of the rotation angles φ 1 , φ 2 , we run the circuit in Fig. 7 N = 8192 times, and so collect the probabilities p k qj of finding the qubit j in the state |k with j = 0, 1, 2, 3 and k = 0, 1. We recall that p k q0 , p k q1 represent the probability that qubit 1 was in state |k at initial time and final time, respectively. Similarly p k q3 , p k q2 , represent the probability that qubit 2 was in state |k at initial time and final time, respectively. Extending the argument presented in Ref. II, we obtain the joint probability p m1,m2,n1,n2 = p n1,n2 p m1m2|n1n2 [U ] as Q m1,m2,n1,n2 = p n1 q0 p m1 q1 p m2 q2 p n2 q3 . Fig. 8 shows the probabilities P ab , a, b = −, 0, +, that the energy change of qubit q 1 is ∆E 1 = aω 1 , and the energy change of qubit q 2 is ∆E 2 = bω 2 . Those are obtained from the joint probabilities p m1,m2,n1,n2 via the expression P ab = m1,m2,n1,n2 p m1,m2,n1,n2 δ m1−n1,a δ m2−n2,b (29) with δ i,j the Kronecker symbol. For all values of nominal rescaled inverse temperatures ω i β i , we found good agreement between the experimentally measured values and the theoretical ones where, for β i ω i , we used the measured values which, we recall, do not perfectly coincide with the nominal rescaled inverse temperatures β i ω i = ln tan(φ i /2). The difference between theoretical values and experimental values of the P ab 's was always below the value 0.1 Fig. 9 shows the quantity e −βm,1∆E1−βm,2∆E2 as a function of β 1 ω 1 , β 2 ω 2 . In our implementations the nominal values of the qubits frequencies were ω 1 ≈ 5.25 GHz and ω 2 ≈ 5.17 GHz. We notice that the agreement with Eq. (22) is very good for sufficiently small values of β i ω i while the deviation from the theoretical value increases as β i ω i increase. As discussed above, this could be a signature of possible leaks of energy from the environment that heat up the qubits.
For an ideal SWAP engine, the average energy ex- changes and the average work read [10]: (33c) Fig. 10, panels a), b) and c) shows the values of ∆E 1 /ω 1 , ∆E 2 /ω 2 , and W /ω (where ω = (ω 1 + ω 2 )/2) as obtained from the measured populations p k qj : with N = 8192 the size of our statistical sample. Note that for qubits with same resonant frequency, the expected average work is null, see Eq. (33c). In our case the two qubits resonant frequencies were very close, and in fact the according measured work was always very small (and almost always positive), compared to the according resonant frequencies energies, see Fig. 10c).
We recall that only four modes of operations are allowed for a generic bi-partite heat engine, depending on the sign of the energy exchanges ∆E i and their sum, i.e., the work W [32]. Those are: Refrigerator [R], i.e., the cold subsystem gets colder, the hot subsystem gets hotter while work is injected in the system; Heat Engine [E], i.e., the cold subsystem heats-up, the hot subsystem cools down while work is extracted; Thermal Accelerator [A], i.e., work is spent to heat up the cold subsystem and cool down the hot subsystem; Heater [H], i.e., both subsystems receive energy from the work source. Fig. 11, panel a) shows the "phase diagram" of the experimentally observed modes of operation of the engine as a function of the rescaled inverse nominal temperatures of the two qubits. Panel b) shows the theoretical diagram of the SWAP engine, according to the rule [10]: We mostly observed the thermal accelerator [A] mode, and sporadically the heat engine [E] and heater mode [H], which accordingly cannot be considered as a robust operations (purple pixel denote cases where the error is large enough that the sign of the interested quantities is not well defined). The refrigerator mode [R] was not observed. This is because the region where we should be able to see it is too thin, see blue region in Fig. 11b).
In order to robustly implement [R], it is crucial to have qubits with appreciably different level spacings, so as to widen the extension of the [R] region. For example, in order to cool down a qubit, say, qubit q 2 , being at temperature 1/β 2 it is necessary that the other qubit (that must be prepared at higher temperature 1/β 1 > 1/β 2 ) has a larger level spacing ω 1 , see eq. (36b).

B. Quantum Measurement Cooling
Quantum measurement cooling (QMC) is a cooling paradigm, recently put forward in Ref. [11], whereby a quantum refrigerator is powered by the very act of quantum measurement, by exploiting its invasiveness. As discussed in Ref. [11], such a measurement-powered cooler can be implemented by substituting, in the SWAP engine design described above, the SWAP gate with a projective measurement on a properly chosen basis. As shown in Ref. [11,33] maximal cooling power (heat extracted from the cold qubit per cycle) and maximal thermodynamic cooling efficiency are achieved when the measurement basis is the singlet-triplet basis (37) Figure 12 shows our implementation of QMC on the IBM architecture. The quantum circuit begins with the ancilla assisted preparation of the state (27). Then a measurement on the singlet-triplet basis is performed according to the basis-change method describe above, Eq.
where CR Y is a controlled rotation along the Y-axis. Finally all qubits are measured in their relative σ z basis, to give the probabilities p k qi , and hence the full joint statistics of energy exchanges, as in the SWAP case.
We recall that theory predicts that the heat engine fluctuation relation, Eq. (22), is robust to projective measurements [6], thus should continue to hold in the present case. Figure (13) shows the quantity e −βm,1∆E1−βm,2∆E2 as a function of β i ω i . We recall that the two qubits resonant frequencies were ω 1 ≈ 5.25GHz and ω 2 ≈ 5.17GHz . As in the SWAP engine setting, we observe very good agreement for small values of β i ω i , and growing, but still moderate, deviations when those quantities grow.  14. Panels a), b), c): Measured rescaled energy exchanges ∆E1 /ω1, ∆E2 /ω2, W /ω, for the QMC engine design in Fig. 12 as a function of nominal inverse rescaled temperatures β1ω1, β2ω2. Panels d), e), f ): their relative experimental error.
Theory predicts that, as compared to the SWAP engine, in this case all energetic exchanges are halved [11], Accordingly the "phase diagram" is identical to that of a SWAP engine. Figure 14, panels a), b), c), shows the experimental values of ∆E 1 /ω 1 , ∆E 2 /ω 2 and W /ω. Figure 14, panels d), e), f ) shows, their respective relative uncertainty, computed as in Eq. (34). Note that the measured values are smaller than half of the according values measured for the SWAP engine. In our understanding that is due to the considerably more complex circuit used to implement this design, which is expected to be affected by larger noise and energy leaks. That this is in fact the case, can be seen by noticing that relative errors are larger in this case compared to the SWAP engine case.
As in the SWAP case, due to the closeness of the qubits level spacings, cooling was not achieved, and the operation observed, for all values of the nominal inverse rescaled temperatures β i ω i was mostly that of a thermal accelerator. The experimentally observed "phase diagram" is qualitatively similar to that observed for the SWAP engine, only more noisy. Exactly as in the SWAP engine case, for the implementation of cooling, qubits with appreciably different level spacing is necessary. That however is not a knob that a remote user of the quantum processor can access.

V. CONCLUSIONS
With this work we have laid the experimental foundations for the study of non-equilibrium thermodynamic phenomena in quantum processors. We have put forward a novel ancilla assisted scheme for the practical implementation of the two point measurement scheme and have experimentally validated its efficacy on an IBM quantum processor. The method can be straightforwardly ported on other quantum computing platforms. Compared to previous methods (specifically the interferometric method [13,14]) it is extremely more effective in terms of QPU time necessary for its implementation, and also allows for the preparation of physical thermal states, a problem which is often avoided by mimicking such states.
We implemented the method on IBM quantum processors, and employed it to experimentally corroborate the prediction that the fluctuation theorem is robust to intermediate projective measurements of a generic observable [6,7], which was not experimentally observed so far.
We also demonstrated, for the first time, the implementation of a quantum heat engine design that is in the limelight of current research, namely the two-qubit/two stroke SWAP quantum engine. We employed our ancilla assisted two point measurement scheme to corroborate the validity of the heat engine fluctuation theorem, a theoretical prediction that was so far only addressed with the interferometric method [26]. We further verified, for the first time, the validity of the heat engine fluctuation theorem for the case of a measurement fuelled quantum heat engine. That result is at the basis of the mechanism of quantum measurement cooling [11], whereby a qubit is cooled down by the very act of being measured (along with a second hotter qubit) in an appropriate measurement basis. In practice that design is obtained by replacing the SWAP operation of the SWAP engine, with a measurement on the two-qubit singlet/triplet basis.
For both heat engines implemented, the observed mode of operation was mostly that of a thermal accelerator, namely, physically what happened is that the cold qubit was heated, the hot qubit was cooled down, while energy was spent to make this happen. Interestingly, the same was observed in an experimental study of the thermodynamics of a quantum annealer [16]. The fact that other modes of operations were not observed is a consequence of the fact that the qubits on the IBM quantum processors have very similar resonant frequencies. In order for the engine to work, e.g., as a cooler, qubits with substantially different level spacings are necessary. Our results then, clearly indicate that in order to cool down qubits on a quantum processor, using a SWAP quantum heat engine, it is crucial to equip them with "service" qubits of larger level spacings, that can be used to extract energy from cold "computational" qubits. Such thermodynamic mechanism could be employed, e.g., to improve the purity of the computational qubits preparation, by sacrificing the purity of the service qubits.