-
Notifications
You must be signed in to change notification settings - Fork 72
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
[gf] GfReFreq density density_zero_T + test #534
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1- Do we really want density and density_zero_T ?
Why not an overload density(beta) and density() ?
Is it clear enough ? (@Wentzell : Opinion on just API requested here).
2- total_density : why do we provide this ?
Taking a trace is trivial (both C++ and numpy) , let's not multiply functions with low contents in the API
it inflate the library for nothing.
To |
As long as this is clearly stated in the documentation I am fine with this API.
I agree with Manuel that this should be kept for backward compatibility. |
I have tried to rebase this and fix the comments. But, since I wrote this in February... the whole structure of the python bindings of the greens function has changed. The files @Wentzell how and where should the wrapping be done? I am not keen on adding this to Best, H |
Ok, we will update the wrappers. |
4ca4a66
to
02d7dce
Compare
I have rebased on unstable, moving the implementation to To use the suggested overloading where With that I consider all comments accounted for. |
This is pending code review. From @Wentzell or @parcollet . |
triqs/gfs/functions/density.cpp
Outdated
|
||
assert(wmin < 0.); | ||
|
||
int N0 = floor(-wmin / dw) + 1; // frequency index at or above w=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::floor !!
|
||
// -- Required to filter out divergent real parts of g that are inf | ||
// -- eg flat dos at dos edge | ||
for (int idx : range(0, res.shape()[0])) res(idx, idx) = dcomplex(0., imag(res(idx, idx))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// FIXME iterate on diagonal
// -- eg flat dos at dos edge | ||
for (int idx : range(0, res.shape()[0])) res(idx, idx) = dcomplex(0., imag(res(idx, idx))); | ||
|
||
res *= dcomplex(0., 1.) * g.mesh().delta() / M_PI; // scale to density |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1i ( standard complex literal !).
1_j
@parcollet this passed the CI, so I merge it. |
This is a remake of pull-request #391 with added text and finite temperature functionality.
Contains .density(beta) and .density_zero_T() functions for GfReFreq.