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. As 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 toward the experimental demonstration of fluctuation theorems in quantum open systems. An opto-mechanical device coupled to a qubit could be able to directly measure entropy generation in an open quantum system. Alexia Auffèves and Juliette Monsel from Université Grenoble Alpes and Cyril Elouard from University of Rochester show that a system composed by a nanomechanical device (such as a tiny membrane) strongly interacting with a two-level system (for example a quantum dot) could potentially provide a feasible way to test entropy production when put into contact with en external bath. Entropy generation is also called “thermodynamic arrow of time” because it’s what drives the evolution of physical system along a preferred direction. Up to now its verification at the quantum level has been limited to isolated systems, but the authors’ proposal could help experimentalists to fill this gap.


INTRODUCTION
Irreversibility is a fundamental feature of our physical world. The degree of irreversibility of thermodynamic transformations is measured by the entropy production, which is always positive according to the second law. At the microscopic level, stochastic thermodynamics 1,2 has extended this concept to characterize the evolution of small systems coupled to reservoirs and driven out of equilibrium. Such systems follow stochastic trajectoriesΣ and the stochastic entropy production Δ i s½Σ obeys the integral fluctuation for successful experimental demonstrations. [4][5][6] Defining and measuring the 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. 7-10 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. [11][12][13][14] So far the quantum JE has thus been extended and experimentally verified in 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 11 or the measurement of its characteristic function. [15][16][17] Experimental demonstrations have been realized, e.g. with trapped ions, 18,19 ensemble of cold atoms, 20 and spins in nuclear magnetic resonance (NMR) 21 where the thermodynamic arrow of time was successfully measured. 22 On the other hand, realistic strategies must still be developed to measure the fluctuations of entropy production for quantum open systems, i.e. that can be simultaneously driven, and coupled to reservoirs. As work is usually assumed to be provided by a classical entity, most theoretical proposals so far have relied on the measurement of heat fluctuations, i.e. small energy changes of the reservoir. Experimentally, this requires to engineer this reservoir and to develop high efficiency detection schemes, which is very challenging. [23][24][25] 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 fluctuations. We investigate a socalled hybrid opto-mechanical system, 26 that consists in a twolevel system (further called a qubit) strongly coupled to a mechanical oscillator (MO) on the one hand, and to a thermal bath on the other hand. Studying single quantum trajectories of the hybrid system, we show that the MO and the qubit remain in a product state all along their joint evolution, allowing to unambiguously define their stochastic energies. We evidence that the mechanical energy fluctuations can be identified with the stochastic work received by the qubit and satisfy JE. Therefore, the MO plays the role of a quantum battery, the ensemble of the qubit and the battery forming an autonomous machine. [27][28][29] Originally, the battery behaves as an embedded quantum work meter, encoding information on the stochastic work exchanges. We show that the evolution of the complete machine is characterized by a generalized IFT that quantitatively involves the amount of extracted information. This situation gives rise to so-called absolute irreversibility, in agreement with recent theoretical predictions and experimental results. [30][31][32][33] Our proposal is robust against finite measurement precision 34,35 and can be probed with state-of-the-art experimental devices.
The paper is divided as follows. First, we introduce hybrid optomechanical devices as autonomous machines, and build the framework to model their evolution on average and at the single trajectory level. Focusing on Jarzynski's protocol, we define stochastic heat, work, and entropy production and study the regime of validity and robustness of JE as a function of the parameters of the problem and experimental imperfections. Finally, we derive and simulate an IFT for the complete machine, evidencing the presence of absolute irreversibility. Our results demonstrate that work fluctuations can be measured directly, by monitoring the energetic fluctuations of the quantum battery. They represent an important step toward the experimental demonstration of quantum fluctuation theorem in a quantum open system.

