Introduction

Coherence is a central feature of quantum theory. It is intimately associated with linear superpositions of states and related interference phenomena1. In the past decades, it has been recognized as an essential physical resource for quantum technologies that can outperform their classical counterparts2, from quantum communication3 and quantum computation4 to quantum metrology5. Understanding the role of quantum coherence in small-scale thermodynamics is a fundamental issue that has been examined using the formalism of open quantum systems6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 and the framework of resource theory22,23,24,25,26,27,28,29,30,31,32,33,34. An insight from these studies is that the laws of thermodynamics have to be extended to allow for the interconversion of coherence and energy24,25,26,27,28,29,30. In particular, the description of thermodynamic processes at low temperatures requires a generalization of the usual free energy in order to account for coherent superpositions of energy eigenstates of a system24.

The interplay between quantum mechanics and nonequilibrium thermodynamics is nontrivial, however. The crucial question under what conditions quantum coherence is also a useful physical resource in quantum thermodynamics has found no definite answer so far. Depending on the considered problem, quantum coherence has indeed been theoretically predicted to either enhance6,7,8,9,10,11,12 or decrease13,14,15,16,17,18 the amount of extractable work. Recent experimental realizations of quantum heat engines are equally inconclusive, with one example reporting a performance boost due to quantum coherence35, and an other one observing an efficiency reduction linked to coherence-induced quantum friction36.

We here develop a general nonequilibrium thermodynamics of quantum coherence valid arbitrarily far from equilibrium. We employ these findings to clarify the impact of coherence on quantum work extraction, and derive concrete criteria for successful coherence-to-work conversion, for both closed and open quantum dynamics. To this end, we derive detailed and integral fluctuation relations for the nonequilibrium entropy production that fully account for superpositions of energy levels at all times, especially at the beginning of a quantum process. Fluctuation theorems are fundamental extensions of the second law for small systems subjected to classical37,38 and quantum39,40 fluctuations. Their generic validity beyond the linear response regime makes them invaluable in the investigation of nonequilibrium phenomena. We concretely use a powerful dynamic Bayesian network approach, widely used in computer science and statistics, that allows the systematic analysis of probabilities of events conditioned on some other events41,42. This formalism preserves the quantum properties of the system at all times43,44,45,46, contrary to other commonly applied methods, such as the two-point-measurement scheme47. The latter method is not able to quantitatively capture initial and final quantum coherences, since these are destroyed by local projective measurements39,40. We furthermore obtain a quantum generalization of the maximum-work theorem that provides an upper bound to the amount of work that can be extracted from a system48. The latter inequality includes a variation of the quantum coherence in the energy representation, expressed in terms of the relative entropy of coherence35. This result depends on the initial coherence, a key contribution that was missed in the past6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34. We specifically identify an out-of-equilibrium regime where maximum work extraction is increased by quantum coherence for fast processes beyond linear response, and show that the presence of coherence is always detrimental for strong thermalization. We finally illustrate our results with an analysis of a driven qubit.

Results

Dynamic Bayesian network

Let us consider a driven quantum system with time-dependent Hamiltonian \({H}_{t}={\sum }_{m}{u}_{t}(m)\vert {m}_{t}\rangle \langle {m}_{t}\vert\), with instantaneous eigenvectors \(\vert {m}_{t}\rangle\) and corresponding eigenvalues ut. We assume that the initial populations are thermally distributed at inverse temperature β in the energy basis \(\left\vert {m}_{0}\right\rangle\), but impose no restrictions on the off-diagonal elements, except the positivity of the state. The system may thus exhibit arbitrary quantum coherence in the energy basis. As a result, the initial system density operator, \({\rho }_{0}={\sum }_{i}{p}_{0}(i)\vert {i}_{0}\rangle \langle {i}_{0}\vert\), does not necessarily commute with the initial Hamiltonian, [H0, ρ0] ≠ 0. The two eigenbases \(\{\vert {i}_{0}\rangle \}\) and \(\{\vert {m}_{0}\rangle \}\) are hence not mutually orthogonal (incompatible) in general. This makes the analysis of the thermodynamics of the system in the energy eigenbasis nontrivial43,44,45,46. We additionally suppose that the system is weakly coupled to a thermal reservoir, at the same inverse temperature β, with density operator \({\rho }_{R}={\sum }_{\mu }{p}_{R}(\mu )\vert \mu \rangle \langle \mu \vert\) and Hamiltonian HR. We will use latin (greek) indices for system (bath) variables to distinguish the two. The interaction Hamiltonian HSR between system and reservoir is taken to satisfy strict energy conservation, [Ht + HR, HSR] = 049, as, for example, for a rotating-wave coupling in quantum optics. We further denote by Ut the total time evolution operator, ∂tUt = − i(Ht + HR + HSR)Ut. The instantaneous eigendecomposition of the system density operator at time t then follows from the local evolution, \({\rho }_{t}={{{{{{{{\rm{Tr}}}}}}}}}_{R}\{{U}_{t}({\rho }_{0}\otimes {\rho }_{R}){U}_{t}^{{{{\dagger}}} }\}={\sum }_{i}{p}_{t}(i)\vert {i}_{t}\rangle \langle {i}_{t}\vert\).

