Skip to content

Force calculation for hybrid gauge rt-tddft#7474

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

Force calculation for hybrid gauge rt-tddft#7474
ESROAMER wants to merge 7 commits into
deepmodeling:developfrom
ESROAMER:develop

Conversation

@ESROAMER

Copy link
Copy Markdown
Collaborator

What's changed?

  1. Support force calculation for hybrid gauge(highly experimental; if used, ensure td_dt is small, at least 0.01 fs).
  2. Fix the issue where the electric field force does not reset to zero after tend.
  3. Output the net force vector.

Linked Issue

#6671

Exx_NAO<T> &exx_nao,
ModuleSymmetry::Symmetry* symm)
ModuleSymmetry::Symmetry* symm,
hamilt::Hamilt<T>* p_hamilt)

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.

the p_hamilt seems useless in this function?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This p_hamilt is used in force_rt_overlap.cpp to obtain Hk.

Comment thread source/source_lcao/FORCE_STRESS.cpp Outdated
two_center_bundle.overlap_orb_beta.get());
tmp_nonlocal.cal_force_stress(isforce, isstress, dmR, fvnl_dbeta, svnl_dbeta);

if(PARAM.inp.td_stype == 2)

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.

avoid using PARAM directly, try to pass input as a parameter

@mohanchen mohanchen added the Features Needed The features are indeed needed, and developers should have sophisticated knowledge label Jun 17, 2026
@mohanchen mohanchen requested a review from AsTonyshment June 17, 2026 00:46
@mohanchen mohanchen added the Refactor Refactor ABACUS codes label Jun 17, 2026
Comment on lines +101 to +111
void TD_pot_hybrid<OperatorLCAO<std::complex<double>, std::complex<double>>>::cal_force_IJR(const int& iat1,
const int& iat2,
const Parallel_Orbitals* paraV,
const ModuleBase::Vector3<double>& dtau,
const ModuleBase::Vector3<double>& dR,
std::complex<double>* dmR_pointer,
double* force1,
double* force2)
{
return;
}

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.

Currently, the template specialization for OperatorLCAO<std::complex<double>, std::complex<double>> simply contains a return; statement. I wanted to double-check: is this early return the intended behavior here?
If it is correct/intentional (e.g., this term is physically zero, or does not require this specific force correction), it would be great to add a brief comment explaining why it's skipped.
If it is a placeholder for a feature that is yet to be implemented, I would strongly recommend adding an explicit abort (e.g., ModuleBase::WARNING_QUIT). This will prevent the code from silently failing if a user attempts a calculation before the feature is complete.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That's a very good point. I will add a WARNING_QUIT.

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

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

Labels

Features Needed The features are indeed needed, and developers should have sophisticated knowledge Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants