and the second law of

B. Ahmadi,1, 2, ∗ S. Salimi,1, † and A. S. Khorashad1 1Department of Physics, University of Kurdistan, P.O.Box 66177-15175, Sanandaj, Iran 2International Centre for Theory of Quantum Technologies, University of Gdansk, Wita Stwosza 63, 80-308 Gdansk, Poland (Dated: November 14, 2019) The second law of classical thermodynamics, based on the positivity of the production, only holds for deterministic processes. Therefore the Second Law in stochastic quantum ther- modynamics may not hold. By making a fundamental connection between thermodynamics and we will introduce a new way of defining the Second Law which holds for both deterministic classical and stochastic quantum thermodynamics. Our work incorporates information well into the Second Law and also provides a thermodynamic operational meaning for negative and positive entropy production.

I. INTRODUCTION tic quantum thermodynamics may expose features not present in a classical setting. It will be seen that the stochastic nature of quantum thermodynamics leads to Thermodynamics and information have intricate inter- the results different than that of classical ones. Our aim relations. Soon after establishing the second law of ther- in this work is to introduce a new way of defining the modynamics by Rodulf Clausius, Lord Kelvin and Max Second Law which holds for both deterministic classical Planck [1–3], in his 1867 thought experiment, ”Maxwell’s and stochastic quantum thermodynamics. In order to do Demon”, James Clerk Maxwell attempted to show that this we make a connection between thermodynamics and thermodynamics is not strictly reducible to mechanics information theory in a fundamental way. We will incor- [4–6]. Although Maxwell introduced his demon to ques- porate information into the Second Law, and then show tion the Second Law, established by others, his demon that this relation is fundamental. Based on this relation revealed the relationship between thermodynamics and a generic form for the efficiency of an engine working in information theory for the first time. Clausius et. al an arbitrary cycle will be derived and we will clarify why never considered information playing any role in consti- and how backflow of information can cause a quantum tuting the Second Law. Maxwell illustrated that by us- engine to be more efficient than a Carnot engine. Our re- ing information about the positions and momenta of the sults provide a thermodynamic operational meaning for particles restrictions imposed by the Second Law can be negative entropy production, which until now only had relaxed thus demanding to take into account informa- information-theoretical interpretations; for example, it tion in the Second Law explicitly. In order to do this witnesses the non-Markovianity (or backflow of informa- we must elucidate the physical nature of information so tion) [12]. It will also be shown that a quantum thermo- that the Second Law includes information as a physical dynamic force [13] decodes (encodes) information (not) entity. In 1929 L´eoSzil´ard[11], inspired by Maxwell’s to be used by the system to perform more work than idea, designed an engine working in a cycle, interacting what is expected and consequently the efficiency of the with a single thermal reservoir, which used information system exceeds the Carnot efficiency. (gained by the measurement on the system) to perform work. In classical thermodynamics the Clausius’ statement of II. CLASSICAL ENGINES AND ITS the Second Law implies that in an irreversible process LIMITATION the entropy production of a system is always positive arXiv:1809.00611v3 [quant-ph] 13 Nov 2019 which means that information is always lost or encoded Before proceeding with the results let us examine a and never regained or decoded. The second law of classi- classical engine (see Fig. (1)) which gives us the moti- cal thermodynamics only holds for deterministic macro- vation of having a quantum engine more efficient than scopic equilibrium systems [1–3] and is not necessarily Carnot classical engine. For this engine we obtain (see valid in non-equilibrium stochastic microscopic systems Supplementary NoteVIII) [7–10]. By equilibrium we mean that both the initial and final states of the system should be equilibrium thermal Tc∆iS ηe − ηC = − , (1) states. Therefore it is expected that the generalization of ∆Qh the second law of classical thermodynamics to stochas- where ηe = 1 − T3/T1 is the engine efficiency, ηC = 1 − Tc/Th the Carnot efficiency and ∆iS = ∆iS1 + ∆iS2 the entropy production of the total system (the engine plus ∗Electronic address: [email protected] the reservoirs) during a cycle. Based on the second law †Electronic address: [email protected] of classical thermodynamics the entropy production is 2 always positive thus ηe can never exceed ηC . This is, in thermodynamics, i.e., distance from the equilibrium state fact, equivalent to the relation Tc ≤ T3 ≤ T1 ≤ Th which affects the minimal work that can be extracted. Another always holds for classical engines. Now the question is: interesting point is that, as in equilibrium thermodynam- does this relation also always hold for quantum engines? ics, based on our partitioning the amount of the internal If it does not, therefore quantum engines may be more energy which is encoded not to be used by the system 1 efficient than that of Carnot. In the following we will to do work equals ∆ S. This is notable because Eq. investigate this question and see how it can be violated β i in the quantum realm hence demanding a new form of (4) indicates the fact that regardless of the equilibrium the Second Law. or non-equilibrium thermodynamics the amount of the 1 internal energy which is encoded equals ∆ S. In other β i 1 words the relation ∆W = ∆ S as a link between irr β i thermodynamics and information theory is fundamental. This relation will serve as an important building block in the rest of this investigation. We must note that ∆Wrev and ∆Wirr in Eq. (2) are not done by the system during the process. The work which is done by the system is ∆W . |∆Wrev| is the maximal amount of the internal en- ergy which is supposed to be spent by the system as work if there was no irreversibility during the process and pos- FIG. 1: (Color online) A classical engine working between itive ∆W is the amount of the internal energy which two reservoirs at temperatures T > T . Irreversibility occurs irr h c is not allowed to be spent by the system as work due to between the engine and the reservoirs not in the interior of the engine. irreversibility (loss of information). This explains why, regardless of the equilibrium or non-equilibrium thermo- dynamics, Eq. (4) has the same form in both stochas- tic and deterministic thermodynamics and thus is funda- mental. Hence the encoded internal energy which is not III. REVERSIBLE AND IRREVERSIBLE WORK supposed to be used as work is always directly related to the entropy production (or information). In other words, The work done by a thermodynamic system, in the we can say weak coupling limit, can always be appropriately parti- tioned into two parts: reversible work and irreversible ∆iS = β×(internal enery not to be spent as work). (5) work (see Supplementary NoteIX), We can go further and define a non-equilibrium free en- ∆W = ∆Wrev + ∆Wirr, (2) ergy for a generic statistical state ρ of a quantum system in contact with a thermal bath as in which 1 F (ρ, H) ≡ E − TS = tr{ρH} − TS(ρ), (6) ∆W ≡ ∆I + ∆F β, (3) rev β and we find and 1 1 ∆iS = ∆Wirr = ∆W − ∆F. (7) ∆W ≡ ∆ S. (4) β irr β i The associated non-equilibrium free energy is analogous It is seen that the total work can always be parti- to its equilibrium counterpart in non-equilibrium pro- tioned into two parts, the reversible part and the irre- cesses. As can be seen from Eq. (7) the minimal work, versible part. This partitioning seems plausible since on average, necessary to drive the system from one ar- whenever the process is reversible all the work is re- bitrary state to another is the difference, ∆F , between versible and there exists no irreversible work as expected. the non-equilibrium free energy in each state. The ex- The reversible work defined in Eq. (3) is different from cess work with respect to this minimum is the dissipated the definition of reversible work in the literature, i.e., or irreversible work, ∆Wirr. If the entropy production β 1 ∆Wrev ≡ ∆F by the term ∆I. Classical thermody- is positive ∆iS ≥ 0 then the generalized minimal work β formulation (the generalized second law) for an isother- namics is the equilibrium thermodynamics and the mini- mal process with given initial and final non-equilibrium mal work can be extracted only in equilibrium processes, distributions is obtained as hence the minimal work equals the equilibrium work, i.e., ∆W = ∆F β. The term ∆I in Eq. (3) explains the 1 min ∆W ≥ ∆F β + ∆I. (8) fact that quantum thermodynamics is a non-equilibrium β 3

