---
title: The Boltzmann factor and the partition function
heading: The probability of a state at temperature T
eyebrow: B11 · Lesson 3 · The Boltzmann factor and the partition function
xp: 45
---

::: hook
Most systems engineers care about aren't isolated; they sit in contact with a much larger environment at temperature T: a transistor on a circuit board, an atom in a gas, an electron in a crystal. For such a system the probability of being in a state with energy E is proportional to $e^{-E/kT}$, the **Boltzmann factor**. It's the single most used formula in device physics. It sets how many electrons are thermally excited across a band gap, how fast a chemical reaction or a failure mechanism proceeds (the Arrhenius law behind every accelerated life test), and how a diode's current depends on voltage.
:::

::: play
- A system with evenly spaced levels, 0, ε, 2ε, ..., sits in contact with a reservoir at temperature T. The stems are the probabilities of each level.
- At low T almost everything is in the ground state. As kT grows past ε, higher levels fill in, each less likely than the one below by the same factor $e^{-\varepsilon/kT}$.
- The readouts give the partition function Z (the sum of all the Boltzmann factors) and the average number of quanta.
:::
:::

```sim plot
view: graph
x: n = 0..15
y: P = 0..1
slider: e = 1..50 step 1 = 10 meV
slider: T = 10..1000 = 150 K log
plot: (1 - exp(-e/(0.086173*T)))*exp(-n*e/(0.086173*T)) | stems | label: probability of level n
readout: ε/kT = e/(0.086173*T)
readout: Z = 1/(1 - exp(-e/(0.086173*T)))
readout: average n = 1/(exp(e/(0.086173*T)) - 1)
```

::: predict
## A failure mechanism has activation energy 0.7 eV. A part is stress-tested at 125 °C instead of its 55 °C use temperature. Roughly how much faster does it fail?

- [ ] About 1.2×, the ratio of the absolute temperatures
- [ ] About 5×
- [x] About 80×
- [ ] About 10⁴×

::: reveal
The rate goes as $e^{-E_a/kT}$, so the acceleration factor is $\exp\left[\frac{E_a}{k}\left(\frac{1}{328\text{ K}} - \frac{1}{398\text{ K}}\right)\right] = e^{4.35}$ = 78. A thousand hours at 125 °C stands in for about nine years at 55 °C, which is how semiconductor makers qualify parts for decades of service in weeks.
:::
:::

::: nameit
## The Boltzmann factor

A system S in contact with a large reservoir R at temperature T. If S is in a particular state of energy E, the reservoir has $U_0 - E$, and its multiplicity is $e^{S_R(U_0 - E)/k} \approx e^{S_R(U_0)/k}e^{-E/kT}$ (expanding $S_R$ to first order, with $\partial S_R/\partial U = 1/T$). So

$$P(s) = \frac{e^{-E_s/kT}}{Z}, \qquad Z = \sum_se^{-E_s/kT}$$

Z is the **partition function**. A level with degeneracy g contributes $ge^{-E/kT}$.

## What Z gives you

With β = 1/kT,

$$\langle E\rangle = -\frac{\partial\ln Z}{\partial\beta} = kT^2\frac{\partial\ln Z}{\partial T}$$

and (next lesson) the free energy $F = -kT\ln Z$, from which everything else follows. For independent parts, Z multiplies: $Z = Z_1Z_2$.

## Two standard results

- **Two levels** 0 and Δ: $P_{upper} = \frac{1}{e^{\Delta/kT} + 1}$, $\langle E\rangle = \frac{\Delta}{e^{\Delta/kT} + 1}$.
- **Evenly spaced levels** nε (an oscillator): $Z = \frac{1}{1 - e^{-\varepsilon/kT}}$ and $\langle n\rangle = \frac{1}{e^{\varepsilon/kT} - 1}$, the Planck distribution of lesson 11.

## Thermal activation

Anything that needs an energy $E_a$ to happen, like a carrier hopping a barrier, an atom diffusing or a defect forming, proceeds at a rate proportional to $e^{-E_a/kT}$: the **Arrhenius law**. Between temperatures $T_1$ and $T_2$ the rate changes by $\exp\left[\frac{E_a}{k}\left(\frac{1}{T_1} - \frac{1}{T_2}\right)\right]$. Useful number: kT = 25.85 meV at 300 K.
:::

::: example
## How many hydrogen atoms in the Sun's 5800 K photosphere are in the n = 2 level for each one in n = 1?

::: solution
1. **Levels and states.** n = 2 lies 10.2 eV up and has 8 states against n = 1's 2 (with spin).
2. **The exponent.**
   $$\frac{10.2}{8.617 \times 10^{-5} \times 5800} = 20.4$$
