The thermodynamics of quantum systems driven out of equilibrium has attracted increasing attention in the last decade, in connection with quantum information and statistical physics, and with a focus on non-classical signatures. While a first approach can deal with average thermodynamics quantities over ensembles, in order to establish the impact of quantum and environmental fluctuations during the evolution, a continuous quantum measurement of the open system is required. Here, we provide an introduction to the general theoretical framework to establish and interpret the thermodynamics for quantum systems whose nonequilibrium evolution is continuously monitored. We review the formalism of quantum trajectories and its consistent application to the thermodynamic scenario, where primary quantities such as work, heat, and entropy production can be defined at the stochastic level. The connection to irreversibility and fluctuation theorems is also discussed together with some recent developments, and we provide some simple examples to illustrate the general theoretical framework.

## I. INTRODUCTION

Quantum thermodynamics is a growing and rapidly evolving field at the intersection of quantum information, many-body physics, and nonequilibrium thermodynamics that has attracted a great deal of attention in the last decade.^{1,2} It aims to describe work, heat, and entropy production along quantum nonequilibrium processes with a special attention to genuine quantum phenomena. Paradigmatic examples include studying the thermodynamic role of quantum coherence^{3–7} also in view of applications,^{8–11} quantum correlations like entanglement^{12–14} or discord,^{15–17} addressing the effects of quantum measurements,^{18–22} and exploring the link between energy and (quantum) information.^{23–27} While most literature in the field until now has focused on first-principle definitions and the behavior of average thermodynamic quantities, fluctuations are gaining increasing attention in recent years. Classical and quantum fluctuations are indeed known to be at the core of thermodynamic behavior at small scales, where genuine trade-offs and universal nonequilibrium relations constraining energetic and entropic quantities emerge.^{28–30} In this context, the framework of quantum trajectories and related methods describing the indirect and continuous monitoring of quantum systems provides an ideal platform to explore stochastic thermodynamics in the quantum regime.

Quantum trajectories were first considered in quantum optics^{31,32} to describe processes such as photodetection and to simulate the dynamics of open quantum systems when the master equation approach becomes intractable.^{33,34} Nowadays, quantum trajectories are generated and recorded in the laboratory in a number of different platforms ranging from superconducting few-level systems^{35–39} to optomechanical setups,^{40,41} including pioneering experiments with trapped ions^{42} and cavity quantum electrodynamics (QED) platforms.^{43,44} Its use have been proposed for different scopes including quantum state estimation^{45,46} and control,^{47–49} detection of dynamical phase transitions,^{50} and the characterization of quantum synchronization^{51,52} among others. The framework for the characterization of stochastic and quantum thermodynamics along quantum trajectories that we introduce here has been roughly developed during the last decade and is capturing increasing attention. Its starting point can be situated in the pioneering efforts of Horowitz^{53} and Hekking and Pekola^{54} to study and interpret the quantum jump approach in thermodynamic terms for particular representative cases (a driven dissipative harmonic oscillator and a driven two-level system). These two works were based, at the same time, in previous studies that obtained partial but useful results, see, e.g., Refs. 55–58. Contributions from several groups within the community working in quantum thermodynamics^{59–73} generalized and tested the framework in the last 8 years, including extensions to scenarios with feedback control,^{74–79} diffusive noise,^{66,80–83} and arbitrary environments.^{68,70} Applications to quantum heat engines,^{84–86} probing correlations,^{87,88} and the erasure of information^{89,90} have been proposed, as well as the development of experimental proposals for measuring heat and work along individual trajectories.^{91–95} Recently, the framework has been also used to obtain generalized versions of the Thermodynamic Uncertainty Relations (TUR)^{96–100}—which establish trade-off relations between the fluctuations of observable currents and dissipation—and to develop a Quantum Martingale Theory (QMT) describing the thermodynamics of processes at stopping times (such as first-passage times or escape times) in connection to quantum features.^{101,102}

Within the quantum trajectory approach, there exist different ways to handle the continuous measurement schemes: the so-called unravellings, the possibility of efficient or inefficient detection, etc. This leads to a variable difficulty to identify the relevant thermodynamic quantities at different levels of generality. Moreover, there has been often different proposals for the interpretation of the thermodynamic quantities arising in the framework and their interplay. In particular, the identification of energetic fluctuations due to measurement backaction as either work or heat have raised an ongoing debate in the community, as we will address in more detail later. Nevertheless, this collaborative effort has provided a powerful and promising extension of stochastic thermodynamics to the quantum realm. This extension not only allows to apply the general understanding and inference possibilities of stochastic thermodynamics to small systems where quantum features cannot be neglected, but it may also help to unveil genuine thermodynamic features of quantum coherence and correlations, and provides new insight to our fundamental understanding of quantum measurements.

In this Review, we focus on the theoretical framework providing an accessible overview of the main ingredients needed to establish and interpret thermodynamics of quantum systems whose nonequilibrium evolution is continuously monitored. We propose a route starting from central concepts extended from classical stochastic thermodynamics and quantum thermodynamics of isolated systems, which are extended to the quantum trajectory scenario. Here, the concept of microreversibility in the evolution will play a central role, over which the whole framework is constructed. In order to provide a balanced presentation in some sections, we extend the formalism to situations not systematically treated in the literature, as for diffusive trajectories where microreversibility issues may arise (Sec. III C). We then discuss the energetics of quantum trajectories in Sec. IV, reviewing different proposals made in the literature and clarify some points needed to reach a solid understanding and coherent interpretation of the main thermodynamic quantities. The review is again complemented with an extension of the framework in order to accommodate situations with multiple conserved quantities and discuss in detail some important points such as the assessment of irreversibility through entropy production and their fluctuations, as well as different possible splits into contributions that provide extra insight on the thermodynamic behavior of the system and their genuine quantum properties (Secs. V and VI). Some aspects of the general framework are illustrated in two simple examples, Sec. VII, while some first experiments that started to explore thermodynamics of quantum trajectories are mentioned, together with other promising platforms. Finally, we provide an outlook on further possible developments and their applications in the field.

## II. QUANTUM TRAJECTORIES IN A NUTSHELL

Quantum trajectories describe the evolution of systems monitored through selective measurement and provide a powerful approach to the description of open quantum systems. Both methodological convenience and the need of a theoretical description accounting for continuous monitoring have been driving motivations for developing this framework. Indeed, with quantum trajectories, numerical simulation of master equations requires less memory and time, relying on (stochastic evolution of) pure states instead of density matrices and being naturally adapted to parallel computation. More crucially, quantum trajectories fill the theoretical gap between the unitary evolution of isolated systems and the master equation evolution in the presence of large and oblivious environments, accounting instead for the distinctive effects of selective measurement. This topic is presented in detail in Refs. 47 and 103–107, to name a few. In the following, we briefly introduce the framework for both quantum-jump and diffusive trajectories, which correspond to the most common sets of experimental records, namely, discontinuous (point) events or continuous signals.

We consider a system monitored though a continuous generalized measurement, changing the state of the system at each small time step *dt*. Positive operator value measurements are defined considering a set of $(K+1)$ operators Ω_{k} such that $\u2211k\Omega k\u2020\Omega k=1$.^{108} Depending on the experimental setting, the operators Ω_{k} can be sharp projections or other measurements like positive operator-valued measure (POVM) operators, including smooth projectors superpositions.^{47} For a given outcome *k* of the (selective) measurement at time *t*, the corresponding updated state of the system becomes $\rho t\u2192\u2009\Omega k\rho t\Omega k\u2020/Pk$ with $Pk=Tr[\Omega k\rho t\Omega k\u2020]$ the probability to obtain outcome *k* in the measurement. The state after unselective measurement, which considers the ensemble mixture of measurement outputs, is therefore $\rho t+dt=\u2211k\Omega k\rho t\Omega k\u2020$.

In the quantum trajectories framework, the main focus is on describing the continuous monitoring of open quantum systems following Markovian evolution. Therefore, if the measurement outcome is not selectively monitored, the change rate of the state $[\rho t+dt\u2212\rho t]/dt$ induced by this unselective measurement in the limit $dt\u21920$ is assumed to correspond to a Lindblad [or Gorini–Kossakowski–Sudarshan–Lindblad (GKLS)] master equation^{109}

where *H* is an Hermitian operator corresponding to the monitored system Hamiltonian, and *L _{k}* are the so-called Lindblad operators. The nonunitary part of the dynamics is modeled by the sum term in Eq. (1), with dissipators $Dk(\rho )\u2261Lk\rho Lk\u2020\u22121/2{Lk\u2020Lk,\rho}$. Although not explicitly written in the above equation, we will also generically allow for temporal dependencies in the operators appearing in the master equation (1). In particular, we consider that $H(\lambda )$ and $Lk(\lambda )$ might depend on a control parameter $\lambda (t)$ that can vary in time, which allow us to model driving processes following externally operated protocols. Such protocols will be important in the following sections, and in that case, we will write the Lindbladian in Eq. (1) as $L\lambda (\rho )$. In Sec. II A, we will instead define the evolution corresponding to a given measurement record, known as quantum trajectory.

### A. Quantum-jump trajectories

A first important class of quantum trajectories in which we focus is known as “quantum-jump” trajectories, which are obtained for a set of measurement operators (complete up to first order in *dt*)

with $dt\u226a1$. Here, the state of the system will be only weakly modified for measurement record *k *=* *0, an event occurring with probability $P0\u223c1$. On the other hand, for the other outcomes $k\u22600$, a substantial change will occur in the system state, but the probability will be negligible ($Pk\u223cdt$). This is the largely explored quantum optics scenario in which a jump is detected, corresponding to a photon emission from a decaying atom modeled by $Lk=\sigma \u2212$. It corresponds to a measurement record taking either values 0 (more frequently) or 1 (when a detector clicks).

The sequence of records of such a measurement in time is denoted by $\gamma (0,\tau )={dN(t);0\u2264t\u2264\tau}$ and constitutes a realization of a stochastic process, where $dN(t)={0,1}$ is a stochastic increment corresponding to either no-click or one click in the detector during the interval $[t,t+dt]$. The number of clicks in the detector up to time *τ* is hence $N(\tau )=\u222b0\tau dN(t)$. In the more general case considered here, with *K* distinguishable channels (like, e.g., energy lowering and raising processes or emission of photons in different modes), the measurement record $\gamma (0,\tau )$ includes *K* stochastic increments $dNk(t)={0,1}$, each of which “signaling” when a jump of type *L _{k}* is detected. Being the probability of a joint event negligible, we assume $dNn(t)dNk(t)=\delta nkdNk(t)$. The (classical) averages of the record of measurements $\u27e8\xb7\u27e9\gamma $ can be associated with the quantum expectation values $\u27e8\xb7\u27e9=Tr[\rho \xb7]$ of the corresponding measurement operators, so that the probability of a jump in the interval $[t,t+dt]$ reads

which tells us the rate at which jumps of type *k* occur during the evolution. Since this probability only depends on quantities evaluated at time *t*, the statistics of the jumps are Poissonian with (time-dependent) intensity $\u27e8Lk\u2020Lk\u27e9$.

If we now consider the evolution of the pure state of a system $|\psi (t)\u27e9$ continuously monitored through the measurement (2), depending of the detection $dNk(t)$, the updated state will correspond to $\Omega 0|\psi \u27e9$ or $\Omega k|\psi \u27e9$ with $k\u22600$, respectively. The state increment $d|\psi (t)\u27e9=|\psi (t+dt)\u27e9\u2212|\psi (t)\u27e9$ can then be constructed by combining these possibilities, each of which is multiplied by the factor $[1\u2212\u2211k\u22600Nk]$ (which becomes 0 when a jump is detected and is 1 otherwise) and the increments *dN _{k}*, respectively. Taking the limit $dt\u21920$, one obtains the nonlinear stochastic Schrödinger equation (SSE) for the conditional dynamics of the monitored state

^{47}

where terms $dNkdt=o(dt)$ have been neglected and $k=1,\u2026,K$ in the sums. As can be appreciated in the above equation, the evolution of the system is smooth and given by the first line when $dNk(t)=0\u2009\u2200k$, while abrupt jumps in the system state occur whenever *dN _{k}* = 1 for some

*k*, as given by the second line.

The corresponding stochastic master equation (SME) for a mixed conditioned state $\rho \gamma (t)$ acquires a more compact form (omitting time dependence)

with drift (no-jump detection) terms

and jumps super-operators

We notice the SME above can be directly obtained from Eq. (4) by identifying $\rho \gamma (t)=|\psi (t)\u27e9\u27e8\psi (t)|$; however, Eq. (5) remains also valid for arbitrary mixed initial states of the system.^{47}

Since the conditional system evolution consists of a sequence of smooth drift steps intersected by a set of *K* rare jump events occurring with small probabilities $dt\u27e8Lk\u2020Lk\u27e9$, the measurement record $\gamma (0,\tau )$ can be alternatively given by specifying the times *t _{j}* at which jumps of each time

*k*were detected:

_{j}where we assumed a total number of *J* jumps detected up to time *τ* accounting for all *K* channels, while drift dynamics occurs the rest of the time. The associated evolution trajectory operator for the monitored state is

with $U(t2,t1)=T+\u2009exp\u2009[\u2212i\u222bt1t2dt(H+i\u2211Lk\u2020Lk)]$ drift (or no-jump) operators modeling a smooth dynamics between times *t*_{1} and *t*_{2} and $T+\u2009exp$ time-ordered exponential (allowing for time dependent Hamiltonians or jumps *L _{k}*). Notice that we are not enforcing state normalization here so that the probability of a given measurement record over an initial state

*ρ*

_{0}is given by $p\gamma =Tr[T\u2020(\gamma )T(\gamma )\rho 0]$. The physical state at final time

*τ*given a certain measurements record is then $\rho \gamma (\tau )=T(\gamma )\rho 0T\u2020(\gamma )/p\gamma $. Finally, when averaging over measurement records $\gamma (0,\tau )$, we recover the unconditional evolution of the system as determined by Eq. (1), that is $\rho \tau =\u2211\gamma T(\gamma )\rho 0T\u2020(\gamma )=E(\rho 0)$, with $E\u2261T+\u2009exp\u2009[\u2212\u222b0\tau dtL]$.

### B. Diffusive trajectories

Let us consider now the case in which, monitored quantities produce one or more (K) continuously fluctuating signals, instead of discontinuous jumps, as it would occur with photocurrents or electrical currents, voltages, etc. In this case, the measurement records are continuous but not differentiable processes in time $\gamma (0,\tau )={Ik(t);0\u2264t\u2264\tau}k=1K$, with *K* current records at each time. A diffusive stochastic evolution equation can be obtained in this case reading^{47,103,104}