The generalized minimal work formulation of thermo- thermodynamics, this is also true as long as the process is dynamics for non-equilibrium distributions gives an im- Markovian. But if the process is non-Markovian ∆iS can portant relation between two major concepts in physics, be negative [12, 15], i.e., some of the internal energy can energy and information. In the following we will show be decoded to be used by the system as work and conse- that in non-equilibrium quantum thermodynamics the in- quently the efficiency can exceed the Carnot efficiency. ternal energy can also be decoded (negative irreversible (b) Consider a quantum engine operating in a cycle be- work) to be used by the system to perform more work tween two heat reservoirs at temperatures Th and Tc with than what is typically expected. Th > Tc. In step I, as depicted in Fig. (2), the engine in- teracts with a hot reservoir at temperature Th from point A(ρ0,H0) to point B(ρ1,H0) while the Hamiltonian re- IV. IRREVERSIBLE WORK AND THE mains unchanged. The heat absorbed by the engine is SECOND LAW ∆Qh = tr{H0(ρ1 − ρ0)}. In step II the engine is decou- pled from the hot reservoir and undergoes an adiabatic

Let us consider a system in state ρ0 at time t = 0 evolution from point B(ρ1,H0) to point C(ρ1,H1). In attached to a bath of temperature T . After a finite-time step III it interacts with a cold reservoir at tempera- τ, let the state of the system be ρτ . The Hamiltonian H ture Tc from point C(ρ1,H1) to point D(ρ0,H1) while of the system remains unchanged during the evolution. the Hamiltonian remains unchanged. The heat rejected The irreversible work after a time τ is obtained as (see to the cold reservoir is ∆Qc = tr{H1(ρ0 − ρ1)}. Fi- Supplementary NoteX) nally in step IV the engine is decoupled from the cold reservoir and, in an adiabatic evolution, goes back to 1 β β its initial point by going from point D(ρ0,H1) to point ∆Wirr = S(ρ0kρ ) − S(ρτ kρ ). (9) β A(ρ0,H0) and complete the cycle. Now the whole work done by the system during the cycle, as in Eq. (3), is During a Markovian evolution ∆Wirr is always positive ∆W = ∆Wirr + ∆Wrev. Since during the adiabatic pro- but for a non-Markovian evolution it can be negative and cesses no entropy is produced in the interior of the system this may lead to results not encountered in classical ther- [14, 16] thus modynamics. In the following we focus our attention on four special cases to elucidate the physical meaning of 1 1 1 ∆Wirr = ∆iSh + ∆iSc. (11) the relation ∆W = ∆ S in non-equilibrium quan- βh βc irr β i tum thermodynamics: Then the efficiency becomes (a) Consider a reversible cycle with a quantum en- ∆ S ∆ S gine operating between two heat reservoirs at temper- i h + i c −∆Wrev β β atures Th and Tc with Th > Tc. Since all the pro- η = − h c (12) cesses are reversible then the work done by the system is ∆Qh ∆Qh ∆W = ∆Wrev. For a machine to work as an engine we Eq. (12) is a generic form for the efficiency of any en- should have ∆Wrev < 0 and since the cycle is reversible, gine working in a cycle. In the case of a reversible cycle ∆Wrev = Th∆Sh + Tc∆Sc, the efficiency of the engine equals the Carnot efficiency, the second term on the right hand side vanishes and it simply reduces to Eq. (10). Now as is clear from Eq. −∆W Tc (12) the second term on the right hand side shows the η ≡ = 1 − = ηC , (10) ∆Qh Th contributions of the Markovianity and non-Markovianity of the processes to the efficiency. If the evolution of the where ∆Qh is the heat absorbed from the hot reservoir. system during steps I and III is Markovian then ∆iSh Eq. (10) holds for all reversible cycles with classical or and ∆iSc are positive and consequently decrease the ef- quantum heat engines [14]. In equilibrium thermody- ficiency which would be less than the Carnot efficiency. namics the Clausius’ statement of the Second Law leads In the language of information this means that some in- to the fact that of all the heat engines working between formation is encoded (lost) hence the system cannot use two given temperatures, none is more efficient than a this encoded energy as work during the evolution. But Carnot engine [1–3]. As can be seen from Eq. (3) the if the evolution of the system during steps I and III is reason behind this is that in equilibrium thermodynam- non-Markovian then ∆iSh and ∆iSc can be negative and ics, due to the Clausius’ statement of the Second Law, consequently can increase the efficiency which can be- the entropy production ∆iS can never be negative, thus come greater than that of Carnot. In the language of it can never help −∆W to increase, i.e., the production information this means that the information is decoded of entropy is an indication of a reduction in the thermal and the system uses this decoded information to perform efficiency of the engine. In the language of information additional work and as a result the efficiency increases. the Clausius’ statement of the Second Law means that in- Thus, as was mentioned before, one way to exceed the formation can never be decoded in deterministic thermo- Carnot efficiency is to have non-Markovian processes dur- dynamics. As we will show below, in stochastic quantum ing the cycle. As an example, consider a spin-1/2 system 4

