add spin_hamiltonian::generate