with $dwk(t)$ a set of real valued Wiener increments with zero mean $\u27e8dwk(t)\u27e9=0$ and nonvanishing correlations $dwk(t)dwl(t)=\delta kldt$. Other similar versions of the diffusive SSE have been derived by many authors,^{32,106,107} which may also include complex-valued Wiener increments.^{47}

This equation can be derived from the previous quantum jump description by using the symmetries of the Lindblad master equation. In particular, Eq. (1) remains unchanged by a transformation in the Lindblad operators $Lk\u2192Lk\u2032=Lk+\alpha k$, accompanied by a change in the Hermitian operator $H\u2192H\u2032=H\u2212i\u2211k(Lk\alpha k\u2217+Lk\u2020\alpha )/2$. By considering a scheme where the jumps $Lk\u2032$ are detected and the parameters *α _{k}* are taken real and big enough, the dynamics of the system can be coarse-grained over a time interval in which several individual jumps occur, but the evolution remains still smooth.

^{47,51,110}This occurs for a coarse grained time $\Delta t\u223c\alpha k\u22123/2$ that leads to a number of detected jumps $\Delta Nk\u223c\alpha k$ and to large number of counts $(\u223c\alpha k2)$, consistent with a Gaussian statistics. This is a prototypical case in the quantum optics framework when moving to the limit in which the system optical mode is homodyne detected (superposed to a large coherent field

*α*, taken real). Similar situations arise as well in heterodyne detection,

^{47}while different classes of shifted operators like the $Lk\u2032$ above can be also obtained using chiral wavewides.

^{111}The measured record $\gamma (0,\tau )={Ik(t);0\u2264t\u2264\tau}$ in this homodyne-like detection scheme becomes for a variation during a small time interval

*dt*,

where $dwk(t)/dt$ corresponds to Gaussian white noise.

Alternative approaches to diffusive processes start from a weak measurement framework modeled by a broad (unsharp) superposition of projectors [instead of Eq. (2)]. This allows for a more direct definition of a diffusion process and some instances can be found in Refs. 106 and 107.

From the diffusive SSE (10) a diffusive SME can be obtained as well, reading

with dissipators $Dk(\rho )$ as defined below Eq. (1), which is of the general form obtained in Refs. 47 and 109. Interesting, both this and Eq. (5) are unraveling of the same GKLS master equation (1), when disregarding the measurement output, as they correspond to the same ensemble description.

Finally, the trajectory operators in this case can be written as a concatenation of measurement operators occurring at each infinitesimal time-step

where the measurement operators generically read:^{47}

and here $post(Ik)=dt/2\pi \u2009exp\u2009(\u2212Ik2/2)$ is the so-called ostensible probability distribution,^{47} ensuring $\u222bpost(Ik)Ikdt=0$ and $\u222bpost(Ik)Ikdt\u2009Ildt=\delta k,ldt$. The above measurement operators obey $\u222b\Omega I\u2020\Omega Idt=1$, and hence, the trajectory operators $T(\gamma (0,\tau ))$ lead, as in the quantum-jumps case, to the unconditioned evolution $\rho \tau =E(\rho 0)$ when averaging over measurement records.

## III. THERMODYNAMIC FRAMEWORK

In this section, we elaborate on the definition of a general thermodynamic framework within the quantum trajectory formalism. In order to provide a consistent identification of all thermodynamic quantities at the trajectory level, we introduce a two-point measurement scheme (TPM), consisting in the inclusion of projective measurements of arbitrary observables at the beginning and at the end of the indirectly monitored process, respectively. This allows us to describe trajectories with fixed end-points. While their actual implementation in the laboratory as projective measurements is not essential, its inclusion in the definitions is needed to recover a consistent framework. The TPM scheme has been extensively used in quantum thermodynamics for the derivation of fluctuation theorems^{112–115} and for the identification of quantum work in the context of energy measurements.^{116,117} In the following, we setup a general thermodynamic formalism combining the TPM scheme and continuous monitoring, as provided by the quantum trajectory formalism introduced above. We will first formally define trajectories in the scheme and associate to them probabilities, which will be compared to their time-reversed twins. Proceeding in this way will allow us to introduce some central concepts such as microreversibility, local detailed balance, and the entropy flow to the environment, which are key to the later identification of heat, work, and entropy production in Secs. IV and V.

### A. Forward and backward processes in the TPM scheme

As mentioned above, we assume an initial projective measurement is performed on the density operator of the system *ρ*_{0} using a complete set of projectors ${\Pi n0}n$, each associated with different eigenspaces (in the most simple case, these correspond to rank-1 projectors, associated with pure states $|n\u27e9$). This first measurement can be alternatively viewed as a preparation procedure of the system in the eigenspace of a given (arbitrary) observable *O*, which verifies by construction $[O,\rho 0]=0$. Let us assume that outcome *n*_{0} is obtained (or prepared) in the initial step. After that, the external driving protocol $\Lambda ={\lambda (t)\u2009;\u20090\u2264t\u2264\tau}$ is executed. The system continuously monitored until the final time *τ* and then follows the dynamical evolution dictated by the SSE (or the SME) with Hamiltonian and Lindblad operators generically depending on the control parameter $\lambda (t)$ at any time. Along the evolution, the monitoring procedure produces a measurement record $\gamma (0,\tau )$. Once the final time *τ* is reached, a second projective measurement is performed using another arbitrary complete set of projectors ${\Pi n\tau}n$ and outcome $n\tau $ is obtained. We can therefore define a trajectory $\gamma [0,\tau ]$ in this TPM scheme labeled by a closed interval $[0,\tau ]$ as the sequence

which contains both the particular outcomes of the initial and final projective measurements *n*_{0} and $n\tau $, together with the continuous monitoring measurement record $\gamma (0,\tau )$. The latter may take different forms depending on the particular measurement scheme chosen for the monitoring (direct detection of jumps, homodyne-like measurement, heterodyne-like measurement, etc.) as discussed in Sec. II.

The probability to observe a given trajectory $\gamma [0,\tau ]$ can be decomposed in the probability to sample the initial state $|n0\u27e9$ from *ρ*_{0} and to observe a given record $\gamma (0,\tau )$ followed by the final outcome $n\tau $ in the final projective measurement, that is,

where $\rho 0=pn0\u2009\Pi n0$ is the spectral decomposition of the initial density operator. The operator $T\Lambda (\gamma (0,\tau ))$ generates of the trajectory on the system state associated with the measurement record $\gamma (0,\tau )$ and driving protocol Λ. Notice also that we keep the subscript Λ in the trajectory probability in Eq. (16) to emphasize that it is conditioned on the external driving protocol.

By averaging over trajectories $\gamma [0,\tau ]$, the final state of the system becomes again $\rho \tau =\u2211n\tau \Pi n\tau \tau E(\rho 0)\Pi n\tau \tau $, where we recall that $E\u2261T+\u2009exp\u2009(\u2212\u222b0\tau dtL\lambda (t))$ is the open-system evolution generated by the master equation (1). Notice that in the special case where the final projective measurement is performed in the density operator eigenbasis (prior to measurement), we have $[\Pi n\tau \tau ,E(\rho 0)]=0$, and hence, it does not have any effect at the ensemble level, similarly to what happens with the initial projective measurement. As mentioned before, the later situation can be interpreted as if there were not projective measurements in the setup at all, but one is still interested in asking what is the probability of (monitored) two-point trajectories $\gamma [0,\tau ]$. Keeping this in mind, we will proceed considering the more general setup where the final projectors are arbitrary, unless otherwise stated.

In order to assess the reversibility of a dynamical evolution, we now compare the process introduced above, which we may be referred as the “forward process,” with its time-reversed twin, or “backward process,” as defined in the following operational way. Here, it is convenient to introduce the time-reversal operator in quantum mechanics, Θ, which is anti-unitary $\Theta \Theta \u2020=\Theta \u2020\Theta =1$ with $\Theta i1=\u2212i1\Theta $ and is responsible for changing the sign of odd-variables under time-reversal, such a momenta or magnetic fields.^{118} For the backward process, it is often convenient to define measurements and dynamics operators; we will distinguish them from the forward ones with a tilde. In the backward process, the system is initially prepared in one of the eigenspaces associated with the corresponding “reversed” version of the projectors used at the end of the forward process, ${\Pi \u0303m\tau \u2261\Theta \Pi m\tau \Theta \u2020}n$ (although other choices for the initial state of the backward process are possible, in general,^{112–114} in analogy to the classical case^{119,120}). Subsequently, the time-reversed driving protocol $\Lambda \u0303={\lambda (\tau \u2212t)\u2009;\u20090\u2264t\u2264\tau}$ is implemented over the transformed system Hamiltonian $H\u0303(\lambda )\u2261\Theta H(\lambda )\Theta \u2020$. For example, if the system Hamiltonian contains as the only odd variable under time reversal the magnetic field *B*, then the transformed Hamiltonian would be $H\u0303(t)=\Theta H(t,B)\Theta \u2020=H(t,\u2212B)$, see, e.g., Ref. 121. The system hence evolves under the associated SSE (or SME) associated with such time-inverted driving protocol under continuous monitoring until time *τ*, where the final projective measurements in performed using the set of projectors ${\Pi \u0303n0\u2261\Theta \Pi n0\Theta \u2020}n$. When the observables measured in the projective measurements are time-reversal invariant, we simply have $\Pi \u0303n\tau =\Pi n\tau $ and $\Pi \u0303n0=\Pi n0$ for every outcome *n*. In Fig. 1, we schematically illustrate both the forward and the backward processes as introduced above.

We are interested in the case where each of the projective measurements produces the same outcome than in the forward process, and the monitoring procedure registers exactly the time-reversed measurement record $\gamma \u0303(0,\tau )$ as compared to the forward record $\gamma (0,\tau )$. For the case of quantum jumps this means that $\gamma \u0303(0,\tau )={(k\u0303J,\tau \u2212tJ),\u2026,(k\u03032,\tau \u2212t2),(k\u03031,\tau \u2212t1)}$ reproduces the inverse sequence of jumps, where $k\u0303j$ corresponds to the opposite jump ($L\u0303kj\u221dLkj\u2020$) with respect to *k _{j}* in the forward trajectory.

^{68}Indeed, a jump up in the energy ladder of the system in the forward trajectory corresponds to a jump down when time is reversed, as much as a photon emission in a forward trajectory corresponds to a photon absorption in the time-reversed one. A similar rule applies to the diffusive trajectories scenario for the time-reversed measurement traces of the monitored currents $\gamma \u0303(0,\tau )={I\u0303k(\tau \u2212t)\u2009;\u20090\u2264t\u2264\tau}k=1K$. Here, $I\u0303k$ is the current associated with the adjoint-twin of the Lindblad operator

*L*in the set ${Lk}k=1K$. This means that the current generated from monitoring

_{k}*L*in the forward process, should equal the current generated from the operator $L\u0303k$ in the backward process when the recorded sequence is inverted (although these are obtained with different probabilities), in analogy to the case of the jump trajectories.

_{k}Finally, combining the time-reversed measurement record with the outcomes of the projective measurements leads to the definition of the time-reversed trajectory $\gamma \u0303[0,\tau ]={n\tau ,\gamma \u0303(0,\tau ),n0}$, which corresponds exactly with the inverse sequence of events than $\gamma [0,\tau ]$. The probability of such a time-reversed trajectory hence reads

where $pn\tau \tau =Tr[\Pi n\tau \tau E\tau (\rho 0)]$ is the probability to sample $n\tau $ from $\rho \tau $ at the beginning of the backward process and $T\Lambda \u0303(\gamma \u0303(0,\tau ))$ is the operator generating the time-reversed record $\gamma \u0303(0,\tau )$ under the time-reversed driving protocol $\Lambda \u0303$. When averaging over time-reversed trajectories, the final state of the system reads $\rho \u0303\tau =\u2211n0\Pi \u0303n00E\u0303\tau (\Theta \rho \tau \Theta \u2020)\Pi \u0303n00$, where $E\u0303\tau $ is the quantum Markovian semigroup of the time-reversed dynamics, $E\u0303\tau \u2261\u2009exp\u2009(\u2212\u222b0\tau dtL\u0303\lambda )$, with generator in Lindblad (GKLS) form

### B. Microreversibility and local detailed balance

The concept of microreversibility, or microscopic reversibility, was originally introduced by Boltzmann in the kinetic theory of gases. It refers to the decomposition of the microscopic dynamical evolution of a system in elementary processes, each of which possess a time-reversal twin.^{122} The microreversibility principle in quantum mechanics is well-known for closed nonautonomous systems

where $U\Lambda (0,t)$ is the unitary evolution of a system under the generic control protocol Λ, from the initial time up to *t*, and $U\Lambda \u0303\u2020(\tau \u2212t,\tau )$ the evolution subjected to the time-reversed protocol $\Lambda \u0303$, see, e.g., Refs. 113 and 115. Here, we consider its applicability in the case of open quantum systems following quantum trajectories. In particular, it has been proven^{68} (see also Refs. 53 and 59) that, starting from the global (system + environment) unitary evolution and applying microreversibility in Eq. (19), one can generically relate the trajectory operators in forward and time-reversal dynamics as

where the scalar quantity $\sigma \Lambda (\gamma (0,\tau ))$ is the stochastic entropy flow from the system to the environment (or entropy exchange) accumulated during the trajectory up to time *τ* in *k _{B}* units (we will assume

*k*= 1 thorough). This quantity is often referred to as either (integrated) “entropy flow”

_{B}^{123}or “entropy of the medium”

^{29}in stochastic thermodynamics and is associated with the reversible part of the changes in the entropy of the system due to its interaction with the environment.

^{124}Notice that since $\sigma \Lambda $ is not an operator, Eq. (20) is far from trivial. This relation quantifies in entropic terms the probability associated with the generation of measurement records $\gamma (0,\tau )$ under the driving protocol Λ with respect to the time-inverted trajectories $\gamma \u0303(0,\tau )$ when the driving protocol is also inverted. The higher the entropy flows to the environment, the less probable is to reproduce the (inverted) forward trajectory in the backward process. Equation (20) is a quantum generalization of the micro-reversibility relation put forward by Crooks in classical systems subjected to external driving and thermal fluctuations.

^{119}We also note that Eq. (20) reduces to Eq. (19) for unitary processes, where $\sigma \Lambda =0$.

Remarkably, the result in Eq. (20) has been derived for generic quantum jump trajectories and without further assumptions in the form of the environment, which does not need to be thermal.^{68} The only condition is that the set of Lindblad (jump) operators ${Lk}k=1K$ is self-adjoint, namely, that the adjoint of every operator *L _{k}* is proportional to another operator contained in the set. This condition, together with the further assumption that the only operator which commutes with all elements in the set is the identity operator, guarantees that the Lindblad dynamics is equipped with a unique (relaxing) steady-state when the driving is frozen.

