Stochastic Thermodynamics of a Finite Quantum System Coupled to Two Heat Baths

We consider a situation where an N-level system (NLS) is coupled successively to two heat baths with different temperatures without being necessarily thermalized and approaches a steady state. For this situation we apply a general Jarzynski-type equation and conclude that heat and entropy is flowing from the hot bath to the cold one. The Clausius relation between increase of entropy and transfer of heat divided by a suitable temperature assumes the form of two inequalities. Our approach is illustrated by an analytical example. For the linear regime, i.e., for small temperature differences between the two heat baths, we derive an expression for the heat conduction coefficient.


Introduction
The study of the non-equilibrium thermodynamics of heat conduction has a long history. As an example, consider the sequence of papers of Lebowitz and Spohn [1][2][3] dealing with both classical and quantum aspects of this problem. A considerable number of papers concerned with thermal conduction for quantum systems consider a kind of chain of small quantum systems connected to the two heat baths at their ends and focus on the questions of whether a local thermal equilibrium is reached in the small quantum systems, whether a constant temperature gradient exists, and whether the heat transfer rate is proportional to this gradient ("Fourier's law"); see, e.g., [4][5][6][7][8][9][10][11].
The present paper is not concerned with the validity of Fourier's law for special systems, but rather assumes a general N-level system (NLS) with alternating contact with two heat baths and studies the heat and entropy transfer in the steady state assumed after some time, without further analyzing the internal structure of the NLS. For this purpose, we use new methods that have been developed during the last decades, in particular, the approach via fluctuation theorems; see, e.g., [3]. The famous Jarzynski equation represents one of the rare exact results in nonequilibrium statistical mechanics. It is originally a statement of the expectation value of the exponential of the work e −β w performed on a system initially in thermal equilibrium with inverse temperature β, but may be far from equilibrium after the work process. This equation was first formulated for classical systems [12][13][14] and subsequently proved for quantum systems [15][16][17][18]. Extensions for systems initially in local thermal equilibrium [17], micro-canonical ensembles [19], and grand-canonical ensembles [20][21][22][23][24][25][26] have been published.
The most common interpretation of the quantum Jarzynski equation is to consider sequential measurements; see [15]. However, there are recent alternative approaches to obtain fluctuation relations. We note the derivation of fluctuation theorems for heat exchange in a quantum correlated bipartite thermal systems using the framework of dynamic Bayesian networks [27], the Margenau-Hill scheme [28], and the end-pointmeasurement scheme [29].
Nevertheless, in the present work we adopt the sequential measurements approach. The general framework for such an approach was outlined in [30,31]. It is neither quantum mechanical nor classical per se and will be referred to as "stochastic thermodynamics" in the present work. We recently applied this method to the problem of the interaction of an NLS with a single heat bath [32]. Here, we extend this work to the interaction with two heat baths of possibly different temperatures. Again, it is possible to describe the influence of the heat baths by an N × N stochastic matrix T that gives the conditional probability of transitions between the N levels of the NLS. Moreover, it is sensible to identify the steady state regime with fixed points of T.
However, it is not readily possible to infer the heat flow between the NLS and heat baths from the change in energy of the NLS, analogously for the entropy flow. At steady state, the corresponding changes of energy and entropy would vanish, although the flow may be non-zero. To cope with this problem we consider a step-wise interaction with the heat baths; see Figure 1. We start with a preparatory energy measurement and a contact only with the first heat bath, followed by a second energy measurement, together described by a stochastic matrix T (0) . This is followed by a separate contact with the second heat bath and another measurement, together described by T (1) . The total interaction plus measurements is hence given by the product matrix T = T (1) T (0) . Moreover, we will assume, similarly as in [32], that the single stochastic matrices T (i) have invariant probability distributions of Gibbs type, thereby introducing the two inverse temperatures β i , i = 0, 1 of the heat baths. This enables us to investigate the dependance between direction of heat and entropy flow and the temperature difference, at least for the steady state. The main message is that, although it would be very difficult to calculate the stochastic matrices T (0) and T (1) for "real" systems, the validity of the second law-like statement about the correct direction of heat and entropy flow only depends on some general properties of these matrices and not of their particular entries. Figure 1. Schematic sketch of one cycle of the alternate interaction of the NLS (black squares) with two heat baths of inverse temperature β 0 < β 1 , resp., interspersed with energy measurements (yellow M). At steady state, the heat δ 1 Q absorbed by the NLS during contact with the first heat bath equals in amount the heat δ 2 Q emitted during contact with the second heat bath.
Our approach thus fits into the framework of collision models, also known as repeated interaction schemes. They are based on the idea of discretizing reduced dynamics in time and simplifying the environment as a collection of identical and independent entities. For a recent account on collision models, see [33]. A representation of sequential heat exchange similar to ours was given in [34] where, however, fluctuations theorems of Crooks' type [35] were considered.
The paper is organized as follows. In Section 2, we present the pertinent definitions and assumptions that characterize the present approach to the heat conduction problem. The main result is obtained in Section 3, where we formulate the Jarzynski-type equation suited for the present problem and apply Jensen's inequality to derive two Clausius inequalities. These inequalities immediately imply that, in the steady state and in the statistical mean, heat and entropy always flow from the hotter to the colder bath. Section 4 is devoted to two analytical examples where the heat and entropy flows noted above can be explicitly calculated by computer-algebraic means. In the first example, we consider stochastic matrices T (0) and T (1) describing partial thermalization. In the second example, a three-level system is alternately coupled to two harmonic oscillators with different temperatures, and the interaction between the system and the harmonic oscillators is described analogously to the Jaynes-Cummings model. Moreover, in this example, the steady state p (s) is characterized by two parameters β (s) and γ (s) , β (s) being some sort of inverse temperature and γ (s) characterizing the deviation of the steady state from a Gibbs state, and the dependence of β (s) and γ (s) on the inverse temperatures of the two heat baths can be explicitly determined. In the linear regime β 0 ≈ β 1 , considered in Section 5, the steady state p (s) will only infinitesimally deviate from the Gibbs state of inverse temperature β 0 . This deviation can be calculated by means of first order perturbation theory and used to determine the common slope a of the functions of entropy transfer and (reduced) heat transfer at β 1 = β 0 . The result, of course, depends of the eigenvalues and eigenvectors of T (0) , which can be obtained for the analytical example of Section 4.2 but probably not, or only approximately, for "real" systems. We close with a summary and outlook in Section 6.