3. **Boltzmann ratio.**
   $$\begin{aligned} \frac{N_2}{N_1} &= 4e^{-20.4} \\ &= 5.5 \times 10^{-9} \end{aligned}$$
4. **Still visible.** Even so, there are enough hydrogen atoms that the Balmer absorption lines starting from n = 2 are prominent in the solar spectrum.

**Answer:** about $5.5 \times 10^{-9}$ atoms are in n = 2 for each one in n = 1.
:::
:::

::: example
## A two-level defect in an oxide has Δ = 50 meV. What fraction is excited at 300 K, and what's its average energy?

::: solution
1. **Gap over kT.**
   $$\begin{aligned} \frac{\Delta}{kT} &= \frac{50}{25.85} \\ &= 1.93 \end{aligned}$$
2. **Excited fraction.**
   $$\begin{aligned} P_{upper} &= \frac{1}{e^{1.93} + 1} \\ &= 0.126 \end{aligned}$$
3. **Average energy.**
   $$\begin{aligned} \langle E\rangle &= 0.126 \times 50 \\ &= 6.3\ \text{meV} \end{aligned}$$
4. **At 77 K.** Δ/kT = 7.5 and the excited fraction drops to 5.3 × 10⁻⁴.

**Answer:** 0.126 of the defects are excited at 300 K, and the average energy is 6.3 meV.
:::
:::

::: example
## An old rule of thumb says a component's failure rate doubles for every 10 °C rise near room temperature. What activation energy does that imply, and what factor does it predict between 25 °C and 125 °C?

::: solution
1. **Set up the doubling.** Doubling between 298.15 K and 308.15 K means
   $$e^{E_a/k(1/T_1 - 1/T_2)} = 2$$
2. **Solve for the activation energy.**
   $$\begin{aligned} E_a &= \frac{k\ln2}{\frac{1}{298.15} - \frac{1}{308.15}} \\ &= \frac{8.617 \times 10^{-5} \times 0.6931}{1.088 \times 10^{-4}} \\ &= 0.549\ \text{eV} \end{aligned}$$
3. **Factor from 25 °C to 125 °C.** With that activation energy, things speed up by
   $$e^{E_a/k(1/298.15 - 1/398.15)} = 214$$
4. **Compare with the rule of thumb.** The rule, applied ten times, would say $2^{10} = 1024$.
5. **Why they differ.** The rule is only a local statement: in 1/T the same 10 °C step is a smaller step at higher temperatures, so the doublings get slower as the part gets hotter.

**Answer:** the rule implies an activation energy of 0.549 eV, which predicts a factor of 214 between 25 °C and 125 °C (the rule itself would say 1024).
:::
:::

::: check
given: D = 20 | 50 | 120; T = 77 | 300 | 400
answer: exp(-D/(0.086173*T))
tolerance: 1%

## Two nondegenerate states differ by {D} meV. At {T} K, what's the ratio of their populations (upper ÷ lower)?

::: right
Right. $e^{-\Delta/kT}$ = {answer}.
:::

::: misses
- [exp(D/(0.086173*T))] Upside down: the upper state is less occupied.
- [any] Not yet. kT = 0.08617 meV/K × T.
:::
:::

::: check
given: E = 0.5 | 0.7 | 1; u = 55 | 85; s = 125 | 150
answer: exp(E/0.000086173*(1/(u + 273.15) - 1/(s + 273.15)))
tolerance: 1%

## A failure mechanism has activation energy {E} eV. What's the acceleration factor for testing at {s} °C instead of {u} °C?

::: right
Right. $\exp\left[\frac{E_a}{k}\left(\frac{1}{T_u} - \frac{1}{T_s}\right)\right]$ = {answer}.
:::

::: misses
- [exp(E/0.000086173*(1/u - 1/s))] Convert to kelvin first.
- [any] Not yet. Ratio of Arrhenius factors.
:::
:::

::: check
given: D = 10 | 40 | 100; T = 100 | 300
answer: 1/(exp(D/(0.086173*T)) + 1)
tolerance: 1%

## A two-level system has splitting {D} meV. What fraction is in the upper level at {T} K?

::: right
Right. $\frac{1}{e^{\Delta/kT} + 1}$ = {answer}.
:::

::: misses
- [any] Not yet. Divide the upper level's Boltzmann factor by Z: $\frac{e^{-\Delta/kT}}{1 + e^{-\Delta/kT}}$.
:::
:::

::: check
given: D = 10 | 40 | 100; T = 100 | 300
answer: D/(exp(D/(0.086173*T)) + 1)
unit: meV
tolerance: 1%

