An autonomous quantum machine to measure the thermodynamic arrow of time

According to the Second Law of thermodynamics, the evolution of physical systems has a preferred direction, that is characterized by some positive entropy production. Here we propose a direct way to measure the stochastic entropy produced while driving a quantum open system out of thermal equilibrium. The driving work is provided by a quantum battery, the system and the battery forming an autonomous machine. We show that the battery's energy fluctuations equal work fluctuations and check Jarzynski's equality. Since these energy fluctuations are measurable, the battery behaves as an embedded quantum work meter and the machine verifies a generalized fluctuation theorem involving the information encoded in the battery. Our proposal can be implemented with state-of-the-art opto-mechanical systems. It paves the way towards the experimental demonstration of fluctuation theorems in quantum open systems.

Irreversibility is a fundamental feature of our physical world. The degree of irreversibility of thermodynamic transformations is measured by their entropy production, which is always positive according to the second law. Entropy production has important practical consequences since it sets fundamental bounds, e.g. to the yield of heat engines, or the ability to convert information into work 1 . At the microscopic level, stochastic thermodynamics 2,3 has extended this concept to characterize the evolution of small out-of-equilibrium systems, which is described by stochastic trajectories can be completely reconstructed from the monitoring of the system's trajectory, allowing for successful experimental demonstrations [5][6][7] .
Defining and measuring entropy production in the quantum regime is of fundamental interest in the perspective of optimizing the performances of quantum heat engines and the energetic cost of quantum information technologies. However, measuring a quantum fluctuation theorem can be problematic in the genuinely quantum situation of a coherently driven quantum system, because of the fundamental and practical issues to define and measure quantum work 8 . So far the quantum JE has thus been extended and experimentally verified in a) Electronic mail: alexia.auffeves@neel.cnrs.fr closed quantum systems, i.e. systems that are driven but otherwise isolated. In this case work corresponds to the change in the system's internal energy, accessible by a two-points measurement protocol 8 or the measurement of its characteristic function 9,10 . Experimental demonstrations have been realized, e.g. with trapped ions 11,12 , ensemble of cold atoms 13 , and spins in Nuclear Magnetic Resonance (NMR) 14 where the thermodynamic time arrow was measured 15 . Recently generalized IFTs for protocols involving information extraction and feedback have been probed with superconducting qubits 16 and NMR 17 , allowing to quantitatively assess the yield of information-to-work conversion in a quantum Maxwell's demon engine.
On the other hand, realistic strategies must still be developed to measure the production of entropy for quantum open systems, i.e. that can be simultaneously driven, and coupled to reservoirs. So far, the theoretical proposals in this direction have relied on the measurement of heat exchanges. Experimentally, this requires to engineer the reservoirs and to develop high efficiency detection schemes, which is very challenging [18][19][20] . Experimental demonstrations have remained elusive.
In this article, we propose a new and experimentally feasible strategy to measure the thermodynamic arrow of time for a quantum open system in Jarzynski's protocol, that is based on the direct measurement of work exchanges. Contrary to former implementations that involved a classical driving entity, here the work is provided by a quantum battery, the ensemble of the system and the battery forming an autonomous machine. We show that the stochastic work received by the system can be unambiguously measured, by measuring the battery's energy change between the initial and the final time of single realizations of the protocol. We verify that these measurable work fluctuations check JE. By construction, the battery acts as a quantum work meter 13 : Therefore we show that the complete autonomous machine verifies a generalized IFT involving the information encoded in the battery 1,21 . Such situations may give rise to absolute irreversibility 16,[22][23][24] .
Originally here, this phenomenon signals the quality of the measurement and the success of the protocol. Our proposal can be realized with state-of-the-art hybrid opto-mechanical systems 25 , and is robust against experimental imperfections such as finite measurement precision 26,27 .

