Fixed hamiltonian extraction