|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
#include <dfpt_pw_impl.h>
Public Member Functions | |
| Impl () | |
| ~Impl () | |
| void | build_occ_kq (int q_idx) |
| double | solve_displacement (int q_idx, int iat, int idir) |
| void | solve_pos_resp (int q_idx) |
| position legs Y^a_{k,v} = P_c x_a|psi_{k,v}> of the q = 0 mesh | |
| void | solve_efield_resp (int q_idx) |
| E-field SCF response dpsi^E,a of the q = 0 mesh. | |
| void | assemble_v_sc (int q_idx, const ModuleBase::Vector3< double > &q_cart, const std::vector< std::complex< double > > &drho_in_g, std::vector< std::complex< double > > &v_sc_r) const |
Private Member Functions | |
| void | check_metallic_occ (const ModuleBase::matrix &wg) const |
| void | setup_q_list (UnitCell &ucell) |
| void | init_submodules (const DFPT_PW_InitContext &ctx, int nk, int nbands, int npw_max, int nrxx, int nspin, int nat) |
| int | occupied_band_count (int ik) const |
| void | run_q0_pre (int q_idx) |
| double | run_displacement_irrep_pass (int q_idx, int irrep) |
| void | run_q0_post (int q_idx) |
| void | symmetrize_q0_tensors () |
| void | run_assemble (int q_idx) |
| double | sternheimer_per_band (int ik, int ib, const std::vector< std::vector< std::complex< double > > > &dv_sc, int nbands, int lin_max, double lin_thr) |
| void | stash_converged_disp_response (int q_idx, int iat, int idir, const std::vector< std::complex< double > > &v_sc_r_last, int nk, int nbands) |
| void | vel_diag_part (int ik, int a, int nbands, std::vector< std::vector< std::complex< double > > > &vel) const |
| void | vel_nl_per_atom (int ik, int a, int it, int ia, int nbands, const std::vector< ModuleBase::Vector3< double > > &gk, std::vector< std::vector< std::complex< double > > > &vel) |
| void | pos_per_band_solve (int ik, int a, int nbands, int lin_max, double lin_thr, std::vector< std::vector< std::vector< std::complex< double > > > > &yvec) |
| void | efield_per_band_solve (int ik, int a, int nbands, int lin_max, double lin_thr, const std::vector< std::vector< std::vector< std::complex< double > > > > &yr, const std::vector< std::vector< std::complex< double > > > &dv_sc) |
| void | stash_dpsi_efield (int q_idx, int a, int nk, int nbands) |
| bool | wired () const |
Private Attributes | |
| DFPT_PW_Data | data_ |
| DFPT_Pert | pert_ |
| DFPT_Stern | stern_ |
| DFPT_Rho | rho_ |
| DFPT_Phon | phon_ |
| DFPT_Q0 | q0_ |
| DFPT_Metal | metal_ |
| ModuleCell::QList | qlist_ |
| std::unique_ptr< DFPT_HamiltShift > | hamilt_ |
| psi::Psi< std::complex< double > > | gs_psi_ |
| UnitCell * | ucell_ = nullptr |
| ModulePW::PW_Basis * | pw_rho_ = nullptr |
| ModulePW::PW_Basis_K * | pw_wfc_ = nullptr |
| Structure_Factor * | sf_ = nullptr |
| std::vector< double > | veff_r_ |
| std::vector< double > | vxc_r_ |
| ModuleBase::matrix | wg_ |
| ModuleBase::matrix | eig_ |
| const XC_First_Order * | xc_ = nullptr |
| double | nelec_ = 0.0 |
| double | ecutwfc_ = 0.0 |
| const Plus_U_Base * | dftu_ = nullptr |
| std::vector< std::vector< std::vector< std::complex< double > > > > | occ_kq_ |
| std::vector< std::vector< double > > | eig_kq_ |
| remembers the (q_idx, ik) the shifted operator was last cached at | |
| int | last_q_ = -1 |
| int | last_ik_ = -1 |
| int | nqx_ = 1 |
| int | nqy_ = 1 |
| int | nqz_ = 1 |
| std::string | qfile_ |
| double | conv_thr_ = 1e-8 |
| int | max_iter_ = 100 |
| int | myrank_ = 0 |
| double | mix_beta_ = 0.4 |
| std::string | asr_type_ = "no" |
| acoustic sum rule mode on the Gamma matrix | |
| std::string | mix_type_ = "v_sc_broyden" |
| response SCF mixing scheme | |
| double | kerker_a2_ = 1.0 |
| Kerker screening a^2, 1/lat0^2 (rho_kerker only). | |
| int | broyden_ndim_ = 8 |
| std::unique_ptr< Base_Mixing::Broyden_Mixing > | vsc_broyden_ |
| std::unique_ptr< Base_Mixing::Mixing_Data > | vsc_broyden_mdata_ |
Friends | |
| class | DFPT_PW |
Private implementation body of DFPT_PW (opaque in the public header).
Only the constructors / destructor and the outward-facing per-solve hooks are public; all data members and per-solve helpers are private.
| ModuleDFPT::DFPT_PW::Impl::Impl | ( | ) |
| ModuleDFPT::DFPT_PW::Impl::~Impl | ( | ) |
| void ModuleDFPT::DFPT_PW::Impl::assemble_v_sc | ( | int | q_idx, |
| const ModuleBase::Vector3< double > & | q_cart, | ||
| const std::vector< std::complex< double > > & | drho_in_g, | ||
| std::vector< std::complex< double > > & | v_sc_r ) const |
per-iteration assembly of the screened response potential v_sc^q = v_Hartree(drho_in) + xc(drho_in) on the shared grid; shared by solve_displacement and solve_efield_resp so the real-space Hartree+XC add loop is not duplicated
| void ModuleDFPT::DFPT_PW::Impl::build_occ_kq | ( | int | q_idx | ) |
occupied-state projector set at k+q for every k of this q (nscf path: the k+q states come from a block-Davidson diagonalization of the full H(k+q) on the k+q ball, QE run_nscf alignment)
< empirical parameter: Davidson outer iterations per k+q ball
< empirical parameter: residual norm target (Ry); occ_kq_ feeds the P_c projector only, whose leakage at this level stays far below the response convergence threshold
< empirical parameter: kinetic-preconditioner floor (1/lat0^2); small enough that the near-Gamma plane waves (which dominate the valence top) are not suppressed in the expansion directions
|
private |
< empirical parameter: relative band weight treated as metallic
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| double ModuleDFPT::DFPT_PW::Impl::solve_displacement | ( | int | q_idx, |
| int | iat, | ||
| int | idir ) |
one self-consistent Sternheimer cycle for the displacement (iat, idir) at q; returns the achieved density residual (zero when unwired)
| void ModuleDFPT::DFPT_PW::Impl::solve_efield_resp | ( | int | q_idx | ) |
E-field SCF response dpsi^E,a of the q = 0 mesh.
| void ModuleDFPT::DFPT_PW::Impl::solve_pos_resp | ( | int | q_idx | ) |
position legs Y^a_{k,v} = P_c x_a|psi_{k,v}> of the q = 0 mesh
|
private |
|
private |
|
private |
|
private |
Project the q=0 response tensors (epsilon_inf, Born charges) onto the crystal point-group form after compute_born and before the ASR family and the LO-TO term consume them (QE zstar_eu/symtensor + dielec/symmatrix parity). No-op under nosym: the raw tensors stay visible as the audit channel for cross-code comparisons.
|
private |
|
private |
|
private |
|
friend |
|
private |
acoustic sum rule mode on the Gamma matrix
|
private |
Broyden history depth (rho/v_sc Broyden) Broyden on the screening potential for v_sc mode (separate instance from the density Broyden because the array length differs: nrxx vs npw)
|
private |
|
private |
|
private |
occupied states at k+q on the k+q G list, [ik][occ m][igl]; rebuilt per q (they depend on q and k only); produced by the nscf diagonalization (DFPT_NSCF on the full H(k+q)), aligned with QE
|
private |
|
private |
|
private |
remembers the (q_idx, ik) the shifted operator was last cached at
|
private |
|
private |
|
private |
Kerker screening a^2, 1/lat0^2 (rho_kerker only).
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
response SCF mixing scheme
|
private |
MPI rank from the init context (0 for serial); used by the dyn file writer for the rank-0 output gate
|
private |
|
private |
|
private |
|
private |
|
private |
nscf eigenvalues at k+q, [ik][occ m] (Ry), ascending; diagnostic companion of occ_kq_ (the Sternheimer shift keeps using the GS eigenvalue of the coupled k band)
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
ground-state XC potential (valence + core input), copied from the init context: the nlcc diagonal 2n+1 term consumes it; the copy owns the storage because the context points at caller stack state
|
private |
|
private |