psi4 / psi4numpy

Combining Psi4 and Numpy for education and development.
BSD 3-Clause "New" or "Revised" License
330 stars 151 forks source link

Factor in Sigma Derivatives in Electron Propagator EP2_SO #132

Closed pwborthwick closed 1 year ago

pwborthwick commented 1 year ago

Hi @dgasmith, Sorry this is probably me being dense! In EP2_SO.py the $\Sigma$'s are of the form $\frac{1}{2} \frac{\langle~\Vert~\rangle}{\Delta(\omega)}$, so the derivatives $\frac{\partial}{\partial{\omega}}$ will be $-\frac{1}{2} \frac{\langle~\Vert~\rangle}{(\Delta(\omega))^2}$. The code seems to have absorbed the factor $\frac{1}{2}$ somewhere? However, in EP3_SO the derivatives of $\Sigma^{(2)}$ appear with the factor $\frac{1}{2}$ incorporated into the EPterm expressions (lines 189-190). Inconveniently, for the $H_2 O$ test case the $\frac{1}{2}$ factors only affect the 4th decimal place so it's difficult to definitively separate the two versions. Can you clarify the situation for me please. Peter

dgasmith commented 1 year ago

I suspect the EP2_SO derivates are incorrect, a way to test this is to use something larger (or an augmented basis set) and observe the total number of iterations.

pwborthwick commented 1 year ago

I've checked the EP2_SO and EP3_SO expressions from the Hugenholtz self-energy diagrams and all the energy terms seem correct. The EP3_SO derivatives also look correct, I'm now sure the EP2_SO derivatives are incorrect missing the factor $\frac{1}{2}$.

obackhouse commented 1 year ago

The second-order self-energy in a spin-orbital basis should definitely have a factor 1/2 and so should the derivative w.r.t frequency.

dgasmith commented 1 year ago

Would someone make a quick PR to fix up the derivatives here?

CC @loriab @JonathonMisiewicz - it would be good to double check the Psi4 implementation for this issue.

pwborthwick commented 1 year ago

Would someone make a quick PR to fix up the derivatives here?

CC @loriab @JonathonMisiewicz - it would be good to double check the Psi4 implementation for this issue.

already did that #133

dgasmith commented 1 year ago

Closed by #133.

JonathonMisiewicz commented 1 year ago

CC @loriab @JonathonMisiewicz - it would be good to double check the Psi4 implementation for this issue.

Psi and the P4N implementation agree for the current P4N test case.