ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ModuleESolver::ESolver_BSE< T, TR > Class Template Reference

#include <esolver_lr_lcao_bse.h>

Inheritance diagram for ModuleESolver::ESolver_BSE< T, TR >:
Collaboration diagram for ModuleESolver::ESolver_BSE< T, TR >:

Public Member Functions

 ESolver_BSE (const Input_para &inp, const std::string &in_dir, const std::string &out_dir, const LRRuntime &runtime)
 ~ESolver_BSE () override
virtual void before_all_runners (BaseCell &basecell, const Input_para &inp) override
 input: input, call, basis(LCAO), psi(ground state), elecstate
virtual void runner (BaseCell &basecell, int istep) override
 run energy solver
virtual void after_all_runners (BaseCell &basecell) override
 perform post processing calculations
void lri_init ()
void ipa_solver ()
 solve IPA without construct and diagonalize matrix
virtual void read_ks_wfc () override
 read in the ground state wave function, gw band energy and occupation
virtual void init_pot (const Charge &chg_gs) override
 init Hartree potential for BSE,
void allocate_eigen_infos ()
 X for tda and also Y for full BSE excitation.
Public Member Functions inherited from ModuleESolver::ESolver_LR< T, double >
 ESolver_LR (const Input_para &inp, const std::string &in_dir, const std::string &out_dir, const LRRuntime &runtime)
 ~ESolver_LR ()
virtual double cal_energy () override
virtual void cal_force (BaseCell &basecell, ModuleBase::matrix &force) override
 Force on the atoms in the relaxed excited state, F = -d(E_gs + Omega)/dR (Ry/Bohr).
virtual void cal_stress (BaseCell &basecell, ModuleBase::matrix &stress) override
 Not implemented: there is no excited-state stress. cell-relax is rejected at input.
Public Member Functions inherited from ModuleESolver::ESolver_FP
 ESolver_FP ()
virtual ~ESolver_FP ()
Public Member Functions inherited from ModuleESolver::ESolver
 ESolver ()
virtual ~ESolver ()
virtual void others (BaseCell &, const int)

Public Attributes

const std::string rpa_dir
LR_IO::RI_kRlist kRlist
psi::Psi< T > * psi_ks_global
 global version of psi_ks
ModuleBase::matrix eig_gw
 GW energy.
