|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
#include <dfpt_pert.h>
Public Member Functions | |
| DFPT_Pert () | |
| ~DFPT_Pert () | |
| void | init (UnitCell &ucell, ModulePW::PW_Basis *pw_rho, ModulePW::PW_Basis_K *pw_wfc, Structure_Factor &sf) |
| ModulePW::PW_Basis_K * | get_pw_wfc () const |
| ModulePW::PW_Basis * | get_pw_rho () const |
| void | build_dv (int q_idx, int atom_idx, int dir, DFPT_PW_Data &data) |
| void | apply_dv (int q_idx, int k_idx, const psi::Psi< std::complex< double > > &psi, DFPT_PW_Data &data) |
| void | d2vloc_r (int atom_idx, int da, int db, std::vector< std::complex< double > > &dv2_r) const |
| void | apply_d2vnl (int atom_idx, int da, int db, const ModuleBase::Vector3< double > &q_eff, const psi::Psi< std::complex< double > > &psi, int k_idx, std::vector< std::vector< std::complex< double > > > &d2v_psi) const |
| void | build_vkb (int it, int ia, const std::vector< ModuleBase::Vector3< double > > &gk, std::vector< std::vector< std::complex< double > > > &vkb) const |
| void | build_vkb_dk (int it, int ia, int dir, const std::vector< ModuleBase::Vector3< double > > &gk, std::vector< std::vector< std::complex< double > > > &vkb, std::vector< std::vector< std::complex< double > > > &dvkb) const |
| double | radial_vq (int it, int ib, double g) const |
| radial part (4pi/sqrt(Omega)) Integral beta(r) j_l(g r) r dr at g (bohr^-1) | |
| void | apply_vr (int q_idx, int k_idx, const std::vector< std::complex< double > > &v_rc, const psi::Psi< std::complex< double > > &psi, const ModuleBase::Vector3< double > &q_cart, std::vector< std::vector< std::complex< double > > > &dv_psi) const |
| void | rho_gvec (int ig, ModuleBase::Vector3< double > &gcar) const |
| void | dVloc_dtau (int atom_idx, int dir, const ModuleBase::Vector3< double > &q, std::vector< std::complex< double > > &dv) |
| void | dVnl_dtau (int atom_idx, int dir, const ModuleBase::Vector3< double > &q, const psi::Psi< std::complex< double > > &psi, int k_idx, std::vector< std::vector< std::complex< double > > > &dv_psi) |
Private Member Functions | |
| double | vloc_at_g (int it, double g2) const |
| void | atom_index (int atom_idx, int &it, int &ia) const |
| linear atom index -> (type, picture) of ucell_. | |
| double | real_ylm (int l, int m, const ModuleBase::Vector3< double > &ghat) const |
| real spherical harmonic Y_{l,m}(g_hat), orthonormal convention, l<=2. | |
| void | grad_real_ylm (int l, int m, const ModuleBase::Vector3< double > &ghat, double grad[3]) const |
| void | real_space_dv (int q_idx, int k_idx, const psi::Psi< std::complex< double > > &psi, DFPT_PW_Data &data, const DFPT_KQ_Basis &kq, std::vector< std::vector< std::complex< double > > > &dv_psi) const |
| void | apply_vr_core (int k_idx, const std::vector< std::complex< double > > &v_rc, const psi::Psi< std::complex< double > > &psi, const DFPT_KQ_Basis &kq, std::vector< std::vector< std::complex< double > > > &dv_psi) const |
| void | build_dv_u (int q_idx, int atom_idx, int dir, DFPT_PW_Data &data) |
| first-order Hubbard potential dV_U (U0 reservation, C1 frozen term). | |
Private Attributes | |
| UnitCell * | ucell_ = nullptr |
| ModulePW::PW_Basis * | pw_rho_ = nullptr |
| ModulePW::PW_Basis_K * | pw_wfc_ = nullptr |
| Structure_Factor * | sf_ = nullptr |
| ModuleDFPT::DFPT_Pert::DFPT_Pert | ( | ) |
| ModuleDFPT::DFPT_Pert::~DFPT_Pert | ( | ) |
| void ModuleDFPT::DFPT_Pert::apply_d2vnl | ( | int | atom_idx, |
| int | da, | ||
| int | db, | ||
| const ModuleBase::Vector3< double > & | q_eff, | ||
| const psi::Psi< std::complex< double > > & | psi, | ||
| int | k_idx, | ||
| std::vector< std::vector< std::complex< double > > > & | d2v_psi ) const |
C5: same-atom second-order NONLOCAL potential acting on psi, chi_n(G'') = (d^2 Vnl / d tau_{da} d tau_{db}) |psi_n> on the q_eff-shifted basis (q_eff = q when q is itself a reciprocal vector, otherwise 2q: the second-order potential carries wavevector 2q; normal-conserving separable case). The terms come from the phase derivatives of the out (q_eff-shifted) and in (k+G') projectors of the SAME displaced atom; they reduce to zero for a uniform translation at q=0 (acoustic consistency).
| void ModuleDFPT::DFPT_Pert::apply_dv | ( | int | q_idx, |
| int | k_idx, | ||
| const psi::Psi< std::complex< double > > & | psi, | ||
| DFPT_PW_Data & | data ) |
| void ModuleDFPT::DFPT_Pert::apply_vr | ( | int | q_idx, |
| int | k_idx, | ||
| const std::vector< std::complex< double > > & | v_rc, | ||
| const psi::Psi< std::complex< double > > & | psi, | ||
| const ModuleBase::Vector3< double > & | q_cart, | ||
| std::vector< std::vector< std::complex< double > > > & | dv_psi ) const |
C7: apply a complex real-space potential on the shared FFT grid to every band of psi (k basis), delivering |v psi> on the k+q basis. The potential is the q-shifted complex periodic amplitude (the same convention as dv_rc); the DFPT self-consistent loop uses it for the screened response potential (Hartree + XC) of the mixed density.
|
private |
shared core of real_space_dv / apply_vr: phase-free cyclic convolution of v_rc with every band of psi, scattered/gathered between the k+q list and the rho grid through the FFT-cell triple.
|
private |
linear atom index -> (type, picture) of ucell_.
| void ModuleDFPT::DFPT_Pert::build_dv | ( | int | q_idx, |
| int | atom_idx, | ||
| int | dir, | ||
| DFPT_PW_Data & | data ) |
|
private |
first-order Hubbard potential dV_U (U0 reservation, C1 frozen term).
| void ModuleDFPT::DFPT_Pert::build_vkb | ( | int | it, |
| int | ia, | ||
| const std::vector< ModuleBase::Vector3< double > > & | gk, | ||
| std::vector< std::vector< std::complex< double > > > & | vkb ) const |
Build the beta-projector array (in the ABACUS vkb convention) for a single atom on an arbitrary k-shifted reciprocal vector list: vkb[mu][ielem] = (-i)^l * Ylm(Ghat) * (4pi/sqrt(Omega) * integral beta(r) j_l(g r) r dr) * exp(i G.tau) with G in 2*pi/lat0 units, g = |G| * tpiba (bohr^-1), tau in bohr. Usable for both the incoming k basis (G = k+G') and the outgoing DFPT k+q basis (G = k+q+G''), so the atomic phase is correct on either side. Public since C6: DFPT_Q0 reuses it for the velocity operator.
| void ModuleDFPT::DFPT_Pert::build_vkb_dk | ( | int | it, |
| int | ia, | ||
| int | dir, | ||
| const std::vector< ModuleBase::Vector3< double > > & | gk, | ||
| std::vector< std::vector< std::complex< double > > > & | vkb, | ||
| std::vector< std::vector< std::complex< double > > > & | dvkb ) const |
C6: analytic derivative of the beta projector with respect to the list shift k_dir (the same shift build_vkb is evaluated at), three terms: the atomic phase (i 2pi tau_dir), the radial chain rule (vq'(g) * tpiba * Ghat_dir, central finite difference of radial_vq) and the real-harmonic direction derivative (grad_real_ylm chain (e_dir - ghat ghat_dir)/|G|). Feeds the dV_nl/dk part of the velocity operator in DFPT_Q0::pos_matrix.
< empirical parameter: |G| floor (2*pi/lat0) for the angular terms
| void ModuleDFPT::DFPT_Pert::d2vloc_r | ( | int | atom_idx, |
| int | da, | ||
| int | db, | ||
| std::vector< std::complex< double > > & | dv2_r ) const |
C5: real-space kernel of the same-atom second-order LOCAL potential d2V_loc(r) = d^2 V_loc / d tau_{da} d tau_{db} (both displacement dressings e^{i q.R} multiply on the SAME atom, so the cell sum collapses to G = 2q mod integers: the kernel is nonzero only when 2q is reciprocal, in which case every integer G survives with its own phase and the kernel equals the plain q=0 one, -w_da w_db Vloc(|w|) exp(i w.tau)). The caller gates on 2q reciprocal and skips otherwise. Returned on the shared real-space grid; its expectation value with |u(r)|^2 enters the electronic dynamical matrix (anharmonic term).
< empirical parameter: |G|^2 zero-shell guard (2*pi/lat0 units)
| void ModuleDFPT::DFPT_Pert::dVloc_dtau | ( | int | atom_idx, |
| int | dir, | ||
| const ModuleBase::Vector3< double > & | q, | ||
| std::vector< std::complex< double > > & | dv ) |
First-order asymmetric-part local potential on the rho grid: dVloc_dtau(Delta) = -i (Delta+q).direction * Vloc(|Delta+q|)
< empirical parameter: |Delta+q|^2 zero-shell guard (2*pi/lat0 units)
| void ModuleDFPT::DFPT_Pert::dVnl_dtau | ( | int | atom_idx, |
| int | dir, | ||
| const ModuleBase::Vector3< double > & | q, | ||
| const psi::Psi< std::complex< double > > & | psi, | ||
| int | k_idx, | ||
| std::vector< std::vector< std::complex< double > > > & | dv_psi ) |
C1: first-order NONLOCAL potential acting on psi (normal-conserving separable case), for one displaced atom in direction dir. Uses the identity (GS exp(-2pi gk.tau) projector convention) dVnl/dtau_a |psi> = -i (k+q+G'')_a * (Vnl |psi>)
|
inline |
|
inline |
C5: read access to the ground-state wfc basis for the dynamical-matrix contractions in DFPT_Phon::accumulate_electron.
|
private |
gradient of real_ylm with respect to the unit vector ghat, l<=2 (dY/dghat returned per cartesian component).
| void ModuleDFPT::DFPT_Pert::init | ( | UnitCell & | ucell, |
| ModulePW::PW_Basis * | pw_rho, | ||
| ModulePW::PW_Basis_K * | pw_wfc, | ||
| Structure_Factor & | sf ) |
| double ModuleDFPT::DFPT_Pert::radial_vq | ( | int | it, |
| int | ib, | ||
| double | g ) const |
radial part (4pi/sqrt(Omega)) Integral beta(r) j_l(g r) r dr at g (bohr^-1)
|
private |
General (nonlocal and local) part of apply_dv for the compartments that live in real space (local potential); the |psi> product requires the shared real-space grid of pw_rho_/pw_wfc_.
|
private |
real spherical harmonic Y_{l,m}(g_hat), orthonormal convention, l<=2.
< empirical parameter: |ghat| floor for the zero-direction limit
| void ModuleDFPT::DFPT_Pert::rho_gvec | ( | int | ig, |
| ModuleBase::Vector3< double > & | gcar ) const |
Grid helper: reconstruct the cartesian reciprocal vector (in 2*pi/lat0 units) of rho-grid index ig from the shared FFT-grid (ix,iy,iz) mapping. A stateless building block exposed publicly so the serial analytic tests can validate the rho-grid G layout directly.
|
private |
C1: first-order LOCAL potential dVloc_dtau (per displaced atom). The local pseudopotential Vloc(g^2) at an arbitrary magnitude: Coulomb atoms use the analytic form, numeric pseudopotentials reuse the radial-mesh Fourier transform of vl_pw.cpp::vloc_of_g at |g| themselves.
< empirical parameter: |G| floor (bohr^-1) for the G=0 radial integral
|
private |
|
private |
|
private |
|
private |