Skip to content

Fix(md): correct FIRE force convergence checks#7458

Open
wazichaoyingbi wants to merge 1 commit into
deepmodeling:developfrom
wazichaoyingbi:fix-fire-force-convergence
Open

Fix(md): correct FIRE force convergence checks#7458
wazichaoyingbi wants to merge 1 commit into
deepmodeling:developfrom
wazichaoyingbi:fix-fire-force-convergence

Conversation

@wazichaoyingbi

Copy link
Copy Markdown

Reminder

  • Have you linked an issue with this pull request?
  • [√] Have you added adequate unit tests and/or case tests for your pull request?
  • [√] Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

NO linked issue.

Unit Tests and/or Case Tests for my changes

  • I tested this change locally with FIRE relaxation cases.

  • The tests verified that:

  • frozen atoms or frozen directions are not included in the FIRE force convergence criterion;

  • the force threshold specified in the INPUT file can control FIRE convergence as expected.

What's changed?

  • Two issues about fire is fixed:
  • 1.Frozen atoms or directions shouldn't be involved in the convergence check, but in current edition they are involved. I fixed it by skipping those frozen degrees of freedom in force check and convergence checl.
  • 2.In current edition, the force_threshold is overwritten which makes the parameter force_thr in INPUT file is actually invalid. I deleted the line that overwritten it.

Any changes of core modules? (ignore if not applicable)

  • No, this PR only changes the file "source/source_md/fire.cpp"

@mohanchen

Copy link
Copy Markdown
Collaborator

Thanks for your contribution! Could you provide some unit tests or integrate tests in the PR?

@mohanchen mohanchen added Bugs Bugs that only solvable with sufficient knowledge of DFT MD & LAM MD and Larege Atomic Models Refactor Refactor ABACUS codes labels Jun 9, 2026
@wazichaoyingbi

Copy link
Copy Markdown
Author

Thanks for your contribution! Could you provide some unit tests or integrate tests in the PR?

03_LJ_FIRE.zip
This is small system with 7 atoms, 1 movable atom at the centre of the cube and 6 fixed atoms at the centre of each faces. The md_nstep is set to 5, and force_thr is set to 0.02. If those fixed atoms are skipped correctly, it will converge immediately(becuase the force on the movable atom is 0). And if it is not skipped, it will run 5 rounds. My result shows that in current version it will run 5 rounds and in the fixed version it converges immediately.

@QuantumMisaka

Copy link
Copy Markdown
Collaborator

@wazichaoyingbi Thanks for you contribution! Does this PR have any relation with #5060

@wazichaoyingbi

Copy link
Copy Markdown
Author

@wazichaoyingbi Thanks for you contribution! Does this PR have any relation with #5060

Yes, this is to solve that question. But this fixed version still takes about 120 md steps before convergence(just approximation, the test based on fixed version is still running), because fire algorithm of abacus is different from ase. But it should fix the problem that abacus can't converge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugs Bugs that only solvable with sufficient knowledge of DFT MD & LAM MD and Larege Atomic Models Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants