H tilde misses zeroth order
We have a bug in H_tilde
. The unperturbed Hamiltonian is never returned, which means that a constant term is missing in the answer.
This is counter intuitive, for example when no perturbation is given to compute_next_orders
and exp_S
doesn't contain anything.
The term should be added to H_tilde
right before returning, as wanted_orders
does not include 0th order terms on purpose.