Basic Definitions
We consider an N-level system (NLS) described by a finite index set N , energies E n , and degeneracies d n for n ∈ N . The Hamiltonian for the NLS without interaction with the heat baths will hence be of the form with a complete family of mutually orthogonal projections P ∼ n , n ∈ N , and d n = Tr P ∼ n . The Gibbs states for the NLS with inverse temperature β > 0 are characterized by probabilities where the partition function Z (β) is given by We assume a rather general initial state ρ ∼ (i) of the NLS of the form which is not necessarily a Gibbs state. After the interaction with the first heat bath, we perform a Lüders measurement of the energy that, without selection according to the outcome, is assumed to yield the intermediate mixed state such that the transition between the probability distributions p (i) → q (i) is given by a left stochastic matrix T (0) characterizing the first heat bath according to m , for all n ∈ N .
Thereafter, an interaction with a second heat bath is assumed that, after a second Lüders measurement of the energy, results in the final state such that, analogously to the first step, where T (1) is another (left) stochastic matrix characterizing the second heat bath. If we model the heat baths by quantum systems and their successive interaction with the NLS by some unitary time evolution, the forms (5) and (7) of the intermediate state and the final state of the NLS does not follow automatically but represents a crucial assumption of our approach. Only if the NLS is non-degenerate, i.e., all d n = 1, then (5) and (7) will follow from general principles. In other cases, these assumptions may fail or be only approximately satisfied.
The stochastic matrices T (0) and T (1) generally possess invariant probability distributions or fixed points, i.e., eigenvectors corresponding to the eigenvalue 1 with non-negative entries. At the moment, we need not assume that these probability distributions are unique, but we will rather postulate that there exist invariant probability distributions of Gibbs type, i.e., n , for all n ∈ N and i = 0, 1 .
It will be plausible to identify the inverse temperatures β 0 and β 1 with the respective inverse temperatures of the heat baths. According to the zeroth law of thermodynamics the interaction between a heat bath and an NLS of the same temperature should not change the occupation probabilities of the energy levels.
The total transition p (i) → q (i) → p ( f ) will be achieved by the product matrix which is again a stochastic matrix. In the case of β 0 = β 1 , the Gibbs state probabilities p (β 0 ) n would form an invariant probability distribution of T, but in the general case of β 0 = β 1 the fixed point of T (not necessarily unique) will be different from p (β i ) , i = 0, 1. Starting with an arbitrary initial distribution p (i) and iterating the above-described protocol of successive interactions with the heat baths and energy measurements, one would obtain a sequence T ν p (i) of probability distributions that converge towards a fixed point of T: If the fixed point is not unique, p (s) will depend on the initial distribution p (i) . Physically, p (s) represents a steady state that will be asymptotically assumed. The NLS transports heat and entropy between the two heat baths, which are approximately unchanged (otherwise the stochastic matrix T could not be kept constant); see Figure 1. This is similar as for the Carnot cycle of classical thermodynamics. The difference, however, is that we do not consider additional extraction of work and allow for irreversible processes, whereas the Carnot process is reversible.
The steady state distribution p (s) can be used to calculate the steady flow of heat and entropy between the two heat baths due to the process described above. A natural question is whether this flow is always directed from the hotter bath to the colder one, as one would expect in accordance with the second law of thermodynamics. This question will be addressed in Section 3.

