# Grand Canonical Partition Function

I'm looking over posted lecture notes for a course, and this derivation of the Grand Canonical Partition function eludes me. It goes like this:

occupation numbers $n_{α}=0,1,…$, Total particle number $\sum^{M}_{α=1}n_{α}=N$, total energy $\sum^{M}_{α=1}n_{α}\epsilon_{\alpha}=E$.

The partition function is $$Z=\sum_{n_{α}}e^{βμN−βE}=\sum_{n_{α}}e^{βμ∑_{α}n_{α}−β∑_{α}n_{α}ϵ_{α}}=\sum_{n_{α}}e^{∑_{α}(n_{α}β(μ−ϵ_{α}))}=\prod_{α}Q_{α}.$$ With $Q_{α}$ equal to $$Q_{α}=\sum_{n_{α}}e^{n_{α}β(μ−ϵ_{α})}=1+e^{β(μ−ϵ_{α})}+⋯$$ up to some maximum $n_{α}$.

I am just endless confused by the part where it goes from a summation to a product. Now I get that I can write the exponential sum as a product of exponentials: $$\sum_{n_{α}}e^{∑_{α}(n_{α}β(μ−ϵ_{α}))}=\sum_{n_{α}}\prod_{α}e^{n_{α}β(μ−ϵ_{α})}$$ But how do we commute the summation and the product? It seems to me that it would have a completely different number of terms before and after switching the two.

In addition, this looks nothing at all like the "normal" formulation of the grand partition function, $$Z=\sum_{N}e^{μNβ}Z(N).$$ Is there some error or is there some mathematical magic I'm missing here? This product/sum version is used to derive a whole bunch of stuff afterwards, so I can't very well ignore it.

Any help is appreciated!

Since $n=\left(n_1,\,n_2,\ldots\right)$ with each $n_i\in\{0,\,1,\,2,\,\ldots\}$, then you can write the sum as $$\sum_{n_\alpha}=\sum_{n_1\in\{0,\,1,\ldots\}}\sum_{n_2\in\{0,\,1,\ldots\}}\cdots\sum_{n_m\in\{0,\,1,\ldots\}}$$ while your product is, $$\prod_\alpha e^{n_\alpha \beta}=e^{n_1\beta}e^{n_2\beta}\cdots e^{n_m\beta}$$ Thus, we have $$\sum_{n_\alpha}\prod_\alpha e^{n_\alpha\beta}=\sum_{n_1\in\{0,\,1,\ldots\}}\sum_{n_2\in\{0,\,1,\ldots\}}\cdots\sum_{n_m\in\{0,\,1,\ldots\}}e^{n_1\beta}e^{n_2\beta}\cdots e^{n_m\beta}$$ Each $n_i$ is independent of the others, so they can be moved around the sums easily: $$\sum_{n_\alpha}\prod_\alpha e^{n_\alpha\beta}=\sum_{n_1\in\{0,\,1,\ldots\}}e^{n_1\beta}\sum_{n_2\in\{0,\,1,\ldots\}}e^{n_2\beta}\cdots\sum_{n_m\in\{0,\,1,\ldots\}}e^{n_m\beta}$$ The set of sums are now a product of the exponentials: $$\sum_{n_\alpha}\prod_\alpha e^{n_\alpha\beta}=\prod_\alpha\sum_{n_\alpha}e^{n_\alpha\beta}$$ QED.