{'fraction_non_alphanumeric': 0.03584734669217601, 'fraction_numerical': 0.010421911187191622, 'mean_word_length': 4.6396933560477, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Origin of Negative Temperatures in Systems Interacting with External Fields

The controversial existence of negative temperatures has stirred interesting debates that have reached the foundations of thermodynamics, including questions on the second law, the Carnot efficiency and the statistical definition of entropy. Here we show that for systems interacting with an external field, negative temperatures arise from an energy mis-attribution in which the interaction energy with the field is treated as a form of internal energy. We discuss how negative temperatures are avoided when using a proper thermodynamic formalism, which accounts for the intensive and extensive variables associated to the external field. We use the paramagnetic system and a perfect gas in a gravitational field to illustrate these ideas. Considerations about the isothermal and adiabatic work done by the field or the system also shed light on the inconsistency of super-Carnot efficiencies.


Introduction
Negative absolute temperatures have been introduced in systems where the density of states is a locally decreasing function of energy [1,2,3,4,5]. Examples include spin systems [6,7,8], lasers [9,10], and systems with long-range interactions [11,12]. In an early review, Dyson [13] describes negative temperatures as 'just a philosophical curiosity'; other authoritative references interpret them as the result of convenient conventions [14] and specify that negative temperatures are actually higher than positive ones [15,8], in the sense that heating from absolute zero to +∞ K, which is identical with -∞ K, continues from there to -0 K [14]. Besides mostly interpretative issues, one particularly troubling point with negative temperatures is the emergence of super-Carnot efficiencies when performing thermodynamic cycles between positive and negative temperatures [5].
Lavenda [2] was perhaps the first author to raise objections against negative temperatures. He noticed that the crux of the matter is whether the magnetic energy is a form of heat and to avoid negative temperatures he proposed a modification of the second law. Often the discussion about negative temperatures centers around spin systems, in which the sudden reversal of the external field induces a population inversion that, while it persists, is characterized by an extensive variable that is opposite in sign to the field [6,1]. If one interprets them as equilibrium states, the difference in orientation between the field and the extensive variable is resolved with a negative temperature. As noted in [16], these states are unstable leading to ambiguities in the definition of thermodynamic temperature.
In parallel, a series of papers focusing on isolated systems [17,4,18] also disputes their existence, basing their criticism on shortcomings of the Boltzmann entropy, and advocates for other forms of microcanonical entropy founded on Gibbs volume entropy. The latter, being proportional to the total number of microstates per energy lower than a given energy, is in fact always a monotonically increasing function of the energy and thus cannot give rise to negative temperatures. However, the fact that Gibbs entropy clashes with some basic principles of thermodynamics [5,19] has prompted a defense of negative temperatures by other authors [5,20]. The ensuing debate has spurred a welcome discussion of the definition of entropy for small systems [4,18,21], however, being focused on isolated systems does not address the role of interactions with the environment [22,23]. Furthermore, in these works the existence of decreasing branches in the density of states of truly isolated system is assumed a priori and the discussion centered on theoretical grounds. To this regard, it is useful to recall Callen's warning ( [24], Sec. 15-3) that the decreasing branch in the density of states of the two states model is outside the range of energies for which the model should be used.
Here we bypass the issue of the possible definitions of entropy (and the related matters on classical and quantum statistics and the equivalence of the ensembles), which is mainly relevant to small systems, to focus on systems in the thermodynamic limit. We show that when thermodynamic systems interact with an external field, such as magnetic or gravitational, negative temperatures emerge from an energy-entropy mis-attribution. On the contrary, the adoption of a correct thermodynamic formalism, which includes the work done by such fields ( [24], p. 81-83), leads to intensive quantities that can be negative but do not correspond to the true thermodynamic temperatures measurable with a thermometer. The ordering effect brought about by the work done on the system by an external field [25] is linked to a reduction in the number of particular microstates and a corresponding lowering of the entropy. As a result, the field force appears as an entropic force whose isothermal work done to order the states of the system ends up being expelled into the environment as heat, in a condition which is reminiscent of the famous Landauer erasure principle [26,27].
After a general theoretical discussion of the thermodynamics and statistical mechanics in the presence of an external field, we illustrate the details of our argument by means of two specific models: a paramagnetic system, which is typically used to explain negative temperatures, and a perfect gas within horizontal plates in a gravitational field. For such models, the calculations can be carried out in detail with simple methods and without distractions from the physical interpretation.

Thermodynamics of systems in an external field
The Gibbs relation for a simple system [28] (no external fields) with internal energy U and entropy S and constant mass and volume can be written as where T = dU dS is the thermodynamic temperature and dQ = T dS = dU is the heat exchanged reversibly with the environment. The latter equality reflects the fact that heat is a disordered form of energy and temperature is the intensive quantity associated to it [13]. Entropy is a first-order homogeneous function of its argument and the corresponding Euler relation has the form ( [24], p. 60) Furthermore, S is a convex, monotonically increasing function of E; these properties ensure the stability of the thermodynamic equilibrium and the existence of strictly positive temperatures [24]. The entropy S 0 accounts for the microstates not directly related to thermal agitation, including those that arise from the spin orientations in a system of particles consisting of magnetic dipoles.
When the system interacts with an external field, φ, the Gibbs relation needs to be extended, as done for the gravitational field by Gibbs and Boltzmann [29,30,31], and shown also by Callen for magnetic systems ( [24], p. 479-483). As a result, in the entropy representation we have [24] where X is the extensive variable associated to φ, such that φ T = ∂S ∂X . In this expression, T is still the thermodynamic temperature, which remains strictly positive, whereas φ T can be either positive or negative depending on the sign of the field. Equation (3) expresses the fact that both changes in U and in X affect the entropy of the system, namely S = S(U, X). The presence of the external field brings about an ordering of the system [25] and a corresponding reduction of S 0 . In a sense, this effect is analogous to the one of raising a thermodynamic wall in a composite system [24]. Moreover, when X has units of length, φ has units of force and can be interpreted as a thermodynamic force associated to the entropy reduction by the field. Negative temperatures arise when the term φX is considered as part of the internal energy. This implicitly happens when the system is improperly treated as a simple system (in the sense of thermodynamics [28]) using an overall energy U = U + φX in (1), i.e., Since T is not the thermodynamic temperature, it should not be expected to be strictly positive. Indeed, T is equal to the thermodynamic temperature T only for iso-X processes, i.e., 1 T dU = 1 T dU , and it becomes negative for processes at constant U , 1 T = φ T , when the external field is negative (e.g., upon inversion of a magnetic or gravitational field). This mis-attribution is analogous to confusing the enthalpy, H = U + pV , with the internal energy, U , by including the Landau potential, pV , as part of the internal energy. In a spin system, for example, the extensive parameter X corresponds to the magnetization and its conjugate intensive parameter is the magnetic field. Their product gives a potential and is the energy arising from the interaction with the magnetic field. As we also show later on, for a correct thermodynamic formalism this energy should be explicitly accounted for in the Gibbs relation [24] (p. 479-483).
From the point of view of statistical mechanics, the system intensive variables can be computed from the Boltzmann postulate, S = k ln Ω, where k is the Boltzmann constant and Ω(U, X) is the number of microstates, In this context, it is crucial to recognize that the number of microstates depends on X. Otherwise a fictitious temperature T appears again when treating Ω as a function of U = U + φX and computing the entropy as This is also the case when constructing the thermodynamic ensembles using a Hamiltonian formulation, since for simple systems it is typical to equal the Hamiltonian H to the system internal energy, while here it has the additional contribution due to the field, i.e., In what follows, we will focus on the simpler case where the equations of state are functions only of their respective variables, i.e., ∂S/∂U = 1/(kT ) = β(U ) and ∂S/∂X = φ/(kT ) = γ(X). This is the case for the ideal gas, where due to the absence of intermolecular forces only the kinetic energy contributes to the internal energy, while the potential energy associated to the infrequent elastic collisions is negligible. Thus, one can alter the extensive variables, X (e.g., the volume), without affecting the internal energy, U . For these systems, the density of states can be factorized as Ω = Ω U Ω X [8], so that where S 0 = k ln Ω 0 ; the latter step emphasizes the lowering of entropy due to the reduction of the number of configurations compared to the value of S 0 when the external field φ is zero.

Paramagnetic system
Magnetic systems provide an emblematic example for the discussion of negative temperatures [8]. We consider an isolated system of N particles with spin-1/2 and intrinsic magnetic moment µ. N + particles have positive spin while the remaining N − = N − N + particles have negative spin so that the total magnetization is M = µ(N + − N − ). It is assumed that there are Ω M equiprobable ways to arrange the spins among the magnetic susceptibility as a function of the magnetic field µ B T . The slope of the entropy curve with respect to the magnetization, shown in (b), is not the thermodynamic temperature but the magnetic field divided by the temperature (B/T ), see equation (14).
particles consistent with the magnetization M and linked to an entropy S M . The total entropy of the system, also includes the entropy linked to thermal configurations, S U = k ln Ω U . In what follows, we consider constant internal energy, U , and focus on the variation of the entropy with respect to the magnetization of the system, M . The number of microstates Ω M due to the possible spin configurations is [32] From the Boltzmann postulate and invoking the Stirling approximation for large systems, one obtains and, using the definition of M and the fact that N − = N − N + , As seen in Figure (1), this entropy is a convex function of the magnetization and is symmetrical about M/µ = 0. The macrostate of zero magnetization, with half spins positive and half negative, is the one with the highest number of microstates and thus of maximum disorder. Increasing magnetization increases the order of the spins, until a minimum entropy is reached when all the spins have same orientation.
Having identified the entropy of the system as a function of the macroscopic variables, it is now possible to compute the intensive variables by differentiating (8). The result coincides with equation (B.19) of Callen [24] and reads and with B the magnetic field. Using these relationships, it is easy to obtain the entropy as S M = S M (B/T ), which is plotted in Figure 2(c)), along with the magnetic susceptibility (Figure 2(d)), Equation (13) (Figure 1(b)). In the energy representation, U = T S − BM and, since S > 0 and BM < 0, then U > 0. The magnetic susceptibility is highest at the lowest magnetization and then decreases with respect to M/µ (see the inverse of the slope of Figure  1(b)). Equivalently, c M goes to zero at saturation (e.g., M = µN + ), whereas it tends to a constant (Curie's law) as B/T → 0, where it becomes a linear function of the inverse temperature with a slope equal to the Curie constant [33]. If one plots the magnetic susceptibility scaled as B µN c M with respect to µ B T , a so-called Schottky anomaly appears because of the particular normalization [8].
The two state paramagnetic model gives rise to negative temperatures [1,34,8,5,35] when the internal energy is identified with the magnetization, for example by giving an energy to the positive spins while attributing zero energy to the negative ones and neglecting the thermal contribution. Accordingly, the system 'internal energy' is defined as U = N + and the entropy is considered only as function of U , Applying equation (4) one then obtains which is positive when U < N + 2 , negative when U > N + 2 , and has an asymptote at U = N + 2 . However, given that one has assumed dU = 0, 1/T turns out to be nothing but B/T , whose sign follows the orientation of the magnetization M .

Ideal gas in a gravitational field
Our second application consists of an ideal gas in a uniform gravitational field g between two horizontal plates at a distance h. In the absence of gravity, the molecules of gas uniformly fill the space and both the particle density ρ and pressure p are constant throughout the height h. Instead, with a gravitational field of intensity g, the molecules are pushed against the plate in the direction of the field. While so far the problem has mainly been approached by means of statistical ensembles [25,36], here the system is assumed to be made of a very large number of molecules (≈ 10 23 ) such that the continuum hypothesis holds and the various thermodynamic quantities can be easily computed by assuming local thermodynamic equilibrium. In isothermal conditions at temperature T , this results in the well-known exponential distributions for density and pressure already obtained by Gibbs and Boltzmann [29,37], where z is the vertical coordinate, M is the molecular mass, and p 0 is found by imposing forces creates an inhomogeneity in density and pressure (and therefore also in the chemical potential), while being in thermal equilibrium at constant T . The uniformity of the vertical temperature profile, ensured by the fact that the gas and the plates are assumed dia-thermal, was clarified by Maxwell and Boltzmann in a interesting debate against an objection by Locksmith [38]. With these premises, it is easy to see that the thermal entropy, s U = c v ln T , does not depend on z or g, while the field-related entropy per unit volume, depends both on z and g. In turn, the total entropy for the layer of gas is found by integration with respect to z in which R is the gas constant, γ = ghM/kT , and ϕ = γ/(h(e γ − 1)). Thus the global entropy (20) depends on g and, as for the spin system, is maximized in the absence of the external field, g → 0, and decreases as the gravitational field is increased, regardless of its direction (see Figure 1(c)). As already noticed by Landsberg et al. [25], beyond a certain |g| the entropy becomes negative. This is simply due to the fact that locally the density is too large for the gas to be still treated as ideal [39].
To formulate an extended Gibbs equation for the overall system analogous to (12) for the spin system, it is necessary to find the extensive variable X associated to g/T . From the fact that ∂S/∂X = g/T , we have ∂S/∂g = g/T (∂X/∂g) and by integration Substituting (20) in the previous expression gives X = N M H g = mH g , where m is the total mass and H g = ( h 0 zρdz)/N is the center of gravity of the gas. As a result, the Gibbs equation can be written as [31] dS By analogy with (15), the gravitational susceptibility c g is defined as c g = N M dH g /dg. These results, summarized in Figure (2), bear a striking similarity to those of the paramagnetic model. They show that the gravitational field tends to organize the system by displacing the center of gravity in the direction of the field. In the limit |g| → ∞ the system is squeezed towards the lower or upper plate depending on the sign of g and S g → −∞, while for |g| → 0 the density profile is uniform and the entropy S g reaches its maximum. Analogously to the magnetic system, also in this case, when the external field (i.e., the gravitational energy) is considered as part of the internal energy in (4), one obtains a negative temperature as soon as the gravitational potential is inverted. In this case, however, the macroscopic and classical nature of the system leaves little doubt that such negative temperatures only have a formal meaning and do not correspond to real temperatures.

Conclusions
Negative temperatures originate from a mis-attribution of energy and disappear when properly accounting for the ordering effects of and the related work done by the external field. Negative slopes ∂S ∂M = B T in a paramagnetic systems are linked to a negative direction of the magnetic field, rather than to a real inversion of the absolute temperature scale. The case of an ideal gas confined vertically by two parallel plates reproduces the same thermodynamic idiosyncrasies of the magnetic system, when the thermal configurations are not carefully distinguished from those affected by the external field.
Moving along the entropy curve in Figure 1(a) and 2(a) corresponds to a reversible isothermal process in the extended Gibbs equations (3), in which the work done by the external field ∆w = φdX is released by the system as heat T ∆S into the environment. For the two applications considered here, the independence between configuration types also implies ∆U = 0 for an isothermal process, analogously to an isothermal compression/expansion of a gas. Thus, in isothermal transformations when the external field is turned on and work is done to order the system, heat is released to maintain constant temperature, while when the external field is turned off, thermal agitation acts to restore the disorder, i.e., increase the entropy, absorbing heat from the environment. In adiabatic processes, the work done by the external field is stored as internal energy and temperature increases, corresponding to a transfer of configurations from magnetic or gravitational to thermal. Switching off the external field, the system transfers back thermal configurations to magnetic or gravitational modes, reducing the temperature. In this way, super-Carnot efficiencies that appear when introducing heat bath at negative temperatures are never present.
Our considerations are limited to conditions of thermodynamic equilibrium of systems interacting with an external field and to ideal, quasi-static transformations between equilibrium states. When the formalism is extended to systems that are not strictly thermodynamic (as in vortices in 2D turbulence [40,41]) as well as nonequilibrium or nonextensive conditions other formal negative temperatures are likely to emerge, instead of actual thermodynamic temperatures that cannot be defined [16].