General Fluctuation Theorem
In order to make this paper as self-contained as possible, we will recapitulate the scenario of stochastic thermodynamics and the derivation of a general fluctuation theorem considered in [30][31][32] in a somewhat simplified form.
We consider two subsequent measurements at a physical system with finite outcome sets, I for the first and J for the second measurement. The total event space will hence be I × J , and the statistics of the subsequent measurements will be given by a probability distribution P : hence satisfying We define the "initial probability" and the (left) stochastic "transition matrix" T with entries assuming that p i > 0 for all i ∈ I. It follows that the "final probabilities" are given by Then the general fluctuation theorem can be formulated as Here, the terms in the bracket represent four random variables indicated by their values, and the bracket indicates the expectation value to be evaluated by means of the probability distribution (12). The proof of (18) is surprisingly simple: The general fluctuation theorem (18) is more of a template that provides sensible statements only when the arbitrary probability distributions p and p (0) have been suitably chosen. We will, in the next subsection, show how the famous Jarzynsiki equation results as a special case of (18) and then consider the choices that yield useful results for our problem.

Jarzynski Equation
We consider two subsequent energy measurements at a d-dimensional quantum system corresponding to two Hamiltonians with spectral decompositions not necessarily commuting and with degeneracies of eigenspaces Let be the corresponding partition functions. Between the two measurements, a unitary time evolution U takes place (not necessarily corresponding to H(t)), and the initial probability distribution is assumed to be a Gibbs state with inverse temperature β. Hence the total probability distribution P is given by Then we make the choices p which, after a short calculation, leads to and With these choices, (18) assumes the form From this, the usual form of the Jarzynski equation immediately follows if we define the random variable w : I × J → R ("work") by and denote the difference of free energies by ∆F := F − F.