that for cyclic processes in which information is system- atically written to the memory, the efficiency can exceed the Carnot limit. It should be noted that in this case the system and the bath are not left to themselves, i.e., the information reservoir acts as Maxwell’s demon which intervene in the process from the outside to decode infor- mation. But in the case of non-Markovian bath nothing intervenes in the process from the outside, i.e., informa- tion is decoded without any help from the outside of the system and the bath. (c) Consider a quantum engine interacting with only one heat reservoir at temperature T . The work done after a cycle is ∆W = −∆Q thus, using Eq. (48) of supplemen- tary NoteX, we get FIG. 2: (Color online) As a visual aid points, between which 1 1 the quantum system operates as the working substance in an ∆W = ∆ S + ∆ S Otto cycle, in dynamical configuration space are depicted in β i h β i c a (ρ, H)-coordinate system. From A to B the heat ∆Qh is β β β β = T [S(ρ1kρ ) − S(ρ0kρ ) + S(ρ1kρ ) − S(ρ0kρ )], absorbed from the hot reservoir at temperature Th and from 0 0 1 1 C to D the heat ∆Qc is rejected to the cold reservoir at (14) temperature Tc. The processes from B to C and from D to β A occur adiabatically. where ρ0 = exp(−βH0)/tr{exp(−βH0)} and β ρ1 = exp(−βH1)/tr{exp(−βH1)}. For this cycle if the heat reservoir is Markovian Eq. (14) is positive, [14, 17–19] working in an Otto cycle, as depicted in Fig. as we mentioned before, i.e., no negative work can (2). The system is in an initial state ρ0, diagonal in be extracted which is in complete agreement with the the eigenbasis of the Hamiltonian H0 = (ω0/2)σz, where Kelvin-Planck statement of the Second Law which ω0 = κB and σz is the Pauli matrix. Here κ is a con- asserts that no process is possible whose sole result stant and B is the constant magnetic field applied in the is the extraction of energy from a heat bath, and the z direction on the system. The efficiency of the engine conversion of all that energy into work [1–3]. But if reads (see Supplementary NoteXI) the heat reservoir is non-Markovian Eq. (14) can be ω T negative. In other words negative work can be extracted η = 1 − 1 ≤ 1 − 3 . (13) ω T in a cycle with only one heat reservoir and this is 0 1 strictly against the Second Law. This violation occurs For a Markovian process in order to absorb heat from the just because the second law of deterministic classical hot reservoir and reject heat to the cold reservoir we must thermodynamics is only based on losing information have Tc ≤ T3 ≤ T1 ≤ Th. Thus 1−T3/T1 ≤ 1−Tc/Th, i.e., (flow of information) while in stochastic quantum the efficiency is less than Carnot efficiency, and the Sec- thermodynamics information could also backflow into ond Law is preserved. But in the case of non-Markovian the system. baths, since the effective temperature of the system may (d) As the last case let us now consider a quantum engine not approach the temperature of the reservoir monoton- working in a cycle, similar to the one in case (a), between ically [20–24], we can have T3 ≤ Tc ≤ Th ≤ T1 which two heat reservoirs at temperatures Th and Tc, but with can lead to an engine more efficient than that of Carnot, Th < Tc, i.e., the engine transports heat from a cool resulting in the violation of the Second Law. It should reservoir to a hot reservoir and performs negative work. be noted that decoupling the system from the reservoir According to the second law of classical thermodynamics might cause some energy cost. But since, in the exam- this is impossible and strictly violates the Clausius’ ple above, we are in the weak coupling limit and turning statement of the Second Law which declares that ”No on and off the interaction occurs very fast compared to process is possible whose sole result is the transfer of the time of the step, this energy cost is negligible, i.e, heat from a colder to a hotter body” [1–3]. In this case Eint = tr{ρHint}' 0. 1 1 ∆Wirr = ∆iSh + ∆iSc and if non-Markovianity is It is worth mentioning that, although Clausius et. al βh βc made no mention of information in establishing the Sec- strong enough such that | ∆Wirr |>| ∆Wrev | negative ond Law, from our point of view the information had work can be output thus the efficiency of the engine already been incorporated into the Second Law. Be- could be greater than zero. Non-Markovianity to be cause positive entropy production means that informa- strong enough means that enough information to be tion is encoded. In Ref. [25] a device interacting with decoded to extract enough negative work. In Ref. [21] a two heat reservoirs, a work reservoir, and an informa- quantum Otto heat engine has been investigated. They tion reservoir which exchanges information but not en- have found that if the heat reservoirs are Markovian Th ergy with the device was investigated. They have found must be larger than 2Tc in order for negative work to 5 be output; however, in the non-Markovian case negative V. THE SECOND LAW OF work can be performed if Th > 0.8Tc. From our point THERMODYNAMICS of view the condition Th > 0.8Tc is the condition under which enough information is decoded for the system to In a thermodynamic process information can be en- perform negative work in the cycle. coded and also decoded for the system to perform work The four cases considered above help to understand the which equals temperature T times the entropy produc- physical nature of information. Rolf Landauer declared tion of the system, i.e., in 1991 that ”information is physical” [26]. Since then, 1 information has come to be seen by many physicists ∆W = ∆ S, as a fundamental component of the physical world irr β i [27–30]. In deterministic equilibrium thermodynamics we could also have negative entropy production. Szil´ard where β = 1/T is the temperature of the reservoir showed that information can be used to do work if one with which the system interacts. As can be seen permits an intelligent being (demon) to intervene in this definition of the Second Law emphasizes on the the process of a thermodynamic system [11]. In the connection between thermodynamics (work as a ther- language of information what Maxwell’s demon does modynamic variable) and information theory, not on a is that it decodes (gathers or brings back) information specific direction for the arrow of time because unlike and the system uses this decoded information to output deterministic classical thermodynamics in stochastic more work. Decoding information causes the entropy quantum thermodynamics the entropy production can production of the system to be negative, therefore as be both positive and negative. This way of defining we have shown above this causes the system to perform the Second Law covers both classical and quantum more work and, in turn, it leads to have an efficiency thermodynamics and also incorporates information greater than that of Carnot. Del Rio et. al [31] have well into the Second Law, i.e., it is never violated in shown that erasing a system, which is coupled strongly the quantum realm nor in the presence of a demon with another system (a quantum memory), may cause intervening in the process. Therefore Carnot’s, Clausius’ the conditional entropy of the system to be negative and and the Kelvin-Planck statements of the Second Law this negative entropy will lead to extracting work from come just as a part of the Second Law, i.e., the encoded the system, thus cooling the environment. Our results part. As we have shown the different results in quantum provide a thermodynamic operational meaning for thermodynamics are obtained just because quantum negative entropy production, which until now only had thermodynamic systems contain quantum correlations information-theoretical interpretations; for example, it through which information can be decoded (brought witnesses the non-Markovianity (or backflow of informa- back) spontaneously without any demon intervening in tion). The significance of a general Szil´ardengine is that the process and consequently more work than what is it conjoins thermodynamics and information theory. It expected can be output. Decoding information (negative shows the usefulness of information for performing some entropy production), without a demon, is never seen thermodynamic task. Given the important link between in deterministic classical thermodynamics therefore the task of work extraction and information theory, as the second law of classical thermodynamics cannot be appears in the examples of Maxwell’s demon [32], the extended to quantum thermodynamics. In the next Szil´ardengine [11], and Landauer’s erasure principle [33], section we will show that there is a thermodynamic it is becoming more common to consider the nature of force which is responsible for decoding and encoding information as physical. It is now well understood that information. the role of the demon does not contradict the second law of thermodynamics, because the initialization of the demon’s memory entails heat dissipation [33–35]. In classical thermodynamics if we leave the system to itself VI. MAXWELL’S DEMON AND QUANTUM (i.e. no demon is allowed to intervene) there is no way THERMODYNAMIC FORCE to have a negative entropy production thus the Carnot engine is in fact the most efficient engine possible. But In Ref. [13] it was shown that a thermodynamic force in the quantum realm, due to the existence of landmark is responsible for the flow and backflow of information quantum features, even if the system is left to itself, in in quantum processes. For a system, interacting with a non-Markovian processes the entropy production of the bath initially at temperature β = 1/T , the rate of the system can be negative (information is decoded) thus entropy production can be expressed as [13] the system, working in a cycle, can be more efficient diS than a Carnot engine. Now we are in a position to = tr{FthVth}, (15) properly define the second law of thermodynamics for dt both classical and quantum thermodynamics as: β where Vth ≡ ρ˙tρt is the thermodynamic flow and Fth ≡ 1 β β [ln ρt − ln ρt] the thermodynamic force. Using Eqs. ρt 6

