The thermodynamic cost of driving quantum systems by their boundaries

The laws of thermodynamics put limits to the efficiencies of thermal machines. Analogues of these laws are now established for quantum engines weakly and passively coupled to the environment providing a framework to find improvements to their performance. Systems whose interaction with the environment is actively controlled do not fall in that framework. Here we consider systems actively and locally coupled to the environment, evolving with a so-called boundary-driven Lindblad equation. Starting from a unitary description of the system plus the environment we simultaneously obtain the Lindblad equation and the appropriate expressions for heat, work and entropy-production of the system extending the framework for the analysis of new, and some already proposed, quantum heat engines. We illustrate our findings in spin 1/2 chains and explain why an XX chain coupled in this way to a single heat bath relaxes to thermodynamic-equilibrium while and XY chain does not. Additionally, we show that an XX chain coupled to a left and a right heat baths behaves as a quantum engine, a heater or refrigerator depending on the parameters, with efficiencies bounded by Carnot efficiencies.

Considerable experimental progress in various physical systems has been achieved toward the goal of controlling the dynamics of open quantum systems and their interactions with the environment 1-3 . For quantum computations or digital coherent quantum simulations, one may wish to have a system that is well isolated from the environment. For dissipative variants of quantum computations 4 or creating new scenarios for non-equilibrium many-body systems, one would need to engineer the coupling to the environment. Recently, a setting in which the quantum system of interest interacts at its boundaries with an external quantum probe such that their coupling can be localized and can be switched on and off repeatedly with a controlled and well-defined state for the probe prior to the interaction has been experimentally realized 5 . This repeated interaction scheme has also been theoretically studied 6,7 . Importantly, the dynamics in an appropriate limit is a boundary-driven Lindblad equation. In this article, we explore the question of what is the thermodynamic cost of having such operations on an open quantum system and what are the thermodynamical quantities, such as heat and work that will determine the efficiency of quantum engines operating in this manner. Boundary-driven Lindblad equations have been intensively studied theoretically, particularly for one-dimensional quantum chains [7][8][9][10][11][12][13][14][15][16][17][18][19] , and powerful techniques have been developed to find their non-equilibrium steady states (NESS) [12][13][14][15][16][17][18][19] . These equations are also frequently used to describe quantum engines [20][21][22][23] and other complex open quantum systems coupled to one or several environments [24][25][26][27] because they are easy to implement. Nevertheless, a boundary driven Lindblad equation does not correctly describe a quantum system passively and weakly coupled to a heat-bath as often occurs in natural systems. It was pointed out recently 28 that inconsistencies with the second law of thermodynamics may arise in this case and a careful examination of the coupling between a quantum refrigerator and the heat-baths 29 reveals why boundary driven models are inappropriate for these situations. For a system passively and weakly coupled to one or several heat-baths the master equation derived in the Born-Markov-secular approximation 30 yields a proper description of the system and the correct balance of heat flows and irreversible entropy production.
Thus, for our study, we consider explicitly the active (time-dependent) type of interaction between the system and the environment implemented in 5 and the model developed in 6,7 . We apply the results of 31,32 to derive the appropriate thermodynamical quantities and, in particular, we focus in the limit where the system is described by a boundary driven Lindblad equation.
Our main result is that driving at the boundaries, even though it looks like a work-free operation, actually might bring work to the system. We illustrate our findings on boundary-driven spin 1/2 chains coupled to one or two heat baths. We show that an XX spin 1/2 chain coupled in this way to a single heat bath relaxes to thermodynamic equilibrium while an XY does not because it is driven out of equilibrium by the power produced by the coupling to the heat bath. When two baths are connected to the chain, we observe that for different parameters, the chain operates as a quantum heat engine, refrigerator or heater, and we determine their efficiencies in the simple case of a chain of two sites. The rest of the paper is organized as follows. We start by reviewing first the thermodynamics of Markovian open quantum systems in the weak coupling limit [33][34][35][36] and second a formulation 31 where the "universe", system plus the environment, evolves unitarily. After that, we consider the repeated interaction scenario for the system and the environment from which the boundary-driven Lindblad equation and the appropriate thermodynamical quantities for the open system are obtained. Then we illustrate our results in XX and XY spin 1/2 chains and offer our conclusions. Finally we have collected in section Methods some details of the calculations.

