ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
deltaspin_pw_mi.cpp File Reference

PW-basis DeltaSpin computation path (free functions). More...

Include dependency graph for deltaspin_pw_mi.cpp:

Namespaces

namespace  spinconstrain
namespace  spinconstrain::pw

Functions

void spinconstrain::pw::cal_mi_pw (ScState &state, void *psi, elecstate::ElecState *pelec)
 Calculate atomic magnetic moments using projector overlap (PW basis).
void spinconstrain::pw::calculate_delta_hcc (ScState &state, const SubspaceCache &cache, elecstate::ElecState *pelec, std::complex< double > *h_tmp, const std::complex< double > *becp_k, const ModuleBase::Vector3< double > *delta_lambda, const int nbands, const int nkb, const int *nh_iat, const int ik, const bool full_update)
 Compute DeltaSpin correction to a subspace Hamiltonian.
void spinconstrain::pw::update_psi_charge_pw_cpu (ScState &state, SubspaceCache &cache, void *psi, void *p_hamilt, elecstate::ElecState *pelec, ModulePW::PW_Basis_K *pw_wfc, const ModuleBase::Vector3< double > *delta_lambda, bool pw_solve, bool full_update)
 CPU implementation of PW wavefunction and charge density update.

Detailed Description

PW-basis DeltaSpin computation path (free functions).

Implementation moved from source/source_pw/module_pwdft/deltaspin_pw_impl.cpp. The former SpinConstrain<std::complex<double>> member functions (cal_mi_pw / calculate_delta_hcc / update_psi_charge_pw_cpu / update_psi_charge_pw_gpu) are now spinconstrain::pw free functions; their dependencies (state, cache, psi, hamiltonian, electronic state, PW basis) are passed explicitly.

The PW path is always instantiated on complex wavefunctions, so these functions are not templated on TK. This file must NOT be wrapped in #ifdef __LCAO so that PW DeltaSpin also compiles when ENABLE_LCAO=off (matching the previous behaviour in module_pwdft, which was compiled unconditionally).