density matrix and non-interacting total energy