Irreversible work and Maxwell demon in terms of quantum thermodynamic force

The second law of classical equilibrium thermodynamics, based on the positivity of entropy production, asserts that any process occurs only in a direction that some information may be lost (flow out of the system) due to the irreversibility inside the system. However, any thermodynamic system can exhibit fluctuations in which negative entropy production may be observed. In particular, in stochastic quantum processes due to quantum correlations and also memory effects we may see the reversal energy flow (heat flow from the cold system to the hot system) and the backflow of information into the system that leads to the negativity of the entropy production which is an apparent violation of the Second Law. In order to resolve this apparent violation, we will try to properly extend the Second Law to quantum processes by incorporating information explicitly into the Second Law. We will also provide a thermodynamic operational meaning for the flow and backflow of information. Finally, it is shown that negative and positive entropy production can be described by a quantum thermodynamic force.

The total entropy production during a cycle is ∆ i S = ∆ i S 1 + ∆ i S 2 . Since no irreversibility occurs in the interior of the engine we have Thus we get The efficiency of the engine reads Now combining Eqs. (4) and (5) we obtain where η C = 1 − T c T h is the Carnot efficiency.

Supplementary Note 2
Irreversibility in physical process is strictly related to the idea of energy dissipation. Irreversible processes encountered by an open thermodynamic system are accompanied with a production of entropy which is fundamentally different from the entropy flow in the form of heat caused by the interaction between the system and its environment. Characterization of irreversibility is one of the cornerstones of non-equilibrium thermodynamics since the theory was born. For an isothermal process the second law of classical deterministic equilibrium thermodynamics may be expressed as where ∆W is the amount of work required to change the state of the system between two equilibrium states and ∆F β the difference in the Helmholtz free energy of the system. This, in turn, led to the introduction of the so-called irreversible work for classical systems S41, S42 ∆W irr ≡ ∆W − ∆F β ≥ 0.
On the other hand for classical thermodynamic systems we have S1-S3 Hence defining ∆W irr as in Eq. (8) gives rise to where ∆ i S is the entropy production of the system during the irreversible process and β = 1/T the temperature of the system. It should be emphasised that in classical equilibrium thermodynamics the reversible work equals the change in the free energy, i.e, ∆W rev = ∆F βS1-S3 . Thus the total work done by the system is partitioned into reversible and irreversible parts, i.e, ∆W = ∆W rev + ∆W irr . Thermodynamic reversibility is achieved if and only if no entropy is produced inside the system, i.e, zero entropy production S1-S3 Eq. (10) has a very subtle and interesting meaning. It links thermodynamics with information theory. It says that some of the internal energy, during the irreversible process, is encoded due to the loss of information and consequently the system cannot use this amount of internal energy to do work. For instance in the process of the free expansion of a gas all the internal energy is encoded therefore no internal energy can be used by the gas to perform any work, i.e, |∆W rev | = |∆W irr |. Thus if the system operates in an irreversible cycle its efficiency decreases S1-S3 . In other words Eq. (10) means that information is physical. Eqs. (8) and (10) have been extended to quantum thermodynamics with the same formulae S43-S51 . This may be wrong and misleading for two reasons. First, the inequality (7) does not always hold in the quantum realm. Because in stochastic quantum thermodynamics there exist processes, called non-Markovian processes, in which we may have This is because in deterministic classical thermodynamics, according to the Clausius' statement of the Second Law, entropy production of a system can never be negative S1-S3 but in quantum thermodynamics, during non-Markovian processes, entropy production of the system may be negative S10, S14 . Second in quantum thermodynamics, as we will show in this work, the reversible work ∆W rev done by a system equals 1 . If now we apply Eq. (9) to the evolution of a closed quantum system we observe that ∆F β − ∆W could be nonzero while ∆ i S = 0, where ∆S = 0 because the evolution of a closed system is unitary and ∆Q = 0 because a closed system does not interact with the environment. This means that the evolution of a closed quantum system is reversible even if neither the initial nor the final state of the system is equilibrium. the process is reversible. Thus if ∆W irr as defined in Eq. (8) is extended to quantum thermodynamic systems with the same formulae, for a closed quantum system Eq. (10) may not hold. For instance, in the case of the evolution of a closed quantum system initially in equilibrium we have Reversible and irreversible work. Using the definition of average energy E = tr{ρ t H t } S15, S52 for the rate of average energy, where ρ t is the instantaneous state of the system and H t the instantaneous Hamiltonian of the system at time t, we have where the first term on the RHS of Eq. (14) is defined as the rate of average heat and the second term as the rate of average work S53 . Therefore average heat and average work (from time t 0 = 0 to t = τ) are respectively defined as Now consider an arbitrary quantum system S coupled with a heat reservoir B at temperature β = 1/T . Eq. (16) becomes where ρ β t = exp(−βH t )/Z t is the instantaneous Gibbs state of the system with Z t the partition function and F β t = − 1 β ln Z t the free energy of the system. The total change in the entropy ∆S of the system is divided into two parts S1-S3 in which S = −tr{ρ ln ρ} is the Von Neumann entropy of the system, ∆ e S ≡ β∆Q the entropy change due to the exchange of energy with the reservoir and ∆ i S the entropy produced by the irreversible processes in the interior of the system. In contrast to the thermodynamic entropy that can be defined only for thermal equilibrium, the Von Neuwman entropy can be defined for an arbitrary probability distribution. Combining Eqs. (15)−(18), we get where S (ρ σ) ≡ tr{ρ ln ρ} − tr{ρ ln σ} is the relative entropy of the states ρ and σ. A thermodynamic reversible process is defined as a process that can be reversed without leaving any trace on the surroundings. That is, both the system and the surroundings are returned to their initial states at the end of the reverse process. This definition of reversibility in conventional thermodynamics may be completely characterized by the entropy production. Thermodynamic reversibility is achieved if and only if the entropy production is zero, i.e., ∆ i S = 0 S1-S3 . A stochastic process is thermodynamically reversible, if and only if the final probability distribution can be restored to the initial one, without remaining any effect on the outside world S38 . As in conventional thermodynamics, reversibility in stochastic processes is completely characterized by the entropy production. Reversibility in stochastic thermodynamics is achieved if and only if the entropy production is zero S38 , i.e., Theorem 1 The work done by a thermodynamic system, in the weak coupling limit, can always be appropriately partitioned into two parts: reversible work and irreversible work, i.e, in which and Proof. Since in a reversible process entropy production is zero using Eqs. (17) and (19), after some straightforward calculations, the (reversible) work is obtained as where I(t) = S (ρ t ρ β t ). Unlike the reversible processes, during a general process the entropy may be produced inside the system (irreversible processes), i.e., ∆ i S 0 S15, S52 . Therefore we find