(4) and (15) we get the Shannon information content and H(ρ1: X) = P √ √ √ √ − tr{ Dkρ1 Dk ln Dkρ1 Dk}. {Dk} are posi- dW 1 k irr = tr{F V }. (16) tive operator valued-measure (POVM) defined by Dk = dt β th th † Mk Mk and pk = tr{Dkρ}. It is seen that the sum of the last three terms on the right hand side of the inequal- Since it was shown in Ref. [13] that the thermody- ity (19) is the irreversible work due to the presence of namic force F is responsible for the flow (encoding) th the feedback controller (the demon). Thus if we take the and backflow (decoding) of information in Markovian and time derivative of these three terms we have non-Markovian dynamics, respectively, Eq. (16) suggests that, if the system is left to itself, Fth actually encodes dW dem 1 X irr = [tr{ρ˙ ln ρ } + p˙ ln p energy, during the flow, not to be used as work by the sys- dt β 1 1 k k tem and decodes energy, during the backflow, to be used k X p p p p as work by the system. In classical thermodynamics De − tr{ Dkρ˙1 Dk ln Dkρ1 Dk}](20). Donder found a similar relation for chemical reactions k [36]. Let us now consider the case in which the system is not left to itself, i.e., someone or something outside the Comparing Eq. (20) with Eq. (16) it is observed that system (as a demon) intervenes in the process. Szil´ard there are three quantum thermodynamic forces responsi- argued that negative work ∆W can be extracted from an ble for the extra work done during the process, isothermal cycle if Maxwell’s demon plays the role of a √ √ feedback controller [37]. When the statistical state of a 1 ln ρ1 2(k) ln pk 3(k) ln Dkρ1 Dk Fth = β ,Fth = β ,Fth = − β . system changes from ρ(x) to ρ(x|m), due to the measure- ρ1 pk ρ1 ments made by the demon on the system, the change in (21) the entropy of the system can be expressed as [34, 38] Thus we may write

