Unify RT-TDDFT EXX with the general LCAO H(R) path - #7864
Conversation
Updated the third row's last value in current_tot.txt.ref.
AsTonyshment
left a comment
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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 🤔
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::kandadd_Hexx_td), while the ordinary LCAO workflow accumulated EXX in H(R). This resulted in separateHamiltonian 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:
OperatorLCAOfolding step constructs H(k) and applies the time-dependent hybrid-gauge phase consistently to all Hamiltonian contributions.add_Hexx_tdinterface are removed.OperatorEXX::contributeHk()is retained only for dedicatedAdd_Hexx_Type::kconsumers such aswrite_vxcand RDMFT.Veffpath is adapted so that Gint contributions are correctly accumulated into complex H(R).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.