The partition function of a hydrogen atom diverges (only considering bound states). However, we can regularize it to get finite answers. Different regularizations give the same result. They largely agree with the physical arguments for the case of the hydrogen atom at room or cold temperature, but this should be considered a mere coincidence. The results from regularized partition functions cannot generally be trusted.
https://ulysseszh.github.io/physics/2024/06/30/regularize-hydrogen.html
The partition function of a hydrogen atom diverges (only considering bound states). However, we can regularize it to get finite answers. Different regularizations give the same result. They largely agree with the physical arguments for the case of the hydrogen atom at room or cold temperature, but this should be considered a mere coincidence. The results from regularized partition functions cannot generally be trusted.