^{125,126}The latter is an important condition in the presence of a thermal environment since it enforces that, in the absence of driving, the system relaxes back to an equilibrium state. However, one may also consider cases where the stationary state of the system is out of equilibrium, or even when there is more than one invariant state like, e.g., in pure decoherence dynamics, for which the second condition above is not necessarily satisfied.

For an adjoint set ${Lk}k=1K$, the Lindblad (jump) operators are either self-adjoint operators, or come in pairs ${Lk+,Lk\u2212}$ such that $Lk+=\Gamma +L\u2020$ and $Lk\u2212=\Gamma \u2212L$ for some operator *L*, and verify a generalized local detailed balance relation:^{59,68}

where $\Delta sk\xb1(\lambda )=\xb1log\u2009(\Gamma +(\lambda )/\Gamma \u2212(\lambda ))$ is a real function and $\Gamma \xb1(\lambda )\u22650$ represent the corresponding (time-dependent) rates evaluated at the instantaneous value of the control parameter *λ*. For the case of self-adjoint operators, we instead have $\Delta sk(\lambda )=0$, independently of their rate. These considerations apply to generic environments^{68} composed by several thermal and/or particle reservoirs, or that can be prepared in quantum states, like, e.g., the squeezed thermal reservoir^{90} hence generalizing previous results derived for a single thermal reservoir,^{53,58} and by assuming a specific form of the system–environment interaction.^{59} The relation (21) hence points to a very fundamental property of Markovian open quantum systems in the weak-coupling limit as described by GKLS master equations. In Sec. VII, some simple examples are examined where the operators ${Lk}$ correspond either to the spontaneous and stimulated emission and absorption of photons in a thermal electromagnetic environment, or the case in which we have a single self-adjoint operator inducing pure decoherence on the system.

As commented in Sec. III A, in the case of quantum jumps, the trajectory operator (9) consists of a sequence of no-jump evolution operators $U\Lambda (ti,tj)$ intersected by the instantaneous jumps $Lk(\lambda tj)$. The trajectory operator of the time-reversed measurement record $T\Lambda \u0303(\gamma \u0303(0,\tau ))$ then contains the inverse sequence of operators, but with jumps $L\u0303kj(\lambda \tau \u2212tj)$ associated with the paired index $k\u0303j$ (i.e., making the change $k+\u2194k\u2212$) and the no-jump evolution operators containing the time-reversal driving $U\Lambda \u0303(\tau \u2212ti,\tau \u2212tj)$. Note, however, that $L\u0303k+\u2260Lk\u2212$. To see how Eq. (20) follows from the local detailed balance relation (21), one inserts pairs $\Theta \u2020\Theta =1$ between each the operators inside $T\Lambda \u0303(\gamma \u0303(0,\tau ))$. Then, assuming $\Theta Lk=Lk\Theta $, we obtain from the microreversibility relation for non-autonomous (closed) systems that $\Theta \u2020U\Lambda \u0303\u2020(\tau \u2212ti,\tau \u2212tj)\Theta =U\Lambda (ti,tj)$, meaning that the smooth no-jump evolution does not contribute to the entropy flow.^{53,59} Finally, we use the local detailed balance relation in Eq. (21) to convert the backward jumps as

This leads to recover (20) with the accumulated entropy flow during the interval $[0,\tau ]$ consisting of a sum of the entropy exchanged with the environment in each jump

where, in the second equality, we have rewritten the expression in terms of the stochastic increments ${dNk}$ appearing in the SSE (or SME). Here, the interpretation of the entropy flow in terms of the exchange of physical quantities with the system is associated with the basis in which the jump operators $Lk+$ and $Lk\u2212$ promote the jumps, and that may change during the evolution.

It is also interesting in many applications to extend the above situation to the case in which the environment is composed by several independent reservoirs, such as thermal reservoirs at different temperatures, or particle reservoirs with different chemical potentials. In such case, the entropy exchanged with the environment can be decomposed as the sum over each reservoir contribution $\sigma \Lambda (\gamma (0,\tau ))=\u2211r=1R\sigma \Lambda (r)(\gamma (0,\tau ))$, by identifying the jumps associated with transitions triggered by the different reservoirs $r=1,\u2026,R$, that is,

where $\Delta sk(r)$ is associated with Lindblad jump operators $Lk\xb1$ from reservoir *r* following local detailed balance Eq. (21), and we denoted *J _{r}* the total number of jumps triggered by reservoir

*r*during the trajectory $\gamma (0,\tau )$. In the second equality, we also introduced $Rr$ in the sum to denote the set of channels corresponding to reservoir

*r*.

Performing the average in Eq. (23) over trajectories $\gamma [0,\tau ]$ we obtain

where in the second line we used the decomposition of the evolution over infinitesimal time-steps introduced in Sec. II, and the fact that only the jumps contribute to the entropy flow. We identify the average entropy flow rate as the expression inside the integral above

where in the second equality we split again in the contributions from the different reservoirs. We notice that whenever $\Delta sk(r)=0$ for all $k\u2208Rr$, the entropy flow to the environment *r* vanishes. This is the case, e.g., for purely decoherence processes associated with self-adjoint Lindblad operators, or to the case of infinite temperature reservoirs, where while leading to both jumps up and down on the energy ladder, $L\xb1$, these occur at equal rates $\Gamma +=\Gamma \u2212$ and hence $L\u2212\u2020=L+$.

### C. Microreversibility in diffusive trajectories

The microreversibility relation in Eq. (20) can be extended to diffusive trajectories in some particular cases. Although a derivation for generic situations as in the case of quantum jumps is not available to the best of our knowledge, we provide here some references and hints in this case for the sake of completeness. One case for which Eq. (20) has been derived (although without including the final projective measurement or end-point of the trajectory) is for a single self-adjoint Lindblad operator describing the monitoring of a system observable.^{66} Microreversibility has been also considered for the case of a two-level (qubit) system monitored under Gaussian measurements^{127–130} and the quantity $\sigma \Lambda $ was identified with a measure of the arrow of time. In these studies, the choice of backward operators to time-reverse the trajectory (our operators $T\Lambda \u0303\u2020(\gamma \u0303(0,\tau ))$) lacked a proper normalization and hence do not lead in general to a probability distribution, see also Ref. 131. This problem disappears in the case in which the Lindblad operators of the monitored system are all self-adjoint operators $Lk=Lk\u2020$ as pointed out in Ref. 81. The same issue arose previously also for quantum jumps with the similar definitions provided in Ref. 60, while the proposal in Ref. 66 run into similar problems when applied to general situations beyond the self-adjoint case. Examples of diffusive trajectories based on self-adjoint operators in the thermodynamic context have been considered for a two-level system in the context of state-stabilization,^{66} a driven monitored double quantum dot,^{80} and the circuit QED setup.^{81} The later approach has been further used to implement a circuit QED Maxwell demon as reported in Ref. 77 (this setup will be examined later in Sec. VII).

In the following, we reproduce Eq. (20) for the case in which all operators used in the unraveling ${Lk}k=1K$ verify $\Delta sk=0$ in Eq. (21). This includes (but is not restricted to) monitoring system observables, which corresponds to the case in which all Lindblad operators are self-adjoint, i.e., $Lk=Lk\u2020$ for all $k=1,\u2026,K$. Since each monitored current in the forward process ${Ik(t)\u2009;\u20090\u2264t\u2264\tau}$ is associated with the unraveling of a Lindblad operator *L _{k}*, we associate the time-reversed current ${I\u0303k(t)\u2009;\u20090\u2264t\u2264\tau}$ to the unraveling of the corresponding adjoint-twin of the operator, $L\u0303k$. Assuming the same form for the measurement operators than in the forward process at infinitesimal time-steps, Eq. (14) in Sec. II, but replacing the jump operators by their adjoint-twins, we have

with time-reversed currents $I\u0303k(\tau \u2212t)=Ik(t)$ and ostensible probability ensuring white noise, $\u222bpost(I\u0303k)I\u0303kdt=0$ and $\u222bpost(I\u0303k)(I\u0303kdt)2=dt$ as for the forward process. From the above definition, and by using Eq. (22) for $\Delta sk=0$, we obtain

where we also used that since the twin operators are also in the set of Lindblad operators, $\u2211kL\u0303k\u2020L\u0303k=\u2211kLk\u2020Lk$. We notice that in the general case (i.e., $\Delta sk\u22600$), Eq. (28) is not verified anymore and microreversibility is lost. This is due to the structure of the measurement operators in Eq. (14). Whether one can derive more general forms for the measurement operators in the time-reversed process that verify Eq. (20) is an open question that requires further investigation. Nonetheless, it is worth pointing out that any reduced dynamics of the system admits a representation in terms of Kraus operators that verifies Eq. (20), as explicitly constructed in Ref. 68.

Introducing Eq. (28) for each of the measurement operators in the trajectory generator of the backward process $T\Lambda \u0303(\gamma \u0303(0,\tau ))=\u222bt=0\tau dt\Omega \u0303J(\lambda \tau \u2212t)$ we recover Eq. (20) with the accumulated entropy flow given by

which is in agreement with known results for observables monitoring.^{81} This leads to a zero average entropy flow $\u27e8\sigma \Lambda (\gamma (0,\tau ))\u27e9=0$, as in the quantum jump trajectory case, cf. Eq. (25). We remark that here, as in the case of quantum jumps, a zero entropy flow is not incompatible with extra entropy production in the environment due to manipulations leading to the monitoring scheme itself.

## IV. ENERGETICS AND THE FIRST LAW

Having introduced the complete setup combining the TPM scheme and continuous monitoring of the system and established the microreversibility relation (20), we are now in a position to discuss the energetics of the system and formulate the first law of thermodynamics in a monitored system. In order to do that, we will first characterize the energy changes during the thermodynamic process at the level of single trajectories and then decompose this quantity into heat and work contributions. Work and heat, contrary to energy changes, are not state functions, i.e., they depend on the precise path the system follows during the evolution, and have been often associated with ordered (controllable) and disordered (uncontrollable) forms of energy. We anticipate that this distinction should not be done in an arbitrary way, only based on the subjective view of which part of the energy is useful or not for one's *a priori* purposes. On the contrary, in a consistent thermodynamic approach the disordered character of the energy currents needs to be founded in the reversibility/irreversibility properties of the evolution in connection with the environment, or said in another way, in the fundamental link between energy and entropy.

We start by introducing the expected energy of the system conditioned on the measurement outcomes at any time as $E\gamma (t)=Tr[H(\lambda t)\rho \gamma (t)]$, where $\rho \gamma (t)$ denotes the state of the system conditioned on $\gamma [0,\tau ]$ and $H(\lambda t)$ is the inclusive Hamiltonian of the system including driving contributions. Following this definition, the energy change in the system along the whole trajectory $\gamma [0,\tau ]$ is

which only depends on the initial and final states of the trajectory as given by the projectors $\Pi n00$ and $\Pi n\tau \tau $, respectively, that is, the energy changes is a state function. Notice that Eq. (30) is still in general a difference between expected values for the system energy, and not a difference between energy eigenstates like in the energetic TPM.^{113} That limit is recovered in the specific case for which the system starts in a diagonal state in the initial Hamiltonian basis and the final Hamiltonian is measured at the end. From the energy change values (30) one can formally construct a probability distribution for the energy changes along the process as

### A. Stochastic heat

In order to characterize heat in a generic process, we will need to further specify the environment that produces the open system evolution and its effect on the system dynamics. Let us assume that the environment is composed by a set of reservoirs labeled by the index $r=1,\u2026,R$ that are able to exchange energy or other globally conserved quantities (also called charges) with the system. We notice that treating the case of several conserved quantities we expand the scope of the Review. The reservoirs can then be characterized by a set of temperatures ${Tr}$ and eventually a set of extra potentials ${\mu ri}$ associated with conserved quantities. We define the stochastic heat transferred from each reservoir to the system during the trajectory $\gamma [0,\tau ]$ as

where $\sigma \Lambda r(\gamma (0,\tau ))$ is the entropy flux to the reservoir *r* as discussed in Sec. III from the microreversibility relation (20). We can hence define the probability distribution of the heat to reservoir *r* during the trajectory as

Although Eq. (32) may seem an abstract identification at first sight, its meaning is clarified as soon as we make some extra assumptions that allow us to identify the heat above with the exchange of physical quantities between the system and reservoirs. Note also that from Eq. (29), the heat transferred to the environment in the (microreversible) diffusive trajectories introduced above is zero.

Let us first consider the case in which the reservoir *r* is a thermal reservoir at temperature *T _{r}*, with state $\rho r=exp\u2009(\u2212Hr/Tr)/Zr$,

*H*being the reservoir Hamiltonian, and $Zr=Tr[exp\u2009(\u2212Hr/Tr)]$ the partition function. It exchanges energy with the system through the jump operators ${Lk}k\u2208Rr$ in the system energy basis, with associated energy quanta $\Delta Ek$ representing the line-width of the transitions. Here and in the following, for the ease of notation, we not always indicate explicitly the dependence of the Hamiltonian or of the operators

_{r}*L*with the control parameter

_{k}*λ*. However, it should be intended that such dependence may always exists. We define a “bare” or “effective” system Hamiltonian $HS(\lambda t)$, as the piece of the inclusive Hamiltonian, $H=HS+V$, verifying

where $L\lambda (r)$ is the piece of the Lindbladian associated with the reservoir *r* and $Z=Tr[e\u2212HS/Tr]$. That is, *H _{S}* is the piece of the system Hamiltonian that determine the basis in which energy is exchanged with the reservoirs. We note that it may or may not coincide with

*H*generating the unitary part of the dynamical evolution in the Lindblad master equation, Eq. (1). For example, when the driving is weak,

*H*represents the bare Hamiltonian of the system not including the driving contribution

_{S}*V*, which is treated as a small perturbation of

*H*. This is the case, e.g., for a two-level system coherently driven by a resonant field,

_{S}^{77,80,81}as considered in the examples of Sec. VII, or for the periodic driving of a cavity mode reported in Ref. 68. Another example is compound systems dissipating into local baths coupled by a weak interaction among them, in which case

*H*represents the Hamiltonian of the uncoupled systems and

_{S}*V*their (weak) interaction Hamiltonian. On the other hand for strong driving or strongly interacting compound systems, we generically have

*H*=

_{S}*H*(and hence

*V*=

*0). The entropy changes in Eq. (21) are hence in all these cases*

