diff --git a/pytriqs/gf/local/gf_desc.py b/pytriqs/gf/local/gf_desc.py index 0169aca0..756ba04f 100644 --- a/pytriqs/gf/local/gf_desc.py +++ b/pytriqs/gf/local/gf_desc.py @@ -3,6 +3,7 @@ from wrap_generator import * module = module_(full_name = "pytriqs.gf.local.gf", doc = "Local Green functions ...") module.add_include("") module.add_include("") +module.add_include("") module.add_include("") module.add_include("") module.add_using("namespace triqs::arrays") @@ -367,6 +368,11 @@ g.add_method(name = "set_from_legendre", signature = "void(gf_view gl)", calling_pattern = "self_c = legendre_to_imfreq(*gl)", doc = """Fills self with the legendre transform of gl""") + +g.add_method(name = "set_tail_from_fit", + signature = "void(tail_view known_moments, int n_moments, int n_min, int n_max, bool replace_by_fit = true)", + calling_pattern = "set_tail_from_fit(self_c, known_moments, n_moments, n_min, n_max, replace_by_fit)", + doc = """Set the tail by fitting""") # Pure python methods g.add_pure_python_method("pytriqs.gf.local._gf_imfreq.replace_by_tail") diff --git a/triqs/gfs/local/fit_tail.cpp b/triqs/gfs/local/fit_tail.cpp index f8ead5d8..5e622c6e 100644 --- a/triqs/gfs/local/fit_tail.cpp +++ b/triqs/gfs/local/fit_tail.cpp @@ -92,7 +92,7 @@ namespace triqs { namespace gfs { namespace local { if (replace_by_fit) { // replace data in the fitting range by the values from the fitted tail int i = 0; for (auto iw : gf.mesh()) { // (arrays::range(n_min,n_max+1)) { - if ((i >= n_min) && (i <= n_max)) gf[iw] = gf.singularity().evaluate(iw); + if (i >= n_min) gf[iw] = gf.singularity().evaluate(iw); i++; } }