The Partition Function

A casual deep-dive into what the partition function Z actually means — from its German roots to why dividing by Z magically turns Boltzmann weights into real probabilities.

First, let me just slam down the definition of the partition function:

Equation from the original notes

The reason we specifically use Z, out of all the many letters of the alphabet, to denote the partition function —

​I’ll transcribe it.

“The partition function is denoted by the symbol Z, because this concept was originally named in German.

Zustandssumme means ‘sum over all states,’ and this exactly captures what Z is. The English name ‘partition function’ indicates the way Z shows ‘how energy is partitioned among the states of the system’: Partition function.“​​

​Actually, earlier we were treating this concept just like a counting-of-cases thing, understanding it as the sum of unnormalized Boltzmann weights over all possible microstates, and we were subtly using the Z concept already.

So let’s dig a little deeper into the meaning of Z.​​

It is the sum of the Boltzmann weights, not the probabilities — normalized probabilities sum to 1!

Equation from the original notes

and since we want to turn this proportionality of the Boltzmann distribution into an equation, we put in a coefficient​

Equation from the original notes

​ and write it like this

Let k label individual microstates, including distinct states that happen to have the same energy. If their energies are

Equation from the original notes

then​

at temperature T the probability of that particular microstate with energy E_k is

Equation from the original notes

and while playing around like this you can see that the definition of Z just pops out.

What does Z mean…

You can grasp it easily in this way:

the probability of being in a state with energy E is, as a factor,

Equation from the original notes

proportional to this — but

Equation from the original notes

itself is not a probability.

We want to call that thing a probability, I’m telling you?!?!!​

And right then, snap~~~ if we divide by Z​

Equation from the original notes

then we can call it a probability, you see?!?!!​

We’ve seen stuff like this in lots of places​

When you flip a coin, ​

say heads came up 30 times — you can’t call that 30 itself a probability, right????

So we divided by something like 30/75, or 30/300, i.e. the “size of the probability distribution,” which is the number of trials.​

So Z plays the role of a normalization sum, like the denominator in that analogy. It is not the number of trials or the sum of already normalized probabilities.

Now now now now, but,

the partition function Z plays a very important role in statistical mechanics.

As we go along you’ll see right away why Z is so important

(spoiler: if you know Z, you can derive U, F, G, H, p, V, S, etc. etc. That is, I’ll go so far as to boldly claim that all the information in thermal and statistical mechanics is melted into Z.)

To give a sense of the scale: if classical mechanics has F=ma, electromagnetism has Maxwell’s equations, and quantum mechanics has the Schrödinger equation,​

then statistical mechanics has the partition function…. it’s important at about that level.​

If you want to analyze anything in statistical mechanics,

the first button to fasten will be computing the partition function​

A preview of the limits of the partition function

In quantum mechanics, a Hamiltonian leading to an equation like this could already be a pain to solve:

An awkward Hamiltonian from the quantum-mechanics analogy.Open figure at full size

An awkward Hamiltonian from the quantum-mechanics analogy.

Likewise, sometimes the partition function is seriously hard to calculate.

  1. Statistical mechanics often tangles up lots of variables. If the sum over states leads to a nasty coordinate dependence like the schematic example below, my odds of transferring out of the physics department go up, lol. The allowed states and their energies still have to be specified to make an actual partition sum.
  2. Quantum mechanics is hard enough, and now temperature $T$ also enters the statistical description. More to keep track of!
  3. We’re usually dealing with many bodies. If we also have to account for their interactions with one another… there go my odds of staying in the physics department again, lolol.

Why partition functions can be difficult, including the two jokes about transferring out of physics.Open figure at full size

Why partition functions can be difficult, including the two jokes about transferring out of physics.

OK so in solving problems in statistical mechanics the first button will be “computing the partition function,”

so: yeah, so (if possible) how do we compute it?!?!?!?! — let’s go get the answer to that.

Equation from the original notes

Tough situations can wait; first let’s compute the partition function in the easiest easiest easiest case!!!! (we’ve done this one before too!!!!)​