which can be seen as a consequence of the local detailed balance condition for the rates, ensured by the Kubo–Martin–Schwinger (KMS) condition for the reservoir state.^{132}

Let us now extend the situation to energy and particles reservoirs, $\rho r=exp\u2009(\u2212(Hr\u2212\mu rNr)/Tr)/Zr$ with *N _{r}* the number of particles operator,

*μ*the corresponding chemical potential, and as before $Zr=Tr[exp\u2009(\u2212(Hr\u2212\mu rNr)/Tr)]$. Assuming that the system exchanges simultaneously both energy and particles with the corresponding reservoir

_{r}*r*through the jump operators ${Lk}$ with $k\u2009inRr$, and denoting $NS(\lambda t)$ the number of particles operator in the system (with $[HS,NS]=0$) we have both

leading to a “local” (e.g., for a single reservoir) steady state $L\lambda (r)(exp\u2009[\u2212(HS\u2212\mu rNS)/Tr]/Z)=0$. The entropy changes can then be identified following similar lines as

In many applications such as in setups considering quantum dots coupled to electronic reservoirs, these relations can be further simplified from the so-called tight-coupling condition. The tight-coupling condition establish the proportionality of energy and particle currents as $\Delta Ek=\epsilon k\Delta Nk$ for some parameters *ε _{k}*, see, e.g., the reviews in Refs. 112 and 133 for relevant examples.

The above relations can be extended to generic situations where the reservoir *r* is in a generalized Gibbs ensemble and exchanges a set of globally conserved charges with the system ${Xi}$ for $i=1,\u2026,N$, where $Xi(\lambda t)$ are Hermitian system operators that may also depend on the external control variable *λ _{t}*. Apart from energy and particles, other extra charges may even not commute with the Hamiltonian, like the different components of angular momenta,

^{134–136}or the squeezing asymmetry operator in bosonic fields.

^{10,137}In such generic cases, it is not possible in general to associate the Lindblad jumps operators to the exchange of a single conserved quantity. Nevertheless, we can always associate the entropy changes in Eq. (21) to the collective exchange of charges as

Here, the set ${\nu i(r)}i=1N$ are generalized chemical potentials associated with the *N* conserved quantities in the setup (and reservoir *r*). Only in the case in which all conserved quantities commute, we will have $[Xi,Lk]=\Delta Xk,iLk$ allowing the split of the entropy changes

in the contributions from the stochastic changes $\Delta Xk,i$ associated with the transmission of a quantum of the corresponding charge *i* to the reservoir *r* with generalized potential $\nu i(r)$. Notice that above we would have $\nu i(r)=\u22121$ for energy jumps and $\nu i(r)=\mu r$ for particle jumps. In the commuting case, the heat current to reservoir *r* is decomposed in the empirical currents to that reservoir as

with $X\u0307k(\lambda t)\u2261(dNk/dt)\u2009\Delta Xk,i(\lambda t)$ and we recall that ${dNk}$ are the stochastic increments of the SSE (or SME) associated with detections on reservoir *r*. The average heat current from reservoir *r* reads, in general,

which follows from Eq. (25) upon using the commutation relations in Eq. (38). Notice that we have contributions to the heat current from every conserved quantity, weighed by their corresponding generalized potentials. For energy exchange the above equation reduces to the prototypical expression $\u27e8Q\u0307\Lambda (r)(t)\u27e9\gamma =\u2211k\u2208RrTr[HSDk(r)(\rho t)]$ known in standard scenarios^{138,139} (for a discussion of local dissipation scenarios, see Ref. 140).

In summary, the above definition of heat from the entropy flow in Eq. (32) is a fundamental identification of the “uncontrollable” part of the system energy changes (as well as the changes in other globally conserved quantities) as those that are able to increase or decrease the entropy of the reservoir involved in such exchanges. This is in agreement with the classical notion of heat also used in stochastic thermodynamics^{29,123} or in full counting statistics (FCS)^{112} to describe fluctuations in energy and particle currents. The above characterization of heat along trajectories follows and extends the one in Refs. 53, 54, 63, 64, and 84 for thermal reservoirs. We also notice that our notion of heat has been referred to as “classical heat” in Refs. 66 and 67. However, it is worth remarking that it will capture quantum effects as soon as there are different charges that do not commute with each other, $[Xi,Xj]\u22600$ for some *i*, *j*, for which the heat exchange cannot be decomposed in separate contributions.

### B. Stochastic work

Due to the presence of quantum effects, work becomes a subtle concept in quantum thermodynamics when it comes to fluctuations and its characterization has led to a number of debates about different approaches that one may follow, see, e.g., Refs. 116, 117, and 141–145. Within a closed energy TPM scheme, however, work can be satisfactorily determined from the outcomes of initial and final measurements whenever the initial measurement do not disturb, on average, the system state. This setup has been indeed used to obtain work fluctuation theorems in general closed and open systems alike^{113} (but with the inconvenience that one would need to perform projective measurements in the whole environment). In the present situation, it is worth recalling that our TPM does not determine necessarily energy eigenstates of the system and the environment at the initial nor the final points of the trajectory, and hence, the situation becomes more tricky.

A simple way to avoid difficulties in the characterization of work consists in *assuming* the verification of the first law, so that work is defined as the deficit between the changes in energy during the trajectory and the heat as identified above

This is the approach generically adopted following the identification of heat above.^{53,54,63,64,72,84} However, it was also noticed as early as in the inception of this approach in Ref. 53 that this definition of work cannot be entirely ascribed to the mechanical work associated with the execution of the driving protocol, the latter being

This issue emerges even in the case of a single thermal bath, in stark contrast with classical stochastic thermodynamics. In the following, we will keep the definition in Eq. (42) and decompose $W\Lambda (\gamma [0,\tau ])$ in order to illustrate how all contributions look like in a general setup. In the derivation, we will also discuss some other interpretations given in the literature to different contributions arising inside $W\Lambda (\gamma [0,\tau ])$.

In order to proceed we assume the work in Eq. (42) and consider the instantaneous energy changes in the expected energy of the system, that is,

where we already identified the driving work in Eq. (43). Some previous works proposed to identify the second term in the above equation as a heat current,^{66,80} in analogy to standard master equation situations for systems exchanging energy with thermal reservoirs in the weak coupling limit, as elaborated, e.g., in Ref. 138. Here, we refrain to identify the whole second term in the above equation as a heat current, since such reasoning is not correct in more general cases, e.g., when extra conserved quantities arise (for example, particle exchange). Henceforth, we will not assume such an *a priori* identification, but elaborate the distinction between heat and work from the relation of energy currents with the entropy flow between system and environment (we will turn back to this point later).

Let us now focus in the case of quantum jump trajectories, Eq. (5). We can decompose the second term in Eq. (44) in drift and jumps contributions as

where $Tr[HMk(\rho \gamma )]=Tr[H{Lk\u2020Lk,\rho \gamma}]/2\u2212E\gamma Tr[Lk\u2020Lk\rho \gamma ]$ is non-zero when $\rho \gamma $ shows coherence in the energy basis, and the second term $Tr[HJk(\rho \gamma )]=Tr[HLk\rho \gamma Lk\u2020]/Tr[Lk\u2020Lk\rho \gamma ]\u2212E\gamma $ accounts for the change in the energy of the system during a jump. In order to obtain work contributions from Eq. (45), we can subtract from it the infinitesimal heat increments from each reservoir $dQ\Lambda (r)(t)=\u2212Tr\u2211kdNk(t)\Delta sk(\lambda t)$ as follows from Eq. (32). This will give us two new contributions to work apart from the driving work identified above. Assuming a set of conserved quantities ${Xi}i=1N$ including energy exchange ($X1=H$), we obtain the three following components for the power performed over the monitored system

which correspond to driving, chemical power induced by the extra conserved quantities, and a measurement contribution from the monitoring scheme with zero average. In the following, we give details and provide pertinent comments on the three contributions (see Appendix A for details on the derivation and the more general case where $X1=HS\u2260H$).

The driving power $W\u0307\Lambda drive(t)=Tr[H\u0307(\lambda t)\rho \gamma ]$ was already introduced in Eq. (43) and accounts for both the modulation of the energy levels of the system and the coherent evolution of the energy eigenstates. Its average over trajectories reads $\u27e8W\u0307\Lambda drive(t)\u27e9=Tr[H\u0307(\lambda t)\rho (t)]$, which reproduces the standard identification of driving power in weak-coupling thermodynamics with thermal reservoirs.^{138,139}

In the second contribution in Eq. (46), we identified the chemical work performed by the reservoirs associated with the extra charges *i *>1 as

We notice that $W\u0307\Lambda chem(t)$ cannot be associated with a particular reservoir, but it is a collective contribution, as corresponds to work.^{146} Its average over trajectories simply reads

For the case of commuting charges, $[Xi,Xj]=0$ for all *i*, *j* the above expression (47) simplifies, according to Eq. (40), to

with $\Delta Xk,i$ the changes in each extra conserved quantity *i *>1 as introduced in Eq. (39). For example, for particle exchange, $\Delta Xk,i=\Delta Nk$ represent the number of particles entering the reservoirs and $\nu i(r)=\mu r$ their chemical potentials. Henceforth, Eq. (49) reduces to the standard chemical work.^{123} Notice that, in any case, this contribution to the work is proportional to the stochastic increments $dNk(t)={0,1}$ and is hence of purely stochastic nature (and associated with the quantum jumps). It accounts for work contributions such as electric currents triggered by the exchange of electrons with metallic leads acting as the reservoirs.

### C. Measurement work versus quantum heat

Following the above derivation, the third contribution in Eq. (46) corresponds to the work performed by the continuous measurement process

which shows terms associated with both the drift periods of the evolution and the jumps. This contribution to the work introduces extra fluctuations during the trajectories but its average vanishes since these two terms compensate each other

The fluctuations in Eq. (50) are, however, non-zero in general. They vanish only if the monitored system $\rho \gamma $ is maintained in either an eigenstate of $H(\lambda )$, or in an eigenstate of the operators $Lk\u2020(\lambda )Lk(\lambda )$ for all *k* during the whole trajectory, as it happens in the classical case.

In order to derive Eq. (50), we assumed for simplicity that the entire system Hamitlonian is a conserved quantity between system and environment, i.e., within the set of conserved charges ${Xi}$ we took $X1=H$. In Appendix A, we show that in the case of local energy conservation only in part of the system Hamiltonian, that is $X1=HS$ with $H=HS+V$ (and *V* a weak perturbation) the expression in Eq. (50) is also recovered by simply replacing *H* by *H _{S}*, and adding the extra term in Eq. (A11) that accounts for (zero-average) extra fluctuations induced by the perturbation

*V*.

The appearance of the quantity (50) in the energy balance has been first noticed in Ref. 53 for a dragged dissipative harmonic oscillator and further explored in Ref. 64 for more general situations. Moreover, it was shown to be a crucial term for recovering work fluctuation theorems along trajectories,^{53,64} in line with previous works on the role of projective measurements on the work distribution.^{147,148} This quantity was also studied in Ref. 66, where it was named “quantum heat,” and further considered in several examples in following works.^{67,69,71} While there is not a definitive consensus on the status of the energy contribution in Eq. (50) different arguments in favor of considering it as either work or heat have been given. In favor of calling it quantum heat, it has been argued that it is of stochastic nature, and hence similar to heat exchanges, in contrast to the work exerted by an external coherent field.^{66,149} In favor of the identification as measurement work that we follow here, we have seen that these fluctuations are not related to the exchange of entropy with the environment, which is a fundamental characteristic of work in contrast to heat. In this sense, this stochastic work contribution would be analogous to the work produced by electric currents,^{133} noisy non-conservative forces,^{150} or thermal reservoirs at infinite temperature,^{150–152} all of which are also of stochastic nature.

We also stress that the quantity in Eq. (50) is still an expectation value over the conditional state $\rho \gamma (t)$ which is not directly associated with the result of any energy measurements. In other words, while this energy change is related to the update of our knowledge about the system's energy during the evolution due to the monitoring process, it does not necessary correspond to any “real” (measurable) energy exchange with the measurement apparatus, contrary to the quantities $\Delta Ek$ and $\Delta Xk,i$ above. In this sense, another possible interpretation would be to not identify $W\u0307\Lambda meas(t)$ with any energy exchange, i.e., refraining from making the assumption in Eq. (42) in the first place. A closely related interpretation in the context of a quantum heat engines was recently put forward which describes probabilistic violations of the first law.^{153}

For diffusive trajectories, a similar derivation of the work components applies for the cases considered in Sec. III C, that is, monitoring of system observables or more generally, when the set of Lindblad operators is such that $\Delta sk=0$ for all *k*. In the present case, the stochastic heat is zero according to Eq. (32). We obtain again the three components to the stochastic power in Eq. (46), where now

where $\xi k=dwk/dt$ are white noise contributions from the Wiener increments with zero mean and $\u27e8\xi k\u2217\xi l\u27e9\gamma =\delta k,l$. Since taking the average over trajectories we have $\u27e8\xi k\u27e9\gamma =0$ we again obtain zero average measurement work, $\u27e8W\u0307\Lambda meas(t)\u27e9\gamma =0$. The same arguments as for the case of quantum jump trajectories apply also here, while we recall that in this case either the Lindblad operators are assumed to be self-adjoint or that we have equal rates for complementary jumps.

Finally, we notice that an extra contribution to the total work $W(\gamma [0,\tau ])$ in Eq. (42), comes from the final measurement implemented in the TPM scheme. We include it into the measurement work as

where the second term due to the projective measurement simply reads

This contribution has an average $\u27e8WTPM(\gamma [0,\tau ])\u27e9\gamma =Tr[H(\lambda \tau )[\rho \tau (\tau )\u2212E(\rho 0)]]$ which becomes zero whenever the final measurement of the TPM scheme is either an energy measurement ($[H(\lambda \tau ),\Pi m\tau ]=0$) or when it is performed in the eigenbasis of the (average) system state $[E(\rho 0),\Pi m\tau ]=0$, in which case $\rho \tau (\tau )=E(\rho 0)$.

## V. ENTROPY PRODUCTION AND IRREVERSIBILITY

The second law of thermodynamics establishes that the changes in the entropy of the universe due to an irreversible process are positive. Such statement of the second law is valid in macroscopic thermodynamics, but becomes blurred in the microscopic world, where it is only verified on average.^{28} Nevertheless, it is possible to introduce microscopic quantifiers of irreversibility such as the stochastic entropy production used in stochastic thermodynamics.^{29,123} In the following, we show how the notion of stochastic entropy production can be extended to quantum trajectories in the present framework and then show how general fluctuation theorems can be obtained using this notion and discuss its split into adiabatic and non-adiabatic components, accounting for different sources of irreversibility.