In order to analyze the influence of quantum coherence on the nonequilibrium thermodynamics of the driven open system, we next construct a dynamic Bayesian network that describes the relationship between dynamical variables through conditional probabilities evaluated via Bayes’ rule41,42. Such networks may be viewed as a generalization of hidden Markov models50. They allow one to specify the dynamics of a system in an eigenbasis conditioned on the evolution in an incompatible eigenbasis (Fig. 1). The conditional probability of initially finding the system in the energy state \(\left\vert {m}_{0}\right\rangle\), given that it is in the eigenstate \(\left\vert {i}_{0}\right\rangle\), is p(m0i0) = ∣〈m0i0〉∣2. Likewise, the conditional probability of finding the system at a later time t in the state \(\left\vert {n}_{t}\right\rangle\), given that it is in the eigenstate \(\left\vert {j}_{t}\right\rangle\), reads p(ntjt) = ∣〈ntjt〉∣2. Since the reservoir is thermal, ρR is diagonal in the energy basis, implying that there exists a joint eigenbasis for the operators ρR and HR. The probability to initially find the bath in the eigenstate \(\left\vert \mu \right\rangle\) is accordingly pR(μ). The conditional probability for the joint evolution of system and reservoir between time 0 and t then follows as \(p({j}_{t},\nu | {i}_{0},\mu )={| \langle {j}_{t},\nu | {U}_{t}| {i}_{0},\mu \rangle | }^{2}\). For a given nonequilibrium driving protocol, we may now define a conditional trajectory Γ = (i0, jt, m0, nt, μ, ν) for the composite system with path probability43,44,45,46

$$P[\Gamma ]={p}_{0}(i){p}_{R}(\mu )p({m}_{0}| {i}_{0})p({j}_{t},\nu | {i}_{0},\mu )p({n}_{t}| {j}_{t}).$$
(1)

The above quantity contains the entire information about the quantum coherence of the system in the energy basis and its time evolution with the weakly coupled heat bath. We may also introduce a backward conditional trajectory Γ* = (jt, i0, nt, m0, ν, μ) by evolving the state ρt ⊗ ρR with a time-reversed evolution, with path probability

$${P}^{* }[{\Gamma }^{* }]={p}_{t}(j){p}_{R}(\nu )p({n}_{t}| {j}_{t})p({i}_{0},\mu | {j}_{t},\nu )p({m}_{0}| {i}_{0}).$$
(2)

We note that path probabilities of a dynamic Bayesian network can be determined experimentally46.

Fig. 1: Two-time dynamic Bayesian network for system and reservoir.
figure 1

It describes the quantum dynamics in one eigenbasis (the instantaneous eigenbases \(\left\vert {m}_{0}\right\rangle\) and \(\left\vert {n}_{\tau }\right\rangle\) of the system Hamilton operator at times 0 and τ) conditioned on the evolution in another incompatible eigenbasis (the instantaneous eigenbases \(\left\vert {i}_{0}\right\rangle\) and \(\left\vert {j}_{\tau }\right\rangle\) of the system density operator at times 0 and τ). Owing to the presence of quantum coherence, these eigenbases are not mutually orthogonal. The eigenstates of the reservoir Hamiltonian are denoted \(\left\vert \mu \right\rangle\) and \(\left\vert \nu \right\rangle\).

Fluctuation relations with quantum coherence

A detailed quantum fluctuation relation may be derived by evaluating the ratio of forward and backward path probabilities, Eqs. (1), (2),43,44,45,46. We concretely find

$$\frac{P[\Gamma ]}{{P}^{* }[{\Gamma }^{* }]} = \frac{{p}_{0}(i){p}_{R}(\mu )}{{p}_{t}(j){p}_{R}(\nu )}\\ ={e}^{\Delta s+\Delta {s}_{R}}={e}^{\beta (w-\Delta F)-\Delta c-{d}_{t}},$$
(3)

where the first equality follows from the microreversibility of the unitary evolution of the composite system, p(i0, μjt, ν) = p(jt, νi0, μ). In the second equality, we have written the total stochastic entropy change of the composite system as the sum of the stochastic entropy variations of the system, \(\Delta s(i,j)={s}_{t}(j)-{s}_{0}(i)=-\ln ({p}_{t}(j)/{p}_{0}(i))\), and of the reservoir, \(\Delta {s}_{R}(\mu ,\nu )=-\ln ({p}_{R}(\nu )/{p}_{R}(\mu ))\)51. To obtain the third equality, we have introduced the stochastic heat exchanged with the equilibrium bath, − βq = ΔsR51, and formulated the system entropy, st(i) = β[ut(m) − ft(i, m)], as a function of the stochastic internal energy ut and of the stochastic nonequilibrium free energy ft (which is defined by the above equation20,21). The stochastic work w follows from the usual first law expression, w = Δu − q38. The nonequilibrium free energy may be further expressed as βft(i, m) = βFt + ct(i, m) + dt(m), where \({F}_{t}=-(1/\beta )\ln {Z}_{t}\) is the usual equilibrium free energy (with ΔF = Ft − F0), and \({c}_{t}(i,m)=\ln ({p}_{t}(i)/{p}_{t}^{{{{{{{{\rm{d}}}}}}}}}(m))\) is the stochastic relative entropy of coherence that quantifies the difference between the state ρt and the associated dephased state in the energy basis \({\rho }_{t}^{{{{{{{{\rm{d}}}}}}}}}\)1. The quantity \({d}_{t}(m)=\ln ({p}_{t}^{{{{{{{{\rm{d}}}}}}}}}(m)/{p}_{t}^{{{{{{{{\rm{eq}}}}}}}}}(m))\) is furthermore the stochastic relative entropy that measures the lag between the nonequilibrium state \({\rho }_{t}^{{{{{{{{\rm{d}}}}}}}}}\) and the corresponding equilibrium state \({\rho }_{t}^{{{{{{{{\rm{eq}}}}}}}}}\)51,52,53. After averaging over the forward process, the latter reduce to familiar relative entropies, \({{{{{{{{\mathcal{C}}}}}}}}}_{t}=\langle {c}_{t}\rangle =S({\rho }_{t}| | {\rho }_{t}^{{{{{{{{\rm{d}}}}}}}}})\) and \({{{{{{{{\mathcal{D}}}}}}}}}_{t}=\langle {d}_{t}\rangle =S({\rho }_{t}^{{{{{{{{\rm{d}}}}}}}}}| | {\rho }_{t}^{{{{{{{{\rm{eq}}}}}}}}})\)54.

