ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
hsolver::HSolverPW< T, Device > Class Template Reference

#include <hsolver_pw.h>

Inheritance diagram for hsolver::HSolverPW< T, Device >:
Collaboration diagram for hsolver::HSolverPW< T, Device >:

Public Member Functions

 HSolverPW (ModulePW::PW_Basis_K *wfc_basis_in, const std::string calculation_type_in, const std::string basis_type_in, const std::string method_in, const bool use_paw_in, const bool use_uspp_in, const int nspin_in, const int scf_iter_in, const int diag_iter_max_in, const double diag_thr_in, const bool need_subspace_in, const bool use_k_continuity_in=false)
 
void solve (hamilt::Hamilt< T, Device > *pHamilt, psi::Psi< T, Device > &psi, elecstate::ElecState *pes, double *out_eigenvalues, const int rank_in_pool_in, const int nproc_in_pool_in, const bool skip_charge, const double tpiba, const int nat)
 solve function for pw
 

Protected Types

using Real = typename GetTypeReal< T >::type
 
using resmem_complex_op = base_device::memory::resize_memory_op< T, Device >
 
using delmem_complex_op = base_device::memory::delete_memory_op< T, Device >
 
using setmem_complex_op = base_device::memory::set_memory_op< T, Device >
 

Protected Member Functions

void hamiltSolvePsiK (hamilt::Hamilt< T, Device > *hm, psi::Psi< T, Device > &psi, std::vector< Real > &pre_condition, Real *eigenvalue, const int &nk_nums)
 
void update_precondition (std::vector< Real > &h_diag, const int ik, const int npw, const Real vl_of_0)
 
void output_iterInfo ()
 

Protected Attributes

ModulePW::PW_Basis_Kwfc_basis
 
const std::string calculation_type
 
const std::string basis_type
 
const std::string method
 
const bool use_paw
 
const bool use_uspp
 
const int nspin
 
const int scf_iter
 
const int diag_iter_max
 
const double diag_thr
 
const bool need_subspace
 
const bool use_k_continuity
 
Device * ctx = {}
 
int rank_in_pool = 0
 
int nproc_in_pool = 1
 
std::vector< double > ethr_band
 

Private Member Functions

void cal_smooth_ethr (const double &wk, const double *wg, const double &ethr, std::vector< double > &ethrs)
 calculate the threshold for iterative-diagonalization for each band
 
void build_k_neighbors ()
 
void propagate_psi (psi::Psi< T, Device > &psi, const int from_ik, const int to_ik)
 

Private Attributes

std::vector< int > k_order
 
std::unordered_map< int, int > k_parent
 
std::vector< ModuleBase::Vector3< double > > kvecs_c
 

Member Typedef Documentation

◆ delmem_complex_op

template<typename T , typename Device = base_device::DEVICE_CPU>
using hsolver::HSolverPW< T, Device >::delmem_complex_op = base_device::memory::delete_memory_op<T, Device>
protected

◆ Real

template<typename T , typename Device = base_device::DEVICE_CPU>
using hsolver::HSolverPW< T, Device >::Real = typename GetTypeReal<T>::type
protected

◆ resmem_complex_op

template<typename T , typename Device = base_device::DEVICE_CPU>
using hsolver::HSolverPW< T, Device >::resmem_complex_op = base_device::memory::resize_memory_op<T, Device>
protected

◆ setmem_complex_op

template<typename T , typename Device = base_device::DEVICE_CPU>
using hsolver::HSolverPW< T, Device >::setmem_complex_op = base_device::memory::set_memory_op<T, Device>
protected

Constructor & Destructor Documentation

◆ HSolverPW()

template<typename T , typename Device = base_device::DEVICE_CPU>
hsolver::HSolverPW< T, Device >::HSolverPW ( ModulePW::PW_Basis_K wfc_basis_in,
const std::string  calculation_type_in,
const std::string  basis_type_in,
const std::string  method_in,
const bool  use_paw_in,
const bool  use_uspp_in,
const int  nspin_in,
const int  scf_iter_in,
const int  diag_iter_max_in,
const double  diag_thr_in,
const bool  need_subspace_in,
const bool  use_k_continuity_in = false 
)
inline

Member Function Documentation

◆ build_k_neighbors()

template<typename T , typename Device >
void hsolver::HSolverPW< T, Device >::build_k_neighbors ( )
private
Here is the call graph for this function:

◆ cal_smooth_ethr()

template<typename T , typename Device >
void hsolver::HSolverPW< T, Device >::cal_smooth_ethr ( const double &  wk,
const double *  wg,
const double &  ethr,
std::vector< double > &  ethrs 
)
private

calculate the threshold for iterative-diagonalization for each band

◆ hamiltSolvePsiK()

template<typename T , typename Device >
void hsolver::HSolverPW< T, Device >::hamiltSolvePsiK ( hamilt::Hamilt< T, Device > *  hm,
psi::Psi< T, Device > &  psi,
std::vector< Real > &  pre_condition,
Real eigenvalue,
const int &  nk_nums 
)
protected

