being the energy of a single photon. The average energy in a mode can be obtained from the partition function : ⟨ E ⟩ = − − d log ⁡ ⁡ ( Z ) d β β = ε ε 2 + ε ε e β β ε ε − − 1 . This formula, apart from the first vacuum energy term, is a special case of the general formula for particles obeying Bose–Einstein statistics. Since there is no restriction on the total number of photons, the chemical potential is zero.