RESULTS
Generalized fluctuation theorems for an autonomous machine. In this section we derive the two above-mentioned fluctuation theorems for an ideal autonomous machine. Convenient physical realizations are provided by opto-mechanical systems in the ultra-strong coupling regime 28 . They are extensively described in the next section.
Model and hypotheses. The machine consists of a quantum system S with discrete energy eigenstates {| } of eigenvalues {E } coupled to a quantum battery B and to a thermal bath of temperature T (Fig. 1a). For the sake of simplicity, in this section we consider two-points quantum jump trajectories 29 defined at t 0 and t 1 . At t = t 0 the machine is prepared in the factorized state | 0 , β 0 where |β 0 is a nonstationary state of the battery, and | 0 is drawn from the system's thermal state. Between t 0 and t 1 , the machine undergoes a unitary evolution that leaves the system's state | 0 unchanged. This state perfectly determines the effective operator U 0 (t) governing the battery's evolution such that at time t − 1 , the machine's state reads | 0 , β 1 ( 0 ) . We have introduced |β 1 ( 0 ) = U 0 (t 1 − t 0 ) |β 0 . Finally, at time t 1 the bath possibly induces a quantum jump of the system towards the state | 1 with probability P t1 [ 1 | 0 ], while the battery's state |β 1 ( 0 ) remains unchanged.
All along the trajectory Σ, the system and the battery remain in a factorized state, allowing to unambiguously define their respective energies.
The battery's energy changes under the action of the system, verifying is the mean battery's energy in the state |β . Reciprocally, in principle an evolution of the battery's state of the form |β t ( ) = U (t − t 0 ) |β 0 induces a time dependence of all system's energy eigenvalues {E βt( ) (t)} associated with the energy eigenstates {| }. As a first condition of ideality (I 1 ), we postulate that these eigenvalues solely depend on the free evolution of the battery: In particular, they are not sensitive to the potential fluctuations induced by the system's initial state, such that E βt( ) (t) = E (t). This condition is closely related to the requirement for energy invariance of the battery behavior that plays an important role to recover Jarzynski equality for an autonomous machine 30 .
We can now provide a thermodynamic analysis of the system alone, then of the whole machine. Between t 0 and t 1 , the system undergoes an energy change ∆u s [ Σ] split into two contributions. During the unitary evolution, S remains in the same state, while its energy eigenvalues evolve in time. Following standard definitions in stochastic thermodynamics 5,18,31 , the corresponding energy change is identified with work w[ Σ] = E 0 (t 1 ) − E 0 (t 0 ). At the time t 1 , the system's population changes stochastically. The corresponding energy change is identified with heat received from the bath q We now consider the complete machine. Interestingly during the unitary evolution, the machine is energetically isolated, such that the following identity is verified: Therefore the work can in principle be measured directly, by measuring the battery's state at t 1 and deducing its energy. The quantum battery behaves as an ideal embedded quantum work meter, provided the final battery's states {|β 1 } are perfectly distinguishable: This provides our second condition of ideality (I 2 ). Example of trajectories in the case of a two-level system of energy states = e, g. The solid (resp. dashed) arrows correspond to the direct (resp. reversed) protocol. For the sake of simplicity, only the trajectories without jump at time t1 are represented. The reversed trajectories that do not have a direct counterpart are plotted in red and the corresponding machine's states with dashed lines. The final battery's states for these trajectories are |β =Ũg(t0 − t1) |β1(e) and |β =Ũe(t0 − t1) |β1(g) , where β = β0 and β = β0. ρ ∞ S (t) (resp. ρB(t)) is the system's thermal state (resp. the battery's average state) at time t.
Two fluctuation theorems. Stochastic entropy production ∆ i s[ Σ] is defined by comparing the probability of the direct trajectory followed by the system P [ Σ], to the probability of its time-reversed counterpartP [ Σ]: We now use Eq. (2) to compute the stochastic entropy produced along the machine's two-points trajectory Σ = ( 0 , β 0 ; 1 , β 1 ) of probability: We have defined the probability p where Z(t) is the system's partition function at time t, and the conditional prob- Reciprocally, the reversed protocol is defined between t 1 and t 0 (See Fig.1b). At t 1 the system's state |˜ 1 is drawn from thermal equilibrium and eventually jumps towards |˜ 0 , then remains unchanged until t 0 . On the other hand the battery's state is drawn from the distribution of states { β 1 } prepared during the direct protocol with probability p B [β 1 ], then evolves under the action of the time-reversed operatorŨ (t) = we get the probability of the reversed trajectory Σ = (˜ 1 ,β 1 ;˜ 0 ,β 0 ): Only the reversed trajectories Σ verifyingβ 0 = β 0 have a direct counterpart Σ. Importantly, this is not the case of all reversed trajectories as soon as T > 0, allowing to define This effect is typical of absolute irreversibility 16,[22][23][24] , here induced by the information on the stochastic work encoded in the quantum battery. From Eqs.
(2), (1), (3), (4) we get the following expression for the stochastic entropy produced along Σ: is the stochastic Shannon entropy acquired by the battery during the direct evolution.
) is the TLS free energy change. The quantities σ[ Σ] and ∆ i s[ Σ] respectively verify the two following IFTs 35 : Eq. (6) corresponds to the usual JE for the quantum system, with the noticeable difference that the stochastic work involved in the expression of the reduced entropy production σ[ Σ] is now measured through the battery's energy change . This is a novelty with respect to former proposals to measure JE in a quantum open system, which had involved reservoir engineering techniques 18,20 or fine thermometry 19 in order to measure heat exchanges. In the next section we provide realistic experimental conditions verifying Eq. (6), validating our proposal.
Eq. (7) constitutes the IFT for the complete autonomous machine initially prepared out of equilibrium and relaxing under its coupling to the bath, giving rise to a strictly positive entropy production. In agreement with former derivations 16,22 , absolute irreversibility signals information extraction, which in the present situation is encoded within the machine itself. Interestingly, the two fluctuation theorems are deeply related. To be experimentally checked, eq. (6) requires the battery to behave as a perfect quantum work meter, which is signaled by Eq. (7). Therefore absolute irreversibility is constitutive of the protocol, and a witness of its success.
Physical implementation. In this section we propose a realistic implementation of the autonomous machine based on hybrid opto-mechanical systems, and demonstrate the experimental feasibility of the proposal.
System and model. Hybrid opto-mechanical systems consist of a two-level system (TLS) of ground (resp. excited) state |g (resp. |e ) and transition frequency ω 0 , dispersively coupled to a mechanical oscillator (MO) of frequency Ω, phonon annihilation operator b and vacuum state |0 . The Hamiltonian of the device is H qm = H q + H m + V qm , where H q = hω 0 |e e| ⊗ 1 m and H m = 1 q ⊗hΩb † b are the TLS and MO free Hamiltonians respectively. We have denoted 1 m (resp. 1 q ) the identity on the MO's (resp. TLS) Hilbert space. The coupling Hamiltonian is V qm =hg m |e e| ⊗ x/x zpf , where g m is the coupling strength, x the MO position operator and x zpf the zero-point fluctuations. The regime considered is the socalled ultra-strong coupling regime g m ≥ Ω, with ω 0 g m . So far physical implementations have involved superconducting qubits embedded in oscillating membranes 36 , nanowires coupled to diamond nitrogen vacancies 37 , or to semiconductor quantum dots where ultra-strong coupling was evidenced 38 .
In the absence of coupling to the bath, the TLS states |e and |g are stable under the dynamics of the hybrid system and perfectly determine the effective Hamiltonian acting on the MO. Let us suppose the initial state is | , β where = e, g and |β = exp In both cases, the hybrid system remains in a factorized state | , β(t) where the coherent nature of the mechanical field |β(t) = U (t) |β is preserved. It is thus possible to define energies for the MO and the TLS, respectively , verifying E e (β) =hω(β) =h(ω 0 + 2g m Re(β)) and E g = 0. We have introduced ω(β) the effective TLS frequency if the MO is in the coherent state |β . Remarkably, the MO already appears as an embedded battery, inducing a time dependent Hamiltonian on the TLS and therefore exchanging work with it. The hybrid opto-mechanical system constitutes our autonomous machine, with the TLS as our quantum system and the MO as our quantum battery 28 .
We now describe the relaxation processes undergone by the machine. The considered transformations shall typically take place within less than a mechanical period, such that the mechanical damping is neglected. Moreover, the TLS is coupled to a heat bath of temperature T , which consists of a spectrally broad collection of electromagnetic modes of frequencies ω. Each mode is at thermal equilibrium and contains a mean number of photonsn ω = (exp(hω/k B T ) − 1) −1 , while γ is the TLS spontaneous emission rate. Supposing that the MO is in a quasi-classical state |β checking g m |β|, γ ω 0 , we show 35 that a master equation can be derived, that describes the relaxation of the machine in the bath. This master equation is finally unraveled in the quantum jump picture 29 , giving rise to the following set of Kraus operators {J −1 (t); J +1 (t); J 0 (t)}: We have introduced σ − = σ † + = |g e|. J −1 and J +1 are jump operators signaled by the emission or absorption of a photon in the bath respectively, acting on the TLS alone. J 0 is the no-jump operator describing the continuous, non Hermitian evolution governed by the effective Hamiltonian . 1 qm is the identity operator in the Hilbert space of the machine.
A quantum trajectory Σ = {|ψ(t n ) } N n=0 is then perfectly defined by the sequence of stochastic jumps/no-jump . Note that the no-jump operator has no effect on the TLS if it is in the state |e/g . From the expression of the Kraus operators, it appears that the machine remains in a factorized state all along its evolution: At each time step t k , either the TLS undergoes a quantum jump from |e/g towards |g/e leaving the MO's state unchanged, or the no-jump evolution leaves the TLS unchanged. This last case gives rise to a unitary evolution governed by the Hamiltonian H m + V qm . Therefore the no-jump evolution preserves the coherent nature of the mechanical field, and solely depends on the TLS state as studied above. The machine's trajectory can be rewritten n=0 is the stochastic TLS trajectory with n = e, g. β = {|β n } N n=0 is the MO's trajectory verifying |β n = n−1 k=0 U k (t k+1 − t k ) |β 0 : The mechanical trajectory is thus perfectly determined by the full TLS trajectory Γ. Finally, the probability of the machine's trajectory reads P where the conditional probability of jump at time t n is defined as P tn [Σ n+1 |Σ n ] = Σ n |J † K(tn) J K(tn) |Σ n and depends on the mechanical state through the TLS effective frequency ω(β). Therefore, while the trajectory Σ of the complete machine is Markovian by construction, this is not necessarily the case of the reduced TLS trajectory Γ since its probability at t n may depend on its past. In the following we shall consider transformations taking place during a quarter of mechanical oscillation. At t = t 0 the MO is prepared in the state |β 0 with β 0 = i|β 0 | a purely imaginary parameter, and the TLS at thermal equilibrium. The machine stochastically evolves until t N = π/2Ω . Examples of numerically generated mechanical trajectories β[ Γ] are plotted in Fig.2 (See Methods). They spread around a central trajectory |β 0 exp(−iΩt) induced by H m . The fluctuations induced by H qm are restricted within an area of typical dimension g m /Ω. The TLS effective frequency is thus independent of these fluctuations as soon as |β 0 | g m /Ω. In this case, Γ is Markovian, and the effect of the MO is similar to some classical external operator imposing the TLS frequency ω cl (t) = ω 0 + 2g m |β 0 | sin(Ωt). Reciprocally, the different values of β N can in principle be unambiguously distinguished, provided that g m /Ω 1 (ultra-strong coupling regime). These two conditions are compatible and correspond to our ideality criteria I 1 and I 2 defined above.
Stochastic thermodynamics. The machine's trajectory Σ generalizes the two-points trajectory studied in the first section, allowing to extend the definitions of the stochastic heat and work: As above, the machine is energetically isolated during the sequences of unitary evolution, such that the total work exchanged verify Eq. Generalized integral fluctuation theorem. We first consider the complete autonomous machine. To validate our approach, we have performed numerical simulations using realistic experimental parameters (see Methods). In particular, typical rates g m /Ω ∼ 10 are within reach of state-of-the-art devices 38 . Eq. (7)) and the mean entropy production ∆ i s[ Σ] Σ are plotted in Fig. 3a and Fig. 3b respectively, as a function of the bath temperature T . The limithω 0 k B T corresponds to to a single reversible trajectory characterized by λ → 0 and a null entropy production. The opposite regime gives rise to absolute irreversibility: A given value of β N can be generated by a single direct trajectory, while all reversed trajectories can take place. Denoting N traj is the typical number of trajectories of the direct protocol with N traj increasing with temperature, λ scales like Reduced Jarzynski's equality. We now focus on the regime of validity for JE (Eq. (6)) characterizing the TLS reduced trajectory Γ (Fig. 4a). As expected, it is verified in the Markovian limit defined by |β 0 | g m /Ω. In this regime, we have checked that the action of the MO is similar to a classical external operator imposing the TLS frequency modulation ω cl (t) = ω 0 + 2g m |β 0 | sin(Ωt) (Fig. 4b). On the contrary, the Markovian approximation and JE break down in the regime (g m /Ω)/|β 0 | ≥ 10 −2 . In what follows, we restrict the study to the range of parameters (g m /Ω)/|β 0 | < 10 −2 .
The results presented in Fig. 3 and 4 presuppose the experimental ability to measure ∆E B with infinite precision. More realistically, we now assume that the mechanical complex amplitude β is measured with a precision δβ > 1 (a precision δβ = 1 corresponds to the zero point fluctuations). Practically, β can be inferred from a time-resolved measurement of the mechanical position which can reach high precision owing to optical deflection techniques 39,40 .
Denoting β M the measured amplitude, the measured work is defined as . The mutual information between the real work distribution w and the measured resonator states distribution β M N equals:   6)) for δβ = 2. As expected, small values of g m /Ω correspond to a poor ability to distinguish between the different final states, hence to measure work, which is characterized by a small mutual information I[W, β M N ]. In this limit, the measured work fluctuations do not verify JE. Increasing the rate g m /Ω allows increasing the information extracted on the work distribution during the readout, such that the mutual information converges towards S Sh [W ]. JE is recovered for typical values of g m /Ω ∼ 50. These values are within reach experiments.