Equation (3) is a quantum extension of the detailed fluctuation theorem by Crooks55,56, to which it reduces when forward and backward initial states are thermal, c0 = ct = dt = 0. The relevant aspect of the relation (3) is the inclusion of the difference, Δc = ct − c0, of final and initial stochastic relative entropies of coherence, which was missed so far20,21. The presence of initial quantum coherence, quantified by c0, strongly influences the work extraction properties of driven quantum systems, as we will discuss below. We note that the contribution of nonthermal initial populations may be easily added by replacing dt by Δd = dt − d0. Integrating Eq. (3) over all forward trajectories, we then obtain the integral quantum fluctuation relation

$$\left\langle {e}^{-[\beta (w-\Delta F)-\Delta c-\Delta d\left.\right)]}\right\rangle =1.$$
(4)

Expression (4) is a fully quantum generalization of the Jarzynski equality57 for driven open quantum systems. It holds for arbitrary initial (and final) nonequilibrium states, with nonthermal populations and quantum coherences in the energy basis, and any driving protocol. It provides the foundation of our study of the energetics of quantum coherence. We note that relations (3) and (4) are inherently different from fully quantum fluctuation theorems recently formulated for quantum channels instead of probability distributions58.

Quantum maximum-work theorem

Determining the maximum amount of work that a system can deliver is a central task of classical and quantum thermodynamics48. Applying Jensen’s inequality to Eq. (4), we obtain

$$\beta (W-\Delta F)\ge \Delta {{{{{{{\mathcal{C}}}}}}}}+\Delta {{{{{{{\mathcal{D}}}}}}}},$$
(5)

where W = 〈w〉 is the mean work—we use the convention that W is positive when performed on the system. Equation (5) can be viewed as a generalization of a resource-theoretic inequality of ref. 59 to general open nonequilibrium processes. Equality is reached when the entropy production stemming from the difference between the initial composite state ρt ⊗ ρR and the final state \({U}_{t}({\rho }_{0}\otimes {\rho }_{R}){U}_{t}^{{{{\dagger}}} }\) vanishes60. The maximum extractable work, − W, is thus

$$\beta {W}_{\max }=-\beta \Delta F-\Delta {{{{{{{\mathcal{C}}}}}}}}-\Delta {{{{{{{\mathcal{D}}}}}}}}=-\beta \Delta {{{{{{{\mathcal{F}}}}}}}},$$
(6)

where we have defined the generalized free energy \({{{{{{{\mathcal{F}}}}}}}}=F+kT({{{{{{{\mathcal{C}}}}}}}}+{{{{{{{\mathcal{D}}}}}}}})\) that extends the equilibrium free energy F with contributions stemming from quantum coherence \({{{{{{{\mathcal{C}}}}}}}}\) and athermality \({{{{{{{\mathcal{D}}}}}}}}\) (with β = 1/kT and k the Boltzmann constant); the latter quantity reduces to the free energy introduced in ref. 24 for thermal operations, when \({{{{{{{\mathcal{D}}}}}}}}=0\). We therefore obtain the general result that more work than the standard equilibrium work, − ΔF, can only be gained from an arbitrary quantum system when the following (necessary) condition is satisfied:

$$\Delta {{{{{{{\mathcal{C}}}}}}}}+\Delta {{{{{{{\mathcal{D}}}}}}}} \, < \, 0.$$
(7)

For an initial thermal state, \({{{{{{{{\mathcal{C}}}}}}}}}_{0}={{{{{{{{\mathcal{D}}}}}}}}}_{0}=0\), we have \(\Delta {{{{{{{\mathcal{C}}}}}}}}+\Delta {{{{{{{\mathcal{D}}}}}}}}={{{{{{{{\mathcal{C}}}}}}}}}_{t}+{{{{{{{{\mathcal{D}}}}}}}}}_{t}\ge 0\)61. In other words, quantum coherence \({{{{{{{{\mathcal{C}}}}}}}}}_{t}\) induced, for example, through the mechanism of quantum friction13,14, and athermality \({{{{{{{{\mathcal{D}}}}}}}}}_{t}\), generated during the time evolution62,63, are both detrimental for quantum work production. One may hence conclude that only initial quantum coherence \({{{{{{{{\mathcal{C}}}}}}}}}_{0}\) and initial athermality \({{{{{{{{\mathcal{D}}}}}}}}}_{0}\) are a potential resource for work extraction in quantum thermodynamics. Expression (6) provides a quantum extension of the standard second law of thermodynamics48.

Unitary work extraction

