gpu4pyscf icon indicating copy to clipboard operation
gpu4pyscf copied to clipboard

Need conv_check in _kernel

Open baopengbp opened this issue 2 months ago • 2 comments

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.

conv_test.txt

baopengbp avatar Sep 20 '25 07:09 baopengbp

And when UHF, "if scf_conv and abs(mf.level_shift) > 0:" in def _kernel cannot run by using tuple mf.level_shift.

baopengbp avatar Sep 25 '25 09:09 baopengbp

Should have been fixed by PR #478

sunqm avatar Sep 30 '25 16:09 sunqm