A question about the resource code

Dear all

I have read the resource code related wi the nonlinear optical response. However, I think it is different from the equations given by (https://doi.org/10.1103/PhysRevB.67.165332) and (https://doi.org/10.1238/Physica.Topical.109a00128). For example, the inter-band part in the article is:
but I think the equation in the code is:
I mark the difference by red color.
I think the latter one makes more sense because it can guarantee the symmetry of b and c.

Did I read the resource code correctly?

Dear “Yunfan”,

You are perfectly right ! I have checked the formulas given in Sharma et al, Phys. Rev. B 67, 165332 (2003), and I have found that the superscripts in Eq.(A9) and (A10) are indeed incorrect, as you point out. I have also determined that the equations (A9), (A10) and (A11) only contain the resonant contribution, and not the antiresonant contribution. This error only affect the real part, not the imaginary part. I have then emailed this info to Sangeeta Sharma and Kay Dewhurst, two of the authors of the PRB, and Kay Dewhurst answered me today, confirming your findings and mine. Additionally, he pointed out that there is also an additional error in the paper Hughes and Sipe PRB53, 10751 (1996), in Eq. B3, the first “i” on the left-hand side should not be present (if I have correctly understood his reply - I am checking with him). But this error was not present in the coding.

The source code of ABINIT was directly copied from the corresponding “ELK” routine (with their blessing) more than one decade ago, and he indicated to me that he has made a new version of this routine, with correct implementation. Soon, it will be fixed also in ABINIT.

I would like to interact more with you about this topic, but it does not need to be on this forum. You can contact me at xavier.gonze at uclouvain.be.