## Same two-level system, splitting {D} meV at {T} K: what's its average energy?

::: right
Right. $\frac{\Delta}{e^{\Delta/kT} + 1}$ = {answer} meV.
:::

::: misses
- [D/2] That's the high-temperature limit.
- [any] Not yet. Δ times the upper-level probability.
:::
:::

::: check
given: a = 10 | 30; b = 50 | 80; g = 2 | 3; T = 200 | 300
answer: 1 + g*exp(-a/(0.086173*T)) + exp(-b/(0.086173*T))
tolerance: 0.5%

## A system has a ground state at 0, a level at {a} meV with {g} states, and one state at {b} meV. What's Z at {T} K?

::: right
Right. $1 + ge^{-E_1/kT} + e^{-E_2/kT}$ = {answer}.
:::

::: misses
- [1 + exp(-a/(0.086173*T)) + exp(-b/(0.086173*T))] Count the degenerate level {g} times.
- [any] Not yet. Sum $e^{-E/kT}$ over states.
:::
:::

::: check
given: D = 20 | 60 | 150; p = 0.01 | 0.1
answer: D/(0.086173*ln(1/p - 1))
unit: K
tolerance: 0.5%

## At what temperature does a two-level system with splitting {D} meV have a fraction {p} in its upper level?

::: right
Right. $T = \frac{\Delta}{k\ln(1/p - 1)}$ = {answer} K.
:::

::: misses
- [any] Not yet. Invert $p = \frac{1}{e^{\Delta/kT} + 1}$.
:::
:::

::: check
kind: parts
given: D = 10 | 30 | 60; g = 2 | 3 | 4; T = 100 | 300

## A level {D} meV above a single ground state has {g} states.

::: part
answer: g*exp(-D/(0.086173*T))
tolerance: 0.5%

### At {T} K, what's the ratio of the level's population to the ground state's?

::: misses
- [exp(-D/(0.086173*T))] Each of the g states gets its own Boltzmann factor.
- [any] $ge^{-\Delta/kT}$.
:::
:::

::: part
answer: D/(0.086173*ln(g))
unit: K
tolerance: 0.5%

### At what temperature are the two populations equal?

::: misses
- [any] Solve $ge^{-\Delta/kT} = 1$.
:::
:::
:::

::: check
kind: derivation
vars: D = 1..100, T = 10..1000

## A two-level system with splitting D (meV) at temperature T (K).

::: step
answer: 1/(exp(D/(0.086173*T)) + 1)

### What fraction p is in the upper level?
:::

::: step
answer: D/(exp(D/(0.086173*T)) + 1)

### What's its average energy, in meV?
:::

::: step
answer: D^2*exp(D/(0.086173*T))/(exp(D/(0.086173*T)) + 1)^2

### What's the variance of its energy, $D^2p(1 - p)$, in meV²?
:::

::: right
Right. The variance is largest when the levels are about equally filled, and it's what sets the heat capacity: $C = \frac{\sigma_E^2}{kT^2}$.
:::
:::

::: explain
## Why does the probability of a state fall off exponentially with its energy?

::: model
The system's energy comes from the reservoir it's in contact with, and every unit of energy the system takes reduces the reservoir's entropy by $\frac1T$ per unit, because that's what temperature means. Less reservoir entropy means fewer reservoir microstates, by a factor of $e^{-E/kT}$ for energy E taken. Since every microstate of the combined system is equally likely, the probability of a particular system state is proportional to how many reservoir microstates go with it, which is that exponential. A large reservoir's temperature doesn't change as the system borrows energy, so the factor is the same for every unit, which is why the dependence is a pure exponential.
:::
:::

::: practice

::: check
given: D = 30 | 200; T = 150 | 600
answer: exp(-D/(0.086173*T))
tolerance: 1%

## Population ratio for {D} meV at {T} K?

::: misses
- [any] $e^{-\Delta/kT}$.
:::
:::

::: check
given: E = 0.4 | 1.1; u = 40 | 70; s = 105 | 175
answer: exp(E/0.000086173*(1/(u + 273.15) - 1/(s + 273.15)))
tolerance: 1%

## Acceleration factor, {E} eV, {u} °C to {s} °C?

::: misses
- [any] $\exp\left[\frac{E_a}{k}\left(\frac{1}{T_u} - \frac{1}{T_s}\right)\right]$.
:::
:::

::: check
given: D = 15 | 90; T = 77 | 500
answer: 1/(exp(D/(0.086173*T)) + 1)
tolerance: 1%

## Upper fraction for splitting {D} meV at {T} K?

::: misses
- [any] $\frac{1}{e^{\Delta/kT} + 1}$.
:::
:::
:::
