After determining the eigenstates |n\rangle and energies \epsilon_n of a given Hamiltonian, exact diagonalization can be used to obtain expectation values of observables. For example, if \mathcal{O} is an observable, its
thermal expectation value is :\langle \mathcal{O}\rangle = \frac{1}{Z} \sum_n e^{-\beta \epsilon_n} \langle n | \mathcal{O} | n \rangle, where Z = \sum_n e^{-\beta \epsilon_n} is the
partition function. If the observable can be written down in the initial basis for the problem, then this sum can be evaluated after transforming to the basis of eigenstates.
Green's functions may be evaluated similarly. For example, the retarded Green's function G^R(t) = -i \theta(t) \langle [A(t), B(0)] \rangle can be written : G^R(t) = -\frac{i \theta(t)}{Z} \sum_{n,m} \left(e^{-\beta \epsilon_n} - e^{-\beta \epsilon_m} \right) \langle n | A(0) | m \rangle \langle m | B(0) | n \rangle e^{-i(\epsilon_m - \epsilon_n)t/\hbar}. Exact diagonalization can also be used to determine the time evolution of a system after a quench. Suppose the system has been prepared in an initial state | \psi \rangle, and then for time t>0 evolves under a new Hamiltonian, \mathcal{H}. The state at time t is :| \psi(t) \rangle = \sum_n e^{-i\epsilon_n t/\hbar} \langle n | \psi(0) \rangle | n \rangle. ==Memory requirements==