tot 1 M 2 M 3 ∆Smeas = H(X|M) − H(X) = −I(X: M), (17) Fth = Fth Fth Fth. (22) P where H(X) = − x ρ(x) ln ρ(x) is the Shanon entropy There are also three thermodynamic flows associated of the system and I(X; M) the be- with these three thermodynamic forces above, tween the state of the system and the measurement out- come M. Since I(X; M) is always positive thus the de- 1 β 2(k) β 3(k) p p β Vth =ρ ˙1ρ1 ,Vth =p ˙kpk ,Vth = Dkρ˙1 Dkρ1 , mon causes the entropy of the system to decrease. This (23) is similar to the case of non-Markovianity in which the and it may be written entropy decreases. Therefore the presence of the demon is also expected to lead to extracting more work from the tot 1 M 2 M 3 Vth = Vth Vth Vth. (24) system than what is expected. Now the role of the demon can be incorporated into the Second Law as [34, 39] We must notice that Eqs. (22) and (24) should not be 1 taken too literally, i.e., these equations just indicate the ∆W ≥ ∆F − I(X: M). (18) fact that there are three thermodynamic forces and flows β involved due to the presence of the feedback controller In Ref. [32] a practical way was offered, as an alternative and we cannot add them up like the way we do about tot to the Szil´ardengine, to physically realize Maxwell’s de- typical vectors. We note that Fth = 0 if and only if mon. They have shown that using a feedback contoller Dk is proportional to the identity operator for all k [32], (the demon) which makes measurements on the engine which means that nothing is intervening in the process, they are capable of extracting more work from the heat therefore no information is decoded to be used to per- reservoirs than is otherwise possible in thermal equilib- form additional work by the system. On the other hand, tot 2 rium. For a system, initially and finally in equilibrium Fth = Fth if and only if Dk is the projection operator states with temperature β = 1/T , which can contact satisfying [ρ1,Dk] = 0 for all k [32], which means that the tot measurement on ρ1 is classical, hence F is classical. In heat reservoirs B1,B2, ..., Bn at respective temperatures th Refs. [34, 40, 41] similar results have been found. There- T1,T2, ..., Tn they have found that fore we have shown that intervention (the demon) from 1 the outside in the process of a system may be represented ∆W ≥ ∆F β − I(ρ : X), (19) β 1 by a thermodynamic force. and 1 VII. SUMMARY I(ρ : X) = [S(ρ ) − H({p }) + H(ρ : X)], 1 β 1 k 1 In this work we have appropriately divided the work where ρ1 is the state of the system at some time t1, S(ρ1) done by a thermodynamic system into two parts: re- P the Von Neumann entropy, H({pk}) = − k pk ln pk versible work and irreversible work. This partitioning 7 seems plausible since whenever the process is reversible information theory is fundamental. Based on this anal- all the work is reversible and there exists no irreversible ysis we have introduced a new definition of the second work as expected. Using this partitioning we have de- law of thermodynamics such that it covers both classical rived a generic form for the efficiency of an engine oper- and quantum thermodynamics and incorporates well in- ating in an arbitrary cycle. It was shown that negative formation into the Second Law. At last, we have shown entropy production, which can occur in non-Markovian that a quantum thermodynamic force is responsible for processes or by intervening in the process of the system encoding and decoding information even when a feedback (Maxwell’s demon), means that the internal energy is de- controller outside the system is involved in the process. coded to be used by the system to perform more work than what is expected and this additional work leads to having quantum engines with efficiencies greater than that of Carnot. We have investigated four special cases 1 to elucidate the physical meaning of ∆Wirr = ∆iS ACKNOWLEDGMENTS β in quantum thermodynamics and have discovered re- sults which strictly contradict the second law of classical The authors would like to thank Profs. Johan Aberg˚ thermodynamics. We have also shown that the relation 1 and Michal Horodecki for very useful comments and ad- ∆W = ∆ S as a link between thermodynamics and vices. irr β i