RESULTS
Hybrid opto-mechanical systems as autonomous machines A hybrid opto-mechanical system consists in a qubit of ground (resp. excited) state g j i (resp. e j i) and transition frequency ω 0 , parametrically coupled to a mechanical oscillator of frequency Ω ≪ ω 0 (Fig. 1a). Recently, physical implementations of such hybrid systems have been realized on various platforms, e.g. superconducting qubits embedded in oscillating membranes, 36 nanowires coupled to diamond nitrogen vacancies, 37 or to semiconductor quantum dots. 38 The complete Hamiltonian of the hybrid system reads H qm = H q + H m + V qm , 26 where H q ¼ hω 0 e j i e h j 1 m and H m ¼ 1 q hΩb y b are the qubit and MO free Hamiltonians, respectively. We have introduced the phonon annihilation operator b, and 1 m (resp. 1 q ) the identity on the MO (resp. qubit) Hilbert space. The coupling Hamiltonian is where g m is the qubit-mechanical coupling strength. Of special interest for the present paper, the socalled ultra-strong coupling regime is defined as g m ≥ Ω, with ω 0 ≫ g m . It was recently demonstrated experimentally. 38 The Hamiltonian of the hybrid system can be fruitfully rewritten It appears that the qubit bare energy states ϵ ¼ e; g are stable under the dynamics and perfectly determine the evolution of the MO ruled by the Hamiltonian H ϵ m . Interestingly, H ϵ m preserves the statistics of coherent mechanical states, defined as β j i ¼ e β Ã bÀβb y 0 j i, where 0 j i is the zero-phonon state and β the complex amplitude of the field. Consequently, if the hybrid system is initially prepared in a product state ϵ; β 0 j i, it remains in a similar product state ϵ; β ϵ t at any time, with β ϵ . If the qubit is initially prepared in the state e j i (resp. g j i), the mechanical evolution is a rotation around the displaced origin (−g m /Ω, 0) (resp. the origin (0, 0)). Such displacement is caused by the force the qubit exerts on the MO, that is similar to the optical radiation pressure in cavity optomechanics. Defining δβ t ¼ β e t À β g t , it appears that the distance between the two final mechanical states δβ t j j scales like g m /Ω. In the ultra-strong coupling regime, this distance is large such that mechanical states are distinguishable, and can be used as quantum meters to detect the qubit state.
As the hybrid system remains in a pure product state at all times, its mean energy defined as E qm ϵ; β ϵ t À Á = ϵ; β ϵ t H qm ϵ; β ϵ t naturally splits into two distinct components, respectively, quantifying the qubit and the mechanical energies: where δ ϵ;e is the Kronecker delta and ω(β) is the effective transition frequency of the qubit defined as: The frequency modulation described by Eq. (3) manifests the back-action of the mechanics on the qubit. Note that the case g m / Ω ≪ |β 0 | corresponds to δβ t j j ( β g t : Then the frequency modulation is independent of the qubit state and follows ω β ϵ t À Á $ ω β 0 e ÀiΩt À Á , even in the ultra-strong coupling regime. In what follows, we will be especially interested in the regime where 1 ≪ g m /Ω ≪ |β 0 |, where the mechanical evolution depends on the qubit state; whereas, the qubit transition frequency is independent of it. We now take into account that the coupling of the qubit to a bath prepared at thermal equilibrium. The bath of temperature T consists of a spectrally broad collection of electromagnetic modes of frequencies ω′, each mode containing a mean number of photons n ω0 = (exp(ħω′/k B T) − 1) −1 . The bath induces transitions between the states e j i and g j i, and is characterized by a typical correlation time τ c giving rise to a bare qubit spontaneous emission rate γ.
The hybrid system is initially prepared in the product state ρ qm (0) = ρ q ð0Þ β 0 j i β 0 h j. ρ q (0) is the qubit state, taken diagonal in the {e, g} basis. β 0 j i β 0 h j is the mechanical state, that is chosen pure and coherent. In the rest of the paper, we shall study transformations taking place on typical timescales t~Ω −1 , such that the mechanical relaxation is neglected. From the properties of the interaction with the bath and the total hybrid system's Hamiltonian H qm , it clearly appears that the qubit does not develop any coherence in its bare energy basis. We show in Supplementary that as long as |β 0 | ≫ g m t, the MO imposes a welldefined modulation of the qubit frequency ω(β 0 (t)) with β 0 (t) = β 0 e −iΩt . This defines the semi-classical regime, where the hybrid system evolution is ruled by the following master equation: We have defined the super-operator D½Xρ ¼ XρX y À 1 2 fX y X; ρg and σ ¼ g j i e h j. Product states of the form ρ qm (t) = ρ q (t) ⊗ ρ m (t) are natural solutions of Eq. (4), giving rise to two reduced coupled equations, respectively, governing the dynamics of the qubit and the mechanics: We have introduced the effective time-dependent Hamiltonians: The physical meaning of these semi-classical equations is transparent: The force exerted by the qubit results into the effective Hamiltonian H m (t) ruling the mechanical evolution. Reciprocally, the mechanics modulates the frequency ω(β 0 (t)) of the qubit (Eq. (3)), which causes the coupling parameters of the qubit to the bath to be time dependent.
The semi-classical regime of hybrid opto-mechanical systems is especially appealing for quantum thermodynamical purposes, as it allows modeling the time-dependent Hamiltonian ruling the dynamics of a system (the qubit) by coupling this system to a quantum entity, i.e. a quantum battery (the MO). The Hamiltonian of the compound is time-independent, justifying to call it an "autonomous machine". [27][28][29] As demonstrated in a previous work, 39 this scenery suggests a new strategy to measure average work exchanges in quantum open systems. Defining the average work rate received by the qubit as _ W = Tr q ρ q ðtÞ _ H q ðtÞ Â Ã , we have shown that this work rate exactly compensates the mechanical energy variation rate: Remarkably, this relation demonstrates the possibility of measuring work "in situ", directly inside the battery. This strategy offers undeniable practical advantages, since it solely requires to measure the mechanical energy at the beginning and at the end of the transformation. The corresponding mechanical energy change is potentially measurable in the ultra-strong coupling regime g m / Ω ≫ 1, 39 which is fully compatible with the semi-classical regime g m t ≪ |β 0 |.
Our goal is now to extend this strategy to work fluctuations. A key point is to demonstrate that the qubit and the mechanical state remain in a pure product state along single realizations of the protocol, allowing to unambiguously define stochastic energies for each entity. This calls for an advanced theoretical treatment based on the quantum trajectories picture.

Quantum trajectories
We shall now describe the evolution of the machine between the time t 0 and t N by stochastic quantum trajectories of pure states iis a vector in the Hilbert space of the machine and t n = t 0 + nΔt with Δt the time increment. To introduce our approach, we first consider the semi-classical regime where the master Eq. (4) is valid: The initial state of the machine Ψ Σ t 0 ð Þ j iis drawn from the product state ρ q ð0Þ β 0 j i β 0 h j where ρ q (0) is diagonal in the {e, g} basis, and the evolution is studied over a typical duration t N À t 0 ð Þ( β 0 j jg À1 m . Equation (4) is unraveled in the quantum jump picture, [40][41][42][43][44] giving rise to the following set of Kraus operators {J −1 (t n ); J +1 (t n ); J 0 (t n )}: We have introduced 1 qm = 1 m ⊗ 1 q the identity operator in the Hilbert space of the machine. J −1 and J +1 are the so-called jump operators. Experimentally, they are signaled by the emission or absorption of a photon in the bath, that corresponds to the transition of the qubit in the ground or excited state, respectively. The mechanical state remains unchanged. Reciprocally, the absence of detection event in the bath corresponds the nojump operator J 0 , i.e. a continuous, non-Hermitian evolution governed by the effective Hamiltonian H eff (t n ) = H qm + H nh (t n ).
Here H nh (t) = Àði h=2Þ J y þ1 ðtÞJ þ1 ðtÞ þ J y À1 ðtÞJ À1 ðtÞ is the non-Hermitian part of H eff . Let us suppose that the machine is initially prepared in a pure The quantum trajectoryΣ is then perfectly defined by the sequence of stochastic jumps/no-jump iat time t n . At any time t N , the density matrix of the machine, i.e. the solution of Eq. (4), can be recovered by averaging over the trajectories: We have introduced the probability of the trajectory P½Σ = ] the probability that the machine is initially prepared in Ψ t 0 ð Þ j i. Interestingly from the expression of the Kraus operators, it appears that starting from the product state ϵ 0 ; β 0 j i, the machine remains in a product state Ψ Σ t n ð Þ j i= ϵ Σ t n ð Þ; β Σ t n ð Þ j i at any time t n , which is the first result of this paper. The demonstration is as follows: At each time step t n , either the machine undergoes a quantum jump J ±1 , or it evolves under the no-jump operator J 0 . In the former case, the qubit jumps from ϵ Σ t n ð Þ into ϵ Σ t nþ1 ð Þand the mechanical state remains unchanged, such as β Σ t nþ1 ð Þ j i= β Σ t n ð Þ j i. In the latter case, the evolution of the machine state is governed by the effective Hamiltonian H eff , whose non-Hermitian part can be rewritten H nh = (−iħ/2)1 m ⊗ H q nh with H q nh diagonal in the bare qubit energy eigenbasis. It naturally derives from the evolution rules that H nh has no effect on a machine state of the form ϵ Σ t n ð Þ; β Σ t n ð Þ j i , such that the no-jump evolution reduces to its unitary component defined by H qm . As studied above, the qubit energy state is stable under such evolution, such that is the stochastic qubit trajectory with ϵ Σ t n ð Þ ¼ e; g. In the semiclassical regime considered here, the jump probabilities solely depend on ω(β 0 (t)), such that the qubit reduced evolution is Markovian. Examples of numerically generated mechanical trajectoriesβε ½ (Methods section) are plotted in Fig. 1c. As it appears in the figure, at the final time the mechanical states β Σ t N ð Þ j i are restricted within an area of typical dimension g m /Ω. Splitting the mechanical amplitude as β Σ (t N ) = β 0 (t N ) + δβ Σ (t N ), the semi-classical regime is characterized by |δβ Σ (t n )| ≪ |β 0 (t N )| while in the ultra-strong coupling regime δβ Σ t N ð Þ ½ Þ)1. These two regimes are compatible, which is the key of our proposal as we show in the next section.
Interestingly, the modeling of the machine stochastic evolution can be extended over timescales t ! β 0 j jg À1 m , beyond the semiclassical regime. The key point is that the trajectory picture allows keeping track of the mechanical state at each time step β Σ t n ð Þ j i. Therefore at each time t n , a master equation of the form of Eq. (4) can thus be derived and unraveled into a set of trajectorydependent Kraus operators similar to Eq. (7), taking now ω(β Σ (t n )) as the qubit effective frequency. In this general situation, the machine stochastic evolution still consists in trajectories of pure product states Ψ Σ t n ð Þ j i= ϵ Σ t n ð Þ; β Σ t n ð Þ j i , but the mechanical fluctuations |δβ Σ (t n )| cannot be neglected anymore with respect to the mean amplitude |β 0 (t n )|. Consequently, Eq. (10) cannot be written as an average product state of the qubit and the MO, resulting in the emergence of classical correlations between the qubit and the MO average states. Moreover, the jump probabilities at time t n now depend on n ω β Σ tn ð Þ ð Þ , such that the reduced qubit trajectoryε is not Markovian anymore. As we show below, this property conditions the validity of our proposal, which is restricted to the Markovian regime.
Stochastic thermodynamics From now on, we focus on the following protocol: At the initial time t 0 the machine is prepared in a product state ρ qm (t 0 ) = ρ 1 q β 0 ð Þ β 0 j i β 0 h j, where ρ 1 q β 0 ð Þ is the qubit thermal distribution defined by the effective frequency ω(β 0 ). Note that ρ qm (t 0 ) is not an equilibrium state of the whole machine. One performs an energy measurement of the qubit, preparing the state is the partition function. The machine is then coupled to the bath and its evolution is studied between t 0 = 0 and t N = π/2Ω. Depending on the choice of thermodynamical system, this physical situation can be studied from two different perspectives, defining two different transformations. If the considered thermodynamical system is the machine, then the studied evolution corresponds to a relaxation toward thermal equilibrium. As the machine Hamiltonian H qm is time-independent, energy exchanges reduce to heat exchanges between the machine and the bath. On the other hand, if the considered thermodynamical system is the qubit, then the studied transformation consists in driving the qubit out of equilibrium through the time-dependent Hamiltonian H q (t), the driving work being provided by the mechanics. In the semi-classical regime, the qubit evolution is Markovian, such that this last situation simply corresponds to Jarzynski's protocol with H q (t) = ħω(β 0 (t)) e j i e h j. We now define and study the stochastic thermodynamical quantities characterizing the transformation experienced by the system (qubit or machine) for the protocol introduced above. As shown previously, starting from a product state Ψ t 0 ð Þ j i¼ ϵ 0 ; β 0 j i the machine remains in a product state at any time ð Þ the machine internal energy, it thus naturally splits into a sum of the qubit energy E q ϵ Σ t n ð Þ; β Σ t n ð Þ ð Þ (Eq. (1)) and mechanical energy E m β Σ t n ð Þ ð Þ (Eq. (2)). Along the trajectory, the set of internal energies can change in two distinct ways. A quantum jump taking place at time t n stochastically changes the qubit and the machine energies by the same amount δE q ½Σ; t n ¼ δE qm ½Σ; t n , leaving the MO energy unchanged. Following standard definitions in stochastic thermodynamics, 24,45,46 the corresponding energy change is identified with heat q[Σ, t n ] provided by the bath. Conversely in the absence of jump, the qubit remains in the same state between t n and t n+1 , whereas its energy eigenvalues evolve in time due to the qubitmechanical coupling. Such energy change is identified with work denoted w[Σ, t n ] and verifies δE q ½Σ; t n ¼ w½Σ; t n . During this time interval, the machine is energetically isolated such that δE qm ½Σ; t n ¼ 0. Therefore, the work increment exactly compensates the mechanical energy change δE m ½Σ; t n ¼ Àw Σ; t n ½ . Finally, the total work (resp. heat) received by the qubit is defined as WΣ ). By construction, their sum equals the qubit total energy change between t 0 and t N , ΔE qΣ which is the second result of this article. Equation (11) extends the results obtained for the average work in a previous work, 39 and explicitly demonstrates the one-by-one correspondence between the stochastic work received by the qubit and the mechanical energy change between the start and the end of the trajectory. The MO thus behaves as an ideal embedded quantum work meter at the single trajectory level. We finally derive the expression of the stochastic entropy production Δ i sΣ The probability of the direct trajectory reads: The state of the hybrid system averaged over the forward trajectories at time t N is described by Eq. (10). At the end of the protocol, the reduced mechanical average state defined as ρ m (t N ) = Tr q [ρ qm (t N )] thus consists in a discrete distribution of the final mechanical states β Σ t N ð Þ j i f g . Introducing the probability p m [β f ] for the mechanical amplitude to end up in a state of amplitude β f , we shall denote it in the following ρ m ( Reciprocally, the time-reversed protocol is defined between t N and t 0 . It consists in time-reversing the unitary evolution governing the dynamics of the machine, keeping the same stochastic map at each time t n . This leads to the expression of the time-dependent reversed Kraus operators: 46,[48][49][50] The initial state of the backward trajectory is defined as follows: The mechanical state β Σ t N ð Þ j iis drawn from the final distribution of states β f j i f g generated by the direct protocol with probability p m [β f ], whereas the qubit state is drawn from the thermal equilibrium defined by β Σ (t N ) with probability p 1 β Σ tN ð Þ . The probability of the backward trajectory reads We have introduced the reversed jump probability at time t ñ P Ψ Σ t nÀ1 ð i. Based on Eqs. (11), (12), (13), and (17), we derive in Supplementary the following expression for the stochastic entropy produced alongΣ: where σ[Σ] and I Sh [Σ] are defined as We have introduced the quantity ΔF[Σ] = k B T log(Z(β 0 )/Z(β Σ (t N ))) that extends the notion of the qubit free energy change to cases where the reduced qubit trajectory ε is non-Markovian. In the Markovian regime, we simply recover Z(t N ) = 1 + exp(−ħω(β 0 (t N ))/ k B T) and ΔFΣ  whole machine. We now study in detail these two fluctuation theorems.
Reduced Jarzynski's equality We first focus on the transformation experienced by the qubit. As mentioned above, in the Markovian regime the applied protocol corresponds to Jarzynski's protocol: The qubit is driven out of thermal equilibrium, whereas it experiences the frequency modulation ω(β 0 (t)). As the stochastic work WΣ h i is provided by the mechanics, one expects the mechanical energy fluctuations to obey a reduced Jarzynski's equality. We derive in Supplementary the following IFT: Equation (21) corresponds to the usual Jarzynski's equality, with the remarkable difference that the stochastic work involved in σ [Σ] is now replaced by the mechanical energy change ΔE mΣ h i . This is the third and most important result of this paper, which now suggests a new strategy to measure work fluctuations. Instead of reconstructing the stochastic work by monitoring the complete qubit trajectory, one can simply measure the mechanical stochastic energy at the beginning and at the end of the protocol. This can be done, e.g. in time-resolved measurements of the mechanical complex amplitude through to optical deflection techniques. 51,52 To do so, the final mechanical states β Σ t N ð Þ j i should be distinguishable, which requires to reach the ultra-strong coupling regime. As mentioned above, this regime has been experimentally evidenced 38 with typical values Ω~g m~4 00 kHz. The strategy we suggest here is drastically different from former proposals aiming at measuring JE in a quantum open system, that involved challenging reservoir engineering techniques 24,25 or fine thermometry 23 in order to measure heat exchanges.
We have simulated the reduced JE (Fig. 2a). As expected, JE is verified in the Markovian limit where we have checked that the action of the MO is similar to a classical external operator imposing the qubit frequency modulation ω(β 0 (t)) (Fig. 2b). 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. 2 presuppose the experimental ability to measure the mechanical states with an infinite precision. To take into account both quantum uncertainty and experimental limitations, we now assume that the measured complex amplitude β M corresponds to the mechanical amplitude β f in the end of the protocol with a finite precision δβ. For our simulations we have chosen δβ = 2, which corresponds to achievable experimental value. 51,52 To quantify this finite precision, we introduce the mutual information between the final distribution of mechanical states p m [β f ] introduced above, and the measured distribution p m [β M ], defined as: p(β f , β M ) denotes the joint probability of measuring β M , whereas the mechanical amplitude equals β f . If the measurement precision is infinite, the mutual information I[β f , β M ] exactly matches the Shannon entropy characterizing the final distribution of mechan- On the opposite, it vanishes in the absence of correlations between the two distributions.
The simulation of the measured JE and the mutual information I [β f , β M ] are plotted in Fig. 3 for the measurement precision δβ = 2, as a function of the parameter g m /Ω (Methods section). We have introduced the measured reduced entropy production σ MΣ As expected, small values of g m /Ω correspond to a poor ability to distinguish between the different final mechanical states, hence to measure work, which is characterized by a non-optimal mutual information. In this limit, the measured work fluctuations W M [Σ] do not verify JE. Increasing the ratio g m /Ω allows to increase the information extracted on the work distribution during the readout. Thus the mutual information converges toward S Sh [β f ] despite the finite precision readout. JE is recovered for g m =Ω $ 50. Such high rates are within experimental reach, by engineering modes of lower mechanical frequency. 53 Generalized integral fluctuation theorem We finally consider the complete machine as the thermodynamical system under study. Based on Eqs. (12) and (18), we show in Supplementary that the entropy produced along the stochastic evolution of the hybrid system obeys a modified IFT of the form: Following, [30][31][32][33] we have defined the parameter λ as The case λ ≠ 0 signals the existence of backward trajectories Σ without any forward counterpart, i.e. PΣ h i ¼ 0, a phenomenon that has been dubbed absolute irreversibility (see Supplementary). From Eq. (23) and the convexity of the exponential, it is clear that absolute irreversibility characterizes transformations associated to a strictly positive entropy production. This is the case in the present situation, which describes the relaxation of the machine towards a thermal equilibrium state: Such transformation is never reversible, unless for T = 0. The IFT (Eq. (23)) and the mean entropy production Δ i sΣ h i D Ẽ Σ are plotted in Fig. 4a, b respectively, as a function of the bath temperature T (Methods section). The limit ħω 0 ≫ k B T corresponds to the trivial case of a single reversible trajectory characterized by a null entropy production and λ → 0. In the opposite regime As noticed in, 30,33,50 absolute irreversibility can also appear in IFTs characterizing the entropy produced by a measurement process. In particular, λ ≠ 0 can signal a perfect information extraction: This typically corresponds to the present situation, which describes the creation of classical correlations between the qubit reduced trajectoryε and the distributions of final mechanical statesβ½ε. Interestingly, the two FTs (21) and (23) are thus deeply related. To be experimentally checked, Eq. (21) requires the MO to behave as a perfect quantum work meter, which is signaled by absolute irreversibility Eq. (23). Therefore absolute irreversibility is constitutive of the protocol, and a witness of its success.

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. 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 quantifies 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 a battery coherently drives a quantum open system into coherent superpositions. Such situations are especially appealing for quantum thermodynamics as they lead to entropy production and energetic fluctuations of quantum nature, 46,54 related to the erasure of quantum coherences. 9,10 Recently, small amounts of average work have been directly measured, by monitoring the resonant field coherently driving a superconducting qubit. 55 Generalizing our formalism to this experimental situation would relate measurable work fluctuations to quantum entropy production, 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. 44 The average value of a quantity AΣ h i is then approximated by AΣ where N traj = 5 × 10 6 is the number of numerically generated trajectories andΣ i , denotes the i-th trajectory.
The reduced entropy production σΣ h i used in Figs. 2 and 4 was calculated with the expression (19), using the numerically generated values of β 0 and β Σ (t N ) in the trajectoryΣ. One value of β Σ (t N ) can be generated by a single direct trajectory Σ: Below we use the equality p m β Σ t N ð Þ ½ ¼PΣ h i . Using the expression (17) of the probability of the reversed trajectory, the average entropy production becomes: To obtain Fig. 3, we considered that the preparation of the initial MO state was not perfect. So instead of starting from exactly β 0 j i, the MO trajectories start from β Σ t 0 ð Þ j i with the β Σ (t 0 ) uniformly distributed in a square of width 2δβ, centered on β 0 . Similarly, the measuring apparatus has a finite precision, modeled by a grid of cell width 2δβ in the phase plane (Re β f , Im β f ). Instead of obtaining the exact value of β Σ (t N ), we get β M Σ t N ð Þ, the center of the grid cell in which β Σ (t N ) is. The value used to compute the thermodynamical quantities are not the exact β Σ (t 0 ) and β Σ (t N ) but β M 0 ¼ β 0 and β M Σ t N ð Þ.

DATA AVAILABILITY
The datasets generated during and/or analyzed during the current study are available from the corresponding author on reasonable request. Fig. 4 Deviation from the integral fluctuation theorem a and mean entropy production b for the complete autonomous machine. Parameters: ω 0 /2π = 2 THz (amounts to ħω 0 /k B T = 1.2 for T = 80 K used in Fig. 2), Ω/2π = 100 kHz, γ/Ω = 5, g m /Ω = 10 and |β 0 | = 5000. In both cases, two different expressions were used. The blue dots are computed using the final distribution of mechanical states β Σ t N ð Þ j i f gand mimic an experiment. The red squares involve the probability of the reversed trajectory, which can only be the result of a theoretical treatment. (See Methods for more details.)