We now analyze the conditions under which initial quantum coherence may be harnessed for useful work extraction. For simplicity, we first consider the case of unitary dynamics by setting the system-bath coupling to zero, HSR = 0. We further assume that the initial populations are thermal, \({{{{{{{{\mathcal{D}}}}}}}}}_{0}=0\). We proceed with the observation that adiabatic driving leaves the density matrix elements of a system with nondegenerate spectra unchanged in the instantaneous eigenbasis, except for a phase factor64. The relative entropy of coherence remains accordingly constant, \(\Delta {{{{{{{\mathcal{C}}}}}}}}=0\), for an adiabatic transformation since it is phase independent. No useful work may therefore be extracted from quantum coherence in this case. A general requirement for positive work extraction from initial quantum coherence is consequently that the unitary driving is nonadiabatic. The criterion for adiabatic dynamics, namely that the total evolution time (or duration of the driving protocol) τP ought to be much larger than the adiabatic time, defined as the timescale set by the square of the inverse gap, \({\tau }_{A}={\max }_{r\in [0,1]}| \langle {m}_{r}| {\partial }_{r}{H}_{r}| {n}_{r}\rangle | /| {u}_{r}(m)-{u}_{r}(n){| }^{2}\), ∀  m ≠ n, with r = t/τP65,66, should thus not be satisfied for coherence-enhanced work extraction. In other words, the driving time τP should be of the order of (or smaller than) the adiabatic time τA:

$${\tau }_{P} \, \lesssim \, {\tau }_{A}\quad (\,{{\mbox{unitary criterion}}}\,).$$
(8)

We illustrate the above discussion with the example of a spin-1/2 in a rotating magnetic field with Hamiltonian \({H}_{t}=({\omega }_{0}/2){\sigma }_{z}+(g/2)[\cos (\omega t){\sigma }_{x}+\sin (\omega t){\sigma }_{y}]\), where ω0 is the frequency of the two-level system, ω and g are the respective frequency and amplitude of the driving field, and σx,y,z are the usual Pauli operators67. The duration of the driving protocol is taken to be τP = 2π/ω. We choose an initial state, ρ0 = ρth + χ, that is thermal in the initial energy basis, plus a nondiagonal matrix χ of elements \(a\scriptstyle\sqrt{{p}_{{{{{{{{\rm{ground}}}}}}}}}(1-{p}_{{{{{{{{\rm{ground}}}}}}}}})}\), for a ∈ [0, 1] ranging from incoherent to maximally coherent. The change of relative entropy of coherence \(\Delta {{{{{{{\mathcal{C}}}}}}}}\) at half the Rabi frequency \(\Omega =\scriptstyle\sqrt{{g}^{2}+{({\omega }_{0}-\omega )}^{2}}\) is shown as a function of the driving frequency and of the driving amplitude in Fig. 2. As expected, \(\Delta {{{{{{{\mathcal{C}}}}}}}}=0\) for adiabatic driving ω → 0 (or, equivalently, τP → ) (vertical (dashed) orange line on the left). We moreover note that, for small driving amplitudes, \(\Delta {{{{{{{\mathcal{C}}}}}}}} \, < \, 0\) occurs around resonance, ω ≃ ω0, and that \(\Delta {{{{{{{\mathcal{C}}}}}}}}\) typically decreases for increasing ∣ω − ω0∣ and ∣g∣. These are the areas where quantum coherence may be converted into work. For a given amplitude g, maximum work extraction is concretely achieved for the driving frequency

$${\omega }_{{{{{{{{\rm{opt}}}}}}}}}=\frac{{E}^{2}\left({\omega }_{0}+g{e}^{-\beta E/2}\right)}{{E}^{2}-2g\left({\omega }_{0}\sinh (\beta E/2)+g\right)},$$
(9)

with the energy \(E=\scriptstyle\sqrt{{g}^{2}+{\omega }_{0}^{2}}\). The optimal frequency \({\omega }_{{{{{{{{\rm{opt}}}}}}}}}\simeq {\omega }_{0}+g\cosh (\beta \omega /2)\) scales linearly with g for small g.

Fig. 2: Quantum coherence for a periodically driven qubit.
figure 2

Change of relative entropy of coherence, \(\Delta {{{{{{{\mathcal{C}}}}}}}}\), for a two-level system in a rotating magnetic field as a function of driving frequency ω and driving amplitude g (with β = 2): \(\Delta {{{{{{{\mathcal{C}}}}}}}}=0\) along the orange lines (in particular, in the adiabatic limit ω → 0). For small driving amplitude g, \(\Delta {{{{{{{\mathcal{C}}}}}}}} \, < \, 0\) close to resonance ω ≃ ω0, enabling coherence-to-work conversion.

In order to gain additional insight, we display in Fig. 3 the time evolution of the average work, βW (red), the change of quantum coherence, \(\Delta {{{{{{{\mathcal{C}}}}}}}}\) (yellow), and the added variations of coherence and athermality, \(\Delta {{{{{{{\mathcal{C}}}}}}}}+{{{{{{{{\mathcal{D}}}}}}}}}_{t}\) (blue); ΔF = 0 for the periodic driving considered. In the absence of initial quantum coherence (a = 0), βW > 0 and no work can hence be gained from the system (Fig. 3a). In this scenario, work is consumed to create coherence, \(\Delta {{{{{{{\mathcal{C}}}}}}}} \, > \, 0\). By contrast, for a = 0.3, quantum coherence is successfully converted into mechanical work, βW < 0 with \(\Delta {{{{{{{\mathcal{C}}}}}}}} \, < \, 0\) (Fig. 3b). We mention that inequality (5) is here saturated. The upper bound for the maximum work (6) is therefore reached. In general, nonequilibrium entropy production, associated with the athermality \({{{{{{{{\mathcal{D}}}}}}}}}_{t}\) of the system, reduces the efficiency of the coherence-to-work conversion (seen as the difference between red and yellow lines in Fig. 3b).

