Refactor the lanczos method for the exponential
Description
Introduce a function that allows to compute arbitrary functions of the Hamiltonian with the Lanzcos expansion. This is used to rewrite the treatment of inhomogenous terms in a nicer way. Moreover, this can be directly called from other parts of the code.