modified spin_hamiltonian2.hpp