Allow 5 tries at most. If ntry > ntry_max = 5, exit diag loop.

In non-self consistent calculation, do until totally converged. Else allow 5 eigenvecs to be NOT converged.

convergence threshold

maximum iterations

dimension of matrix

number of eigenpairs sought

leading dimension of psi

wrap hpsi into lambda function, Matrix \times blockvector

wrap spsi into lambda function, Matrix \times blockvector spsi(X, SX, ld, nvec) ld is leading dimension of psi and spsi

Here is the call graph for this function:

◆ output_iterInfo()

template<typename T , typename Device >
void hsolver::HSolverPW< T, Device >::output_iterInfo ( )
protected

◆ propagate_psi()

template<typename T , typename Device >
void hsolver::HSolverPW< T, Device >::propagate_psi ( psi::Psi< T, Device > &  psi,
const int  from_ik,
const int  to_ik 
)
private

◆ solve()

template<typename T , typename Device >
void hsolver::HSolverPW< T, Device >::solve ( hamilt::Hamilt< T, Device > *  pHamilt,
psi::Psi< T, Device > &  psi,
elecstate::ElecState pes,
double *  out_eigenvalues,
const int  rank_in_pool_in,
const int  nproc_in_pool_in,
const bool  skip_charge,
const double  tpiba,
const int  nat 
)

solve function for pw

Parameters
pHamiltinterface to hamilt
psireference to psi
pesinterface to elecstate
method_indav or cg
skip_charge

calculate the contribution of Psi for charge density rho

Here is the caller graph for this function:

◆ update_precondition()

template<typename T , typename Device >
void hsolver::HSolverPW< T, Device >::update_precondition ( std::vector< Real > &  h_diag,
const int  ik,
const int  npw,
const Real  vl_of_0 
)
protected

Member Data Documentation

◆ basis_type

template<typename T , typename Device = base_device::DEVICE_CPU>
const std::string hsolver::HSolverPW< T, Device >::basis_type
protected

◆ calculation_type

template<typename T , typename Device = base_device::DEVICE_CPU>
const std::string hsolver::HSolverPW< T, Device >::calculation_type
protected

◆ ctx

template<typename T , typename Device = base_device::DEVICE_CPU>
Device* hsolver::HSolverPW< T, Device >::ctx = {}
protected

◆ diag_iter_max

template<typename T , typename Device = base_device::DEVICE_CPU>
const int hsolver::HSolverPW< T, Device >::diag_iter_max
protected

◆ diag_thr

template<typename T , typename Device = base_device::DEVICE_CPU>
const double hsolver::HSolverPW< T, Device >::diag_thr
protected

◆ ethr_band

template<typename T , typename Device = base_device::DEVICE_CPU>
std::vector<double> hsolver::HSolverPW< T, Device >::ethr_band
protected

◆ k_order

template<typename T , typename Device = base_device::DEVICE_CPU>
std::vector<int> hsolver::HSolverPW< T, Device >::k_order
private

◆ k_parent

template<typename T , typename Device = base_device::DEVICE_CPU>
std::unordered_map<int, int> hsolver::HSolverPW< T, Device >::k_parent
private

◆ kvecs_c

template<typename T , typename Device = base_device::DEVICE_CPU>
std::vector<ModuleBase::Vector3<double> > hsolver::HSolverPW< T, Device >::kvecs_c
private

◆ method

template<typename T , typename Device = base_device::DEVICE_CPU>
const std::string hsolver::HSolverPW< T, Device >::method
protected

◆ need_subspace

template<typename T , typename Device = base_device::DEVICE_CPU>
const bool hsolver::HSolverPW< T, Device >::need_subspace
protected

◆ nproc_in_pool

template<typename T , typename Device = base_device::DEVICE_CPU>
int hsolver::HSolverPW< T, Device >::nproc_in_pool = 1
protected

◆ nspin

template<typename T , typename Device = base_device::DEVICE_CPU>
const int hsolver::HSolverPW< T, Device >::nspin
protected

◆ rank_in_pool

template<typename T , typename Device = base_device::DEVICE_CPU>
int hsolver::HSolverPW< T, Device >::rank_in_pool = 0
protected

◆ scf_iter

template<typename T , typename Device = base_device::DEVICE_CPU>
const int hsolver::HSolverPW< T, Device >::scf_iter
protected

◆ use_k_continuity

template<typename T , typename Device = base_device::DEVICE_CPU>
const bool hsolver::HSolverPW< T, Device >::use_k_continuity
protected

◆ use_paw

template<typename T , typename Device = base_device::DEVICE_CPU>
const bool hsolver::HSolverPW< T, Device >::use_paw
protected

◆ use_uspp

template<typename T , typename Device = base_device::DEVICE_CPU>
const bool hsolver::HSolverPW< T, Device >::use_uspp
protected

◆ wfc_basis

template<typename T , typename Device = base_device::DEVICE_CPU>
ModulePW::PW_Basis_K* hsolver::HSolverPW< T, Device >::wfc_basis
protected

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