### A. Stochastic entropy production

Quantum versions of the stochastic entropy production have been indeed introduced in TPM schemes^{114} and extended to quantum jump trajectories^{59} and to general completely positive and trace preserving (CPTP) maps^{64,68} (for a recent review on the subject, see Ref. 154). The two main ingredients for the construction of stochastic entropy production along quantum trajectories are the identification of a stochastic entropy associated with the system state along a trajectory, and the entropy flux transferred to the environment. We identify the changes in the entropy of the system along a quantum trajectory $\gamma [0,\tau ]$ as

which correspond to the changes in Shannon self-information or surprisal of the system between the initial and final end-points, as in the classical case.^{119,120} We notice that for being the quantity $\Delta S(\gamma [0,\tau ])$ well-defined, the initial and end-points of the trajectories as specified in the TPM are needed. This is also a requisite in order to recover the changes in the von Neumann entropy of the system when the average over trajectories is performed

with $SvN(\rho )=\u2212Tr[\rho \u2009log\u2009\rho ]$, and $\rho \tau $ being the system state after the final measurement. We notice that related proposals not using a TPM^{60,66,67} unfortunately do not verify, in general, Eq. (56), hence leading to nonstandard entropy production definitions.

The microreversibility relation for the trajectory operators in Eq. (20) implies that the entropy flow to the environment is related to the conditional probabilities of observing the forward and time-reversed trajectories

which have been shown [according to Eq. (20)] to be independent of the initial and final outcomes of the TPM, *n*(0) and $n(\tau )$, unlike the forward and backward conditional probabilities itself, cf., Eqs. (16) and (17), respectively. The entropy flow has been related to the changes in the entropy of the reservoir(s) by analyzing the underlying generalized measurement scheme at each infinitesimal time-step of the quantum trajectory dynamics^{68} (see also Ref. 149). Such analysis leads to the identification of the entropy flow with the von Neumann entropy change of the reservoir due to the interaction with the system plus an extra non-negative term accounting for the internal relaxation of the reservoir back to its equilibrium state

where we denoted *ρ _{r}* and $\rho r\u2032$ the density operator of the reservoir

*r*before and after the evolution step from

*t*to

*t*+

*dt*, respectively, and $S(\rho A||\rho B)=Tr[\rho A(log\u2009\rho A\u2212log\u2009\rho B)]\u22650$ is the quantum relative entropy.

^{155}We notice that this expression is in agreement with previous results derived at the ensemble level for a single thermal reservoir

^{156,157}and for more general collisional dynamics

^{152,158,159}(for a recent review, see Ref. 160). Moreover, we notice that the total entropy changes in the environment may have extra terms as well due to other mechanisms implicit in the monitoring scheme and apart from the interaction with the system, as indeed happens in some decoherence models.

^{161}

The entropy production during the trajectory $\gamma [0,\tau ]$ can then be defined as the sum of the changes in the entropy of the system plus the changes in entropy of the environment due to the entropy flow

where in the second line we split the entropy flow in contributions from each reservoir and used the identification of the stochastic heat in Eq. (32). Equations (59) and (60) are the extension to quantum trajectories of the stochastic entropy production employed in stochastic thermodynamics^{29,123} and can be particularized for a number of cases of interest. For example, in the isothermal situation (*R *=* *1), $1/Tr\u2261\beta $, using the first law in Eq. (42) we have

where we introduced the stochastic non-equilibrium free energy changes along the trajectory, $\Delta F(\gamma [0,\tau ]))=\Delta E(\gamma [0,\tau ])\u2212T\Delta S(\gamma [0,\tau ])$. We recall that in the above equation the work done during the trajectory includes, in general, the three contributions highlighted in Eq. (46).

It is worth mentioning at this point that one may be tempted to use Eq. (57) as a definition of the entropy flow to the environment $\sigma \Lambda (\gamma (0,\tau ))$, without relying into Eq. (20). That would allow to, e.g., consider more general diffusive trajectories beyond the $\sigma \Lambda (\gamma (0,\tau ))=0$ cases. This is an interesting route which merits further exploration. However, the weakness of such an approach is that it misses to constrain the measurement operators in the backward process to be both normalized and able to reverse the trajectories, so extra care would be needed. This in turn may introduce extra irreversibility^{129} and an extra dependence of $\sigma \Lambda $ on the initial and final outcomes of the trajectories *n*_{0} and $n\tau $.^{128}

Another interesting approach that bypass some of the problems regarding the definition of entropy production under diffusive measurements involves an alternative definition of entropy production based on the Wigner function and Wigner entropy,^{162} the so-called Wigner entropy production rate,^{163} which can be applied to general Gaussian setups. The Wigner entropy production coincides with the standard entropy production in the high temperature limit and is well-suited for studying zero-temperature environments. In Ref. 82, this approach was used to single out the entropy flux to the environment and the information rate gathered by the continuous monitoring process, hence extending the Sagawa–Ueda second-law inequality with information beyond discrete measurements for Gaussian systems, which was experimentally tested in an optomechanical setup.^{83}

### B. Fluctuation theorems

The definition of the trajectory entropy change in Eq. (55) and the microreversibility relation leading to Eq. (57) implies that the entropy production becomes a measurement of irreversibility along trajectories,^{53,59,64,68} verifying the detailed fluctuation theorem:

Its average can be identified with the distinguishability between forward and time-reversed trajectories as in the classical case:^{164}

where $DKL[{pn}||{qn}]=\u2211npn\u2009log\u2009(pn/qn)$ denotes the Kullback–Leibler divergence, which is non-negative $DKL[{pn}||{qn}]\u22650$ and becomes zero only for equal probability distributions. It is a classical version of the quantum relative entropy and measures the information lost when approximating ${pn}$ with ${qn}$.^{165}

From Eq. (62), it is immediate to obtain the integral fluctuation theorem:

which constrains several properties of the entropy production fluctuations, $P(Stot)=\u2211{\gamma}P(\gamma [0,\tau ])\delta (Stot\u2212Stot(\gamma [0,\tau ]))$. For example, Eq. (64) implies an exponential tail for the probability of negative entropy events:

where $x\u22650$. In the isothermal situation, Eq. (61), this relation becomes a statement about the probability to extract work out of the system on the top of the free energy change, $P(W\u2264\Delta F\u2212x)\u2264e\u2212x$, where again *x *>0, while Eq. (64) becomes a generalized version of the Jarzynski equality.^{28} Moreover, the fluctuation theorem in Eq. (64) directly implies, by means of Jensen's inequality $\u27e8eX\u27e9\u2265e\u27e8X\u27e9$, the second-law inequality

The detailed fluctuation theorem in Eq. (62) becomes a particularly stronger statement in the case of time-symmetric driving $\Lambda =\Lambda \u0303$, such as for constant Hamiltonian or some instances of periodic driving, leading to a non-equilibrium steady state of the system. In that cases, whenever the system starts in the long-time (asymptotic) steady state of the dynamics $pn0=\pi n0$, Eq. (62) reproduces the so-called Evans–Searles^{166} or Gallavoti–Cohen^{167,168} fluctuation theorem

which links the two tails of the probability density $P(Stot)$ in the forward process. In the quantum scenario, it has been typically used to describe the statistics of energy and other currents in nonequilibrium steady states.^{112,113} In Ref. 72, the fluctuation relation (67) has been extended to transitions between thermal steady states for driving dynamics much slower than the system relaxation time-scales,^{169} and a similar identity for the joint probability of work and entropy production fluctuations, has been used to obtain finite-time corrections to the Carnot efficiency.^{89}

It is worth remarking that the correct identification of the operators in the backward process through the micro-reversibility relation in Eq. (20) is crucial to recover the correct expression of the stochastic entropy production and the integral fluctuation theorem in Eq. (64). Some attempts to define the stochastic entropy production omitting the TPM lead to the break of the integral fluctuation theorem by a efficacy-like parameter *α*, such that $\u27e8e\u2212Stot\u27e9=\alpha \u22641$, which depends on the unraveling details.^{60} A similar situation arises for related definitions of an arrow of time indicator^{127,130} where the efficacy term have been shown to be a form of so-called absolute irreversibility.^{129} Such extra source of irreversibility can be avoided in the TPM framework presented here, while absolute irreversibility in general will not appear whenever the density operators for the initial states of forward and time-reversal processes share the same support.^{170} Recently, other general fluctuation relations for quantum jump trajectories based on generic symmetries other than time-reversal have been derived in the long-time limit using large deviation theory.^{171}

## VI. DECOMPOSITION OF ENTROPY PRODUCTION

We have seen that the stochastic entropy production in Eq. (59) contains two terms, one related to the change in entropy of the system and another related to the entropy that is transferred to the environment. In the following, we will see that the entropy production can be instead split in other meaningful ways, whose parts separately verify fluctuations theorems. Such splits refine our understanding of the second law at the level of fluctuations, since the contributions retain many of the nice properties and constraints mentioned before and provide further insight on the energetics. We will focus in two particular splits of the entropy production: the first split is based on the adiabaticity of the evolution and comes from the context of stochastic thermodynamics for nonequilibrium transitions between steady states. The second split is instead a genuine partition of the entropy production along quantum trajectories based on the effects of the measurement and allows the characterization of quantum effects on the entropy production statistics.

### A. Adiabatic and nonadiabatic entropy production

The total entropy production can be decomposed in two components related to different sources of irreversibility arising in nonequilibrium transitions among steady states.^{172} In the context of stochastic thermodynamics, these contributions have been called the adiabatic and nonadiabatic entropy production^{173,174}

and correspond, respectively, to the irreversibility arising from the breaking of detailed balance due to either nonequilibrium environmental conditions and external driving. They have been shown to verify separate fluctuation theorems,^{173} generalizing a series of previous results^{175,176} regarding the heat needed to maintain a nonequilibrium steady state (house-keeping heat) and dissipated when driven far from it (excess heat), see, e.g., the review.^{29}

The split of the entropy production into adiabatic and non-adiabatic contributions along quantum jump trajectories [Eq. (68)] has been first considered in Ref. 59 and then extended to more general setups and generic quantum operations in Refs. 64 and 68. Here, we will follow the general derivation reported there. We assume $\pi \lambda $ to be an instantaneous invariant state of the Lindbladian, verifying $L\lambda (\pi \lambda )=0$. Notice that although $\pi \lambda $ would be unique in many cases of interest, we do not impose that condition generically. Moreover, it follows from the expressions for the Lindblad operators in the backward process in Eq. (22) that $\pi \u0303\lambda \tau \u2212t=\Theta \pi \lambda t\Theta \u2020$ is the instantaneous invariant state of the time-reversed dynamics, $L\u0303\lambda (\pi \u0303\lambda )=0$, where the generator $L\u0303\lambda $ is given in Eq. (18).

Following Refs. 64 and 68, the split can be performed by introducing the nonequilibrium potential operator, namely, $\Phi \lambda \u2261\u2212log\u2009\pi \lambda $, which is a quantum version of the nonequilibrium potential used by Hatano and Sasa.^{175} The split can be performed if the jump operators verify the condition

for a set of real numbers ${\Delta \varphi k}$, which also implies $[\Phi \lambda ,Lk\u2020Lk]=0$. The above equation implies that the Lindblad operators produce jumps (or coherent combinations thereof) in the $\pi \lambda $ basis with a definite change in the nonequilibrium potential given by $\Delta \varphi k(\lambda )$. In addition, the Hamiltonian contribution in the Lindblad equation would need to verify $[H(\lambda ),\varphi \lambda ]=0$, which imply that the jumps are in the energy $H(\lambda )$ basis. However, we remark that, in some cases, the later condition can be avoided by transforming the Lindblad equation to a rotating frame.

When Eq. (69) is verified, one can introduce the dual and dual-reversed processes, which are similar to the forward and backward processes, respectively, but they are characterized by modified jump operators that verify relations similar to Eq. (22) but involving changes in the nonequilibrium potential (see Appendix B for details). This allow us to obtain the probability of trajectories in the dual process, $P\Lambda +$, and the probability of time-reversed trajectories in the dual-reverse process $P\Lambda \u0303+(\gamma \u0303[0,\tau ])$. Then, using similar methods than the ones used for obtaining the detailed fluctuation theorem in Eq. (62) one can verify the following relations that constitute the definition of the adiabatic and nonadiabatic entropy production along quantum trajectories

Notice that while the non-adiabatic entropy production depends on the system entropy changes and hence on the initial and final trajectory outcomes *n*_{0} and $n\tau $, the adiabatic entropy production only depends on the environmental monitoring record $\gamma (0,\tau )$. This is in accordance with the notion that the adiabatic entropy production is entirely due to environmental nonequilibrium constraints.

The stochastic adiabatic entropy production $Sad(\gamma [0,\tau ])$ vanish if the sole effect of the entropy flow is to produce a modification in the state of the system, e.g., pushing it toward the instantaneous steady state $\pi \lambda $. Then, $\sigma \Lambda (\gamma (0,\tau ))=\u2212\Delta \Phi (\gamma (0,\tau ))$, or alternatively $\Delta sk=\u2212\Delta \varphi k$, case in which all the entropy production is nonadiabatic.^{68} The most paradigmatic case in which this situation is verified is in the presence of a single thermal reservoir. However, as soon as various reservoirs with different temperatures or chemical potentials are considered, the adiabatic contribution becomes in general non-zero, since some part of the entropy flow from one reservoir is damped into the others. In such general situations, some care must be taken to not confuse the total entropy production with the nonadiabatic part. On the other hand, the stochastic nonadiabatic entropy production $Sna(\gamma [0,\tau ])$ vanishes when the system is always maintained in the instantaneous steady-state of the dynamics and the latter is still far from equilibrium. In such case all the entropy production is adiabatic, as situation that is verified, e.g., in heat engines and refrigerators working continuously in non-equilibrium steady states.^{139}

The above equations (70) and (71) lead to relations analogous to Eq. (63) for the average of the adiabatic and nonadiabatic entropy productions in terms of the Kullback–Leibler divergence

and integral fluctuation theorems

which generalize the Speck–Seifert^{176} fluctuation theorem and the Hatano–Sasa relation,^{175} respectively. Equations (70) and (71), together with (74) constitute the quantum version of the fluctuation theorems for the adiabatic and nonadiabatic entropy productions obtained in Ref. 173.

Some extra insight can be obtained by explicitly calculating the average nonequilibrium potential changes rate^{68}

where we used the commutation relation in Eq. (69). Using this expression, we can now provide a closed expression for the average nonadiabatic entropy production rate as^{62,68}