The definition of the partition function is

Equation from the original notes

so

plugging in the possible energies for the two-level system above:

Equation from the original notes

Eh… this was a bit much. Way too easy, no….???​

Then let’s compute Z for the second simple model, the simple harmonic oscillator!!!!!​

Quantum-mechanically, the allowed energies for the harmonic oscillator were

Equation from the original notes

right​

So applying it to the definition of the partition function,

Equation from the original notes

​This one’s easy too hehehe​

Now let’s consider rotational energy.

By rotation here I mean the rigid rotor’s spatial rotation, not intrinsic quantum spin ^^hehehehehehe

Angular momentum is enough to make my chest tighten already….hehehe

First, classical-mechanically the rotational energy is

Equation from the original notes

.

If you understand it as

Equation from the original notes

it’s not hard, right???

But quantum-mechanically the angular momentum L had to be defined as an operator,

so we split the angular momentum into components

Equation from the original notes

and had to express it like this,

but this also couldn’t serve as a good weapon, so the physicists’ drastic measure was to

turn their attention not to L as the variable of interest, but to

Equation from the original notes

.

That’s because L^2 has a commutator of 0 with each and every one of L_x, L_y, L_z,

and commutator being 0 means the commutation law holds,

which means $L^2$ and one chosen component, usually $L_z$, can have common eigenstates. It does not make $L_x,L_y,L_z$ simultaneously sharp: those components do not commute with one another.

So we use $L^2$ and $L_z$ for the joint labels $\ell,m$, or diagonalize that commuting pair in matrix language.

And if you massage L^2​ nicely​

using the Ladder operator:

Equation from the original notes

you could express it like this.​

Equation from the original notes

You can write it like this,

and writing it this way you can easily find the eigenvalues​

the eigenvalue of

Equation from the original notes

is

Equation from the original notes

and

the eigenvalue of

Equation from the original notes

is

Equation from the original notes

you can find them like this…​

Ah… I was trying to keep it short and came way too far.

For the details, please refer to Angular Momentum (Quantum Mechanics I Studied #21) .

Anyway, the energy of the rotational state is

Equation from the original notes

Heads-up: the rotational-energy picture drops a square on $\hbar$. The rigid-rotor levels are $E_\ell=\hbar^2\ell(\ell+1)/(2I)$, consistent with the earlier $L^2$ eigenvalue $\hbar^2\ell(\ell+1)$.

that’s what it is.​

​Okay then we can compute Z, right?!?!!!

Equation from the original notes

Is it done if we compute it like this?!?!?!?!?!!!

nononononononononononononono

There’s one more thing to think about​​

Equation from the original notes

​there isn’t just one state with this energy, you know

the number of states that can have angular momentum l…. that is, the number of degenerate states is (2l+1) for each l.​

Why?!?!?!!!!!​

The ones that can have angular momentum l are

Equation from the original notes

can be -l, -l+1, . . . , l-1 , l, these are the possibilities,

so as many as that number of cases can have angular momentum l.​

(e.g. l=2 is possible with m=-2, m=-1, m=0, m=1, m=2 all of them)​​

So when summing Boltzmann weights by energy level in the partition function, include this weighting for the number of states.

Equation from the original notes

Use the same squared $\hbar$ in both rotational partition-function pictures: $Z_{\rm rot}=\sum_{\ell=0}^{\infty}(2\ell+1)\exp[-\beta\hbar^2\ell(\ell+1)/(2I)]$. The final picture correctly adds the degeneracy $2\ell+1$, but its exponent still needs that square.

​Kyaa~~~~ so if you write it like this, we can count up the partition function Z~~~~~~~~~​

I’ll do the detailed calculation in the post where I solve practice problems.~~~​

Aaaaaah and, ​that red part up there —

please keep in mind that it’s the number of states that can have E_n

because it’s going to be treated very importantly later on~~~​ lol

Questions or corrections?

Did a step lose you, or does a number look off? Email me or use the contact page. Include the note title and the step or figure you mean.

Feedback goes to me privately by email; it is not posted as a public comment.