Skip to content

Fix: Prevent missing EXX in RT-TDDFT evolution when using estep_per_md > 1 evolution strategy#7360

Merged
mohanchen merged 6 commits into
deepmodeling:developfrom
AsTonyshment:td_exx
May 18, 2026
Merged

Fix: Prevent missing EXX in RT-TDDFT evolution when using estep_per_md > 1 evolution strategy#7360
mohanchen merged 6 commits into
deepmodeling:developfrom
AsTonyshment:td_exx

Conversation

@AsTonyshment

Copy link
Copy Markdown
Collaborator

Linked Issue

Fix #7068.
Follow-up to PR #7344 (Fix missing EXX contribution in RT-TDDFT evolution steps).

Description

The previous fix in PR #7344 successfully addressed the unphysical energy jump for the first evolution step by restricting the two-level SCF skip logic using this->istep == 0. However, it was incomplete for scenarios involving multiple electron evolution steps (estep_per_md > 1) within a single ionic step in RT-TDDFT.

What's Changed

  • Added State Flag: Introduced bool initial_gga_done = false; to the OperatorEXX class (op_exx_lcao.h).
  • State Update: In contributeHk (op_exx_lcao.hpp), if the operator ever observes *this->two_level_step > 0, it permanently sets this->initial_gga_done = true.
  • Updated Skip Condition: Modified the early return condition to only skip EXX if the initial GGA loop has never been completed (!this->initial_gga_done).

Testing

Verified that unphysical energy jumps are eliminated in RT-TDDFT regardless of the md_nstep and estep_per_md configurations:
截屏2026-05-18 下午2 44 50

@AsTonyshment AsTonyshment requested review from Copilot and mohanchen and removed request for Copilot May 18, 2026 06:50
@AsTonyshment AsTonyshment requested review from Copilot and removed request for Copilot May 18, 2026 06:52
Copilot AI review requested due to automatic review settings May 18, 2026 07:04
@AsTonyshment AsTonyshment requested review from Copilot and removed request for Copilot May 18, 2026 07:59
@mohanchen mohanchen added Refactor Refactor ABACUS codes EXX and lr-TDDFT Related to EXX or lr-TDDFT labels May 18, 2026
@mohanchen mohanchen merged commit 23e677e into deepmodeling:develop May 18, 2026
19 checks passed
@AsTonyshment AsTonyshment deleted the td_exx branch May 19, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EXX and lr-TDDFT Related to EXX or lr-TDDFT Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RT-TDDFT calculations with hybrid functional PBE0 were very different when setting md_nsteps and estep_per_md

2 participants