gftool.pade.Mod_Averager

gftool.pade.Mod_Averager(z_in, coeff, mod_fct, *, valid_pades, kind: gftool.pade.KindSelector, vectorized=True)[source]

Create function for averaging Pade scheme using mod_fct before the average.

This function behaves like Averager just that mod_fct is applied before taking the averages. This should be used, if not the analytic continuation but a mollification thereof is used.

Parameters:
z_in : (N_in,) complex ndarray

complex mesh used to calculate coeff

coeff : (…, N_in) complex ndarray

coefficients for Pade, calculated from pade.coefficients

mod_fct : callable

Modification of the analytic continuation. The signature of the function should be mod_fct (z, pade_z, *args, **kwds), the tow first arguments are the point of evaluation z and the single Pade approximants.

valid_pades : list_like of bool

Mask which continuations are correct, all Pades where valid_pades evaluates to false will be ignored for the average.

kind : {KindGf, KindSelf}

Defines the asymptotic of the continued function and the number of minumum and maximum input points used for Pade. For KindGf the function goes like \(1/z\) for large z, for KindSelf the function behaves like a constant for large z.

vectorized : bool, optional

If vectorized, all approximants are given to the function simultaniously where the first dimension corresponds to the approximants. If not vectorized, mod_fct will be called for every approximant seperately. (default: True)

Returns:
mod_average : function

The continued function f(z) (z, ) -> Result. f(z).x contains the function values f(z).err the associated variance.

Raises:
TypeError

If valid_pades not of type bool

RuntimeError

If all there are none elements of valid_pades that evaluate to True.