Fluctuation Theorem and Direction of Heat and Entropy Flow
We retain the basic definitions of Section 2 and make the following choices in order to apply the general fluctuation theorem in Section 3.1. First, we identify the outcome sets of the two energy measurements with the level set of the NLS: I = J = N .
Then we will apply (18) in two ways: The first one is given by It follows that q according to (9), and the fluctuation theorem (18) assumes the form: Using Jensen's inequality (JI) and the fact that x → − log x is a convex function, we conclude, analogously to [32] ((63)-(66)), 0 = − log 1 (38) = − log p Here we have used the obvious definitions of the random variables "heat transfer" and "entropy transfer" Hence we have shown the following Clausius inequality: Note that the choice p n = p (s) n is not necessary to derive (45); similarly as in [32], this Clausius inequality would hold for arbitrary initial probability distributions. However, the choice of a steady state distribution will be crucial to derive the second Clausius inequality; see (54) below.
The second way of applying (18) will be given by the choice Again, q holds according to (9). Due to the fixed point property of p (s) with respect to T = T (1) T (0) , the choice (46)-(48) implies that the roles of p n and q m are interchanged. This means that, at steady state, the NLS absorbs the same amount of heat during contact with the first heat bath as it emits during the contact with the second one, analogously for the entropy. It follows that (45) again holds, but with the replacements This gives and thus, together with (45), we obtain the Clausius inequalities These inequalities have the same form as the corresponding inequalities derived in [32] and, under different assumptions, in [36][37][38][39][40][41], but generally a different meaning. For example, in [32] the inverse temperature β 1 refers to the NLS before the interaction with the heat bath of inverse temperature β 0 , but in (54) the inverse temperature β 1 refers to the second heat bath, whereas the NLS is in the steady state and, in general, has no temperature at all. Immediate consequences of (54) are and These equations imply that, in the steady state regime and in the statistical mean, heat and entropy always flow from the hotter bath to the colder one.

Analytical Example I: Partial Thermalization
We will consider an example where all considered quantities can be analytically calculated for arbitrary N. The stochastic matrices T (0) and T (1) are not obtained by studying the interaction with a heat bath but are chosen phenomenologically to represent a mixture of perfect thermalized and an unchanged distribution. This choice obviously satisfies postulate (9). For simplicity, we consider only the case of a mixture with equal proportions. The N energies of the NLS are chosen as E n = n for n = 1, . . . , N, without degeneracy.
The stochastic matrix P(β) of perfect thermalization is given by and hence T for i = 0, 1. After some calculations, we obtain for the steady state distribution p (s) , the fixed point of for k = 1, . . . , N. This is a certain temperature-dependent mixture between the Gibbs states of inverse temperatures β 0 and β 1 of the two heat baths, which appears plausible.
Using the steady state distribution and computer-algebraic means, we can calculate the various transferred quantities as ∆S, β i ∆Q for any given N, although the result is generally too complex to be shown here. These quantities are plotted in Figure 2 for the two cases of N = 5 and N = 100 energy levels, thereby confirming the Clausius inequalities (54) and the direction of the heat and entropy flow from the hotter to the colder bath.

