The Grand Partition Function

We let particles flow freely and ask what happens to the partition function — turns out there's a grand version Z_G derived straight from entropy!

Lots of state functions do differ between when particle inflow/outflow isn’t allowed and when it is, and the difference turned out to be $\mu\,dN$. So now I want to talk about the partition function too.

Wouldn’t the partition function also be different when particle inflow/outflow isn’t allowed and when it is??

We touched on the meaning of $Z$ back in chapter 21, and that meaning was “the size of the probability distribution.”

A closed system drawn as a thick circle, with Z = Σ_i e^(−βE_i)

When particle inflow/outflow isn’t allowed, the partition function was defined like this. Now let’s allow particles to flow in and out.

The same circle with a gap and two red arrows, particles flowing in and out: Z_G = ?

When particles can flow in and out, how will the partition function be defined??

It’s called the Grand Partition Function, Z_G, and it turns out this Z_G is derived using entropy?? Let’s follow along!!

Only energy exchanged: the reservoir, a big circle holding E − ε, joined to the system, a small circle holding ε

When only energy is exchanged, the thing that moves is energy, so with $\Omega$, the number of possible microstates for that energy, we drew the picture above and derived the probability of the system being in a state with energy $\varepsilon$: Temperature (Thermal & Statistical Mechanics I Studied #4). But from now on particles can flow in and out too, so both $E$ and $N$ can be exchanged.

Energy and particles exchanged: the reservoir holds U_G − ε and N_G − N, the system holds ε and N

So this time we draw it like this, and instead of the variable $\Omega$ we use the variable $S$!! We are finding the probability of one particular microstate. To get the probability of an energy-and-particle-number pair, we would sum over all microstates with that pair. But $\Omega$ will definitely depend on the variables $E$ and $N$, so surely the probability that the system is in a state with $E = \varepsilon$ and $N = N$, P(ε, N), is proportional to the number of microstates the reservoir has at U_G − ε, N_G − N?! That is,

P(ε, N) ∝ Ω(U_G − ε, N_G − N)

it should be.

Okay, and now back to the main point: which way maximizes $S$~~ Let’s gogo and develop it with this logic. To do that, there’s some background knowledge we need to have in hand first.

Two-variable Taylor series expansion

Two-variable Taylor series: f(x,y) near x = x₀, y = y₀ is f(x₀,y₀) + f_x(x − x₀) + f_y(y − y₀) + ½f_xx(x − x₀)² + f_xy(x − x₀)(y − y₀) + ½f_yy(y − y₀)² + ⋯, every derivative taken at x = x₀, y = y₀

Now when we use this as an approximation, we just throw away the dot-dot-dot at the end, right?

The same expansion as an approximation, f(x,y) ≅ the same terms with the dots thrown away

Expanding the reservoir’s entropy

With this laid down as background, I’ll go with the same logic as Temperature (Thermal & Statistical Mechanics I Studied #4), so it might be a good idea to look at that part for reference and then come back.

I’m going to set up the reservoir’s $S$, and approximate S(U_G − ε, N_G − N) to get the approximation for the situation ε ≈ 0, N ≈ 0. Here the system’s energy and particle number are small compared with the reservoir totals — not literally zero. To make it easier to follow,

Let U_G − ε = A, N_G − N = B, and I’ll get the approximation for A ≈ U_G, B ≈ N_G

S(U_G − ε, N_G − N) = S(A, B); near A ≈ U_G, B ≈ N_G, S(A, B) ≅ S(U_G, N_G) + (∂S/∂A)(A − U_G) + (∂S/∂B)(B − N_G), with the substituted A and B in red

I’ll approximate only this far. And now I’ll put the red substituted variables back the way they were.

Putting the variables back: = S(U_G, N_G) + (∂S/∂U_G)(U_G − ε − U_G) + (∂S/∂B)(N_G − N − N_G) = S(U_G, N_G) − ε ∂S/∂U_G − N ∂S/∂B

We found earlier that (∂S/∂U_G) at fixed V, N is 1/T and (∂S/∂N) at fixed U_G, V is −μ/T, so we pull these in and use them

The expansion tidied up: S(U_G, N_G) − ε/T + Nμ/T, so S(U_G − ε, N_G − N) = S(U_G, N_G) in red − (1/T)(ε − μN) in blue

That’s what we’ve tidied up so far?! Alriiight.

Now let’s play a few tricks on what we’ve tidied up.

The red part: with entropy’s statistical definition S = k_B lnΩ, S(U_G, N_G) = k_B lnΩ(U_G, N_G) and S(U_G − ε, N_G − N) = k_B lnΩ(U_G − ε, N_G − N)

The blue part gets a trick too: −(1/T)(ε − μN) is the same thing as ln e^(−(1/T)(ε − μN))

Then let me write it out again.

Both sides rewritten with k_B lnΩ, step by step, until Ω(U_G − ε, N_G − N) = Ω(U_G, N_G) e^(−(ε − μN)/k_BT)

Why did I derive this relation?

Because now I want to define the partition function in the Grand canonical ensemble!! The definition of the partition function is

Z = Σ_α e^(−E_α/k_BT)

where $\alpha$ labels the energy states… anyway, that’s what it was. But now that the variables $\mu$ and $N$ that determine the energy have been added, the statistical weight now involves $E_\alpha-\mu N_\alpha$, rather than $E_\alpha$ alone. The physical energy is still $E_\alpha$.

(Actually you’ve a~~~ll caught on already from earlier, lol: that form is what goes in.)

But first, let me nail down some, uh.. terminology before we go in. A collection of “systems that can exchange energy and particles” is called the grand canonical ensemble, right? The partition function for those systems gets the special name Grand Partition Function.

So, where are we going to put the relation above,

Ω(U_G − ε, N_G − N) = Ω(U_G, N_G) e^(−(ε − μN)/k_BT)

to use?

Then p(ε, N) ∝ Ω(U_G − ε, N_G − N)

Right here.

If it’s not clear how this relation holds, please check out Temperature (Thermal & Statistical Mechanics I Studied #4)~

Slam it into that relation:

Then p(ε, N) ∝ Ω(U_G, N_G) e^(−(ε − μN)/k_BT)

So

So p(ε, N) ∝ e^(−(ε − μN)/k_BT)

Phew, all derived~

This distribution works on the same principle as the Boltzmann distribution, but it gets its own name: the Gibbs distribution.

The Grand Partition Function

Now that we’ve got the probability distribution, we’ve taken a big step toward the partition function!! Let’s keep going!!

To say it once more: the partition function was all about the size of the probability distribution. It is the sum of the statistical weights, the factor that makes all the probabilities add up to one — not a count of coin-toss trials. And what we tidied up above is exactly the probability distribution for a system that can exchange both energy and particles!!

Now let me change the notation.

Change of notation: p(ε, N) ∝ e^(−(ε − μN)/k_BT) becomes p(E, N) ∝ e^(−(E − μN)/k_BT)

And writing it as an equation,

With a coefficient: p(E, N) ∝ (a constant) e^(−(E − μN)/k_BT)

What does it mean?! The probability that, at temperature $T$, the system is in a state with energy $E$ and, at that moment, $N$ particles!!

Okay, now we can define the partition function. The probability that the energy is E_j and the number of particles is N_j can be written like this.

The probability of state j: p(E_j, N_j) = (a constant) e^(−(E_j − μN_j)/k_BT) divided by (a constant) Σ_j e^(−(E_j − μN_j)/k_BT); the constant cancels

So that guy down there in the denominator is what we can call the partition function, right?! The size of the probability distribution!!

That is,

Z_G = Σ_j e^(−(E_j − μN_j)/k_BT)

the Grand Partition Function.

Tying in the internal energy

Now that we know the partition function, there’s so, so much we can do!! Once you nail down the partition function~ you can derive lots of state functions!!

First, shall we tie the internal energy of a system with particle inflow/outflow to the partition function? In these thermodynamic formulas, $N$ means the mean $\langle N\rangle$; the actual particle number fluctuates. First, here’s how we tied them together when particle inflow/outflow wasn’t allowed:

Without particle flow: U = ⟨E⟩ = Σ E_i p_i = (1/Z) Σ E_i e^(−βE_i) = (1/Z)(−dZ/dβ), so U = −d lnZ/dβ

That’s how we tied them.

So in a system with particle inflow/outflow, will simply saying U_G = −d lnZ_G/dβ do the job?!

Nope… it doesn’t work. Doesn’t work. It’s actually

U_G = −(∂ lnZ_G/∂β) at fixed μ, plus μN

though.

This one seems kind of hard to interpret in terms of meaning. Because the rate of change of the partition function, and a partition function with a log taken on top of that… I think it’s a form that’s hard to take in as meaning.

So I’m thinking I’ll prove the formula above mathematically. Pulling the right side apart and differentiating with respect to $\beta$ isn’t that hard, right?! Then let’s gogo.

The proof: Z_G = Σ e^(β(μN_i − E_i)), so (∂ lnZ_G/∂β) at fixed μ = Σ (μN_i − E_i) P_i = μ Σ N_i P_i − Σ E_i P_i = μ⟨N⟩ − ⟨E⟩

Therefore (∂ lnZ_G/∂β) at fixed μ = μ⟨N⟩ − ⟨E⟩ = μN − U_G, which is then solved for U_G

The other free-energy state functions for when particles flow in and out, I’ll derive in the next post!!~~


Heads-up. The figures here are the original notes, slips and all. A few things to watch for:

  • In the step-by-step derivation of $\Omega(U_G - \varepsilon, N_G - N)$, the fifth line should read $k_B\ln\left(\Omega(U_G, N_G)\,e^{-(\varepsilon - \mu N)/k_BT}\right)$, with the $\ln$ in front of the whole product; the final line is right.
  • In the formula for $p(E_j, N_j)$, every exponent should read $(E_j - \mu N_j)$, not $(E_j - \mu E_j)$, as in $Z_G = \sum_j e^{-(E_j - \mu N_j)/k_BT}$ right after it.
  • In the reminder of $U = -\frac{d\ln Z}{d\beta}$, the exponents carry the index $i$: $e^{-E_i/k_BT}$ and $e^{-\beta E_i}$.
  • The last line of the internal-energy proof has both signs flipped: it should read $U_G = \mu N - \left(\frac{\partial \ln Z_G}{\partial \beta}\right)_\mu$, as stated just before the proof (since $-\left(\frac{\partial \ln Z_G}{\partial \beta}\right)_\mu = U - \mu N$).

Comments

Discussion happens via GitHub Discussions. You'll need a GitHub account to comment.