In DLR Documentation, be more clear about which functions are representable.
Opened this issue · 2 comments
Description
When interpolating a constant Green's function (eg..
This issue also occurs for DLR Green's functions which have frequency structure, but with a high-frequency offset.
Steps to Reproduce
The following minimal example will reproduce the problem
import numpy as np
from triqs.plot.mpl_interface import oplot,plt
from triqs.gf import *
U = 1.0
beta = 100.0
dlrwmax = 100.0
dlreps = 1e-10
wmeshdlr_f = MeshDLRImFreq(beta, 'Fermion', dlrwmax, dlreps)
G_w = Gf(mesh=wmeshdlr_f, target_shape=[1])
G_w.data[:] = U
G_c = make_gf_dlr(G_w)
wmesh_f = MeshImFreq(beta, "Fermion", n_iw=50)
G_interp_w = Gf(mesh=wmesh_f, target_shape=[1])
for w in wmesh_f:
G_interp_w[w] = G_c(w)
fig = plt.figure(figsize=(5.0,3.0),dpi=300)
ax = fig.add_subplot(111)
oplot((G_interp_w - U).real, linewidth=1.0, linestyle='-', marker='.', name="Interpolated")
oplot((G_w - U).real, linewidth=1.0, linestyle='-', marker='.', name="DLR" )
ax.set_xlim(-4, 4)
ax.set_xlabel("$i\omega_m$")
ax.set_ylabel("$G(i\omega_{n}) - U$")
plt.show()
The resulting plot is
Expected behavior: The error dlreps
.
Actual behavior: The error dlreps
.
Dear @YannIntVeld
The behavior you describe is actually expected.
The DLR representation is not suited for Green functions that do not
have a spectral representation, e.g. a constant function.
We should however make this more clear in our documentation.
Dear @Wentzell
Ah, I see that makes a lot of sense.
Thanks a lot for the clarification.