deepmodeling / abacus-develop

An electronic structure package based on either plane wave basis or numerical atomic orbitals.

Home Page:http://abacus.ustc.edu.cn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

xuan112358 opened this issue · comments

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)

  • Reproduce the performance issue on a similar system or environment.
  • Identify the specific section of the code causing the performance issue.
  • Investigate the issue and determine the root cause.
  • Research best practices and potential solutions for the identified performance issue.
  • Implement the chosen solution to address the performance issue.
  • Test the implemented solution to ensure it improves performance without introducing new issues.
  • Optimize the solution if necessary, considering trade-offs between performance and other factors (e.g., code complexity, readability, maintainability).
  • Review and incorporate any relevant feedback from users or developers.
  • Merge the improved solution into the main codebase and notify the issue reporter.

Thanks for your report , I will fix it.

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

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?

@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.