gpu4pyscf
gpu4pyscf copied to clipboard
Need conv_check in _kernel
In kernel of both pyscf and gpu4pyscf, the extra cycle actually is to remove DIIS. And sometimes we need level-shift to get the right result.
When I did some calculation with level-shift, the extra cycle some can but some cannot get the same results before. I can get the density matrix from an energy and gradient changed less than the default tol =1e-9 without extra cycle using a large tol and short cycles such as tol = 1e-16 and max_cycle = 30 in an example. Using this density matrix and the same level-shift value, both the init E and cylcle 1 get the same results before. That is no DIIS.
Then I think we need conv_check to select if extra cylce in gpu4pyscf just like pyscf.
And when UHF, "if scf_conv and abs(mf.level_shift) > 0:" in def _kernel cannot run by using tuple mf.level_shift.
Should have been fixed by PR #478