The following formula has been given in Hoofts't Hooft's black holes notes ($|\Omega \rangle$ is the vacuum state of Minkowski space, O is a operator):
$$\langle \Omega| O|\Omega \rangle = \sum_{n \ge 0} \langle n | O | n \rangle e^{-2 \pi n \omega}(1-e^{-2 \pi \omega})=Tr(O \rho_{\Omega})$$
How does this mean that the radiation is thermal and follows plancksPlancks black body law?
Here, I read that $\langle O \rangle = \frac{1}{Z}\sum_n e^{-\beta E_n}\langle n |O|n\rangle$. How is this sum the same as that in the above expression?
How is the density matrix related to the law of black body radiation? How can I derive plack'sPlanck's law from the expectation value of O in the first expression?