[1] Kondepudi D and Prigogine I, Modern Thermodynamics Phys. Rev. A 82 012105 90 (2010). (New York: Wiley 1998). [21] X. Y. Zhang, X. L. Huang, and X. X. Yi, J. Phys. A: [2] S. J. Blundell, K. M. Blundell, Concepts in Thermal Math. Theor. 47, 455002 (2014). Physics (Oxford University Press 2009). [22] J. Paavola, J. Piilo, K.-A. Suominen, and S. Maniscalco, [3] H. B. Callen, Thermodynamics and an Introduction to Phys. Rev. A 79, 052120 (2009). Thermostatistics 2nd edn (JohnWiley, 1985). [23] F. Intravaia, S. Maniscalco, and A. Messina, Phys. Rev. [4] J. C. Maxwell, Theory of Heat (Appleton, London, 1871). A 67, 042108 (2003). [5] H. S. Leff and A. F. Rex, (eds) in Maxwell’s Demon: En- [24] H. S. Goan, P. W. Chen, and C. C. Jian, J. Chem. Phys. tropy, Information, Computing (Princeton Univ. Press, 134, 124112 (2011). 1990). [25] S. Deffner and C. Jarzynski, Phys. Rev. X 3, 041003 [6] K. Maruyama, F. Nori, and V. Vedral, Rev. Mod. Phys. (2013). 81, 1-23 (2009). [26] R. Landauer, Information is physical, Physics Today, [7] D. J. Evans, D. Cohen, and G. P. Morriss, Phys. Rev. 44(5), 23-29 (1991). Lett. 71, 24012404 (1993). [27] M. Karnani, K. Pkknen, and A. Annila, Pro. R. Soc. A [8] D. J. Evans, and D. J. Searles, Phys. Rev. E 40, 16451648 465 (2107), 2155-2175 (2009). (1994). [28] V. Vedral, Decoding reality: The universe as quantum [9] G. M. Wang, E. M. Sevick, E. Mittag, D. J. Searles, and information, Oxford University Press (2010). D. J. Evans, Phys. Rev. Lett. 89, 050601 (2002). [29] V. Vedral, Information and physics. Information, 3(2), [10] S. An, J.-N. Zhang, M. Um, D. Lv, Y. Lu, J. Zhang, 219-223 (2012). Z.-Q. Yin, H. T. Quan, and K. Kim, Nature Phys. 11, [30] P. Davies, and N. H. Gregersen, Information and the na- 193199 (2015). ture of reality: from physics to metaphysics, Cambridge [11] L. Szil´ard, Zeitschrift f¨urPhysik 53, 840 (1929). University Press (2010). [12] Hong-Bin Chen, Guang-Yin Chen, and Yueh-Nan Chen, [31] del Rio, L., Aberg,˚ J., Renner, R., Dahlsten, O. and Ve- Phys. Rev. A 96, 062114 (2017). dral, Nature 474, 61-63 (2011). [13] B. Ahmadi, S. Salimi, A. S. Khorashad and F. Kheiran- [32] T. Sagawa and M. Ueda, Phys. Rev. Lett. 100, 080403 dish, Sci. Rep. 9, 8746 (2019). (2008). [14] Quan, H. T., Liu, Y.-x., Sun, C. P. and Nori, F., Phys. [33] R. Landauer, IBM J. Res. Dev. 5, 183 (1961). Rev. E 76, 031105 (2007). [34] Juan M. R. Parrondo, Jordan M. Horowitz and Takahiro [15] S. Marcantoni, S. Alipour, F. Benatti, R. Floreanini, and Sagawa, Nature Phys. 11, 131-139 (2015). A. T. Rezakhani, Sci. Rep. 7, 12447 (2017). [35] S. Lloyd, Phys. Rev. A 56, 3374 (1997). [16] J. Gemmer, M. Michel and G. Mahler, Quantum Ther- [36] De Donder, T., Van Rysselberghe, P., Affinity. 1936, modynamics, Lect. Notes Phys. 784 (Springer, Berlin Stanford University Press: Menlo Park, CA. Heidelberg 2009) [37] M. A. Nielsen, C. M. Caves, B. Schumacher, and H. Bar- [17] G. Thomas, N. Siddharth, S. Banerjee, and S. Ghosh, num, Proc. R. Soc. A 454, 277 (1998). Phys. Rev. E 97, 062108 (2018). [38] S. Lloyd Phys. Rev. A 39, 5378-5386 (1989). [18] G. Thomas and R. S. Johal, Phys. Rev. E 83, 031135 [39] Takahiro Sagawa, arXiv:1712.06858. (2011). [40] Jung Jun Park, Kang-Hwan Kim, T. Sagawa, and Sang [19] T. D. Kieu, Phys. Rev. Lett. 93, 140403 (2004). Wook Kim, Phys. Rev. Lett. 111, 230402 (2013). [20] H. N. Xiong, W. M. Zhang, X. G. Wang and M. H Wu, [41] Li-Hang Ren and Heng Fan, Phys. Rev. A 96, 042304 8

(2017). IX. SUPPLEMENTARY NOTE 2 [42] C. Jarzynski, Phys. Rev. Lett. 78, 2690 (1997). [43] G. E. Crooks, Phys. Rev. E 60, 2721 (1999). Irreversibility in physical process is strictly related to [44] J. M. R. Parrondo, C. Van den Broeck, and R. Kawai, New J. Phys. 11, 073008 (2009). the idea of energy dissipation. Irreversible processes en- [45] S. Deffner and E. Lutz, Phys. Rev. Lett. 105, 170402 countered by an open thermodynamic system are accom- (2010). panied with a production of entropy which is fundamen- [46] M. Esposito and C. Van den Broeck, EPL, 95 (2011) tally different from the entropy flow in the form of heat 40004. caused by the interaction between the system and its [47] F. Plastina, A. Alecce, T. J. G. Apollaro, G. Falcone, G. environment. Characterization of irreversibility is one Francica, F. Galve, N. Lo Gullo, and R. Zambrini, Phys. of the cornerstones of non-equilibrium thermodynamics Rev. Lett. 113, 260601 (2014). since the theory was born. For an isothermal process the [48] T. B. Batalh˜ao, A. M. Souza, R. S. Sarthour, I. S. second law of deterministic equilibrium classical thermo- Oliveira, M. Paternostro, E. Lutz, and R. M. Serra, Phys. dynamics may be expressed as Rev. Lett. 115, 190601 (2015). [49] G. Francica, J. Goold, and F. Plastina, arXiv:1707.06950. ∆W ≥ ∆F β, (31) [50] S. Deffner and S. Campbell, J. Phys. A: Math. Theor (2017). [51] T. B. Batalh´ao,S. Gherardini, J. P. Santos, G. T. Landi, where ∆W is the amount of work required to change the and M. Paternostro, arXiv:1806.08441. state of the system between two equilibrium states and β [52] S. Deffner and E. Lutz, Phys. Rev. Lett. 107, 140404 ∆F the difference in the Helmholtz free energy of the (2011). system. This, in turn, led to the introduction of the so- [53] R. Alicki, J. Phys. A 12, L103 (1979). called irreversible work [42, 43], [54] H. P. Breuer and F. Petruccione, The theory of open β quantum systems (Oxford University Press, Oxford, ∆Wirr ≡ ∆W − ∆F ≥ 0. (32) 2002). [55] A. Rivas, S. F. Huelga and M. B. Plenio, Rep. Prog. Defining ∆Wirr as in Eq. (32) gives rise to Phys. 77, 094001 (2014). 1 ∆W = ∆ S, (33) irr β i VIII. SUPPLEMENTARY NOTE 1 where ∆iS is the entropy production of the system during The entropy production between the engine and the the irreversible process and β = 1/T the temperature of hot reservoir is the system. It should be emphasised that in equilibrium thermodynamics the reversible work equals the change in ∆Qh ∆Qh β ∆iS1 = − , (25) the free energy, i.e, ∆Wrev = ∆F [1–3]. Thus the total T1 Th work done by the system is partitioned into reversible and and between the engine and the cold reservoir irreversible parts, i.e, ∆W = ∆Wrev + ∆Wirr. Thermo- ∆Q ∆Q dynamic reversibility is achieved if and only if no entropy ∆ S = c − c . (26) is produced inside the system, i.e, ∆ S = 0 [1–3]. Eq. i 2 T T i c 3 (33), in the language of information, has a very subtle The total entropy production during a cycle is ∆iS = and interesting meaning. It links thermodynamics with ∆iS1+∆iS2. Since no irreversibility occurs in the interior information theory. It says that some of the internal en- of the engine we have ergy, during the irreversible process, is encoded due to the loss of information and consequently the system can- ∆Qh ∆Qc = . (27) not use this amount of the internal energy to do work. T T 1 3 For instance in the process of the free expansion of a gas Thus we get all the internal energy is encoded therefore no internal energy can be used by the gas to perform any work, i.e, ∆Qc ∆Qh ∆iS = − . (28) |∆W | = |∆W |. Thus if the system operates in an T T rev irr c h irreversible cycle its efficiency decreases [1–3]. In other The efficiency of the engine reads words Eq. (33) means that information is physical. Eqs. (32) and (33) have been extended to quantum thermo- −(∆W1 + ∆W2) ∆Qc T3 ηe ≡ = 1 − = 1 − . (29) dynamics with the same formulae [44–52]. This may be ∆Q ∆Q T h h 1 wrong and misleading for two reasons. First, the inequal- Now combining Eqs. (28) and (29) we obtain ity (31) does not always hold in the quantum realm. Be- T ∆ S cause in stochastic quantum thermodynamics there exist η − η = − c i , (30) processes, called non-Markovian processes, in which we e C ∆Q h may have Tc where ηC = 1 − is the Carnot efficiency. β Th ∆W ≤ ∆F . 9

