gftool.density_error

gftool.density_error(delta_gf_iw, iw_n, noisy=True)[source]

Return an estimate for the upper bound of the error in the density.

This estimate is based on the integral test. The crucial assumption is, that ω_N is large enough, such that \(ΔG ∼ 1/ω_n^2\) for all larger \(n\). If this criteria is not met, the error estimate is unreasonable and can not be trusted. If the error is of the same magnitude as the density itself, the behavior of the variable factor should be checked.

Parameters:
delta_gf_iw(…, N) ndarray

The difference between the Green’s function \(Δ G(iω_n)\) and the non-interacting high-frequency estimate. Only it’s real part is needed.

iw_n(N) complex ndarray

The Matsubara frequencies corresponding to delta_gf_iw.

noisybool, optional

Whether the input delta_gf_iw contains noise (default: True). If noisy, an average over the highest frequency is taken to estimate the error.

Returns:
float

The estimate of the upper bound of the error. Reliable only for large enough Matsubara frequencies.