deepmodeling / abacus-develop

An electronic structure package based on either plane wave basis or numerical atomic orbitals.
http://abacus.ustc.edu.cn
GNU Lesser General Public License v3.0
151 stars 122 forks source link

The number of SCF convergence steps during MD increases when using new version of deepks code #4525

Closed xuan112358 closed 1 day ago

xuan112358 commented 1 week ago

Details

I found that after the commit #3256 @dyzheng , when running MD with deepks model, the first SCF step required the same number of iterative steps compared to that before the commit. However, in the subsequent MD steps, although the iterative results are the same, the number of SCF iterative steps is significantly increased. Below is the example of MD step 1. The left is calculated using the code just before the commit. The right is calculated using the code after the commit. The right side obviously has more iteration steps. image

This is the files of the example. github_deepks.zip

Task list for Issue attackers (only for developers)

dyzheng commented 1 week ago

Thanks for your report , I will fix it.

dyzheng commented 1 week ago

You can try the new parameters in INPUT: mixing_restart 1e-2 and mixing_dmr 1, I tested your case with code in #4537 , the SCF-steps of 5 MD steps are: 15, 8, 8, 9, 8

xuan112358 commented 6 days ago

I tested the code and you're right. I'm wondering what have changed after #4357. I found that the steps would be less even without these two mixing parameters. And mixing_restart and mixing_dmr are amazing! Do they affect accuracy? What kind of systems do they work in?

WHUweiqingzhou commented 4 days ago

@xuan112358 For the calculations which use density matrix to construct the operator, like DFTU and DeePKS, mixing_restart & mixing_dnr make SCF mix density matrix as same as charge density, make them unify with each other, thus help convergence. I hope it helps.