This is because in deterministic classical thermodynam- process is defined as a process that can be reversed with- ics, according to the Clausius’ statement of the Second out leaving any trace on the surroundings. That is, both Law, the entropy production of a system can never be the system and the surroundings are returned to their negative [1–3], but in quantum thermodynamics, dur- initial states at the end of the reverse process. This def- ing non-Markovian processes, the entropy production of inition of reversibility in conventional thermodynamics the system may be negative [12, 15]. Second, in quan- may be completely characterized by the entropy produc- tum thermodynamics, as we will show in this work, tion. Thermodynamic reversibility is achieved if and only the reversible work ∆Wrev done by a system equals if the entropy production is zero, i.e., ∆iS = 0 [1–3]. 1 ∆I + ∆F β, where I(t) = S(ρ kρβ), rather than ∆F β. A stochastic process is thermodynamically reversible, if β t t and only if the final probability distribution can be re- If we apply Eq. (32) to the evolution of a closed quantum stored to the initial one, without remaining any effect system, which is unitary, we observe that ∆Wirr could on the outside world [39]. As in conventional thermody- be nonzero while the process is reversible, i.e, ∆iS = 0. namics, reversibility in stochastic processes is completely Thus if ∆Wirr is defined as in Eq. (32) for quantum characterized by the entropy production. Reversibility in systems, for a closed quantum system Eq. (33) may stochastic thermodynamics is achieved if and only if the not hold. For instance in the case of the evolution of entropy production is zero [39], i.e., a closed quantum system initially in equilibrium we have 1 ∆W = S(ρ kρβ) 6= 0 while ∆ S = 0. ∆iS = 0. (39) irr β t t i Reversible and irreversible work. We define heat as Z τ ∆Q ≡ dttr{ρ˙tHt}, (34) Theorem 1 The work done by a thermodynamic sys- 0 tem, in the weak coupling limit, can always be appro- and work is defined as the mean change of Hamilton with priately partitioned into two parts: reversible work and time [53] irreversible work, i.e, Z τ ∆W = ∆Wrev + ∆Wirr, (40) ∆W ≡ dttr{ρtH˙ t}, (35) 0 in which where ρt is the state of the system and Ht the Hamilto- nian of the system. Now consider an arbitrary quantum 1 ∆W = ∆I + ∆F β, (41) system S coupled with a heat reservoir B at temperature rev β β = 1/T . Eq. (35) becomes and Z τ 1 β β ∆W = − dttr{ρt∂t ln ρt } + ∆F , (36) 1 β 0 ∆W = ∆ S. (42) irr β i β where ρt = exp(−βHt)/Zt is the instantaneous Gibbs state of the system with Zt the partition function and Proof. Since in a reversible process no entropy is pro- 1 duced inside the system, i.e., ∆ S = 0, using Eqs. (36) F β = − ln Z the free energy of the system. The total i t β t and (38), after some straightforward calculations, the (re- change in the entropy ∆S of the system is divided into versible) work is obtained as two parts [1–3] 1 ∆W = ∆I + ∆F β, ∆S = ∆iS + ∆eS, (37) rev β in which S = −tr{ρ ln ρ} is the Von Neumann entropy β where I(t) = S(ρtkρ ). Unlike the reversible processes, of the system, ∆eS ≡ β∆Q the entropy change due to t during a general process the entropy may be produced the exchange of energy with the reservoir and ∆iS the entropy produced by the irreversible processes in the in- inside the system (irreversible processes), i.e., ∆iS 6= 0 terior of the system. In contrast to the thermodynamic [16, 54]. Therefore we find entropy that can be defined only for thermal equilibrium, 1 1 β the Von Neuwman entropy can be defined for an arbitrary ∆W = ∆iS + ∆I + ∆F , probability distribution. Combining Eqs. (34)−(37), we β β get where the sum of the last two terms on the right hand τ Z side is the reversible work, ∆Wrev, and the first term is ∆ S = S(ρ kρβ)−S(ρ kρβ)− dttr{ρ ∂ ln ρβ}, (38) i 0 0 τ τ t t t the irreversible work, ∆Wirr. Hence the total work done 0 by a system during a general process can be expressed as where S(ρkσ) ≡ tr{ρ ln ρ} − tr{ρ ln σ} is the relative en- tropy of the states ρ and σ. A thermodynamic reversible ∆W = ∆Wirr + ∆Wrev.  10