Analytical Example II: Modified Jaynes-Cummings Model
As an example where the time average of the transition matrix T(β) corresponding to a heat bath of inverse temperature β can be exactly calculated, we have considered in [32] a single spin with spin quantum number s = 1 coupled to a harmonic oscillator that serves as a heat bath. Hence we have a N = 3-level system with N = {1, 0, −1}. The total Hamiltonian and further details are given in [32] and need not be repeated here. The Hamiltonian strongly resembles the Jaynes-Cummings model [42,43] originally describing the interaction of a 2-level system with a quantized radiation field but also considered for 3-level systems [44,45]. We reproduce the analytical result [32] for the entries of T(β): Here Φ(z, s, a) := ∑ k∈N z k (k+a) s denotes Lerch's transcendent; see [46] § 25.14. It can be shown that T(β) is a left stochastic matrix and leaves the probability distribution invariant that corresponds to a Gibbs state with inverse temperature β.
Using this analytical result, we set T (0) = T(β 0 ) and T (1) = T(β 1 ) for the model with two heat baths and can explicitly calculate the heat and entropy transfer ∆S (β 1 ) and β i ∆Q (β 1 ), considered in Section 3, as functions of β 1 . Although the result is too complex to be shown here, these transfer functions can be plotted for fixed values of β 0 , say, β 0 = 1; see Figure 3. Thus one can graphically confirm the Clausius inequalities (54) and the correct sign of heat and entropy flow. The three functions have a common tangent at β 0 = β 1 , the slope of which will be calculated in Section 5.  Figure 3. Plot of the transferred entropy ∆S per cycle (red curve) and reduced heat transfer β 0 ∆Q (blue curve) and β 1 ∆Q (dark yellow curve) as a function of the inverse temperature β 1 of the second heat bath and fixed inverse temperature β 0 = 1 of the first one. The common tangent at β 1 = β 0 = 1 is indicated by the dashed black line with slope a ≈ 0.173895 that will be calculated in Section 5. The calculations have been made for the analytical example of Section 4.2 and steady state regime. Note that the Clausius inequalities (54) are satisfied and that the signs of ∆S and ∆Q coincide with the sign of β 1 − β 0 in accordance with the second law of thermodynamics.
In the limit β → 0, we obtain the bi-stochastic matrix Both limits facilitate the analytical calculation of corresponding asymptotic values of the pertinent functions. Of note, the latter one (73) is an example of a stochastic matrix where the algebraic and geometric degeneracy of the eigenvalues no longer coincide: the eigenvalue t 2 = 1/2 is doubly degenerate but possesses only a one-dimensional eigenspace Next we will investigate the structure of the steady state distribution p (s) as a function of β 0 and β 1 for the present example. A general probability distribution p of a 3-level system with energies E 1 , E 0 , E −1 can be characterized by two parameters β, γ such that where Z is chosen such that p 1 + p 0 + p −1 = 1. A Gibbs-type probability distribution would thus be characterized by γ = 0 and β being the inverse temperature of the distribution. It is then a straightforward task to calculate the parameters β (s) , γ (s) corresponding to the steady state distribution p (s) as a function of β 0 and β 1 . Again, the result is too complex to be shown, but it can be plotted for fixed β 0 , say, β 0 = 1; see Figures 4 and 5. Surprisingly, we find that for β 0 = 1 and β 1 = β = 0.578258 . . ., the second parameter γ (s) vanishes and hence the corresponding steady state distribution is of Gibbs type.

The Linear Regime
So far, we have not made any assumptions about the relationship of the stochastic matrices T (0) and T (1) . They can be completely independent except that they have Gibbstype fixed points. If T (0) and T (1) were derived from a physical model of the interaction of the NLS with a heat bath of inverse temperature β, as in the example of Section 4.2, there would probably be further relations between T (0) and T (1) , but we have not needed to consider them so far. However, if we turn to the linear regime where the value of δ := β 1 − β 0 is infinitesimally small, we will need the following mild assumption, that is fortunately satisfied for the analytical example of Section 4.2: Assumption 1. There exists a smooth family δ → T(δ) of (left) stochastic matrices defined for all |δ| < r and some r > 0 such that Here, the overdot˙means ∂ ∂δ (. . .) | δ=0 . We will henceforward omit the argument δ = 0 for sake of simplicity. For example, for the total cycle we have The steady state distribution p (s) will also be chosen as a smooth family denoted by p(δ) such that T p (s) = p (s) now reads and where p = p (β 0 ) . We will calculateṗ by means of first order perturbation theory. This is similar in concept to the derivation of a Kubo formula in Liouville space in [7], where the temperature gradient introduced by the two heat baths is treated as an external perturbation. Because the unperturbed matrix will, in general, not be symmetric, some slight modifications of the Rayleigh-Schrödinger perturbation theory known from quantum mechanics are required, which will be derived in what follows. To simplify these calculations, we will restrict ourselves to the "generic case" of Assumption 2. The eigenvalue t 1 = 1 of T is algebraically non-degenerate and, for the other eigenvalues t 2 , . . ., the algebraic and geometric degeneracy coincides.
Hence there exists a complete basis of R N of (right) eigenvectors |e n of T satisfying T |e n = t n |e n , for n = 1, . . . , N, where |e 1 = p = p (β 0 ) and t 1 = 1. Here we have switched to Dirac's bra-ket style, which makes the notation somewhat easier. The dual basis of left eigenvectors of T will be denoted by e n |, n = 1, . . . , N, such that the following holds: The latter implies Obviously, e 1 = (1, 1, . . . , 1). Let e 1 ⊥ denote the subspace Upon differentiating (77), we obtaiṅ and hence, using T p = p, The two vectorsṗ andṪ p lie in the subspace e 1 ⊥ , and the latter is left invariant under the linear map 1 − T 2 . Hence (85) can be solved forṗ by inverting the restriction of 1 − T 2 to the subspace e 1 ⊥ . By means of (82), the result can be written aṡ This completes the calculation of the steady state distribution in linear order in δ = β 1 − β 0 . Next we consider the corresponding energy transfer ∆Q . Let E ∈ R N be the "energ" vector with components n|E = E n . The expectation value Q 0 of the energy of the NLS before the contact with the first heat bath is After the contact with the first heat bath and a subsequent energy measurement, we obtain the energy expectation value Hence where This completes the calculation of the slope a of the tangent of β 1 → ∆Q at β 1 = β 0 , which can be considered as a sort of heat conduction coefficient. The fact that a ≥ 0 is a consequence of (55).
This calculation establishes an "external Fourier law", similarly as in [7], that holds independent of a possibly constant temperature gradient inside the NLS.
In the example of Section 4.2 and for β 0 = 1, the right and left eigenvectors of T as well asṪ can be explicitly calculated, although they are not shown here due to their overwhelming complexity. Inserting these terms into (95) gives a≈0.173895, the slope of the common tangent of the three function plots in Figure 3. Similarly, in the example of Section 4.1, the slope of the common tangent was calculated as a ≈ 0.249977 (N = 5), and a ≈ 0.306891 (N = 100), and plotted in Figure 2.

