Added unit tests for check_convergence and get_energy.