Fig. 3: Coherence-to-work conversion for a periodically driven qubit.
figure 3

a Without initial coherence (a = 0), work βW performed is positive as quantum coherence is created during unitary evolution, as depicted respectively by the full and dashed curves. Moreover, the right hand side of the second law, represented by the dotted line, lies on top of βW, as unitary processes do not produce entropy. b With initial coherence (a = 0.3), work is efficiently extracted from quantum coherence, βW < 0 and \(\Delta {{{{{{{\mathcal{C}}}}}}}} \, < \, 0\). Maximum work production occurs at half the Rabi time, τW = Ω/π, where Ω is the Rabi frequency. This time lies beyond the linear response regime shown by the dashed-dotted line; insets show deviations from the quantum fluctuation-dissipation relation for work. c For nonunitary dynamics (γ ≠ 0), coherence-to-work is hampered by decoherence, which reduces \(\Delta {{{{{{{\mathcal{C}}}}}}}}\), and by nonequilibrium entropy production, which leads βW to deviate from the variation, \(\Delta {{{{{{{\mathcal{C}}}}}}}}+{{{{{{{{\mathcal{D}}}}}}}}}_{t}\), of coherence and athermality. Parameters are ω = 1, g = 0.005, β = 0.5 and δ = ω0 − ω = − 0.005.

Note that maximum work extraction occurs at a time τW (here given by half the Rabi time, τR/2 = π/Ω), which lies beyond the linear response regime (Fig. 3b): In the absence of initial coherence (a = 0), the linear response approximation leads to the fluctuation-dissipation relation \(W=\Delta F+\beta {\sigma }_{W}^{2}/2-{{{{{{{{\mathcal{Q}}}}}}}}}_{0}\), where \({\sigma }_{W}^{2}\) denotes the work variance and \({{{{{{{{\mathcal{Q}}}}}}}}}_{0}=(\beta /2)\int\nolimits_{0}^{1}dy{I}^{y}({\rho }_{t}^{{{{{{{{\rm{eq}}}}}}}}},\Delta {H}_{t})\), is a non-negative quantum correction than only vanishes when \([{H}_{t},{\dot{H}}_{t}]=0\)68,69; the Wigner-Yanase skew information quantifying the quantum uncertainty of observable L, measured in state ρ, is here given by Iy(ρ, L) = tr[ρy, L][ρ1−y, L]70. For a ≠ 0, the fluctuation-dissipation relation is generalized to \(W=\Delta F+\beta {\sigma }_{W}^{2}/2-{{{{{{{{\mathcal{Q}}}}}}}}}_{0}-{E}_{{{{{{{{\mathcal{Q}}}}}}}}}\), with an additional contribution, \({E}_{{{{{{{{\mathcal{Q}}}}}}}}}={{{{{{{\rm{tr}}}}}}}}\Delta {H}_{H}\chi\), stemming from the initial coherence, where ΔHH is the variation of the Hamiltonian in the Heisenberg picture. In both cases, the linear response approximation only agrees with the exact work for t ≪ τW (insets of Fig. 3a, b).

Nonunitary work extraction

The problem becomes more complicated when the system is coupled to a heat bath. In this situation, the available amount of quantum coherence is suppressed by environment-induced decoherence71,72, and \(\Delta {{{{{{{\mathcal{C}}}}}}}}\) is reduced compared to the unitary evolution (yellow line in Fig. 3c). Entropy dissipation associated with system-bath correlations, as well as entropy production caused by the athermality of the reservoir73 further hinder coherence-to-work conversion (large difference between red and yellow lines in Fig. 3c). The unitary criterion (8) is thus not enough to guarantee successful coherence-to-work transfer in this case. Under Markovian dynamics, the decoherence time scale is longer than the bath relaxation time. The decoherence rate may accordingly be expressed for short times as \(1/{\tau }_{D}=-2\,{{\mbox{tr}}}\,[{\rho }_{0}{\dot{\rho }}_{0}]/\,{{\mbox{tr}}}\,[{\rho }_{0}^{2}]\)74 (see also refs. 75,76,77,78), and the contribution from bath athermality may be neglected. As a consequence, coherence-to-work conversion in open quantum systems with nonunitary dynamics is only effective when the work extraction time τW is much shorter than the decoherence time scale τD:

$${\tau }_{W} \, \ll \, {\tau }_{D}\quad (\,{{\mbox{nonunitary criterion}}}\,).$$
(10)