double cbm_energy
double vbm_energy
double direct_gap
std::vector< double > tda_ene
std::vector< double > full_ene
std::vector< ct::Tensor > full_X
 [nspin_types][{nstates, nk* (locc* lvirt}]
std::vector< ct::Tensor > full_Y
std::unique_ptr< BSE::MolecularLRI< T > > mo_lri
Public Attributes inherited from ModuleESolver::ESolver
bool conv_esolver = true
std::string classname

Additional Inherited Members

Protected Member Functions inherited from ModuleESolver::ESolver_LR< T, double >
Grid_Driver & gd () const
const TwoCenterBundle & tcb () const
Parallel_Grid & pgrid () const
Structure_Factor & sfac () const
pseudopot_cell_vl & vloc () const
void bind_ground_state_aliases_ ()
 bind the aliases above; ks_ must already be set (or null for the lr path)
void initialize_from_unitcell_ (UnitCell &ucell, const Input_para &inp)
void initialize_from_ks_ (UnitCell &ucell, const Input_para &inp)
 one-time setup from the ground-state solver; ends by calling refresh_from_ks_
void refresh_from_ks_ (UnitCell &ucell)
 re-read everything that depends on the atomic positions, once per ionic step
void setup_relax_target_ ()
void follow_target_state_ (std::ofstream &ofs)
 Compare roots in a common electron-hole basis using exact cross-geometry AO overlap.
int target_ekb_offset_ () const
 index of the relaxed state inside pelec->ekb
void set_gint ()
void fill_z_window_ (const int *desc_src)
ct::Tensor pad_X_to_z_ (const int ispin, const int istate_begin, const int nst) const
void setup_eigenvectors_X ()
 allocate and set the inital value of X
void set_X_initial_guess ()
void read_ks_chg (Charge &chg)
 read in the ground state charge density
void set_dimension ()
 check the legality of the input parameters
void reset_dim_spin2 ()
 reset nocc, nvirt, npairs after read ground-state wavefunction when nspin=2
void set_parallel_orbitals_band (Parallel_Orbitals &p, const int nbands_in)
 setup Parallel_Orbitals info. beyond Parallel_Blkcyclic
void init_pot_groundstate (const Charge &chg_gs)
 ========================== for gradient calculation =========================
ct::Tensor solve_zvector_eqation (const int ispin, const int nst, const ct::Tensor &Xz, const std::vector< std::vector< ct::Tensor > > &window_density)
 Solve the Z-vector equation for nst independent blocks of Xz.
std::vector< ModuleBase::matrix > cal_force_openshell (const int istate_only=-1)
std::vector< ModuleBase::matrix > cal_force_Xz (const int ispin, const ct::Tensor &Xz, const std::vector< double > &omega, const int label_begin)
 Gradients for excitation vectors supplied by the caller, already widened into the Z window – the two functions above are thin wrappers that widen the stored eigenvectors and look up their omega.
std::vector< ModuleBase::matrix > cal_force_openshell_Xz (const ct::Tensor &Xz, const std::vector< double > &omega, const int label_begin)
 open-shell counterpart of cal_force_Xz
void resolve_target_multiplet_ ()
 Fill target_group_ from the excitation energies of the current geometry.
double target_omega_ () const
ModuleBase::matrix cal_lr_force_relax_ (std::ofstream &ofs)
ModuleBase::matrix cal_jt_force_ (const std::vector< ModuleBase::matrix > &diag, std::ofstream &ofs)
 The force of the steepest-descending branch of the target multiplet, i.e. lr_degen_mode = jt.
LR::GradientInputs< T > gradient_inputs_ () const
ct::Tensor pad_group_to_z_ (const int ispin, const std::vector< int > &group) const
void cal_force_and_grad_matrix_ (const int ispin, std::ofstream &ofs)
 Per-state gradients of every state, plus the gradient matrix of each degenerate multiplet when lr_degen_thr asks for it. The single-point entry point.
std::vector< std::vector< ModuleBase::matrix > > cal_grad_matrix_degenerate (const int ispin, const std::vector< int > &group, const std::vector< ModuleBase::matrix > &diag, std::ofstream &ofs)
 The gradient matrix of one degenerate multiplet, $G^{(A\alpha)}_{kl}=\langle X_k|\partial A/\partial R_{A\alpha}|X_l\rangle$.
void test_force ()
module_dm::DensityMatrix< T, double > cal_dm_gs ()
 ground-state density matrix
Protected Member Functions inherited from ModuleESolver::ESolver_FP
virtual void before_scf (UnitCell &ucell, const int istep)
virtual void after_scf (UnitCell &ucell, const int istep, const bool conv_esolver)
virtual void iter_finish (UnitCell &ucell, const int istep, int &iter, bool &conv_esolver)
const vdw::VdwResult * get_vdw_result () const
Protected Attributes inherited from ModuleESolver::ESolver_LR< T, double >
const std::string in_dir
const std::string out_dir
const UnitCell * ucell_
std::vector< double > orb_cutoff_
std::ofstream & ofs_running_
 cached aliases, read once here instead of at every log/print call site below
std::ofstream & ofs_warning_
const int my_rank_
std::unique_ptr< ModuleESolver::ESolver_KS_LCAO< T, double > > ks_
 the ground-state solver, kept alive across ionic steps (esolver_type = "ks-lr"). Null on the lr path, where the ground state comes from files instead.
Grid_Driver gd_own_
 only used when ks_ is null
TwoCenterBundle two_center_bundle_own_
 only used when ks_ is null
Grid_Driver * gd_ptr_
const TwoCenterBundle * tcb_ptr_
Parallel_Grid * pgrid_ptr_
Structure_Factor * sf_ptr_
pseudopot_cell_vl * locpp_ptr_
std::vector< std::shared_ptr< LR::PotHxcLR > > pot
std::unique_ptr< psi::Psi< T > > psi_ks
 ground state wave function
psi::Psi< T > * psi_ks_all_
 all KS orbitals. On the ks-lr path this aliases the ground-state solver's psi (nk x nbands x nbasis – far too big to copy every ionic step, and only read here); on the lr path it points at psi_ks_all_own_, filled from file.
std::unique_ptr< psi::Psi< T > > psi_ks_all_own_
ModuleBase::matrix eig_ks
 ground state bands, read from the file, or moved from ESolver_FP::pelec.ekb
ModuleBase::matrix eig_ks_all
 all eigenvalues of ground state, read from the file, or moved from ESolver_FP::pelec.ekb
ModuleBase::matrix wg_ks
ModuleBase::matrix wg_ks_all
 occupation numbers of ground state in the [nocc+nvirt] window
std::unique_ptr< elecstate::Potential > pot_gs
 occupation number of all bands of ground state
std::unique_ptr< elecstate::Potential > pot_gs_hartree
double etxc_gs
 ground-state Hartree potential, only used for test_force
double vtxc_gs
std::shared_ptr< LR::PotHxcLR > pot_hxc_gs
std::vector< ct::Tensor > X
 used in lr-grad, in the ground-state Hxc gradient term coming from dF/dC
int nloc_per_state
std::vector< int > nocc
 number of occupied orbitals for each spin used in the calculation
int nocc_in
 nocc read from input (adjusted by nelec): max(spin-up, spindown)
int nocc_max
 full occupied count in the largest spin channel
std::vector< int > nvirt
 number of virtual orbitals for each spin used in the calculation
int nvirt_in
 nvirt read from input (adjusted by nelec): min(spin-up, spindown)
int nbands
int nbasis
std::vector< int > npairs
 n_occ*nvirt, the basis size of electron-hole pair representation
int nstates
 how many 2-particle states to be solved
int nspin
int nk
int nupdown
bool openshell
std::string xc_kernel
bool ks_initialized_
 whether initialize_from_ks_ has already run
bool exx_owned_
 exx_lri was built here (so its Cs/Vs are ours to refresh)
bool excited_relax_
 driving calculation = relax from an excited state
int target_is_
 spin block of the relaxed state in X and pelec->ekb
double etot_gs_
 ground-state total energy of the current step (Ry)
ModuleBase::matrix force_gs_
ModuleBase::matrix lr_force_
 The LR part of the excited-state force, -d(Omega)/dR (Ry/Bohr).
int target_state_
std::vector< T > target_X_prev_
LR::RootBasis< T > target_basis_prev_
std::vector< std::string > spin_types
std::unique_ptr< ModuleGint::GintInfo > gint_info_
Parallel_Blkcyclic paraC_
 variables for parallel distribution of KS orbitals
std::vector< Parallel_Blkcyclic > paraX_
 variables for parallel distribution of excited states
std::unique_ptr< psi::Psi< T > > psi_ks_z_
ModuleBase::matrix eig_ks_z_
Parallel_Blkcyclic paraC_z_
std::vector< Parallel_Blkcyclic > paraX_z_
std::vector< int > nvirt_z_
int nbands_z_
int nloc_per_state_z_
Parallel_Orbitals paraMat_
 variables for parallel distribution of matrix in AO representation
Parallel_Orbitals paraMat_all_
LCAO_Orbitals orb_
 numerical atomic orbital data for single-point evaluation
std::vector< std::complex< double > > velocity_mo
 store the velocity matrix elements in MO basis
std::vector< MultipletLVC > multiplet_lvc_
std::vector< int > target_group_
Protected Attributes inherited from ModuleESolver::ESolver_FP
std::unique_ptr< const vdw::VdwResult > vdw_result_
 vdW correction evaluated once for the current ionic configuration.
elecstate::ElecState * pelec = nullptr
 These pointers will be deleted in the free_pointers() function every ion step.
K_Vectors kv
 K points in Brillouin zone.
Charge chr
 Electorn charge density.
ModulePW::PW_Basis * pw_rho = nullptr
ModulePW::PW_Basis * pw_rhod = nullptr
ModulePW::PW_Basis_Big * pw_big = nullptr
 dense grid for USPP
Parallel_Grid Pgrid
 parallel for rho grid
Structure_Factor sf
 Structure factors that used with plane-wave basis set.
pseudopot_cell_vl locpp
 local pseudopotentials
module_charge::Charge_Extra CE
 charge extrapolation method
surchem solvent
 solvent model
bool pw_rho_flag = false
 flag for pw_rho, 0: not initialized, 1: initialized
ModuleBase::TimePoint iter_time
 the start time of scf iteration
Protected Attributes inherited from ModuleESolver::ESolver
const Input_para * inp_ = nullptr
 Bound in before_all_runners; members use inp_->xxx instead of PARAM.inp.xxx.

Constructor & Destructor Documentation

◆ ESolver_BSE()

template<typename T, typename TR = double>
ModuleESolver::ESolver_BSE< T, TR >::ESolver_BSE ( const Input_para & inp,
const std::string & in_dir,
const std::string & out_dir,
const LRRuntime & runtime )
inline
Here is the call graph for this function:

◆ ~ESolver_BSE()

template<typename T, typename TR = double>
ModuleESolver::ESolver_BSE< T, TR >::~ESolver_BSE ( )
inlineoverride

Member Function Documentation

◆ after_all_runners()

template<typename T, typename TR>
void ModuleESolver::ESolver_BSE< T, TR >::after_all_runners ( BaseCell & cell)
overridevirtual

perform post processing calculations

Reimplemented from ModuleESolver::ESolver_LR< T, double >.

Here is the call graph for this function:

◆ allocate_eigen_infos()

template<typename T, typename TR>
void ModuleESolver::ESolver_BSE< T, TR >::allocate_eigen_infos ( )

X for tda and also Y for full BSE excitation.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ before_all_runners()

template<typename T, typename TR>
void ModuleESolver::ESolver_BSE< T, TR >::before_all_runners ( BaseCell & basecell,
const Input_para & inp )
overridevirtual

input: input, call, basis(LCAO), psi(ground state), elecstate

read orbitals and build the interpolation table

Reimplemented from ModuleESolver::ESolver_LR< T, double >.

Here is the call graph for this function:

◆ init_pot()

template<typename T, typename TR>
void ModuleESolver::ESolver_BSE< T, TR >::init_pot ( const Charge & chg_gs)
overridevirtual

init Hartree potential for BSE,

Attention
here we don't multiply 2 for singlet or 0 for triplet, we will do it in HamiltBSE

Reimplemented from ModuleESolver::ESolver_LR< T, double >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ipa_solver()

template<typename T, typename TR>
void ModuleESolver::ESolver_BSE< T, TR >::ipa_solver ( )

solve IPA without construct and diagonalize matrix

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lri_init()

template<typename T, typename TR>
void ModuleESolver::ESolver_BSE< T, TR >::lri_init ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_ks_wfc()

template<typename T, typename TR>
void ModuleESolver::ESolver_BSE< T, TR >::read_ks_wfc ( )
overridevirtual

read in the ground state wave function, gw band energy and occupation

Reimplemented from ModuleESolver::ESolver_LR< T, double >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ runner()

template<typename T, typename TR>
void ModuleESolver::ESolver_BSE< T, TR >::runner ( BaseCell & cell,
int istep )
overridevirtual

run energy solver

Reimplemented from ModuleESolver::ESolver_LR< T, double >.

Here is the call graph for this function:

Member Data Documentation

◆ cbm_energy

template<typename T, typename TR = double>
double ModuleESolver::ESolver_BSE< T, TR >::cbm_energy

◆ direct_gap

template<typename T, typename TR = double>
double ModuleESolver::ESolver_BSE< T, TR >::direct_gap

◆ eig_gw

template<typename T, typename TR = double>
ModuleBase::matrix ModuleESolver::ESolver_BSE< T, TR >::eig_gw

GW energy.

◆ full_ene

template<typename T, typename TR = double>
std::vector<double> ModuleESolver::ESolver_BSE< T, TR >::full_ene

◆ full_X

template<typename T, typename TR = double>
std::vector<ct::Tensor> ModuleESolver::ESolver_BSE< T, TR >::full_X

[nspin_types][{nstates, nk* (locc* lvirt}]

◆ full_Y

template<typename T, typename TR = double>
std::vector<ct::Tensor> ModuleESolver::ESolver_BSE< T, TR >::full_Y

◆ kRlist

template<typename T, typename TR = double>
LR_IO::RI_kRlist ModuleESolver::ESolver_BSE< T, TR >::kRlist

◆ mo_lri

template<typename T, typename TR = double>
std::unique_ptr<BSE::MolecularLRI<T> > ModuleESolver::ESolver_BSE< T, TR >::mo_lri

◆ psi_ks_global

template<typename T, typename TR = double>
psi::Psi<T>* ModuleESolver::ESolver_BSE< T, TR >::psi_ks_global

global version of psi_ks

◆ rpa_dir

template<typename T, typename TR = double>
const std::string ModuleESolver::ESolver_BSE< T, TR >::rpa_dir

◆ tda_ene

template<typename T, typename TR = double>
std::vector<double> ModuleESolver::ESolver_BSE< T, TR >::tda_ene

◆ vbm_energy

template<typename T, typename TR = double>
double ModuleESolver::ESolver_BSE< T, TR >::vbm_energy

The documentation for this class was generated from the following files: