I would like to derive the partition function for the quantum Harmonic oscillator from scratch:
$$\tag{1} Z = \int dp \, dx\, e^{-\beta H}.$$
The free particle appears in many textbooks. $H = p^2$ so it is a Gaussian integral
$$\tag{2} Z = \int dp \, dx \, e^{-\beta p^2} = L \int dp \, e^{-\beta p^2} = L \sqrt{2\pi/\beta}.$$
I wanted to do the same calculation for the Harmonic oscillator I get could take advantage that
$$\tag{3} Z = \int dp \, dx \, e^{-\beta (p^2 + x^2)} = \int dx \, e^{-\beta x^2} \cdot \int dp \, e^{-\beta p^2 } = \sqrt{2\pi} \cdot \sqrt{2\pi} = 2\pi .$$
Or I could integrate over the circles
$$\tag{4} H = p^2 + x^2 = E$$
take advantage the Hamiltonian is symmetric on rotation in phase space
$$\tag{5} Z = \int dp \, dx \, e^{-\beta (p^2 + x^2)} = \int dE \, d\theta \, E \, e^{-\beta E} = 2\pi. $$
It seems I have forgotten that energy levels are quantized, so I should integrate over the circles
$$\tag{6} H = E_n = \hbar \omega (n + \tfrac{1}{2}).$$
Where are the $E_n$ wavefunctions $\psi_n$ located in phase space? By Heisenberg uncertainty, we can't specify both $(p,x)$ in the phase plane. Are they equidistributed on the circle $p^2 + x^2 = E$?