# Does the canonical ensemble represent a pure or mixed state?

I have a question concerning the density matrix of the canonical ensemble:

$$\hat{\rho} = \frac{1}{Z\left( \beta\right)}e^{-\beta\hat{H}}.$$

I think this density matrix does NOT represent a pure state, as $$\text{Tr}\left( \hat{\rho}^2\right)$$ should not equal to $$1$$, this is my attempt to prove it:

$$\text{Tr}\left( \hat{\rho}^2 \right) = \sum_{m}\langle m \vert \hat{\rho}^2 \vert m \rangle = \frac{\sum_{m}\left\langle m \left| \left(e^{-\beta\hat{H}}\right)^2\right| m \right\rangle}{Z\left( \beta\right)^2} = \frac{\sum_{m}\left\langle m \left| e^{-2\beta\hat{H}} \right| m\right\rangle}{Z\left( \beta\right)^2} = \frac{\sum_{m} e^{-2\beta E_m} \left\langle m \vert m\right\rangle}{Z\left( \beta\right)^2} = \frac{ \sum_{m} e^{-2\beta E_m } }{Z\left( \beta\right)^2}$$

Could anybody please look over this and tell me whether this is correct? And is there a way to further simplify the last expression? In my opinion, one might be able to rewrite this last term to clearly see $$\text{Tr}\left( \hat{\rho}^2\right) \ne 1$$.

It holds that $$0 < \frac{e^{-\beta E_m}}{Z} < 1$$ (as long as we consider the case where the Hamiltonian has more than one eigenvalue, as @Valter Moretti has pointed out) and thus $$\left(\frac{e^{-\beta E_m}}{Z}\right)^2 < \frac{e^{-\beta E_m}}{Z} \quad \forall m$$.
All in all, we find $$\mathrm{Tr}\rho^2 = \sum\limits_m \left(\frac{e^{-\beta E_m}}{Z}\right)^2 < \sum\limits_m \frac{e^{-\beta E_m}}{Z} = 1 \quad ,$$ where the last equality follows from the definition of the density operator.