Quantum harmonic oscillator: consider a single harmonic oscillator with the Hamiltonian
$$
\mathcal{H}=\frac{p^2}{2 m}+\frac{m \omega^2 q^2}{2}, \quad \text { with } \quad p=\frac{\hbar}{\mathrm{i}} \frac{\mathrm{d}}{\mathrm{d} q}
$$
(a) Find the partition function $Z$, at a temperature $T$, and calculate the energy $\langle\mathcal{H}\rangle$.
(b) Write down the formal expression for the canonical density matrix $\rho$ in terms of the eigenstates $\left(\{|n\rangle\}\right.$, and energy levels $\left(\left\{\epsilon_n\right\}\right)$ of $\mathcal{H}$.
(c) Show that for a general operator $A(x)$,
$$
\frac{\partial}{\partial x} \exp [A(x)] \neq \frac{\partial A}{\partial x} \exp [A(x)], \quad \text { unless } \quad\left[A, \frac{\partial A}{\partial x}\right]=0,
$$
while in all cases
$$
\frac{\partial}{\partial x} \operatorname{tr}\{\exp [A(x)]\}=\operatorname{tr}\left\{\frac{\partial A}{\partial x} \exp [A(x)]\right\}
$$
(d) Note that the partition function calculated in part (a) does not depend on the mass $m$, that is, $\partial Z / \partial m=0$. Use this information, along with the result in part (c), to show that
$$
\left\langle\frac{p^2}{2 m}\right\rangle=\left\langle\frac{m \omega^2 q^2}{2}\right\rangle .
$$
(e) Using the results in parts (d) and (a), or otherwise, calculate $\left\langle q^2\right\rangle$. How are the results in Problem 1 modified at low temperatures by inclusion of quantum mechanical effects?
(f) In a coordinate representation, calculate $\left\langle q^{\prime}|\rho| q\right\rangle$ in the high-temperature limit. One approach is to use the result
$$
\exp (\beta A) \exp (\beta B)=\exp \left[\beta(A+B)+\beta^2[A, B] / 2+\mathcal{O}\left(\beta^3\right)\right]
$$
(g) At low temperatures, $\rho$ is dominated by low-energy states. Use the ground state wave function to evaluate the limiting behavior of $\left\langle q^{\prime}|\rho| q\right\rangle$ as $T \rightarrow 0$.
(h) Calculate the exact expression for $\left\langle q^{\prime}|\rho| q\right\rangle$.