The non-equilibrium free energy for a generic statistical an initial state ρ0, diagonal in the eigenbasis of the Hamil- state ρ of a quantum system in contact with a thermal tonian H0 = (ω0/2)σz, where ω0 = κB and σz is the bath is defined as Pauli matrix. Here κ is a constant and B is the constant magnetic field applied in the z direction on the system. F (ρ, H) ≡ E − TS = tr{ρH} − TS(ρ), (43) In step I the engine interacts weakly with a hot reser- voir at temperature Th, for time τ1 from point A(ρ0,H0) where H is the Hamilton of the system. Using Eqs. (34) to point B(ρ1,H0). The final state of the system is and (35), Theorem1, and Eq. (43) we obtain ρ1 = exp(−H0/T1)/tr{exp(−H0/T1)}, which is diagonal in the eigenbasis of H . Here T = −ω /(2 tanh−1hσ i ), 1 1 1 0 z 1 ∆ S = ∆W = ∆W − ∆F. (44) where hσzi = tr{ρ1σz}, is the effective temperature of β i irr the system after time τ1. The heat absorbed by the engine is ∆Q = tr{H (ρ − ρ )}. In step II the en- Eq. (44) is the extension of Eq. (32) to quantum thermo- h 0 1 0 gine is decoupled from the hot reservoir and undergoes dynamics. The only difference is that ∆F in Eq. (44) is an adiabatic evolution from point B(ρ ,H ) to point the difference in non-equilibrium free energies and as we 1 0 C(ρ ,H ) by varying the magnetic field from ω to ω mentioned before this is because quantum thermodynam- 1 1 0 1 (ω < ω ). Since the system performs work, the tem- ics is a non-equilibrium thermodynamics. The associated 1 0 perature of the system changes at the end of this pro- non-equilibrium free energy is analogous to its equilib- cess and it becomes T = T ω /ω . In step III it inter- rium counterpart in non-equilibrium processes. When 2 1 1 0 acts weakly with a cold reservoir at temperature T from the initial and final states of the system are thermal equi- c point C(ρ ,H ) to point D(ρ ,H ) for time τ and the librium states Eq. (44) becomes equivalent to Eq. (32) 1 1 0 1 2 state of the system becomes ρ0 with the effective temper- in conventional thermodynamics as expected. −1 ature T3 = −ω1/(2 tanh hσzi0). The heat rejected to the cold reservoir is ∆Qc = tr{H1(ρ0 − ρ1)}. Finally in X. SUPPLEMENTARY NOTE 3 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,H1) to point A(ρ0,H0) Consider a system in state ρ0 at time t = 0 attached and complete the cycle. The temperature of the system to a bath of temperature T . After a finite-time τ, let the at the end of this cycle becomes T0 = T3ω0/ω1. It can state of the system be ρτ . The Hamiltonian H of the sys- be shown that the effective temperatures of the system tem remains unchanged during the evolution. Therefore, approach the temperatures of the heat baths asymptoti- using Eq. (38), the entropy production of the system cally [17]. The heat absorbed by the system from the hot after a time τ is reservoir during step I is given by β β ∆iS = S(ρ0kρ ) − S(ρτ kρ ). (45) ω ω ω ∆Q = 0 [tanh( 1 ) − tanh( 0 )]. (49) h 2 2T 2T For a completely positive, trace preserving (CPTP) map 3 1 Λt and any two density matrices ρ1 and ρ2, if the dynam- β β In the same way, the heat rejected to the cold heat during ics is Markovian for which Λt[ρ ] = ρ for all t, we have step III is obtained as [55] ω ω ω β β 1 1 0 S(ρ2|ρβ) = S(Λt[ρ1]kΛt[ρ ]) ≤ S(ρ1kρ ). (46) ∆Qc = − [tanh( ) − tanh( )]. (50) 2 2T3 2T1 β β But if the dynamics is non-Markovian, since Λt[ρ ] 6= ρ , Now the total work done by the system after the cycle is we can have [55] ∆W = −(∆Qh + ∆Qc), i.e, β S(ρ2kρ ) ≥ S(ρ1kρβ). (47) ω − ω ω ω ∆W = 1 0 [tanh( 1 ) − tanh( 0 )]. (51) The heat exchanged between the system and the bath is 2 2T3 2T1 obtained as For a machine to work as an engine we must have ∆W < 0, ∆Qh > 0 and ∆Qc < 0. This implies that ∆Q = T ∆S − T ∆iS β β = T [S(ρτ ) − S(ρ0)] + T [S(ρτ kρ ) − S(ρ0kρ )]. ω ω 1 ≥ 0 . (52) (48) T3 T1

Hence the efficiency of the engine reads XI. SUPPLEMENTARY NOTE 4 ω T η = 1 − 1 ≤ 1 − 3 . (53) Here we consider a spin-1/2 system [14, 17–19] working ω0 T1 in an Otto cycle, as depicted in Fig. (2). The system is in