{'fraction_non_alphanumeric': 0.03733480176211454, 'fraction_numerical': 0.0105359765051395, 'mean_word_length': 4.00018355359765, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A simple quantum heat engine

Quantum heat engines employ as working agents multi-level systems instead of gas-filled cylinders. We consider particularly two-level agents such as electrons immersed in a magnetic field. Work is produced in that case when the electrons are being carried from a high-magnetic-field region into a low-magnetic-field region. In watermills, work is produced instead when some amount of fluid drops from a high-altitude reservoir to a low-altitude reservoir. We show that this purely mechanical engine may in fact be considered as a two-level quantum heat engine, provided the fluid is viewed as consisting of n molecules of weight one and N-n molecules of weight zero. Weight-one molecules are analogous to electrons in their higher energy state, while weight-zero molecules are analogous to electrons in their lower energy state. More generally, fluids consist of non-interacting molecules of various weights. It is shown that, not only the average value of the work produced per cycle, but also its fluctuations, are the same for mechanical engines and quantum (Otto) heat engines. The reversible Carnot cycles are approached through the consideration of multiple sub-reservoirs.


I. INTRODUCTION
Quantum heat engines employ as working agents multi-level systems instead of gas-filled cylinders. We consider particularly two-level agents such as electrons immersed in a magnetic field, work being produced when the electrons are being carried from high-magnetic-field regions into low-magnetic-field regions. The purpose of the present paper is to show that quantum heat engines may be viewed as purely mechanical systems such as watermills. This is achieved by considering the microscopic content of the fluid reservoirs. To wit, these reservoirs are viewed as collections of molecules of various weights. In the simplest configuration, the molecule weights are supposed to be equal to zero or one, with the average molecular weight corresponding to the fluid density. For such models, watermills correspond to quantum (Otto) heat engines employing as working agent two-level systems. Not only the average work produced per cycle, but also the work fluctuations, are the same.
The operation of quantum heat engines that employ as working agents multi-level systems, for example harmonic oscillators, free particles in a box, three-level atoms or electrons submitted to magnetic fields, were introduced by Geva and Kosloff in [1,2], see also [3,4]. The present paper, restricted to slow elementary systems, should help students get a feel for the method of extraction of mechanical energy from heat baths without having to enter into Thermodynamics concepts in a first approach.
In the following we consider in turn a classical mechanical system (watermill), a classical Otto heat engine and a quantum Otto heat engine. We explain in what sense the first is related to the third. Through the introduction of multiple reservoirs, the simple Otto cycle leads to the reversible Carnot cycle, which, inherently, exhibits greater efficiency.
1. Let us begin by considering a purely mechanical system, namely a watermill. As is well known, the energy released by water dropping from a high-level reservoir into a lower one may be employed to lift a weight. Ideally  FIG. 1: Schematic representation of a classical mechanical engine that converts the potential energy of heavy balls into the lift of a weight. In the figure the two reservoirs contain N = 5 balls each. The lower one is located at altitude ǫ l . The upper one is located at altitude ǫ h . A cycle consists of exchanging two balls with the help of a rotating plate. One may suppose that the balls are made up of steel and that they stick to a magnetic circular plate.
(e.g., neglecting friction) the efficiency is unity in the sense that the potential energy lost by water is entirely converted into the weight potential energy (because the motion is assumed to be slow no consideration is given here to kinetic energy). However, we may also define the efficiency η as the ratio of the work actually performed to the one that would have been performed if the same amount of water had been dropped to some lower reference level. If the reservoir altitudes with respect to that reference level (see Fig. 1) are denoted by ǫ l > 0 and ǫ h > ǫ l , where the subscripts l and h stand for "low" and "high", respectively, we have obviously for the ideal engine η = 1 − ǫ l /ǫ h . We will show that this expression for the efficiency applies as well to quantum Otto heat engines.
To facilitate the comparison, we in fact consider a slightly different kind of mill. The high-altitude reservoir is supposed to contain a high-density fluid and the low-altitude reservoir a low-density fluid. Work is produced when some volume of fluid is exchanged between the two reservoirs. Let the fluids be modeled as collections of N balls (or molecules), n of them having weight 1 and N − n having weight 0. We suppose for simplicity that the total number of balls, N , is the same for the two reservoirs. The number of weight-1 balls in the lower reservoir is denoted by n l and the number of weight-1 balls in the higher reservoir by n h . Clearly, the exchange of two randomly-selected ball between the reservoirs will produce a positive average work if n h > n l . As far as the average work is concerned only fluid densities matter. Other microscopic models with n 0 balls of weight w 0 , n 1 balls of weight w 1 , and so on, would do just as well, as long as the density w/N remains the same.
Here, w ≡ n k w k , k = 0, 1, 2... denotes the total fluid weight. The microscopic model determines, however, the fluctuations of the work produced. In this paper, we evaluate both the average work produced and the variance of that work, averages being defined with respect to an ensemble of initially identical engines. Only the most elementary rule of probability is needed, namely, the fact that when an urn contains N balls possessing labels that help distinguish one ball from another, the probability of picking up any particular ball is 1/N .
2. Let us explain next what are, in essence, classical Otto heat engines. The working agent may be a gas-filled cylinder with a movable piston, initially in thermal contact with a hot bath. When the cylinder is separated from the bath and allowed to expand in length, the piston motion may be employed to lift a weight, while the gas cools down. As a second step, the cylinder is put in contact with a cold bath. The cylinder is subsequently separated from the bath and allowed to shrink back to its original length. Note that, in contrast with the four-stroke Carnot cycle, the cylinder length does not vary when it is in contact with the baths. Heat-engine efficiencies, η, are defined in general as ratios of the work performed and the heat removed from the hot bath. The Otto cycle efficiency may reach the Carnot efficiency η C = 1 − T cold /T hot , where T cold,hot denote the bath temperatures, only in the limit where the work produced is vanishingly small.
3. In quantum Otto engines the working agent, instead of being a classical gas, is a multilevel system, for example (spin-1/2) electrons immersed in a magnetic field B, for the two-levels case. Electrons possess different energies depending on whether their magnetic moments point in the magnetic field direction or in the opposite direction. For simplicity, we select units such that the level energy difference ǫ is equal (rather than just proportional) to B. Without loss of generality, the electron lower-level energies are set equal to 0 [5]. The upper-level energy is then simply ǫ = B. If an electron in the upper state is trans-low magnetic field high magnetic field ferred from a high-magnetic-field region into a low-magnetic-field region the electron energy gets reduced. This reduced energy is delivered to the agent that helps displace the electron. For example, if the electron is acted upon by an electric field the energy is delivered to the battery that generates that field. In the quantum Otto cycle an electron (the working agent), initially in thermal contact with a bath at temperature T h and immersed in a magnetic field B h = ǫ h , gets carried to a bath at a lower temperature T l and lower magnetic field B l = ǫ l . This electron is subsequently carried back to the original bath, thereby closing the cycle, with some net work being performed. Because the cycle is assumed to be arbitrarily slow, there is enough time for the electron to reach a regime of thermal equilibrium with the baths. The two processes (h → l and l → h) being statistically independent it is easy to evaluate the statistics of the net work performed, and in particular the average work and the work variance.
To facilitate the comparison that we wish to make, two slight modifications of the quantum Otto cycle just described are made. First, instead of a single electron moving back and forth between the two baths we suppose that, at the same time, an electron in equilibrium with the hot bath is carried to the cold bath and an electron in equilibrium with the cold bath is carried to the hot bath, as is illustrated in Fig. 2. The two arrows illustrate the exchange of two electrons.
In the above discussion the bath microscopic nature has been left unspecified. We now assume that the heat baths are actually collections of two-level electrons, similar to the ones previously referred to as being the "working agents". These electrons are supposed to interact weakly with one another so that an equilibrium situation may eventually be reached, but the interaction energy is so small that the total energy is very nearly the sum of individual electron energies. Let an (isolated) bath contain n electrons in the upper state and N − n in the lower state. If an electron is being picked up from the bath at random, the probability that it be in the upper state is exactly n/N . At that point we notice that there is an exact correspondence with the fluid previously considered, provided the latter is modeled as a collection of distinguishable balls, n of them having weight 1, and N − n of them having weight 0. In the limit that n and N − n are both large a temperature may be defined. The quantity n/N previously called "density" is equal to 1/[exp(ǫ/k B T ) + 1], where k B denotes the Boltzmann constant, see Appendix A. Notice that this temperature is negative if the "density" exceeds one-half [6]. The point we wish to make here is that the comparison made between particular mechanical and heat engines is exact, while the concept of temperature may be introduced only in the limit of large particle numbers.
The average and variance of the work produced by modified watermills are evaluated in Section II. A generalization is made to the case where the high and low reservoirs are split into a number of sub-reservoirs for the purpose of comparing mechanical systems and Carnot heat engines. The treatment of quantum heat engines is given in Section III for single low-and high-temperatures baths and in Section IV for multiple cold and hot baths.
Only two-level systems are considered in detail. But note that when the ball weights are allowed to be w k = k, where k = 0, 1, 2..., the mechanical system is equivalent to quantum heat engines employing as working agents onedimensional oscillators, whose level energies are, as is well-known, ǫ k = (k + 1/2) ω, where denotes the Planck constant divided by 2π and ω denotes the oscillator angular frequency. The latter plays for oscillators a role similar to the magnetic field B for electrons. Previous results [7] are recovered in that manner.
From the quantum point of view, ideal gases confined to one-dimensional boxes of length L are collections of non-relativistic particles of masses m, whose wavefunctions must vanish at x = 0 and x = L. The energy levels are in that case given by ǫ ℓ = p 2 /2m, where p = k, kL = ℓπ, ℓ = 1, 2.... That is, the energy levels are of the form ǫ ℓ = ℓ 2 /L 2 , the quantity 1/L 2 playing therefore for non-relativistic particles a role similar to the magnetic field for electrons. In our comparison, ideal gases would correspond to fluids whose molecular weights would be 1,4,9.... Ideal gases will not be considered further in the present paper.

II. THE MECHANICAL ENGINE
Consider the mechanical engine shown in Fig. 1 that converts the energy released by dropping heavy balls from one level to a lower one into the energy required to lift a weight. Only slow regular (quasi-static) motions are contemplated so that kinetic energies may be ignored. Specifically, the engine consists of two reservoirs, a lower one at altitude ǫ l > 0 defined with respect to some reference level, an a higher one at altitude ǫ h > ǫ l . The two reservoirs are supposed to contain N balls each, of various weights. The total weight of the lower-reservoir balls is denoted by w l and the total weight of the higher-reservoir balls by w h .
Let now two randomly-selected balls be exchanged between the reservoirs. As is illustrated in the figure this could be accomplished by a rotating plate, but the details of the mechanism need not be given as we are only concerned in establishing matters of principle. Since the probability of picking up a particular ball from a reservoir is 1/N , the average energy removed from the lower reservoir is ǫ l w l /N and the average energy added to the higher reservoir is ǫ h w l /N . At the same time, a ball is being picked up at random from the higher reservoir and carried to the lower reservoir so that the numbers of balls in each reservoir remain equal to N . An average energy ǫ h w h /N is thus removed from the higher reservoir and an average energy ǫ l w h /N added to the lower one.
According to the above discussion the average energies in the lower and higher reservoirs are incremented respectively by The average work performed follows from the law of conservation of energy Since by convention ǫ h > ǫ l we require that w h > w l if the system is aimed at lifting the weight, and w h < w l in the opposite situation. The engine efficiency η is defined as the ratio of the average work performed W (see above) and the average higher-reservoir energy consumption − Q h . We obtain Let us now suppose that there are m low-level reservoirs (referred to as sub-reservoirs) at altitudes ǫ l,1 , ǫ l,2 , ...ǫ l,m , with weights w l,1 , w l,2 , ...w l,m , respectively. (Comas separating l from the numbers 1,2... that label the sub-reservoirs will henceforth be suppressed for brevity, except when a confusion may arise). Likewise, we suppose that there are m high-level sub-reservoirs at altitudes ǫ h1 , ǫ h2 , ...ǫ hm , with weights w h1 , w h2 , ...w hm . Randomly selected balls are carried at the same time from the sub-reservoir l1 to the sub-reservoir l2,. . . , from lm to h1, h1 to h2. . . , and hm to l1, thereby closing the cycle, as illustrated in Fig. 3 for the case where m = 2. Using the same argument as above, the total average energy increment in the lower and higher reservoirs is The average work produced is W = − Q l − Q h . In the next Section we consider the limit in which m goes to infinity while the steps in ǫ tend to zero as one goes from one sub-reservoir to the next. As far as the average work performed is concerned, only the total ball weights in the sub-reservoirs are relevant. However, if we are interested in the statistics of the work performed, we need specify the individual balls weights. For simplicity, let us suppose that the sub-reservoir k contains n k balls of weight 1 and N − n k weightless balls, with k running from 1 to 2m, with the understanding that 2m + 1 ≡ 1. The probability that a ball of weight 1 be picked up from the sub-reservoir k is f k = n k /N . If that event occurs, the work performed W is incremented by ǫ k − ǫ k+1 according to the law of conservation of energy, since the ball picked up from the sub-reservoir k is being transferred to the sub-reservoir k + 1. If the event does not occur W is unchanged. Since the ball selections from different sub-reservoirs are independent the contributions of the individual events averages and variances add up, and we obtain variance(W ) where the sums run from k = 1 to 2m. It follows from this expression that if the altitude difference between the highest and lowest sub-reservoirs is kept constant, and in the limit that m → ∞, the work performed is essentially non-fluctuating. Indeed, if ǫ k − ǫ k+1 is of order ∆ the numerator, of order m∆ 2 , tends to zero when the denominator, of order m∆, is kept constant. A similar situation occurs for some quiet-pump lasers [8].

III. THE EQUIVALENT QUANTUM HEAT ENGINE
The mechanical engine described in the previous Section may be viewed as a quantum heat engine, a ball of weight w located in a reservoir at altitude ǫ being viewed as the occupation of the level ǫw of a multilevel system.
Suppose for example that the ball weights may only be 0 or 1, and consider a 2-level atom whose ground state energy is set equal to zero and whose excited state energy is ǫ through appropriate normalization. Weight-0 balls are equivalent to such atoms in the ground state while weight-1 balls are equivalent to such atoms in the excited state. Accordingly, each reservoir may now be viewed as a collection of N two-level atoms, n of them being in the excited state and N − n of them in the ground state. Changing the reservoir altitude amounts to changing the atom level-energy spacing. As an example, let us suppose that the 2-level system is actually an electron immersed in a magnetic field. A change of the reservoir altitude corresponds in that case to a change in magnetic field strength. The two heat baths are represented in Fig. 2. To avoid a confusion, let us emphasize that the reservoirs are not viewed as reservoirs of structureless molecules.
We thus consider a collection of N atoms with level energies 0 and ǫ. The inverse temperature β ≡ 1/k B T of such an atomic collection may be found in every text-book of statistical mechanics. For the reader convenience the derivation is recalled in Appendix A. If the total energy is nǫ Using as before subscripts l for the lower reservoir and subscripts h for the higher one, we have therefore respectively. Note that β l,h are positive when n l,h are smaller than N/2 and negative when they are larger than N/2. From the previous expressions, the average work produced, given in (2), may be written as where we consider that the reservoir temperatures have been ascribed some values.
As an example of a heat engine suppose that ǫ l = 1 and ǫ h = 2. The calculated efficiency is η = 0.5. Further, for N = 10 000, n l = 2 000 and n h = 3 000, the work delivered per cycle is W = 0.1 in the energy unit employed to define ǫ. For the above numerical values, we calculate that β l = 1.38, β h = 0.42. The maximum (Carnot) efficiency would be η C ≡ 1 − β h /β c = 0.69. If we keep constant β l and β h and vary ǫ l , ǫ h , the work performed given in (8) may reach 0.2. Figure 4 (curve m = 1) gives the maximum efficiency η for a given value of the average work W performed in a cycle. Positive work corresponds to a heat engine while negative work corresponds to a heat pump, whose coefficient of performance is the reciprocal of η. The gray areas have been obtained by randomly selecting positive ǫ-values.
In subsequent examples we keep N = 10 000 and the absolute value of the population difference: |n l − n h | = 1 000. To exemplify heat pumps, it suffices to exchange the values of n l and n h , keeping ǫ l and ǫ h the same as above. The efficiency, as defined earlier, remains η = 0.5. However, it is usual (and natural) in the case of heat pumps to define a coefficient of performance (COP) as the ratio of the amount of heat generated in the hot reservoir (e.g., in the house) to the work required to operate the system (e.g., from the power line). The COP (reciprocal of η) is in our example equal to 2. We calculate further that β l = 0.85, β h = 0.69 and thus the maximum (Carnot) heat-pump COP is 1/η C = 5.5.
Negative reservoir temperatures are now particularly considered. If the number of balls of weight 1 in the reservoir at altitude ǫ = 1 is equal to 7 000 and the number of balls of weight 1 in the reservoir at altitude ǫ = 2 is equal to 8 000 the reservoir temperatures are both negative. The β, Q and W -values are simply opposite in sign to the previous ones, with β l = −0.69, β h = −0.85. It follows that the reservoir at altitude ǫ = 2 is colder than the reservoir at altitude ǫ = 1. The system is a heat pump with some work flowing into it and heat being transferred to the hotter reservoir. If the above values of n l and n h are interchanged the system becomes a heat engine indistinguishable from the one initially considered as far as the operating parameters are concerned. If n l = 4 500, n h = 5 500 and ǫ c = 1, ǫ h = 2 the cold reservoir temperature is positive while the hot reservoir temperature is negative, with β l = 0.2, β h = −0.1. As before, the heat engine delivers an average energy W = 0.1 and the efficiency is η = 0.5. The maximum attainable efficiency is unity.
For the sake of comparison with the case of electrons submitted to a magnetic field, note that the quantity denoted here n/N corresponds to the electron spin (divided by ) plus 1/2. The reservoir altitude ǫ corresponds to the quantity denoted by ω in [1]. The relation between n/N and the inverse temperature β given in (6) coincides with the one given in that reference.

IV. MULTIPLE SUB-RESERVOIRS
The engine efficiency may improve if a large number, m, of low and high sub-reservoirs are employed, as shown in Fig. 3 for the case where m = 2. The number of balls in each sub-reservoir is again equal to N . The low sub-reservoirs are labeled by lk, while the high sub-reservoirs are labeled by hk where k = 1, . . . , m. The total weight of the balls in sub-reservoir lk with altitude of ǫ lk is denoted by n lk and the total weight of the balls in sub-reservoir hk with altitude of ǫ hk is denoted by n hk .
We now suppose that n lk ≡ n l (ǫ lk ) and n hk ≡ n h (ǫ hk ), where we have introduced the functions where β l,h are constants and f (x) denotes a function of x to be later specified.
The above expressions of Q l , Q h are now written as where we have defined L k ≡ β l ǫ lk and H k ≡ β h ǫ hk . They enable us to evaluate the average work performed W = − Q l − Q h and the efficiency η = − W / Q h for given values of the parameters L k , H k , k = 1, 2 . . . m.
If the ǫ-values do not vary much from one k-value to the next, the sums may be converted into integrals, and we obtain [7] where The lower limit of the integral is unimportant. The simpler expressions given in Section II corresponding to m = 1 are equivalent to the so-called Otto cycle of heat engines. It is recovered from the present formulation by setting L 1 = L m and H 1 = H m . If, on the other hand, H m = L 1 and L m = H 1 the quantity β l Q l + β h Q h vanishes, and the Carnot efficiency is reached. The average work performed may be written in that case as where we have introduced the absolute reservoir temperatures T l , T h . The average work is the product of the change of temperature and the change of entropy.
To proceed further, we must specialize the above results. Consider the case where the sub-reservoirs contain n balls of weight unity, the other balls being weightless as discussed in Section II. According to Appendix A the appropriate function is in that case Using the above expression of the entropy, we find that W max = k B (T h − T l ) ln (2). More generally, when the allowed weight-values are 0, 1 . . ., 2j we have W max = k B (T h − T l ) ln(2j + 1) [4]. When β l = 1.38, β h = 0.42 (k B T h − k B T l = 1.66) the cycle is reversible and the Carnot efficiency η C = 0.695 is reached when for example ǫ l1 = 1, ǫ lm = 1.1, ǫ h1 = 3.6, ǫ hm = 3.3. In that case W = 0.05. When we allow the ǫ to vary the work may reach the value W max = 1.14. Figure 4 shows how the heat-engine maximum efficiency varies as a function of the work performed for 1 (Otto cycle), 2, 3, and an infinity (Carnot cycle) of cold and hot sub-reservoirs. Positive work corresponds to heat engines and negative work to heat pumps, whose coefficients of performance are the reciprocals of η. The figure gives also the minimum value of the efficiency. Curiously, the minimum Carnot cycles efficiency is proportional to W . The above formulas are valid also when the hot reservoir has a negative temperature, in which case the maximum efficiency is unity. For example, if β l = 0.2, β h = −0.1, we obtain for ǫ l1 = ǫ lm = ǫ hm = 0.3, ǫ h1 = 14, a work produced W = 2.5 and an efficiency η = 0.997.

V. CONCLUSION
We have seen that a simple urn model suffices to obtain expressions for the average value and the variance of the work produced by a simple mechanical system consisting of balls dropping from one level to another. We have shown that this system is formally the same as a quantum heat engine employing as a working substance multi-level atoms. When temperatures are ascribed to the two reservoirs according to the laws of Quantum Statistical Mechanics, the expression for the Carnot efficiency is obtained in the limit of a large number of sub-reservoirs. In particular, when the ball weights may only be zero or one, the mechanical system is equivalent to a quantum heat engine employing as working substance electrons submitted to a spatially varying magnetic field. When the ball weights may take any non-negative integral values, the system describes heat engines employing linear oscillators as working substance.

APPENDIX A: RESERVOIR TEMPERATURE
We have considered in the main text a reservoir at altitude ǫ containing N distinguishable balls of weight 0 or 1. These balls were likened to two-level atoms in the ground state and the excited state, respectively. The purpose of the present appendix is to recall how temperatures may be assigned to collections of two-level atoms. We employ the main concept of Statistical Mechanics that asserts that states of isolated systems that correspond to the same total energy (degenerate states) are equally likely to occur.
Let n denote the number of balls of weight 1 and N − n the number of balls of weight 0. The energy is E = nǫ. The number of possible configurations (degeneracy) is given by the formula (see, e.g, [8,9]) For N = 3 and n = 1 for example, the possible configurations are (1,0,0), (0,1,0), and (0,0,1), where we have listed in the parentheses the weights of the first, second and third balls. The degeneracy is therefore W(1) = 3 in agreement with (A1). The entropy is defined as: S(E) = ln(W(n)) if the Boltzmann constant is set equal to unity, and the inverse temperature as: β ≡ dS(E)/dE = [d ln(W(n))/dn]/ǫ. The derivative cannot be evaluated exactly since n is an integer. The best one can do is to apply the Stirling approximation of factorials: d ln(n!)/dn ≈ ln(n!) − ln((n − 1)!) = ln(n). We obtain from (A1) The second relation says that the Boltzmann factor exp(−βǫ) is the ratio of the number n of balls of weight 1 and the