JohanSchott / Pade_approximants

Perform analytical continuation using Pade approximants.
MIT License
14 stars 4 forks source link

Pade approximation for functions that show step-like behavior #1

Open maximiliandaschner opened 2 years ago

maximiliandaschner commented 2 years ago

I have tried to use the Pade approximation for the arctan(x) function as it resembles a Green's function in condensed matter physics. However, by using its function values on the real axis as an input for the Pade approximation and then trying to find the function values on the imaginary axis I ran into some issues. The arctan(i*x) shows step-like behavior which can be easily observed since it is an analytical function. On the other hand, using the Pade approximation results in large fluctuations at the edges (see plot below).

Pade_Arctan For simplicity, the plot only includes the real part of both, the analytical function arctan(i*x) and the Pade approximation of arctan(x) on the imaginary axis.

I was wondering whether your code can find the analytical continuation of the Arctan(x) from the real axis to the imaginary axis more accurately than my code.

JohanSchott commented 2 years ago

The analytical continuation using a Padé approximant is very sensitive to the numerical precision of the input data and the precision used in the fit. If your input data precision is high I would suggest using an arbitrary-precision floating-point arithmetic library in the fit, e.g. mpmath. I would guess that the averaging over several Padé approximants and some other tricks used in this repo will give a result that is not significantly different from the output your code produced.