3/7
where the first term is the irreversible work ∆W irr and the sum of the last two terms on the right hand side is the reversible work ∆W rev . Hence the total work done by a system during a general process can be expressed as The non-equilibrium free energy for a generic statistical state ρ of a quantum system in contact with a thermal bath is defined as where H is the Hamilton of the system. Using Eqs. (15) and (16), Theorem 1, and Eq. (27) we obtain Eq. (28) is the extension of Eq. (8) to quantum thermodynamics. The only difference is that ∆F in Eq. (28) is the difference in non-equilibrium free energies and as we mentioned before this is because quantum thermodynamics is a non-equilibrium thermodynamics. The associated non-equilibrium free energy is analogous to its equilibrium counterpart in non-equilibrium processes. When the initial and final states of the system are thermal equilibrium states Eq. (28) becomes equivalent to Eq. (8) in conventional thermodynamics as expected.

Supplementary Note 3
Consider a system in state ρ 0 at time t = 0 attached to a bath of temperature T . After a finite-time τ, let the state of the system be ρ τ . The Hamiltonian H of the system remains unchanged during the evolution. Therefore, using Eq. (19), the entropy production of the system after a time τ is For a completely positive, trace preserving (CPTP) map Λ t and any two density matrices ρ 1 and ρ 2 , if the dynamics is Markovian But if the dynamics is non-Markovian, since Λ t [ρ β ] ρ β , we can have S54 S (ρ 2 ρ β ) ≥ S (ρ 1 ρ β ).
The heat exchanged between the system and the bath is obtained as

Supplementary Note 4
Here we consider a spin-1/2 system S13, S16-S18 working in an Otto cycle, as depicted in Fig. (2) of the main text. The system is in an initial state ρ 0 , diagonal in the eigenbasis of the Hamiltonian H 0 = (ω 0 /2)σ z , where ω 0 = κB and σ z is the Pauli matrix.
Here κ is a constant and B is the constant magnetic field applied in the z direction on the system. In step I the engine interacts weakly with a hot reservoir at temperature T h , for time τ 1 from point A(ρ 0 , H 0 ) to point B(ρ 1 , H 0 ). The final state of the system is ρ 1 = exp(−H 0 /T 1 )/tr{exp(−H 0 /T 1 )}, which is diagonal in the eigenbasis of H 1 . Here T 1 = −ω 0 /(2 tanh −1 σ z 1 ), where σ z = tr{ρ 1 σ z }, is the effective temperature of the system after time τ 1 . The heat absorbed by the engine is ∆Q h = tr{H 0 (ρ 1 −ρ 0 )}. In step II the engine is decoupled from the hot reservoir and undergoes an adiabatic evolution from point B(ρ 1 , H 0 ) to point C(ρ 1 , H 1 ) by varying the magnetic field from ω 0 to ω 1 (ω 1 < ω 0 ). Since the system performs work, the temperature of the system changes at the end of this process and it becomes T 2 = T 1 ω 1 /ω 0 . In step III it interacts weakly with a cold reservoir at temperature T c from point C(ρ 1 , H 1 ) to point D(ρ 0 , H 1 ) for time τ 2 and the state of the system becomes ρ 0 with the effective temperature T 3 = −ω 1 /(2 tanh −1 σ z 0 ). The heat rejected to the cold reservoir is ∆Q c = tr{H 1 (ρ 0 − ρ 1 )}. Finally in step IV the engine is decoupled from the cold reservoir and, in an adiabatic evolution, goes back to its initial point by going from point D(ρ 0 , H 1 ) to point A(ρ 0 , H 0 ) and complete the cycle. The temperature of the system at the end of this cycle becomes T 0 = T 3 ω 0 /ω 1 . It can be shown that the effective temperatures of the system approach the temperatures of the heat baths asymptotically S18 . The heat absorbed by the system from the hot reservoir during step I is given by In the same way, the heat rejected to the cold heat during step III is obtained as Now the total work done by the system after the cycle is ∆W = −(∆Q h + ∆Q c ), i.e, For a machine to work as an engine we must have ∆W < 0, ∆Q h > 0 and ∆Q c < 0. This implies that Hence the efficiency of the engine reads