Skip to content

Unify RT-TDDFT EXX with the general LCAO H(R) path - #7864

Open
ESROAMER wants to merge 10 commits into
deepmodeling:developfrom
ESROAMER:develop
Open

Unify RT-TDDFT EXX with the general LCAO H(R) path#7864
ESROAMER wants to merge 10 commits into
deepmodeling:developfrom
ESROAMER:develop

Conversation

@ESROAMER

Copy link
Copy Markdown
Collaborator

What's changed?

This PR unifies the RT-TDDFT hybrid-functional EXX workflow with the general LCAO H(R) Hamiltonian path.

Previously, RT-TDDFT used a dedicated k-space EXX path (Add_Hexx_Type::k and add_Hexx_td), while the ordinary LCAO workflow accumulated EXX in H(R). This resulted in separate
Hamiltonian assembly and gauge-phase handling for RT-TDDFT.

The new implementation uses the same H(R)-based EXX path for both ordinary LCAO calculations and RT-TDDFT:

  • EXX is accumulated into the complete H(R) together with the local and non-local Hamiltonian terms.
  • The final generic OperatorLCAO folding step constructs H(k) and applies the time-dependent hybrid-gauge phase consistently to all Hamiltonian contributions.
  • The RT-TDDFT-specific k-space EXX reconstruction and add_Hexx_td interface are removed.
  • OperatorEXX::contributeHk() is retained only for dedicated Add_Hexx_Type::k consumers such as write_vxc and RDMFT.
  • Hybrid RT-TDDFT selects a complex H(R) representation even for collinear spin cases.
  • The complex Veff path is adapted so that Gint contributions are correctly accumulated into complex H(R).
  • Duplicate EXX reconstruction in the current/H(R) assembly path is removed.
  • RT-PBE0 reference results are updated to the validated H(R)-based implementation.

The main purpose of this change is to eliminate the divergent RT-TDDFT EXX path and make RT-TDDFT use the same H(R)-based Hamiltonian construction as the general LCAO workflow.

@mohanchen mohanchen added Refactor Refactor ABACUS codes EXX and lr-TDDFT Related to EXX or lr-TDDFT labels Aug 26, 2026

@AsTonyshment AsTonyshment left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work overall! Unifying the RT-TDDFT EXX path with the general LCAO H(R) workflow makes the Hamiltonian construction much cleaner. I had also noticed the fragmented paths summarized in the diagram, but had not found time to address them. I left one inline concern about the interaction between Cell_Nearest and the hybrid-gauge phase; otherwise, I think this is a very good direction.

if (this->add_hexx_type == Add_Hexx_Type::R)
{
// if k points has no shift, use cell_nearest to reduce the memory cost
this->use_cell_nearest = (ModuleBase::Vector3<double>(std::fmod(this->kv.get_koffset(0), 1.0),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be missing something about how the LibRI cell indices are defined, but I think applying Cell_Nearest here may lose information needed by the hybrid-gauge phase. BvK-equivalent translations have the same Bloch phase on the sampled k-point mesh, but their finite-field phases, exp(i A(t)·R), are generally different 🤔

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.

3 participants