qsimulate-open / bagel

Brilliantly Advanced General Electronic-structure Library
GNU General Public License v3.0
92 stars 44 forks source link

MDCI Difference Gradient Scaling #219

Closed bapride11 closed 3 years ago

bapride11 commented 3 years ago

In forming the projected "effective gradient" for MDCI optimizations, it appears that the term "xf", used to minimize the energy difference gradient, is scaled by the difference gradient norm twice, instead of once as in JPCB 2008, 112, 405-413, Eq (5)

https://github.com/qsimulate-open/bagel/blob/4c0ab21158dbe1ef4373cce5735cc1392146386c/src/opt/get_grad.cc#L322-L328

If I've interpreted the above code correctly, it will lead to problems when the magnitude of the difference gradient is exceptionally large (but perhaps not when exceptionally small due to the cutoff parameter).

shiozaki commented 3 years ago

Hello, thanks for pointing this out. This piece of code was originally written by @jwpk1201. My recollection was that MDCI optimization never became stable, and it is possible that this behavior was due to a bug. I will take a look and see if it is an error or not. In the meantime, if you have some numerical results with and without scaling, I'd appreciate your input.

jwpk1201 commented 3 years ago

Hi Greg, thank you for pointing this out. I think this is a bug. Though I don't think it will lead to problems in the final results, it would affect convergence behavior. Simply replacing (2.0 en / x1norm) with (2.0 en) will remove this bug. I will work on it...

shiozaki commented 3 years ago

Jae Woo - I will edit on github now. Thanks for confirming it, hope you are well!