We illustrate the predictive power of condition (10) by taking the same driven two-level example as before and letting it weakly interact, with coupling strength γ, to a bath of infinitely many harmonic oscillators at inverse temperature β79. Considering that the relaxation time of the reservoir is short compared with the timescale of the system in the rotating frame, specified through the unitary operator \({U}_{r}=\exp -i\omega t{\sigma }_{z}/2\), the master equation for \({\tilde{\rho }}_{t}={U}_{r}{\rho }_{t}{U}_{r}^{{{{\dagger}}} }\) is of the standard Markovian form, \({\dot{\tilde{\rho }}}_{t}=-i[{\tilde{H}}_{{{{{{{{\rm{eff}}}}}}}}},{\tilde{\rho }}_{t}]+{{{{{{{\mathcal{L}}}}}}}}[{\tilde{\rho }}_{t}]\), with the dissipator, \({{{{{{{\mathcal{L}}}}}}}}[{\tilde{\rho }}_{t}]=\gamma \bar{n}{D}_{+}[{\tilde{\rho }}_{t}]+\gamma (\bar{n}+1){D}_{-}[{\tilde{\rho }}_{t}]\), where \({\tilde{H}}_{{{{{{{{\rm{eff}}}}}}}}}={U}_{r}{H}_{t}{U}_{r}^{{{{\dagger}}} }-\omega {\sigma }_{z}/2\) is the effective system Hamiltonian in the rotating frame and \({D}_{\pm }[{{{{{{{\mathcal{O}}}}}}}}]={\sigma }_{\pm }{{{{{{{\mathcal{O}}}}}}}}{\sigma }_{\mp }-\{{\sigma }_{\mp }{\sigma }_{\pm },{{{{{{{\mathcal{O}}}}}}}}\}/2\) are the dissipative channels for the σ± transitions (\(\bar{n}\) denotes the mean number of bath excitations)79. The average work flow of the system may then be consistently defined via the first law as \({\dot{W}}_{t}={\dot{E}}_{t}-{\dot{Q}}_{t}\), where Et = trHtρt is the internal energy and \({\dot{Q}}_{t}={{{\rm{tr}}}}{H}_{t}{{{{{{{\mathcal{L}}}}}}}}[{\rho }_{t}]\) is the heat flow80.

Figure 4 depicts the average work βW as a function of time for three values of the coupling strength. For small dam**, τD = 5τW (blue), coherence is efficiently converted into useful work, βW < 0, and maximal work extraction occurs at time τW like in the unitary regime shown in Fig. 2b. For moderate dam**, τD = τW (green) and τD = 0.5τW (red), a strongly diminished amount of work can be produced at short times owing to the adverse effect of decoherence (the decoherence time τD is represented by the vertical dashed lines). Thus for τD ≪ τW, when there is strong thermalization, no work can be effectively extracted from the system. For tτD, the average work increases linearly in time, since the system reaches a steady state and the entropy production rate is accordingly constant.

Fig. 4: Influence of decoherence on work extraction.
figure 4

Coherence-to-work conversion, βW < 0, is only effective when the work extraction time τW is much smaller than the decoherence timescale τD, τW ≪ τD. No work can be extracted for strong thermalization, τD ≪ τW (vertical lines indicate the decoherence time τD). Same parameters as Fig. 3.

It is worthwhile to remark that the work extraction criteria (8) and (10) differ from the resource-theoretic results obtained in refs. 24,26 that suggest that quantum coherence cannot be converted into work using only a single system, although showing that \(\Delta {{{{{{{\mathcal{C}}}}}}}}\) is always non-positive. This discrepancy comes from the fact that refs. 24,26 consider a special class of thermal operations, while Eqs. (8), (10) generically hold for arbitrary nonequilibrium processes, which can already be probed using current technology46,81,82,83.

Discussion

We have performed a detailed investigation of the interconversion of quantum coherence and mechanical work in nonequilibrium quantum processes, and examined the conditions under which quantum coherence is a useful resource in quantum thermodynamics. We have, in particular, derived a maximum-work theorem from a generalized fluctuation relation that accounts for initial coherences, and obtained explicit criteria for successful coherence-to-work conversion, for both closed and open quantum systems. Our results highlight the competing influence of initial coherence (that can be converted into work) and coherence generated during time evolution through quantum friction (that consumes work), as well as the adverse effects of entropy production and decoherence. We have additionally discerned a timescale for optimal coherence-enhanced work extraction that lies beyond the range of linear-response regime. These findings emphasize the importance of initial quantum coherence for thermodynamic applications and their generation via reservoir-engineering techniques84,85,86,87,88,89. Such coherent (and, possibly, athermal) baths may be easily described in the dynamic Bayesian network formalism by including a contribution ΔcR + ΔdR in the fluctuation relations. We expect these insights to be useful for the design of efficient quantum-enhanced nanomachines.

Methods

Driven two-level system

We consider a two-level system, with frequency ω0, in a rotating magnetic with Hamilton operator

$${H}_{t}=\frac{{\omega }_{0}}{2}{\sigma }_{z}+\frac{g}{2}\left[\cos (\omega t){\sigma }_{x}+\sin (\omega t){\sigma }_{y}\right],$$
(11)

where ω is the driving frequency and g the driving amplitude67. The solution to its time evolution operator ∂tUt = − iHtUt is explicitly given by

$$U_t = \exp\left\{-i \frac{\omega t}{2}\sigma_z\right\}\exp\left\{-\frac{i}{2}(\delta \sigma_z + g \sigma_x)t\right\},$$
(12)

where δ = ω0 − ω is the detuning between the driving frequency and the natural frequency of the two-level system. We define for future reference the transformation to the instantaneous energy basis of Ht

$${R}_{t}^{H}=\left(\begin{array}{ll}\cos \frac{\theta }{2}\hfill&\sin \frac{\theta }{2}{e}^{-i\omega t}\\ -\sin \frac{\theta }{2}{e}^{i\omega t}&\cos \frac{\theta }{2},\hfill\end{array}\right)$$
(13)