DISCUSSION
We have evidenced a new protocol to measure stochastic entropy production and thermodynamic time arrow in a quantum open system. Based on the direct readout of stochastic work exchanges within an autonomous machine, this protocol is experimentally feasible in state-of-the-art opto-mechanical devices and robust against finite precision measurements. Let us underline that recent experimental measurements of Jarzynski's equality based on opto-mechanical devices either in- volved classical open systems such as levitated nano-beams 7 or closed quantum systems 11,12 . Our proposal fully exploits the ability allowed by these devices to measure work fluctuations, to make a step towards the measurement of time arrow for quantum open systems. It offers a promising alternative to former proposals relying on the readout of stochastic heat exchanges within engineered reservoirs, which require high efficiency measurements. Originally, our proposal sheds new light on absolute irreversibility, which measures information extraction within the quantum work meter and therefore signals the success of the protocol.
In the near future, direct work measurement may become extremely useful to investigate genuinely quantum situations where the system of interest carries quantum coherences. In this situation, measurements performed directly on the system or on the bath to reconstruct work exchanges can induce energetic fluctuations 5,8,41,43 , that participate to entropy production. Measuring work directly inside the quantum battery allows getting rid of such perturbations, opening a new chapter in the study of quantum fluctuation theorems.

METHODS
The numerical results presented in this article were obtained using the jump and no-jump probabilities to sample the ensemble of possible direct trajectories 2 . The average value of a quantity where N traj = 5 × 10 6 is the number of numerically generated trajectories and Σ i denotes the i-th trajectory.
The reduced entropy production σ[ Σ] used in Fig. 3 and 4 was calculated with the expression (13), using the numerically generated values of β 0 and β N in the trajectory Σ. One value of β N can be generated by a single direct tra-  35 such that the average entropy production verifies: while we have: The plotted error bars represent the statistical error σ/ N traj , where σ is the standard deviation.

