Partition function of a photon gas

I am trying to calculate the partition function of a photon gas. The book I'm currently following is "Thermal Physics by Garg, Bansal, and Ghosh"

It does the following:

The parition function is

$$Z = \sum_{n_i=0}^{\infty}\exp[-\frac{n_1 h \nu_1}{k_BT}-\frac{n_2 h \nu_2}{k_BT}-...]$$

$$=\sum_{n_1=0}^{\infty}\exp(-\frac{n_1 h \nu_1}{k_BT}) \sum_{n_2=0}^{\infty}\exp(-\frac{n_2 h \nu_2}{k_BT})...$$

$$=\prod_{i=1}^\infty \frac{1}{1 - \exp(-h \nu_i/kT)}$$ by using infinite series.

$$\ln Z = - \sum_{i=0}^\infty \ln(1 - \exp(-h \nu_i/kT))$$

This much is fine, but then it says exactly this:

Note that the summation is over all single photon states. Therefore, we have to multiply the expression on the right hand side by the number of states in volume $$V$$ and in the frequency range $$\nu$$ to $$\nu + d\nu$$. You may recall that this number is $$\frac{8 \pi V \nu ^2 d\nu}{c^3}$$. Hence, on replacing summation by integration and multiplying by the number of states, we get:

$$\ln Z = -\frac{8 \pi V}{c^3} \int_0^{\infty} \nu ^2 \ln(1-\exp(-h \nu/kT) d\nu$$

This last step is difficult to understand. The summation is over $$i$$, which is an index to designate separate frequencies of photons. This is not over states so that I could multiply by D.O.S function. Also, why would we multiply it here? The quantity is not even $$Z$$, it is $$\ln Z$$...

The index $$i$$ labels the distinct normal modes of cavity in which the photons are confined rather than the frequencies. There can be many modes with the same frequency. The normal modes are solutions of the classical Maxwell field equations. Modes, frequencies, and quantum states are different things.
• Just compute the solutions of Maxwell's equation i a cube with conducting walls. Obviously, because of the symmmetry, for any allowed frequency there will be at least six modes because the wave vector can be in either $x$, $y$ or $z$ direction, and there are two polarizations. Each mode can be occupied by any number of photons, so the mode and the occupation number define the quantum state. May 16, 2021 at 13:26