with the angle \(\theta =\arctan g/{\omega }_{0}\). We take an initial state ρ0 whose populations are thermally distributed at inverse temperature β, and with coherences a ∈ [0, 1]. It is convenient to write this state in the form

$${\rho }_{0}=\frac{1}{2}\left(1-\tanh \frac{\beta E}{2}{\sigma }_{z}^{{\prime} }+a\sec{{{{{\rm{h}}}}}}\frac{\beta E}{2}{\sigma }_{x}^{{\prime} }\right),$$
(14)

where \({\sigma }_{i}^{{\prime} }={R}_{0}^{H{{{\dagger}}} }{\sigma }_{i}{R}_{0}^{H}\) are the Pauli matrices rotated to the basis of the initial Hamiltonian and \(E=\sqrt{{g}^{2}+{\omega }_{0}^{2}}\) is the initial energy gap. The term a gauges the amount of coherences of the state: if a = 0, ρ0 reduces to a standard thermal state, whereas, if a = 1, ρ0 is pure. We choose real coherences for simplicity—any type of coherence may be included via by a \({R}_{\phi }^{z}={e}^{-i\phi {\sigma }_{z}/2}\) rotation on σx, without providing additional physical insight.

It is advantageous to analyze the dynamics in the rotating frame. Any operator \({{{{{{{\mathcal{O}}}}}}}}\) becomes accordingly \(\tilde{{{{{{{{\mathcal{O}}}}}}}}}={R}_{\omega t}^{z{{{\dagger}}} }{R}_{t}^{H}{{{{{{{\mathcal{O}}}}}}}}{R}_{t}^{H{{{\dagger}}} }{R}_{\omega t}^{z}\). Combining Eqs. (12) and (14), we obtain the density operator

$${\tilde{\rho }}_{t}=\frac{1}{2}\left[1-\tanh \frac{\beta E}{2}{m}_{t}^{z}+a\sec\!{{{{{\rm{h}}}}}}\frac{\beta E}{2}{m}_{t}^{x}\right],$$
(15)

where the operators mz and mx are given by

$${m}_{t}^{z} ={\sigma }_{z}-2{\mu }_{t}{N}_{t},\\ {m}_{t}^{x} ={\sigma }_{x}-2{\nu }_{t}{N}_{t},$$
(16)

We have here defined the following quantities

$$ {N}_{t} ={\mu }_{t}{\sigma }_{z}-\frac{\delta }{| \delta | }\sqrt{1-{\mu }_{t}^{2}}\,{R}_{z}^{{{{\dagger}}} }({\xi }_{t}){\sigma }_{x}{R}_{z}({\xi }_{t}),\\ {\mu }_{t} =\frac{g\omega }{E\Omega }\sin (\frac{\Omega t}{2}),\\ {\nu }_{t} =-\frac{{E}^{2}+{\Omega }^{2}-{\omega }^{2}}{2E\Omega }\sin (\frac{\Omega t}{2}),\\ {\xi }_{t} =\arctan \frac{2g\omega \cot (\frac{\Omega t}{2})}{{E}^{2}+{\Omega }^{2}-{\omega }^{2}}.$$
(17)

We emphasize that, in this local Hamiltonian basis, all coherences are energetic by construction, simplifying analytical calculations. We further note that Nt disappears in the adiabatic limit (ω → 0). In this scenario, the initial state undergoes a simple phase shift in the local Hamiltonian basis.

We next evaluate the average work performed on the system during time t, \(W={{{\rm{tr}}}}{\tilde{\rho }}_{t}\tilde{H}-{{{\rm{tr}}}}{\tilde{\rho }}_{0}\tilde{H}\), where \(\tilde{H}=E{\sigma }_{z}/2\). Using Eq. (15), we find:

$${W}_{t} = \frac{{g}^{2}{\omega }^{2}}{{E}^{2}{\Omega }^{2}}{\sin }^{2}\frac{\Omega t}{2}\\ \times \left(\tanh \frac{\beta E}{2}+a\frac{{E}^{2}+{\Omega }^{2}-{\omega }^{2}}{2g\omega }\sec{{{{{\rm{h}}}}}}\frac{\beta E}{2}\right).$$
(18)

We observe that W → 0 in the adiabatic limit ω → 0, as discussed in the main text for general systems. The condition for work extraction, W < 0, furthermore yields

$$\sinh \frac{\beta E}{2} < \frac{{\omega }^{2}-({E}^{2}+{\Omega }^{2})}{2g\omega }\ a.$$
(19)

We recover the impossibility of extracting useful work from an incoherent thermal state, since the inequality cannot be fulfilled for a = 0 and βE > 0.

By minimizing Eq. (18) with respect to the driving frequency ω, we may additionally derive an expression for the optimal driving frequency ωopt that allows for maximum work production from initial quantum coherence for a given driving amplitude g. We obtain

$${\omega }_{{{{{{{{\rm{opt}}}}}}}}}=\frac{{E}^{2}\left({\omega }_{0}+g{e}^{-\frac{\beta E}{2}}\right)}{{E}^{2}-2g\left({\omega }_{0}\sinh \frac{\beta E}{2}+g\right)},$$
(20)

in which case the state at the end of half Rabi period is the ground state of the final Hamiltonian.