where we used the explicit form of the nonequilibrium potential operator $\Phi \lambda t=\u2212log\u2009\pi \lambda t$ and the fact that $[\Phi \lambda ,H(\lambda )]=0$. From Eq. (76), it immediately follows that for quasi-static processes for which $\rho t\u2243\pi \lambda t$ then $\u27e8S\u0307na\u27e9\gamma \u22430$. Moreover, we observe that in the absence of driving, e.g., in relaxation processes, the above expression becomes the entropy production derived by Sponh, $\u27e8S\u0307na(t)\u27e9\gamma =\u2212ddtS(\rho t||\pi )$.

Using Eq. (41) and the expression obtained before for the average entropy flow rate in Eq. (25), the average adiabatic entropy production rate turns out to be

It therefore follows that the adiabatic entropy production becomes zero if the nonequilibrium potential has the form $\Phi \lambda t=\u2211i\nu riXi(r)(\lambda t)$, which is the case if the instantaneous steady-state is in equilibrium, $\pi \lambda \u221de\u2212\u2211i\nu i(r)Xi/Tr$. This is the case for a single reservoir, but cannot be verified whenever there are several reservoirs at different temperatures *T _{r}* and e.g., chemical potentials

*μ*.

_{r}We remark that the conditions given in Eq. (69) are stronger that the ones needed to ensure a well-defined time-reversed dynamics verifying the detailed fluctuation theorem in Eq. (62) for the total entropy production. Indeed, there are relevant cases where Eq. (62) is verified while condition (69) is not. An explicit example was analyzed in Ref. 68 for a periodically driven harmonic oscillator, where the coherent driving is weak enough to not modify the structure of the thermal dissipator, while inducing coherence in the steady state (see also the first example in Sec. VII for a similar situation). Another relevant situation comprises cases with extended interacting systems and local dissipation. In that case the Lindblad operators associated with the local dissipators do not necessarily promote jumps in the basis of the global steady state of the system, due to the presence of a coherent coupling. Examples of this kind of dynamics are some models of quantum autonomous refrigerators^{177,178} and other thermal machines used for entanglement generation.^{179}

The cumulants of the nonadiabatic entropy production along quantum jump trajectories has been explicitly obtained in Ref. 72 for slowly driven processes in contact with a single reservoir [where Eq. (69) is typically satisfied] by constructing a two-variables moment generating function involving also the nonadiabatic work.^{180} These results were subsequently applied to quantum heat engines working within the slow-modulation regime to obtain bounds on the efficiency at finite time.^{100}

### B. Uncertainty and Martingale entropy production

Very recently, a new decomposition of the entropy production has been proposed based on an extension of the so-called Martingale theory for entropy production^{181–185} to quantum trajectories.^{101,102} Although we will not discuss here Martingale theory for entropy production, we can fully introduce this decomposition of entropy production with the elements at hand. This decomposition results particularly useful in order to split the entropy production into classical and quantum contributions at the level of single trajectories, and highlights the entropic effects due to the end-point projections in the TPM scheme.

The decomposition of the entropy production is based on a different notion of the entropy of the system as given by the logarithm of the quantum fidelity between the density operator $\rho \tau $ of the average dynamics and the stochastic wave function given by the SSE $|\psi \gamma (\tau )\u27e9$ just prior to the final application of the projectors ${\Pi n\tau}$. That is,^{101,102}

