# Hamiltonian solver