add test/spin_hamiltonian.cpp