Exact diagonalization code