The partition function is commonly used as a generating function for expectation values of various functions of the random variables.
\bold{E}[H] = \langle H \rangle = -\frac {\partial \log(Z(\beta))} {\partial \beta} .