ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
sto_elecond.h
Go to the documentation of this file.
1#ifndef STOELECOND_H
2#define STOELECOND_H
3
8
9template <typename FPTYPE, typename Device>
10class Sto_EleCond : protected EleCond<FPTYPE, Device>
11{
12 public:
13#ifdef __ENABLE_FLOAT_FFTW
14 using lowTYPE = float; // Here we use float to accelerate the calculation, which is enough for the accuracy
15#else
16 using lowTYPE = double;
17#endif
18 using lcomplex = std::complex<lowTYPE>;
24 public:
25 Sto_EleCond(UnitCell* p_ucell_in,
26 K_Vectors* p_kv_in,
27 elecstate::ElecState* p_elec_in,
28 ModulePW::PW_Basis_K* p_wfcpw_in,
29 psi::Psi<std::complex<FPTYPE>, Device>* p_psi_in,
30 pseudopot_cell_vnl* p_ppcell_in,
31 hamilt::Hamilt<std::complex<FPTYPE>, Device>* p_hamilt_in,
33 Stochastic_WF<std::complex<FPTYPE>, Device>* p_stowf_in);
35 delete hamilt_sto_;
36 };
49 void decide_nche(const FPTYPE dt, const FPTYPE cond_thr, const int& fd_nche, FPTYPE try_emin, FPTYPE try_emax);
62 void sKG(const int& smear_type,
63 const double& fwhmin,
64 const double& wcut,
65 const double& dw_in,
66 const double& dt_in,
67 const bool& nonlocal,
68 const int& npart_sto);
69
70 protected:
71 int nbands_ks = 0;
72 int nbands_sto = 0;
73 int cond_nche = 0;
74 int fd_nche = 0;
75 int cond_dtbatch = 0;
79
84 protected:
89 void cal_jmatrix(hamilt::HamiltSdftPW<std::complex<lowTYPE>, Device>* hamilt,
90 const psi::Psi<std::complex<lowTYPE>, Device>& kspsi_all,
91 const psi::Psi<std::complex<lowTYPE>, Device>& vkspsi,
92 const double* en,
93 const double* en_all,
94 std::complex<FPTYPE>* leftfact,
95 std::complex<FPTYPE>* rightfact,
96 psi::Psi<std::complex<lowTYPE>, Device>& leftchi,
97 psi::Psi<std::complex<lowTYPE>, Device>& rightchi,
98 psi::Psi<std::complex<lowTYPE>, Device>& left_hchi,
99 psi::Psi<std::complex<lowTYPE>, Device>& right_hchi,
100 psi::Psi<std::complex<lowTYPE>, Device>& batch_vchi,
101 psi::Psi<std::complex<lowTYPE>, Device>& batch_vhchi,
102#ifdef __MPI
103 psi::Psi<std::complex<lowTYPE>, Device>& chi_all,
104 psi::Psi<std::complex<lowTYPE>, Device>& hchi_all,
105 void* gatherinfo_ks,
106 void* gatherinfo_sto,
107#endif
108 const int& bsize_psi,
109 std::complex<lowTYPE>* j1,
110 std::complex<lowTYPE>* j2,
111 std::complex<lowTYPE>* tmpj,
113 const int& ik,
114 const std::complex<lowTYPE>& factor,
115 const int bandinfo[6]);
116};
117#endif // ELECOND_H
Definition elecond.h:14
Definition klist.h:13
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:57
Definition sto_che.h:9
Definition sto_elecond.h:11
Stochastic_WF< std::complex< FPTYPE >, Device > * p_stowf
pointer to the stochastic wavefunctions
Definition sto_elecond.h:77
Sto_Func< FPTYPE > stofunc
functions
Definition sto_elecond.h:78
hamilt::Hamilt< std::complex< FPTYPE >, Device > * p_hamilt
pointer to the Hamiltonian
Definition sto_elecond.h:76
void decide_nche(const FPTYPE dt, const FPTYPE cond_thr, const int &fd_nche, FPTYPE try_emin, FPTYPE try_emax)
Set the N order of Chebyshev expansion for conductivities It will change class member : fd_nche,...
Definition sto_elecond.cpp:46
~Sto_EleCond()
Definition sto_elecond.h:34
hamilt::HamiltSdftPW< std::complex< lowTYPE >, Device > * hamilt_sto_
pointer to the Hamiltonian for sDFT
Definition sto_elecond.h:81
void sKG(const int &smear_type, const double &fwhmin, const double &wcut, const double &dw_in, const double &dt_in, const bool &nonlocal, const int &npart_sto)
calculate Stochastic Kubo-Greenwood
Definition sto_elecond.cpp:477
hamilt::HamiltSdftPW< std::complex< FPTYPE >, Device > * p_hamilt_sto
pointer to the Hamiltonian for sDFT
Definition sto_elecond.h:80
void cal_jmatrix(hamilt::HamiltSdftPW< std::complex< lowTYPE >, Device > *hamilt, const psi::Psi< std::complex< lowTYPE >, Device > &kspsi_all, const psi::Psi< std::complex< lowTYPE >, Device > &vkspsi, const double *en, const double *en_all, std::complex< FPTYPE > *leftfact, std::complex< FPTYPE > *rightfact, psi::Psi< std::complex< lowTYPE >, Device > &leftchi, psi::Psi< std::complex< lowTYPE >, Device > &rightchi, psi::Psi< std::complex< lowTYPE >, Device > &left_hchi, psi::Psi< std::complex< lowTYPE >, Device > &right_hchi, psi::Psi< std::complex< lowTYPE >, Device > &batch_vchi, psi::Psi< std::complex< lowTYPE >, Device > &batch_vhchi, psi::Psi< std::complex< lowTYPE >, Device > &chi_all, psi::Psi< std::complex< lowTYPE >, Device > &hchi_all, void *gatherinfo_ks, void *gatherinfo_sto, const int &bsize_psi, std::complex< lowTYPE > *j1, std::complex< lowTYPE > *j2, std::complex< lowTYPE > *tmpj, hamilt::Velocity< lowTYPE, Device > &velop, const int &ik, const std::complex< lowTYPE > &factor, const int bandinfo[6])
calculate Jmatrix <leftv|J|rightv>
Definition sto_elecond.cpp:147
lowTYPE low_emax_
Emax of the Hamiltonian for sDFT.
Definition sto_elecond.h:83
int nbands_sto
number of stochastic bands
Definition sto_elecond.h:72
double lowTYPE
Definition sto_elecond.h:16
lowTYPE low_emin_
Emin of the Hamiltonian for sDFT.
Definition sto_elecond.h:82
int fd_nche
number of Chebyshev orders for Fermi-Dirac function
Definition sto_elecond.h:74
int cond_nche
number of Chebyshev orders for conductivities
Definition sto_elecond.h:73
std::complex< lowTYPE > lcomplex
Definition sto_elecond.h:18
int nbands_ks
number of KS bands
Definition sto_elecond.h:71
int cond_dtbatch
number of time steps in a batch
Definition sto_elecond.h:75
Definition sto_func.h:6
Definition sto_wf.h:13
Definition unitcell.h:16
Definition elecstate.h:15
Definition hamilt_sdft_pw.h:11
Definition hamilt.h:16
Definition velocity_pw.h:13
Definition VNL_in_pw.h:21
Definition psi.h:37
#define __MPI
Definition hamilt.h:12
base device SOURCES math_dngvd_test cpp endif() if(ENABLE_GOOGLEBENCH) AddTest(TARGET PERF_MODULE_HSOLVER_KERNELS LIBS parameter $
Definition CMakeLists.txt:10
Definition memory_op.h:61
Definition memory_op.h:77
Definition memory_op.h:17