Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real Frequency Flat Density of states has invalid spectral function #791

Open
chuffa opened this issue Sep 15, 2020 · 0 comments
Open

Real Frequency Flat Density of states has invalid spectral function #791

chuffa opened this issue Sep 15, 2020 · 0 comments

Comments

@chuffa
Copy link

chuffa commented Sep 15, 2020

Hello,

I am using the newest TRIQS version on branch unstable 3.0.0.

I am trying to calculate the spectral function of the Flat hyrbdization and by chance included the omega-value of the step in my omega grid. Then one cant use the propper definition of the spectral function as .
I understand that this is hard to deal with as the real-part of the flat DOS indeed diverges, but I would argue that having a huge number as real part (even if it is wrong) is better than having -inf there. And in any case, the spectral function is well defined and should be accessible also using the general formulae provided above.

Even if this doesnt get fixed I think the bug report is good to have for future reference.

import numpy as np
from triqs.gf import *

inds = list(range(2))
d = GfReFreq(indices = inds, window = (-1.1, 0.9), n_points =  21, name = "up")
for i in inds:
    d[i,i] << Flat(half_bandwidth = 1.)

x = [ w.value for w in d.mesh ]    

spec = 1j/(2*np.pi)*( d- d.conjugate().transpose())
print(x[1])
print(d.data[1,:,:])
print(spec.data[1,:,:])

with the output:

-1.0
[[-inf+0.j   0.+0.j]
 [  0.+0.j -inf+0.j]]
[[nan+nanj  0. +0.j]
 [ 0. +0.j nan+nanj]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant