For distinguishable noninteracting spins, let a fraction occupy the level and the remainder occupy . The Stirling formula gives
The relation yields
Positive temperature corresponds to ; a population inversion has negative temperature.
Let two systems exchange energy inside an otherwise isolated composite system, so is fixed. By the Second law of thermodynamics, equilibrium maximizes the total entropy
At an interior maximum,
Thus , which is entropy maximization under thermal contact and the condition for thermal equilibrium.
Stability requires this entropy maximum to be locally strict, so each ordinary subsystem has a concave entropy-energy relation. Since
one has , or equivalently
This is the entropy concavity and positive heat capacity criterion.
Now let and . Because the spins are distinguishable, the number of microstates is the binomial coefficient
The Boltzmann entropy and the Stirling formula give, to leading order for large ,
The total energy is
Therefore
Solving for the up-spin fraction gives the independent spin-one-half two-level system result
For ordinary positive absolute temperature,
with as and as . Since the spectrum is bounded above, the population-inverted range is also mathematically possible and corresponds to negative temperature; is the infinite-temperature state.
Substitution gives
and direct differentiation yields
Thus the energy increases with temperature throughout either finite-temperature branch, in particular throughout the required positive-temperature range.
Because the one-particle spectrum is bounded above, a negative temperature is possible. A population-inverted configuration with more particles in the level than in the level has
which requires . Equivalently, above the maximum-entropy energy , adding energy reduces the number of compatible microstates, so . The limiting configuration with every particle at has , zero entropy, and .
Immediately after the reversal the state populations have not changed, but the new Hamiltonian satisfies
Thus
so the same state is canonical for the reversed field with
This is the magnetic-field reversal and negative temperature construction. Since
the partition function is unchanged. Therefore
A gas has kinetic energy unbounded above. Its partition function diverges for , so it cannot have a normalizable negative temperature canonical state and cannot satisfy the zeroth-law equilibrium condition .
If an amount flows from the spins into a positive-temperature gas, the total entropy change is
The second law therefore selects heat flow
This is the general ordering expressed by heat flow from negative to positive temperature.