Thermodynamics of open quantum systems
Open system weakly and passively coupled to the environment. Let us briefly review the usual formulation of thermodynamics in open quantum systems [33][34][35][36] . Consider an open system described by a master equation in the Lindblad form where the environment consists of several heat-baths r whose action on the system is represented by the dissipator with ⋅, ⋅ [ ] the commutator and ⋅, ⋅ { } the anti-commutator. The operators µ L r are system operators and represent the action of the environment over the system. When this equation is obtained from the weak coupling limit for a time independent system, one finds global Lindblad operators µ L r that are eigen-operator of the Hamiltonian H S

30
. For simplicity, we consider that the system can only exchange energy and no particles with the environment. Now consider the internal energy ρ ( ) = ( ( ) ( )) U t H t t tr S S and the entropy ρ with one contribution per heat-bath. For system passively and weakly coupled to the heat-baths, these quantities are defined as In section Methods: Heat from a given reservoir in the weak-coupling limit we justify these definitions. Note that if the Hamiltonian of the system is time independent, no work can be performed on the system and only heat is exchanged with the baths. In that case the system will typically reach a steady state. Consider now this to be the situation. The second law states the positivity of the entropy production ( / ≥ ) d S dt 0 i , which is the difference between the time-derivative of the entropy and the entropy flow from the environment to the system . This is the local-detailed-balance condition 37 i.e. if a single heat-bath is in contact with the system detailed balance as defined in 34,38 holds. This property of the dissipators D r is satisfied in quantum master equations obtained in the weak-coupling and with the Born-Markov-secular approximation (global Lindblad equation). This framework has been applied successfully to the study of thermodynamic properties and efficiencies of engines 29 In boundary-driven systems the Lindblad operators µ L r act locally on the boundaries of the system and in general the corresponding Lindblad equation does not satisfy local-detailed-balance. We come back to this point later. Following recent developments in the physics of non-equilibrium systems that have emphasized the importance of time reversal symmetry at the microscopic level of description 42 , a formulation of quantum thermodynamics in which the system plus the environment evolves unitarily has been proposed 31 . We consider this framework to analyze boundary driven systems.
"universe" under unitary evolution. Let a system and an environment with Hamiltonians ( ) H t S and H E (time independent), respectively, coupled by an interaction potential V(t) evolve with total Hamiltonian the initial density matrix for the reservoir r. Initially, the system and heat baths are . For arbitrary strength coupling between the system and environment 31 , the internal energy is defined by , and the first law relates its changes to work and heat ∆ ( , which is also given by given by minus the change in energy of the r-reservoir.
as the thermodynamic entropy of the system and r r r e determined by the heat flows in Eq. (5) and the entropy production 31 under the time evolution of the full system, plays a crucial role in the splitting of entropy change in the entropy flow and a positive entropy production. In the weak-coupling limit → V 0 and assuming that the open system satisfies a Lindblad equation obtained from the Born-Markov-secular approximation 30 , the rate of entropy production / ≥ d S dt 0 i and the above expressions for work and heat take the standard form given in Eq. (3) and Eq. (2) respectively. This is shown in section methods by considering the method of full-counting statistics 43 . However, the Lindblad models investigated in 7-10,12-18,28 are not obtained from the weak-coupling limit and do not satisfy local-detailed-balance. Thus to obtain the appropriate expressions for the thermodynamical quantities in boundary driven systems we apply in the next section the previous formulation, in particular Eqs (4),(5),(6), to a system plus environment evolving unitarily in which the reduced density matrix for the system satisfy a boundary driven Lindblad equation in an exact limit.

The repeated interaction scheme
Let us consider a finite system with time-independent Hamiltonian H S and left (L) and right (R) reservoirs composed of an infinite set of identical non-interacting finite systems with Hamiltonian H r n , i.e., Each H r n interacts with the system for a time span τ. This interaction is always of the same form, but to emphasize that interactions occur with different copies . At = t 0, the system and reservoirs are decoupled, i.e., ρ . At = + t 0 , the system begins to interact with the first copy and after a lapse of time τ, the state of the total system is ρ τ Then, at t = τ + 0, the interaction with the first copy is replaced by an interaction with the second copy for a time τ and so on. A recursion relation for the state of the system is obtained 6,7 by tracing out the nth copy of the environment (denoted as Tr n ) The unitaries are . This is the repeated interaction scheme. For simplicity we considered only two heat-baths but the generalization to several reservoirs is straight forward.
Let us consider the change of thermodynamical quantities in the time intervals of length τ. Crucially, due to the resetting of the heat baths, the interaction term is time dependent. According to Eq. (4) for time-independent H S , work is performed at the discrete times τ n where the interaction between the system and the environment changes because the copy in interaction changes. Performing the integral in Eq. (4) between an initial time τ ε − n and a final time τ ε + n , we obtain in the limit ε → 0. We simplify this expression with the standard 30 assumption that ω . This condition will be repeatedly used; it allows us to split We use Tr r to denote the trace over the r = L or r = R system and Tr to denote the full trace. The heat flow from the bath to the system in the time interval of length τ where the system interacts with the nth copy is evaluated from Eq. (5) n n is the density matrix of the nth copy of the environment at the end of the interaction with the system.
The entropy production ∆ S i in the time lapse τ is obtained from Eq. (6), and after some manipulations 31,32 , it can be written as the sum Note that because before the interaction the state of the system is arbitrary and uncorrelated with the product of thermal states of the copy, the theory of 31,32 applies independently of the correlations built between the system and previous copies.
Heat, work and boundary-driven Lindblad equation. The index n is associated with the copy that interacts in the interval of time τ τ ( − ) , n n [ 1 ] , but the copies are all identical prior to the interaction (a tensor product of two canonical distributions) and the interaction V r n is always of the same form. Because no confusion will arise, we drop the label n and denote the interaction = ∑ V V r r , the Hamiltonian of the bath copy H r and the state ρ . It was shown 6,7 that for V r that satisfies ω       = β V Tr 0 r r r and whose strength is scaled with τ as τ = / V v r r , the system evolution Eq. (7) in the limit τ → 0 converges to a Lindblad evolution (see methods) with ∆W r in Eq. (8) and ∆Q r in Eq. (9). In the limit τ → 0 with τ = / V v , we obtain (see methods) Finally, we express the entropy production rate as the difference between the time derivative of the von Neumann entropy and the entropy flow where the first term is computed using Eq. (10) with ≡ ∑ D D r r and the second term is computed from Eq. (11). Eqs (11),(12) provide appropriate thermodynamic expressions for systems evolving with Eq. (10). Now we illustrate our findings in spin 1/2 chains.

Spin models
Consider an XY spin 1/2 chain with Hamiltonian In the repeated interaction scheme we consider the couplings   is not the solution of What can be shown is that these dissipators thermalize the single spin in the boundary if we disconnect it from the rest of the chain. Indeed let us consider the L dissipator . This is the generic situation in boundary driven Lindblad systems.
The expression for power and heat Eq. (11) can be evaluated using the system hamiltonian Eq. (13), the coupling Eq. (14), the bath hamiltonian σ / h 2 r r z and the corresponding ω β r . One obtain (we take  (15), (16) one has the corresponding  Q R and  W R . To compute this quantities, we obtain ρ ( ) t S by solving the Lindblad equation 44 . Consider the case in which the system interacts with one bath (for instance the left bath, but we drop the label L). In general, two situations can occur: the system relaxes to thermodynamic equilibrium in which all current vanishes or the system reaches a NESS if it is externally driven.
XX chain coupled to one bath. An XX spin chain (J x = J y ) in a uniform magnetic field h i = h coupled to a single bath relaxes to equilibrium: the entropy production rate, heat flows and power vanish. The equilibrium density matrix is not generally a canonical distribution but rather, as one can prove, is given by a generalized Gibbs state ω ( ) , which is a conserved quantity, i.e.,  Figure 1 illustrates the relaxation to this equilibrium state by depicting the decaying power, heat flow and entropy production rate.
XY chain coupled to a single bath. For an XY chain, we found that the system reaches a driven NESS. In this NESS, entropy production is strictly positive and constant, and because =  H 0 S , the first law  13) with J x = J y = J. The NESS in the special case of a uniform magnetic field was analyzed in 7 . The power and heat from the reservoir to the system are given by Eqs (15), (16). In Fig. 2 in the NESS as functions of h L . We observe that the heat flows can change sign and that for h R = h L , they have opposite signs, i.e., We also observe in Fig. 2  L L , that is, the second law holds even when heat flows from cold to hot, as is the case L , a situation that would appear to be a contradiction to the Clausius statement of the second law if we do not realize the presence of  W. The previous numerical study of boundary-driven spin chains can be complemented with exact results for power and heat in a two-site boundary-driven spin chain obtained from a full analytical solution of the NESS (see methods). In the NESS, the expression for power Eq. , the sign of the entropy production rate is given by Let us end this analysis by noting that for β β ≤ L R , this system behaves as a heat engine for . Note that the efficiencies are independent of temperature. These are steady-state operating engines analogous to those in 45 .

Discussion
In conclusion, the repeated interaction scheme provides a physical description of a system interacting with an environment that, in an appropriate limit, provides a boundary-driven Lindblad equation for the system. The Lindblad operators that appear in this equation are determined by the interaction of the system with the environment, the Hamiltonian of the copies that form the bath and, importantly, by the fact that it is refreshed constantly. By computing the thermodynamical quantities for the full system plus the environment, one can derive the corresponding expressions for the boundary-driven model. One important observation is that due to the refreshing of the reservoir, work is done or extracted by the external agent in charge of this refreshing. This power drives the system out of equilibrium. Note that this power appears even if the system Hamiltonian and Lindblad operators are time independent. We applied our results to spin chains. In the single bath case, we found that an XX spin chain with a homogeneous magnetic field relaxes to thermal equilibrium, i.e., a state with zero entropy production, while an XY spin chain reaches a driven NESS, a state with a non-zero entropy production In the two heat bath case, the XX chain for different temperatures β β ≠ R L and a homogeneous magnetic field reaches a non-driven =  W 0 NESS and an equilibrium state for β β = h h L L R R where the entropy production rate, power, heat flows and spin currents vanish. For inhomogeneous magnetic fields, the chain reaches a driven ≠  W 0 NESS. Jumping to a broader context, this work shows that the knowledge of a Lindblad equation for an open system does not determine the heat flows or other thermodynamical quantities. These quantities also depend on the properties of the environment and how the system is coupled to it. Here, we have obtained appropriate expressions for heat flows and power for interactions with an environment of a type recently implemented in a laboratory 5 . But when the reservoir is weakly and passively coupled to the system, i.e. there is no work cost in achieving the coupling, the system is appropriately described by a global 28 Lindblad equation and the thermodynamical quantities by Eq. (2). Finally, this work is also an extension of quantum thermodynamics to a class of open quantum systems without local-detailed-balance.

Methods
We provide here some details of the calculations mentioned in the main text.

Work, heat and boundary-driven Lindblad equation from the repeated interaction scheme.
For completeness we derive Eq. (10) and Eq. (11)  in (17) is expanded for small τ considering the scaling the leading order in the right hand side of (17) is  τ ( ). Thus, we divide by τ and take the limit τ → 0 and → ∞ n such that τ = t n and obtain  n S n S n n . Dropping as before the label n, in the limit τ → / V v and τ → 0 we can replace U by (18). The leading order of ∆Q r is  τ ( ) r r n n S n n . As before we drop the label n. The leading order is also  τ ( ) but we need U up to  τ ( ) . We obtain . They satisfy a close system of equations: From Eqs (15,16) in the main text we note that λ = =   W JX W 2 L R , while the first term in the right hand side of (23) is /  Q h 2 L L and the corresponding term in (24)  Heat from a given reservoir in the weak-coupling limit. Consider a system coupled to several reservoirs as discussed in "universe" under unitary evolution. The heat that comes from one of them, for instance the r = L reservoir is