yambo-code / yambo

This is the official GPL repository of the yambo code
http://www.yambo-code.eu/
GNU General Public License v2.0
98 stars 38 forks source link

fix (G+k)-> 0 component of kb projector for l=0 in p2y #78

Closed muralidhar-nalabothula closed 5 months ago

muralidhar-nalabothula commented 5 months ago

Dear developers,

p2y wrongly sets, l=0, (K+G)->0 component of Kleynman Bylander projectors (PP_KB_K variable) to zero. This PR fixes this. I also made a small change in bessel function to avoid 0^0 case.

Best regards, Murali

sangallidavide commented 5 months ago

Thanks Murali. I redirected the PR into bug-fixes.

Do you have any test where this has an impact?

If I'm not wrong, in the dipoles pp_kb are always multiplied by pp_kbd which remain zero anyway.

muralidhar-nalabothula commented 5 months ago

Hello Davide,

This should not effect any result in the Yambo code (I assume, pp_kb are used in only dipoles). Their product is zero for all $l$, as ppkb has $\delta{l,0}$ factor and ppkbd has a $\delta{l,1}$. But this term is important if we want to use pp_kb for other purposes such as el-ph (this is how I noticed, the el-ph matrix elements are slightly off if gamma point wave-function are involved). Please note that I did not fix pp_kbd term for k+G->0 and $l =1$, assuming that product appears in the dipoles and it is not really used anywhere other than dipoles.

Let me cross check if the inclusion of both terms does change something.

Update: I check it for silicon, this PR does not alter dipoles

Best regards, Murali

sangallidavide commented 5 months ago

Thanks Murali. I merged this in the bug-fixes. It will enter in the master when the latter will be merged.