Here, we assumed for simplicity that the stochastic evolution has no extra classical sources of uncertainty and is hence described by the SSE. However, the definition can be extended to the case of the SME as $S\rho (\tau )\u2261\u2212log\u2009Tr[\rho \tau \rho \gamma (\tau )]$, which is no longer the logarithm of a precise fidelity in general (like Uhlmann's fidelity for mixed states). In any case, we notice that this notion of entropy differs from the system entropy used in Eq. (55). In particular, Eq. (78) reduces to the standard surprisal only when the stochastic wave function at time *τ* remains in an eigenstate of the density operator at the final time $\rho \tau $, i.e., when $\u27e8\psi \gamma (\tau )|\Pi k\tau |\psi \gamma (\tau )\u27e9=\delta l,k$ for some *l*, which is not the case in general. As a consequence, by averaging Eq. (78) along trajectories we do not recover von Neumann entropy $\u27e8S\psi (\tau )\u27e9\u2260SvN(\rho \tau )$.

Using the notion of entropy above we can then decompose the entropy production as

The first term is called the uncertainty entropy production and reads

where $S\psi $ is the fidelity-based entropy introduced in Eq. (78). Hence, $Sunc(\gamma [0,\tau ])$ corresponds to the part of the entropy production due to the final projection of the monitored system. The uncertainty entropy production is of quantum origin and becomes zero in the classical case, since in that case the system state is always an eigenstate of its density operator (and of any other observable). It can be interpreted as a disturbance due to the final projective measurement when the state $|\psi \gamma (\tau )\u27e9$ shows an intrinsic (quantum) uncertainty. It is worth remarking in this context that $Sunc(\gamma [0,\tau ])$ is nonzero even when the projectors ${\Pi k\tau}$ are chosen to be in the basis of $\rho \tau $.

In addition, $Sunc$ can be shown to be bounded by the log-ratio of the minimum and maximum eigenvalues of the density operator $\rho \tau $^{101}

where we denoted $pmax\tau =maxkpk\tau $ and $pmin\tau =minkpk\tau $.

The second term in Eq. (79) has been called the martingale entropy production, because it is an exponential martingale, a particularly strong property which, in particular, also implies the integral fluctuation theorem. The explicit form of the martingale entropy production reads

which remarkably does not depend on the end-point of the trajectory, i.e., the outcome of the final projective measurement $n\tau $. The entropy production in Eq. (82) represents somehow a “classicalized” or “smoothed” version of the entropy production $\Delta Stot(\gamma [0,\tau ])$ on which (at least part of) the quantumness is not present anymore, in the sense that the part due to the intrinsic uncertainty in the system state has been removed. As can be appreciated the martingale entropy production $Smar(\gamma [0,\tau ])$ is an extensive quantity, in contrast to $Sunc(\gamma [0,\tau ])$, since it contains the entropy flow $\sigma \Lambda (\gamma (0,\tau ))$. In Refs. 10 and 102, both the uncertainty and the martingale entropy productions have been shown to verify an integral fluctuation theorem in both steady-state and generic evolutions

which in particular imply the second-law-like inequalities

together with the other properties of the integral fluctuation theorems regarding the negative tails of the distributions of both $Sunc(\gamma [0,\tau ]$ and $Smar(\gamma [0,\tau ])$. The non-trivial fact that $\u27e8Sunc(\gamma [0,\tau ])\u27e9\u22650$ also implies that the total entropy production can be lower bounded by the martingale one

The above inequality represents an useful bound since $Smar(\gamma [0,\tau ])$ does not depend on the final projection $\Pi n\tau \tau $ and might hence be obtained in real time only from the monitored record $\gamma (0,\tau )$ and the initial preparation of the system state. Indeed, $Smar(\gamma [0,\tau ])$ becomes particularly crucial when considering stopping times (e.g., first-passage times, escape times, etc.) or gambling strategies, since in those cases one would like to decide to stop (or not) the process before introducing any disturbance into the system.^{102} We remark that the bound in (85) becomes tight in the long time limit, since $Sunc(\gamma [0,\tau ])$ is bounded, while $Smar(\gamma [0,\tau ])$ is extensive in time and hence $\u27e8Stot(\gamma [0,\tau ])\u27e9\gamma \u2243\u27e8Smar(\gamma [0,\tau ])\u27e9\gamma $ when $\tau \u2192\u221e$.

## VII. SIMPLE EXAMPLES

### A. Quantum jumps of a driven two-level system in a thermal environment

As a first example we consider a single two-level system driven by a coherent field in contact with a thermal environment at a finite temperature *T*, whose emission and absorption of excitations (e.g., photons) are monitored. We denote the Hamiltonian of the two-level system (without driving) as $HS=\omega |1\u27e9\u27e81|$, with system computational basis ${|0\u27e9,|1\u27e9}$. The driving is assumed to be weak and resonant with the two-level system. It induces an extra time-dependent term reading $V(t)=\epsilon (e\u2212i\omega t\sigma ++ei\omega t\sigma \u2212)$, with $\sigma \u2212\u2261|0\u27e9\u27e81|$, $\sigma +\u2261|1\u27e9\u27e80|=\sigma \u2212\u2020$, and driving strength $\epsilon \u226a\omega $. In order to make contact with the thermodynamic framework for trajectories, we identify the control parameter as $\lambda (t)=\epsilon ei\omega t$, and hence, Λ represents a cyclic protocol running during an arbitrary interval of time $[0,\tau ]$. Moreover, we assume that the driving is instantaneously switched on at the beginning of the protocol and switched off at time *τ*, that is $\lambda (0)=\lambda (\tau )=0$.

The master equation governing the unconditional dynamical evolution of the dissipative-driven system is given by Eq. (1), with $H(\lambda )=HS+V(\lambda )$ and two Lindblad (jump) operators, ($k=+,\u2212$), associated with emission and absorption events reading

which verify $L\u2212=e\u2212\omega /TL+\u2020$, with $\Gamma 0$ the spontaneous emission rate and $n\xaf=(e\omega /T+1)\u22121$ the average number of excitations in the thermal (bosonic) environment with frequency *ω*. The above master equation in Lindblad form can be derived using standard methods in open quantum systems such as the Born–Markov and Secular approximations, and possess a single nonequilibrium steady state $\pi (t)$ which follows a closed unitary orbit, $\pi \u0307=\u2212i[HS,\pi ]$, due to the presence of coherences in the *H _{S}* basis.

^{55}

For assessing the thermodynamics during trajectories within the TPM, we assume the initial state of the system to be sampled from the local Gibbs state of the system before the driving is applied, $\rho 0=e\u2212\beta HS/Z$ with $Z=Tr[e\u2212\beta HS]=1+e\u2212\beta \omega $, at the (inverse) environmental temperature $\beta =1/T$. Therefore, the two possible initial states of the system are either $|0\u27e9$ or $|1\u27e9$ with probabilities $p0=1/Z$ and $p1=e\u2212\beta \omega /Z$, that is, $\Pi n0={|n\u27e9\u27e8n|},$ for *n *=* *0, 1. As for the final projectors, we consider the simplest situation where they are given by the basis of the density operator at the final time, $E(\rho 0)$, i.e., no extra disturbance at the unconditional level ($[\Pi m\tau ,E(\rho 0)]=0$).

When the emission and absorption processes are (efficiently) monitored during the evolution, the state of the system conditioned to detections can be described by the stochastic Schrödinger equation

where the Poissonian stochastic increments $dN\xb1(t)$ are zero almost all the time interval except when any jump of type $k=\xb1$ is detected, in which case they become 1. An example of the evolution of the state of the system in the Bloch sphere of the two-level system is provided in Fig. 2(a). A trajectory starts in the circle point marking the ground state and is driving up along the surface of the sphere while rotating at frequency *ω*. At some point an emission is detected producing a jump in the system back to the ground state (straight line), followed by a second period of rotation where the system is again directed toward the equator of the sphere up to the diamond point.

We also notice that in some situations (e.g., photocounting) detection of absorption events $dN+$ may be difficult to implement and hence require some detection engineering, like, e.g., using an auxiliary highly unstable third level $|2\u27e9$ from which emissions $|2\u27e9\u2192|1\u27e9$ can be photocounted.^{67} In superconducting qubits, this problem can be overcome by implementing a high-precision detection of the temperature variations due to the jumps that are produced in a resonator acting as the thermal reservoir.^{95}

The jump operators (86) do not depend on the control parameter *λ* and promote jumps in the bare Hamiltonian basis *H _{S}*, i.e., $[HS,L\xb1]=\xb1\omega L\xb1$, in accordance with Eq. (34) for energy jumps. It can be easily checked that the dissipative part of the unconditional evolution, $D+(\rho )+D\u2212(\rho )$, has a single invariant state of Gibbs form, $e\u2212HS/T/Z$ (but the steady state of the entire dissipative-driven dynamics is not of Gibbs form). Therefore, we can identify the energy change in the system during the jumps as $\Delta E\xb1=\xb1\omega $, corresponding to a photon absorbed (emitted) from (into) the environment. In addition, we observe that since the set of Lindblad operators is complete in the sense introduced in Sec. III, we obtain the local detailed balance for the jump operators in Eq. (21) with associated entropy changes

confirming that the energy quanta exchanged with the reservoir during the jumps can be interpreted as heat. This is all what we need to characterize the heat over trajectories. Substituting the form of $\Delta s\xb1$ in Eqs. (23) and (32), we obtain

thus the heat along the trajectory is the net energy absorbed from the reservoir during the jumps, i.e., energy absorbed with jumps of type $k=+$ minus energy released in the jumps of type $k=\u2212$, during the interval $[0,\tau ]$.

We now turn our attention to the total work, $W\Lambda (\gamma [0,\tau ])=\Delta E\Lambda (\gamma [0,\tau ])\u2212Q\Lambda (\gamma [0,\tau ])$ and its three contributions as introduced in Eq. (46). First we notice that since there is a single conserved quantity (the energy) the chemical work contribution associated with extra conservation laws is zero in this case. The driving contribution can be calculated from Eq. (43) and reads

where the two terms in the first line correspond, respectively, to the work needed to switch on and off the driving at the beginning and end of the protocol. Since the initial state is diagonal in the *H _{S}* basis, we have $Tr[\Pi n0V(0)]=0$, i.e., no work is needed to switch on the driving. Moreover, since the steady state also verifies $Tr[V\pi ]=0$, we have also zero switch- off work cost in this case.

The work contribution due to continuous measurement is from Eq. (50)

where we recall that the first line is due to the final projective measurement at time *τ*, and $E\gamma (t)=\u27e8H(\lambda t)\u27e9$ is the instantaneous expected energy of the driven two-level system conditioned on the continuous measurement record.

In Fig. 2(b), we show the energy change $\Delta E\Lambda (\gamma [0,\tau ])$, heat $Q\Lambda (\gamma [0,\tau ])$ and total work $W\Lambda (\gamma [0,\tau ])$ evaluated along a sample trajectory starting in the ground state [the first part of the trajectory is depicted in the Bloch sphere in Fig. 2(a)]. The energy changes in the qubit reveal the Rabi oscillations followed by the two-level system during the no-jump periods, which are interrupted by the jumps associated with the emission and adsorption events. Heat is exchanged with the thermal environment only during the jumps, and we can appreciate three emission events (downstairs jumps) and two absorption ones (upstairs jumps). Instead, work is realized or extracted during both no-jump periods and jumps, contrary to the classical case. In Fig. 2(c), the total work is split into the driving $W\Lambda driving(\gamma [0,\tau ])$ and measurement $W\Lambda meas(\gamma [0,\tau ])$ contributions introduced in Sec. IV B, which are shown for the same trajectory. The driving contribution is continuous during the whole trajectory and shows a smooth behavior between jumps, reflecting the work performed to generate the Rabi oscillations. The jumps instead do not contribute to the driving work, but its detection produce cusps on it. On the other hand, the measurement work suffers abrupt changes owing to its stochastic nature and it is monotonous and slightly decreasing between jumps. This reflects the fact that when no jumps are detected the system is more likely in its ground state implying that less work have been employed in driving it from its initial (ground) state. In a similar way, detection of a emitted excitation suddenly increases the conditional work, since we just learn that energy (provided previously by the drive as work) has been dissipated into the environment, and the other way around for absorption events.

We are also interested in the stochastic entropy production in this example and its fluctuations and contributions. The stochastic entropy production, as given by Eq. (59), reduces to the expression for a single thermal reservoir $Stot(\gamma [0,\tau ])=\beta (W(\gamma [0,\tau ]\u2212\Delta F)$ given in Eq. (61), where $\Delta F(\gamma [0,\tau ])=\Delta E(\gamma [0,\tau ])\u2212T\Delta S(\gamma [0,\tau ])$ is the stochastic nonequilibrium free energy. We plot $Stot(\gamma [0,\tau ])$ in blue in Fig. 3(a) by assuming virtual end measurements performed at each value of the final time *τ*. High-frequency noisy changes in the entropy production reflect the quantum fluctuations associated with the final measurement and pinpoints the intervals in which the stochastic wave function $|\psi \gamma (t)\u27e9$ is in a superposition of the density operator eigenstates. The decomposition into uncertainty and martingale components in Eq. (79) is shown by means of the dashed orange line. As can be appreciated, the above quantum fluctuations are absent in the martingale entropy production, leading to a smooth version of the total entropy production, showing abrupt changes only corresponding to the energy jumps in the two-level system. The effect of the Rabi oscillations can be also appreciated in the evolution of $Smar(\gamma [0,\tau ])$ during the no-jump intervals. The local maxima and minima during such intervals correspond to zero quantum fluctuations, i.e., the stochastic wave function $|\psi \gamma (\tau )\u27e9$ prior to measurement becomes one of the eigenstates of the density matrix $\rho (\tau )$ at that time. The uncertainty entropy production (not shown in the figure) is the difference between $Stot(\gamma [0,\tau ])$ and $Smar(\gamma [0,\tau ])$, hence capturing only the high-frequency quantum fluctuations produced in the final measurement. In Fig. 3(b), we show the convergence of the three different fluctuation theorems for the total $\u27e8e\u2212Stot\u27e9\gamma $ (blue), martingale $\u27e8e\u2212Smar\u27e9\gamma $ (orange), and uncertainty $\u27e8e\u2212Sunc\u27e9\gamma $ (green) entropy production as a function of the number of trajectories employed in the simulations for three different final times $\omega \tau $ (see caption). We can see a good convergence in the three cases, being the uncertainty entropy production fluctuation theorem the one that converges more quickly to 1. In the inset, we provide estimations of the total entropy production and uncertainty probability distributions, $P(\Delta Stot)$ and $P(Sunc)$, respectively, for a fixed final time $\omega \tau =2500$. As we can appreciate the entropy production distribution is close to a Gaussian with positive mean $\u27e8\Delta Stot\u27e9\gamma \u22650$. The uncertainty entropy production instead displays a large peak but also some secondary peaks at both positive and negative sides. Since $Sunc$ is a bounded non-extensive quantity over time, the whole distribution is closer to zero as compared with $P(\Delta Stot)$.

On the other hand, the split into adiabatic and non-adiabatic entropy production contributions in Eq. (68) cannot be implemented in this setup. This is because the condition in Eq. (69) is not verified, since the jumps promoted by the Lindblad operators are not eigenoperators of the steady state $\pi (\lambda )$ and hence of the nonequilibrium potential $\Phi (\lambda )$, breaking the fluctuation theorems in Eqs. (74). This sets apart this configuration from any classical jump process, for which the adiabatic and non-adiabatic entropy production are always well defined and remarks the importance of quantum effects in the fluctuations. In this respect, the situation is very similar to the weakly driven cavity mode dissipating into a thermal environment considered in Ref. 68, where the break of the split leads to an adiabatic entropy production which would be negative on average.

### B. Nondemolition monitoring of a driven superconducting qubit

As a second example, we consider the case of a coherently driven superconducting qubit over which a dispersive measurement of energy is applied.^{80,81} This setup has been experimentally implemented in Ref. 77 using a transmon qubit coupled to a 3D aluminum cavity to implement a Maxwell demon. No further contact with a thermal reservoir is assumed. The qubit does not exchange energy with the cavity mode, so that it acts as a dephasing environment for the qubit, induced by the continuous (homodyne) measurement of the cavity.

The Hamiltonian of the qubit is again $H(\lambda )=HS+V(\lambda )$, where the free system Hamiltonian reads $HS=(\u2212\omega q/2)\sigma z$, and the driving contribution $V(\lambda )=\u2212i\sigma y\lambda $ with $\lambda (t)=\Omega R\u2009cos\u2009(\omega qt)$ the control parameter inducing the driving. We assume again a weak driving $\Omega R\u226a\omega q$. The coupling with the cavity mode is assumed to be of the form $Hint=\u2212\xi \sigma za\u2020a$, with *a* and $a\u2020$ the ladder operators of the cavity mode, so that $[HS,Hint]=0$. The cavity has energy $Hc=\omega ca\u2020a$ and is coherently probed to acquire information about the state of the system.^{77} This leads to a diffusive trajectory over the qubit, with a noisy output signal proportional to *σ _{z}*.

In this situation, the unconditional state evolution of the system can be described by a Lindblad equation implementing pure dephasing over the qubit, with a single Lindblad operator $Lz=\kappa \sigma z$, where *κ* is a constant characterizing the strength of the measurement. We note that since we have a single self-adjoint Lindblad operator, $Lz=Lz\u2020$, the micro-reversibility relation for diffusive trajectories stated in Sec. III C holds. Moreover, there the steady state of the evolution is not unique in this case: any state of the qubit diagonal in the *H _{S}* basis is invariant under the action of the environment. In particular, the maximally mixed state $\pi =1/2$ is also an invariant state, that is, the map generating the dynamics is unital.

A single current proportional to the qubit energy corresponds to the measurement record, namely $\gamma (0,\tau )={I(t);0\u2264t\u2264\tau}$, with $I(t)=2\kappa \u27e8\sigma z\u27e9dt+dw(t)$ and the Wiener increment satisfies the rules $dw2(t)=dt$ and $\u27e8dw(t)\u27e9\gamma =0$. Taking into account the measurement record, the following stochastic master equation for the evolution of the qubit conditioned on the continuous measurement is obtained

where we assume efficient detection of the qubit by reading-out the cavity. Analogously to the previous example, we consider the initial state of the system at thermal equilibrium, $\rho 0=e\u2212\beta HS/Z$, from which we sample the initial state of the trajectories (in the *H _{S}* basis), according to the probabilities $p0=e\u2212\beta \omega q/2/Z$ and $p1=e\u2212\beta \omega q/2/Z$ with $Z=e\u2212\beta \omega q/2+e\beta \omega q/2$. We also consider that the final measurement of the TPM is performed in the $E(\rho 0)$ basis. In the long time limit, the state of the system approaches the fully mixed state $1/2$. A sample trajectory generated by the stochastic master equation in Eq. (92) is shown in Fig. 4, to be compared with Fig. 2(a). We note that since the initial state of the system is pure, and efficient detectors are considered, the evolution remains in the surface of the Bloch sphere also here (non-efficient detection would lead to excursion inside the sphere volume).

For assessing the energetics we note that, as stated in Sec. IV A, no heat is dissipated from the system into the environment during a dispersive monitoring verifying the micro-reversibility relation in Eq. (28). This is in accordance with the fact that the interaction with the cavity preserves the qubit energy, and hence for every trajectory

which, consequently, will only depend on the initial and final eigenstates of the trajectory $\gamma [0,\tau ]$. The two different contributions to the work are in this case

where again the switch-on and switch-off interaction energy costs are identically zero. On the other hand, the measurement work reads in this case, from Eq. (52):

with again $E\gamma (t)=\u27e8H(\lambda t)\u27e9$ including both the qubit and driving Hamiltonians. In Fig. 5(a), we compare the above driving and measurement contributions to the work for a single trajectory together with the total work $W\Lambda (\gamma [0,\tau ])$. We observe that the total work (being equal to the energy changes in the qubit) shows again Rabi oscillations due to the driving, which however are not damped or intersected by abrupt changes anymore. Since the trajectory starts in the excited state, the total work is negative and oscillates between 0 (whenever the state of the system is again excited) and $\u2212\omega q$ (when the system state reaches the ground state) and hence *ω _{q}* is extracted. Nevertheless, the period of such oscillations becomes stochastic due to noise with a variance that increases over time, leading to the dephasing behavior when averaging over trajectories. The driving work is perfectly smooth in this situation and shows oscillations that reproduce the total work frequency combined with a slower modulation. Instead, the measurement work captures all the energy fluctuations due to white noise in the evolution, which are associated with the disturbance in the state of the system due to the measurement.

Since the stochastic heat is zero for every trajectory, the entropy production in this case only accounts for the entropy changes in the system due to the (unital) measurement process, $Stot(\gamma [0,\tau ])=\Delta S(\gamma [0,\tau ])=\u2212log\u2009pn\tau \tau +log\u2009pn00$. In this case, the entropy production admits a trivial split into adiabatic and non-adiabatic contributions. Because of the unitality property of the map, the nonequilibrium potential operator $\Phi \lambda =\u2212log\u2009\pi \lambda $ verifies $[\Phi \lambda ,Lz]=0$, and hence, all nonequilibrium potential changes are zero, $\Delta \varphi k(\lambda )=0$ for all *k* in Eq. (69). As a consequence, the non-adiabatic entropy production in Eq. (71) just becomes the total entropy production, and the adiabatic entropy production in Eq. (70) vanishes. Importantly, the latter does not imply that there might not be extra entropy production due to processes not related to the heat exchanged with the system, as it is the case, e.g., in Ref. 161. The split between uncertainty and martingale entropy productions is also simpler in this case and becomes $\Delta Sunc(\gamma [0,\tau ])=\u2212log\u2009(pn\tau \tau )\u2212S\psi (\tau )$ and $\Delta Smar(\gamma [0,\tau ])=log\u2009(pn00)+S\psi (\tau )$.

In Fig. 5(b), we plot the total entropy production (blue curve) for a single trajectory and compare it with the martingale (classicalized) version (orange curve). As can be seen there, quantum fluctuations are dominant in this diffusive scenario since the changes in the entropy of the system due to the final virtual measurement are in general greater than the changes accumulated during the evolution. Blank spaces corresponds to intervals of time where the system state is very close to an eigenstate of $\rho (\tau )$ at that time. As time becomes comparable to the fully dephasing time, $1/\kappa $, the entropy change converges to a definite value which is independent of the final outcome, $\Delta S(\gamma [0,\tau ])\u2192\u2009log\u20092+log\u2009pn00$ for $n0={0,1}$. Since the sample trajectory in the figure starts in the excited state ($n0=1$), we have $\Delta S(\gamma [0,\tau ])\u2192\u22120.62$ corresponding to $p00=0.269$ the excited state probability at the initial time. On the other hand, the martingale entropy production shows small fluctuations due to the white noise contribution, similarly to the energy variation and the total work. It always remains within the envelope generated by the quantum fluctuations in $Stot(\gamma [0,\tau ])$ and coincides with it in the periods where the conditional state of the system is close to a eigenstate of the density matrix.

The stochastic evolution of the total and martingale entropy productions can be best appreciated in the inset of Fig. 6, where the probability distributions for $Stot(\gamma [0,\tau ])$ and $Smar(\gamma [0,\tau ])$ are plotted for a fixed final time, $\tau =1000\omega q\u22121=\kappa \u22121$. In particular we observe the four points in $P(Stot)$, two on the left side corresponding to the cases where the system is initially in the excited state [and hence $Stot$ takes on negative values as in Fig. 5(b)] and two positive corresponding to the case in which initially the qubit starts in the ground state. Moreover, as can be appreciated from $P(Smar)$, the martingale entropy production can take continuous values between the maximum and minimum of $Stot$ for each initial state (but it cannot cross from positive to negative values and vice versa). The bimodal, highly non-Gaussian shape of the entropy production makes that the averages $\u27e8Stot\u27e9\gamma \u22650$ and $\u27e8Smar\u22650\u27e9\gamma $ (or even they variances) are poorly informative of the actual dynamics of the system, and the effect of the measurement noise on the system. In any case we check in Fig. 6 that the fluctuation theorems for both the total and martingale entropy productions are again verified as the functionals $\u27e8e\u2212Stot\u27e9\gamma ,\u2009\u27e8e\u2212Smar\u27e9\gamma $, and $\u27e8e\u2212Sunc\u27e9\gamma $ all tend to 1 when increasing the number of trajectories in the simulation.

## VIII. DISCUSSION AND OUTLOOK

In this Review, we have discussed the application of the quantum trajectories framework for describing open quantum systems that are continuously monitored and to assess their thermodynamics. We conclude by stressing the key elements we used to accomplish a coherent description of all thermodynamic quantities at the stochastic level, namely, the introduction of a general TPM scheme on which quantum trajectories are embedded, the identification of entropy flow (and hence heat) from the micro-reversibility principle for quantum trajectories, Eq. (20), a suitable identification of the stochastic work induced by measurement back-action, Eqs. (50) and (52), and the identification of entropy production from the likelihood of probabilities in forward and backward processes. For the latter point, it was important to define both processes in clear operational terms, that is, explicitly stating the initial states, driving protocol implemented, and monitoring scheme implemented. The benefits of following such a recipe consist in recovering a coherent framework for the description of fluctuations of the main thermodynamic quantities, where central nonequilibrium relations associated with the second law, such as the fluctuation theorems, hold (as expected from an all-inclusive analyses^{17,113,114}).

From the experimental perspective, despite many works have already explored the thermodynamics of average quantities in open systems, still very few aspects of stochastic quantum thermodynamics have been tested in the laboratory. Some remarkable exceptions are for example the implementation of a Maxwell demon following diffusive trajectories in a circuit QED setup.^{77} The authors showed how the information acquired by monitoring a superconducting qubit system could be used to adequately implement a discrete feedback pulse for work extraction. We considered this setup in Sec. VII B (without feedback), where other thermodynamic quantities not considered in Ref. 77, like the driving/measurement work split or the martingale entropy production could be also accessed, and their fluctuation relations tested. Another promising QED platform,^{186} where most of the predictions of the framework for the case quantum jumps could be tested, consists of the implementation of extremely precise calorimetry on resistors acting as (finite-size) thermal reservoirs through fluorescence measurements.^{95,187}

Two other experiments tested the energetics of quantum monitored systems at an effective zero temperature,^{83,94} a situation that involves many subtleties from the thermodynamic perspective and over which there is hence not complete consensus within the community. In Ref. 94, a driven superconducting qubit is radiatively coupled to a transmission line whose electromagnetic field is subjected to a homodyne measurement by a Josephson parametric amplifier. Tracking the stochastic state of the system, the authors construct the total energy exchanged with the environment along single trajectories and compare their results with a TPM scheme using energy measurements at different instants of time, and with a feedback loop that effectively isolates the system. Moreover, the authors compare tentative definitions of work and heat with the standard average expressions from the master equation, obtaining good agreement. Unfortunately, the experimental results are not sufficient for confirming or discarding a particular decomposition into heat and work along trajectories. In Ref. 83, an optomechanical system was subjected to homodyne detection of the cavity field, leading to the monitoring of the nanomechanical oscillator Gaussian state at effective zero temperature. The focus was the assessment of the Wigner entropy production, and the authors were also able to identify the informational gain term due to the measurement. Finally, a closely related situation has been considered in Refs. 188 and 189, where fluctuation theorems have been tested in some particular situations using a nitrogen-vacancy (NV) center in diamond and an engineered dissipation channel. The system is subjected to repeated projective measurements (rather than following a continuous monitoring) while the authors could address driven-dissipative cases where only measurements of the system energy changes are needed to construct either heat or work.^{189}

We notice that situations with strictly zero temperature remain out of the formalism introduced here, since the condition for the Lindblad operators to include their adjoint pairs (or to be self-adjoint) would not be verified. However, we stress that such situations correspond to an idealization, since following the third-law of thermodynamics, attaining zero temperature would need infinite time,^{150,190} infinite dimensions,^{191} or infinite resources.^{192,193} This situation can be solved within the formalism by allowing a small but non-zero temperature, accounting for the fact that adjoint processes (e.g., absorption of energy quanta from the environment) are improbable but not completely impossible.

In order to improve the applicability of the framework to most common experimental situations in different platforms, it would be desirable to systematically include the effects of non-efficient detectors in the thermodynamic framework. Moreover, the present approach for both quantum jumps and diffusive trajectories might be extended to cases where not all Lindblad operators are included in the monitoring. In such cases, the expressions for the entropy flows above derived, and hence of heat and work, would need to be modified to take into account the flow of entropy not detected from the measured currents or jumps. Such an extension would be interesting in view of possible applications of the framework for, e.g., entropy production estimation under hidden currents, in analogy to stochastic thermodynamics.^{194} A detailed analysis of such an extension is left for future work.

It is also worth mentioning that the results obtained within the quantum trajectory approach followed here are equivalent, in the case of quantum jumps, to multi-time correlation function approaches^{195} and to the full counting statistics (FCS) method,^{112,196} although the difficulty to obtain and interpret the main thermodynamic quantities might be different. A comparison of those frameworks with the quantum jump method has been provided, e.g., in Refs. 197–199, for particular cases, as well as with alternative methods.^{200,201} In the FCS method, counting fields modeling the interaction between system and detectors in the reservoirs are introduced, which leads to a generalized master equation for a modified density operator that depends on these fields,^{112,196} and from which the moments of the heat currents can be obtained (see also Ref. 202). This approach have been extended to the case of periodically driven systems combining it with Floquet theory^{203,204} and non-equilibrium Green function approaches,^{205} and it has been used to assess work, heat, or efficiency fluctuations in thermoelectric systems,^{206,207} quantum thermal machines,^{208–211} to study Landauer's principle,^{212} or to explore the consequences of TUR breakdown.^{213,214} Connections of the quantum trajectory approach with collisional models used to describe the dynamics of open quantum systems have been discussed in the recent review.^{160} Moreover, recent developments used a collisional approach to assess information dynamics and their connection with thermodynamics in the continuously monitored scenario (see also Ref. 70).^{215,216}

Finally, many works in recent years discussed the advantages and inconveniences of using TPM schemes, including both fundamental and practical considerations. On the fundamental side, one of the main critiques to the TPM scheme using projective energy measurements is that it is not suitable for considering initial states of the system bearing coherences in the energy basis^{145} (but coherences developed during the system evolution are captured^{217}). Although often overlooked in the literature, this issue is avoided by allowing more general observables in the initial and final projective measurements of the TPM. When such observables coincide with the density operator of the unconditioned system, the TPM does not cause indeed any disturbance on the system state, as discussed before. This approach can be complemented by introducing so-called augmented trajectories (or Bayesian networks), which include extra virtual measurements (e.g., over subsystems) without introducing their backaction,^{6,218} and have shown useful to obtain extra fluctuation relations.^{219} On the more practical side, although the TPM have been directly implemented in several experiments,^{220–224} projective measurements are often difficult to control and may destroy the quantum system over which they are performed. Alternative schemes reproducing their results have been hence proposed which reproduce the TPM statistics by using indirect measurements and interferometry techniques.^{117,225–230} Some of these alternative schemes have been successfully tested in the laboratory to measure work distributions and test fluctuation theorems in closed systems.^{231–233} We expect that such techniques may be easily extended to the case of more general observables than the energy, as considered here.

## ACKNOWLEDGMENTS

The authors acknowledge the Spanish State Research Agency QUARESC Project (No. PID2019-109094GB-C21/AEI/10.13039/501100011033), the Severo Ochoa and Maria de Maeztu Program for Centers and Units of Excellence in R&D (No. MDM-2017-0711), and CAIB QUAREC Project (No. PRD2018/47). G.M. acknowledges funding from Spanish MICINN through the “Juan de la Cierva” program (No. IJC2019-039592-I).

## AUTHOR DECLARATIONS

### Conflict of Interest

The authors have no conflicts to disclose.

## DATA AVAILABILITY

Data sharing is not applicable to this article as no new data were created or analyzed in this study.

### APPENDIX A: DERIVATION OF WORK CONTRIBUTIONS WITH MULTIPLE CONSERVED QUANTITIES

In order to reach the decomposition of work (power) in Eq. (46) with the contributions from driving work in Eq. (43), chemical work in Eq. (47) and measurement work in Eq. (50), we start by subtracting the heat flux(es), that is, work is identified as $W\u0307\Lambda (t)\u2261E\u0307\Lambda (t)\u2212\u2211rQ\u0307\Lambda (r)$, which from Eq. (44) yields

where in the second line we expanded the middle term using the stochastic master equation as in Eq. (45).

We will now manipulate the middle term in the second line of (A1) associated with the quantum jumps, $Tr[HJk(\rho \gamma )]=Tr[Lk\u2020HLk\rho \gamma ]/\u27e8Lk\u2020Lk\u27e9\u2212E\gamma $ by using the commutation relations between the Hamiltonian *H* and the Lindblad operators *L _{k}*. For this purpose, and for remaining as general as possible, we split the Hamiltonian as $H=HS+V$, where

*H*is the part of the system energy which verifies energy conservation within system and reservoir [and hence enters as a charge in Eq. (38)] and

_{S}*V*is a weak interaction. Hence, we split the term $Tr[Lk\u2020HLk\rho \gamma ]=Tr[Lk\u2020HSLk\rho \gamma ]+Tr[Lk\u2020VLk\rho \gamma ]$. Crucially, we now rewrite Eq. (38) for the entropy flow with multiple conserved quantities as

where we simply assumed $X1=HS$ (energy conservation) with $\nu 1(r)=\u22121$ and rearranged terms. Notice that here above *k* represents a channel that belongs to reservoir *r* with which energy and the other charges ${Xi}$ for *i *>1 are exchanged. This equation allow us to manipulate the expression $Tr[Lk\u2020HSLk\rho \gamma ]$ for such a channel by using the following two equations directly coming from (A2)

which introduced into $Tr[Lk\u2020HSLk\rho \gamma ]$ give us the two following equivalent relations:

Combining the rhs of Eqs. (A5) and (A6) with equal 1/2 weights then leads to the expression that we wanted

where we recall that channel *k* belongs to reservoir *r*. Introducing Eq. (A7) into the quantum jump term proportional to $Tr[HJk(\rho \gamma )]$ in Eq. (A1) and performing the sum over *k* for the different reservoirs, we immediately obtain

where we identified the heat currents $Q\u0307\Lambda (r)=\u2212Tr\u2211k(dNk/dt)\Delta sk(r)$ coming from the second term in Eq. (A7), and the chemical power $W\u0307\Lambda chem$ in Eq. (47), coming from the last contribution in Eq. (A7).

Introducing Eq. (A8) into the power split of Eq. (A1) the heat current contributions cancel and we obtain

Finally, Eq. (46) is recovered by identifying the remaining terms in the above equation with the measurement work

where we recall that $Mk(\rho \gamma )=1/2\u2009{Lk\u2020Lk,\rho \gamma}\u2212Tr(Lk\u2020Lk\rho \gamma )\rho \gamma $. We notice that in the case *H _{S}* =

*H*and

*V*=

*0, we recover Eq. (50). Moreover, assuming*

*V*is of the order of the coupling between system and reservoirs, terms like $Tr[VMk(\rho \gamma )]\u223cO(||V||3)$ can be neglected, and we can replace

*H*by

*H*in the first term of the r.h.s. in the above equation. However, the second (jump) term proportional to the weak interaction

_{S}*V*during the jumps remains (since it is normalized by $\u27e8Lk\u2020Lk\u27e9$). By noticing that $E\gamma =Tr[H\rho \gamma ]=Tr[HS\rho \gamma ]+Tr[V\rho \gamma ]$, we may interpret the extra term in Eq. (A10)

as the work needed to maintain the interaction *V* connected to the system (or to instantaneously switching it off and on again) when local jumps occur. This contribution should only be neglected at the average level where $\u27e8dNk\u27e9\gamma =dt\u27e8Lk\u2020Lk\u27e9$ compensates for the normalization and hence $Tr[Lk\u2020VLk\rho ]\u223c\u27e8Lk\u2020Lk\u27e9Tr[V\rho \gamma ]\u223cO(||V||3)$, and hence $\u27e8W\u0307\Lambda int\u27e9\gamma =0$. Therefore, although no network is needed to maintain the interaction *V* while the system (locally) exchanges energy with the reservoirs, this nevertheless induces extra power fluctuations as quantified by Eq. (A11).

### APPENDIX B: DERIVATION OF THE ADIABATIC AND NON-ADIABATIC DECOMPOSITION FOR QUANTUM STOCHASTIC ENTROPY PRODUCTION

In this appendix, we provide more details on the decomposition into adiabatic and non-adiabatic contributions of the entropy production for monitored systems (Sec. V). As mentioned there, we introduce dual and dual-reversed processes that are similar to the forward and backward process, but employ a modified set of Lindlbad operators. We denote these sets by ${Lk+}k=1K$ and ${L\u0303k+}k=1K$, respectively, which verify:^{59,68}

On the other hand, the Hamiltonian part of the evolution is the same as in forward and backward processes, $H(\lambda )$ and $H\u0303(\lambda )$, respectively. That is, the control protocol Λ is implemented in the dual process and the time-reversed control protocol $\Lambda \u0303$ is implemented in the dual-reverse process. Moreover, the above equations also guarantee that the instantaneous steady states in the dual and dual-reverse dynamics coincide with those in the forward and backward dynamics, respectively.

In this context, it is useful to define the trajectory operator that generates the environmental record $\gamma (0,\tau )$ in the dual process. We denote it $T\Lambda +(\gamma (0,\tau ))=U+(\tau ,tJ)LkJ+\u2026Lk1+U+(t1,t0)$, where the no jump intervals are governed by the same drift evolution as in the forward process, $U+(tj,ti)=U(tj,ti)$ and the dual jumps are given in Eq. (B1) in terms of the original ones. Analogously, we denote the operator associated with the trajectory $\gamma \u0303[0,\tau ]$ in the dual-reverse process as $T\Lambda \u0303+(\gamma \u0303(0,\tau ))=U\u0303+(\tau ,tJ)L\u0303kJ+\u2026L\u0303k1+U\u0303+(t1,0)$ with $U\u0303+(tj,ti)=\Theta U\u2020(\tau \u2212tj,\tau \u2212ti)\Theta \u2020$ and $L\u0303k+$ in Eq. (B2). These operators are related to the probabilities of observing the trajectories $\gamma [0,\tau ]$ and $\gamma \u0303[0,\tau ]$ in the dual and dual-reversed process, respectively,

to be compared with Eqs. (16) and (17). Using the relations in Eqs. (B1) and (B2) for the dual and dual-reversed jumps, together with the corresponding ones for the drift evolution operators, we obtain the following relations:

where we introduced the accumulated change in nonequilibrium potential during the whole trajectory:

The relations (B5) and (B6) are analogous to the micro-reversibility relation in Eq. (20) but help us to relate the statistics of the dual and dual-reversed processes to the original forward process, which are the key to obtain the detailed fluctuation theorems in Eqs. (70) and (71).

On a more technical side, we note that in Ref. 234 it was shown that conditions equivalent to Eq. (69) on the Lindblad operators (called a privileged representation) are verified when the so-called *s*-dual generator $L\u0303\lambda +(\rho )\u2261\pi \lambda 1\u2212sL\lambda \u2217(\pi s\rho \pi 1\u2212s)\pi \lambda s$ associated with $L\lambda $, for $s\u2208[0,1]$ commutes with the modular automorphism, $M(\rho )=\pi \lambda \rho \pi \lambda \u22121$ (see Theorem 8 and Proposition 19 in Ref. 234). This constraint in turn ensures that the maps generated by $L\u0303\lambda +(\rho )$ are unique and form a quantum Markov semigroup $\u2200\u2009s\u2208[0,1]$, while the symmetric dual generator (*s *=* *1/2) always leads to a quantum Markov semigroup even when commutation with the modular automorphism is not ensured (see Theorem 36 and Example 41 in Ref. 234). The condition in Eq. (69) allowing the entropy production split and the derivation of separate fluctuation theorems for the two pieces are equivalent to the existence of a privileged representation for the symmetric dual generator in the case of jump trajectories.^{59} However, such conditions, as introduced in Refs. 64 and 68, ensure the split and the fluctuation theorems for general CPTP maps, not necessarily forming a quantum Markovian semigroup.