Summary and Outlook
The second law of thermodynamics has several formulations of varying generality; one of them is that heat always flows spontaneously from the hotter to the colder body. In the field of quantum mechanics, the formulation, let alone the proof, of a corresponding second law is highly obscure and controversial, despite (or even because of) the large body of literature on this subject. In this situation, it seems advisable to gather a few facts that capture what we know for sure. We know that the von Neumann entropy increases in the course of a Lüders measurement [47]. Further, again in the case of sequential Lüders measurements, there hold various Jarzynski-type equations, and, for each of them, Jensen's inequality produces second law-like statements; see [30,31]. In this paper, we have singled out a particular Jarzynski-type equation so that the corresponding second law-like statement essentially coincides with the above formulation, namely, that heat flows from the hotter to the colder heat bath. However, the latter was only demonstrated for the collision model we used for heat transfer.
However, although this result is very general and relatively easy to prove, we need to note some restricting assumptions that were required for the proof. The quantum system is an arbitrary N-level system (NLS), and we implicitly assume that its states are completely characterized by the occupation probabilities p n of the nth energy level, not only at the beginning but also during the whole heat conduction process. The two heat baths are not analyzed in detail; they almost appear as "black boxes" only described by stochastic matrices that contain the conditional transition probabilities between the energy levels of the NLS and leave invariant Gibbs states of inverse temperature β i , i = 0, 1. For technical reasons, we had to alternate contacts of the NLS with the two heat baths, as we would lose the overview of the heat and entropy transfer with a total contact of all three systems. Hopefully, this special protocol will be a reasonable approximation for real heat conduction processes. As a benefit of our approach, we note that no thermalization assumptions are needed; the heat conduction process can be arbitrarily irreversible. Our calculations are essentially confined to the steady state regime. Of note, the approach to a steady state after a large number of cycles is not an extra assumption but follows from the property that all eigenvalues of a stochastic matrix except the eigenvalue 1 are < 1 in absolute value.
It looks promising to apply the present approach to similar problems. For example, a general thermodynamic process could be split into pure heat and work parts that can be represented by (bi-)stochastic matrices analogously as in this paper, and the Jarzynski-Jensen method could be used to obtain second law-like statements.  Institutional Review Board Statement: Not applicable.

Data Availability Statement:
No new data were created or analyzed in this study. Data sharing is not applicable to this article.