\langle\hat{A}\rangle=\sum_n\langle n| \hat{A}|n\rangle e^{-\beta H_n}