Finally, we evaluate the time average of the work W, Eq. (18), both over the duration of the driving protocol τP and over the Rabi time τR:

$$ {\bar{W}}_{R} = \frac{1}{{\tau }_{R}}\int\nolimits_{0}^{{\tau }_{R}}{{{{{{{\rm{d}}}}}}}}t{W}_{t}= \frac{{g}^{2}{\omega }^{2}}{2{E}^{2}{\Omega }^{2}}\\ pt\times \left(\tanh \frac{\beta E}{2}+a\frac{{E}^{2}+{\Omega }^{2}-{\omega }^{2}}{2g\omega }\sec{{{{{\rm{h}}}}}}\frac{\beta E}{2}\right),\\ {\bar{W}}_{P}= \frac{1}{{\tau }_{P}}\int\nolimits_{0}^{{\tau }_{P}}{{{{{{{\rm{d}}}}}}}}t{W}_{t}=\left(1-\,{{\mbox{sinc}}}\,\,\frac{2\pi \Omega }{\omega }\right){\bar{W}}_{R},$$
(21)

where \(\,{{\mbox{sinc}}}\,x=\sin x/x\). The two averages retain the negativity condition of the previous discussion. However, for small values of 2πΩ/ω, \({\bar{W}}_{P}\) becomes increasingly smaller, given the quadratic behavior of sincx near the origin. This might be specially useful in the engineering of heat engines that make use of these initial coherences, where the average is usually performed with respect to the driving frequency16,17.

Decoherence timescale for the driven two-level system

In this section, we compute the decoherence timescale, \(1/{\tau }_{D}=-2\,{{\mbox{tr}}}\,[{\rho }_{0}{\dot{\rho }}_{0}]/\,{{\mbox{tr}}}\,[{\rho }_{0}^{2}]\)74, for the driven two-level system weakly coupled to a Markovian reservoir. We first write

$${\tau }_{D}=\frac{\,{{\mbox{tr}}}\,[{\rho }_{0}^{2}]}{2{\sum }_{i}{\gamma }_{i}{\widetilde{{{\mbox{cov}}}}}_{{\rho }_{0}}({L}_{i}^{{{{\dagger}}} },{L}_{i})},$$
(22)

where ρ0 is the initial state of the evolution, γi are the decay rates associated with the Li Lindblad operators in the master equation, and \({\widetilde{{{\mbox{cov}}}}}_{{\rho }_{0}}\left(X,Y\right)=\,{{\mbox{tr}}}\,[{\rho }_{0}XY{\rho }_{0}]-\,{{\mbox{tr}}}\,[X{\rho }_{0}Y{\rho }_{0}]\) is a generalized covariance74.

For the damped two-level system, we respectively have Li = {σ, σ+} and \({\gamma }_{i}=\{\gamma (\bar{n}+1),\gamma \bar{n}\}\) where \(\bar{n}={(\exp (\beta {\omega }_{0})-1)}^{-1}\) is the thermal mean occupation number at frequency ω0 and inverse temperature β. We further express the initial state as ρ0 = (1 + r ⋅ σ)/2, where r = (r, rz) is the Bloch vector and σ = (σ, σz); the subscript ⊥ refers to all perpendicular contributions to σz. Combining all the terms in Eq. (22), we find

$$1/{\tau }_{D}= \, \frac{4\gamma }{1+{r}^{2}}\\ \times \left[(\bar{n}+1){\widetilde{{{\mbox{cov}}}}}_{{\rho }_{0}}\left({\sigma }_{+},{\sigma }_{-}\right)+\bar{n}{\widetilde{{{\mbox{cov}}}}}_{{\rho }_{0}}\left({\sigma }_{-},{\sigma }_{+}\right)\right]$$
(23)

with

$${\widetilde{{{\mbox{cov}}}}}_{{\rho }_{0}}\left({\sigma }_{\pm },{\sigma }_{\mp }\right)={\left(\frac{1\mp {r}_{z}}{2}\right)}^{2}-\frac{1-{r}^{2}}{4},$$
(24)

where r = ∣r∣. Further simplifications lead to

$$1/{\tau }_{D}=\frac{2}{1+{r}^{2}}\left[\gamma (\bar{n}+1/2)({r}^{2}+{r}_{z}^{2})+\gamma {r}_{z}\right].$$
(25)

Assuming that the populations of the two-level system are thermal with respect to a bath of mean occupation number \(\bar{m}\), then \({r}_{z}=-1/(2\bar{m}+1)\) and we can rewrite Eq. (25) as

$$1/{\tau }_{D} = \, \frac{\gamma (\bar{n}+1/2)}{{{{{{{{\mathcal{P}}}}}}}}}\\ \times \left[{r}_{\perp }^{2}-2\frac{1}{\bar{m}-1/2}\left(\frac{1}{\bar{n}-1/2}-\frac{1}{\bar{m}-1/2}\right)\right],$$
(26)

where \({{{{{{{\mathcal{P}}}}}}}}=(1+{r}^{2})/2\) is the purity of the initial state. The first term in the square bracket is the contribution to the decoherence time from the actual coherence of the state, while the second term is the contribution from the mismatch of the thermal occupations between system and environment. We mention that the prefactor \(\gamma (\bar{n}+1/2)\) is the usual decoherence time considered in the optical Bloch equations79. In fact, we recover it in the case where the initial state is maximally coherent in the energy basis, thus rz = 0 and r = r = 1 in Eq. (25).