SUPPLEMENTARY INFORMATION FOR "AN AUTONOMOUS QUANTUM MACHINE TO MEASURE THE THERMODYNAMIC ARROW OF TIME"
A. Derivation of the integral fluctuation theorem for the complete autonomous machine The IFT for the complete autonomous machine [Eq. (7) The direct trajectories Σ = ( 0 , β 0 ; 1 , β 1 ) such that P [ Σ] = 0 simultaneously verify . We used the detailed balance condition and the expression p ∞ (t) = exp(−E (t)/k B T )/Z(t).
B. Derivation of Jarzynski's Equality for an autonomous machine in a two-points quantum jump trajectory To obtain JE [Eq.(6) of the main text], we start from the sum of the probabilitiesP [ Σ] of the reversed trajectories defined in Eq. (4) of the main text and eliminate the battery degrees of freedom: C. Master equation for a hybrid opto-mechanical system in the ultra-strong coupling regime The master equation describing the evolution of the hybrid opto-mechanical system in contact with a thermal bath is derived starting from the total Hamiltonian H = H qm + H b + V qb 1,2 . H b = kh ω k a † k a k is the free Hamiltonian of the heat bath, in thermal equilibrium at temperature T , where a k is the annihilation operator of the photonic mode of frequency ω k . The coupling Hamiltonian between the TLS and the bath reads V qb = kh g k (a k + a † k )(σ + + σ − ), where σ − = |g e|, σ + = |e g| and g k is the coupling strength between the TLS and the k-th mode.
The regime considered in this paper is ω 0 g m ≥ Ω, γ. The typical correlation time of the bath verifies τ c γ −1 , g −1 m , Ω −1 . As in the main text, the MO is initially prepared in a pure state |β 0 which is, more precisely, a coherent state verifying g m |β 0 | ω 0 . We can then define a coarse-grained time step ∆t, fulfilling τ c ∆t γ −1 , g −1 m , Ω −1 such that under these assumptions, the hybrid opto-mechanical system is at any time t > 0 in a state of the form ρ qm (t) = ρ q (t)⊗|β(t) β(t)|, where ρ q (t) is the reduced density matrix of the TLS at time t and |β(t) is a coherent state of the MO of amplitude β(t) 3 . Therefore, the density operator ρ qm (t) obeys the master equation: + γn ω(β(t)) D[σ + ⊗ 1 m ]ρ qm (t) + γ n ω(β(t)) + 1 D[σ − ⊗ 1 m ]ρ qm (t).
We have defined the superoperator D[X]ρ = XρX † − 1 2 {X † X, ρ},n ω = (exp(hω/k B T ) − 1) −1 the average photon number of energyhω in the bath and ω(β) = ω 0 + 2g m Re β the effective TLS's frequency. In the derivation, we use in particular that the coherent state of the MO has a unit position variance, such that the subsequent variance of the effective frequency of the TLS is of order g m and can be neglected.
D. Reversed protocol for a hybrid opto-mechanical system The reversed protocol is defined by inverting the unitary evolution, keeping the same stochastic map at each time t n . It starts from the TLS prepared at thermal equilibrium, and the battery in ρ B . Following 4-6 , we have defined the reversed Kraus operators at time t N − t: allowing to express the probability of the reversed trajec- n=0P tn [ n , β n | n+1 , β n+1 ], where we have introduced the reversed jump probability at time t N − t n : P tn [ n , β n | n+1 , β n+1 ] = Σ n+1 |J † K(tn)J K(tn) |Σ n+1 . (20) E. Derivation of Jarzynski's Equality for the hybrid opto-mechanical system We start from the sum over all reversed trajectories: 1 = ΣP [ Σ]. In the limit |β 0 | g m /Ω, the MO's action on the TLS is similar to an external operator imposing the evolution of the TLS's frequency ω cl (t) = ω 0 + 2g m |β 0 | sin(Ωt). As a consequence, the reversed jump probability at time t N − t n (Eq. (20)) does not depend on the exact MO's state β n+1 , but only on β 0 e −iΩtn+1 , which corresponds to the free MO's dynamics. The evolution of the MO is fully determined by the trajectory Γ of the TLS, therefore