Building a Hamiltonian matrix

You will also need to include the single-particle energies. This is easy: they only contribute to diagonal matrix elements, that is, \( H(\alpha,\alpha) \). Simply find the occupied single-particle states \( i \) and add the corresponding \( \epsilon(i) \).