ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hamilt_lcaopw.h
Go to the documentation of this file.
1#ifndef HAMILTLIP_H
2#define HAMILTLIP_H
3
6#ifdef __EXX
8#endif
9
10namespace hamilt
11{
12
13template <typename T>
14class HamiltLIP : public HamiltPW<T, base_device::DEVICE_CPU>
15{
16 public:
19 ModulePW::PW_Basis_K *wfc_basis,
20 K_Vectors *p_kv,
22 const UnitCell *ucell)
23 : HamiltPW<T, base_device::DEVICE_CPU>(pot_in, wfc_basis, p_kv, nlpp, nullptr, ucell, nullptr) {};
24#ifdef __EXX
27 ModulePW::PW_Basis_K *wfc_basis,
28 K_Vectors *p_kv,
30 const UnitCell *ucell,
31 Exx_Lip<T> &exx_lip_in)
32 : HamiltPW<T, base_device::DEVICE_CPU>(pot_in, wfc_basis, p_kv, nlpp, nullptr, ucell, nullptr),
33 exx_lip(exx_lip_in) {};
34 Exx_Lip<T> &exx_lip;
35#endif
36};
37
41template <typename T>
42class HamiltLIPHSOperator : public HamiltHSOperator<T, base_device::DEVICE_CPU>
43{
44 public:
46 HamiltLIP<T> *hm,
47 const ModulePW::PW_Basis_K *wfc_basis,
48 const bool cal_exx,
49 const double hybrid_alpha)
50 : HamiltHSOperator<T, base_device::DEVICE_CPU>(hm, wfc_basis), hm_lip_(hm), cal_exx_(cal_exx),
51 hybrid_alpha_(hybrid_alpha) {};
52
53#ifdef __EXX
54 void add_to_subspace_h(T *hcc, const int naos) const override
55 {
56 if (!cal_exx_)
57 {
58 return;
59 }
60 const int ik = this->ik_;
61 for (int n = 0; n < naos; ++n)
62 {
63 for (int m = 0; m < naos; ++m)
64 {
65 hcc[n * naos + m] += (T)hybrid_alpha_ * hm_lip_->exx_lip.get_exx_matrix()[ik][m][n];
66 }
67 }
68 }
69
70 void export_subspace_vec(const T *vcc, const int naos, const int nbands) const override
71 {
72 if (cal_exx_)
73 {
74 hm_lip_->exx_lip.set_hvec(this->ik_, vcc, naos, nbands);
75 }
76 }
77#endif
78
79 private:
81 const bool cal_exx_;
82 const double hybrid_alpha_;
83};
84
85} // namespace hamilt
86
87#endif
Definition exx_lip.h:28
Class for k-points management.
Definition klist.h:20
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:56
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition potential_new.h:58
HamiltHSOperator(Hamilt< T, base_device::DEVICE_CPU > *hm, const ModulePW::PW_Basis_K *wfc_basis)
Definition hamilt_hs_adapter.h:25
int ik_
Definition hamilt_hs_adapter.h:62
const bool cal_exx_
Definition hamilt_lcaopw.h:81
HamiltLIP< T > * hm_lip_
Definition hamilt_lcaopw.h:80
const double hybrid_alpha_
Definition hamilt_lcaopw.h:82
HamiltLIPHSOperator(HamiltLIP< T > *hm, const ModulePW::PW_Basis_K *wfc_basis, const bool cal_exx, const double hybrid_alpha)
Definition hamilt_lcaopw.h:45
Definition hamilt_lcaopw.h:15
HamiltLIP(elecstate::Potential *pot_in, ModulePW::PW_Basis_K *wfc_basis, K_Vectors *p_kv, pseudopot_cell_vnl *nlpp, const UnitCell *ucell)
Definition hamilt_lcaopw.h:17
Definition hamilt_pw.h:21
const UnitCell *const ucell
Definition hamilt_pw.h:62
HamiltPW(elecstate::Potential *pot_in, ModulePW::PW_Basis_K *wfc_basis, K_Vectors *p_kv, pseudopot_cell_vnl *nlpp, Plus_U_Base *p_dftu, const UnitCell *ucell, const General_Exx_Info *exx_info)
Definition hamilt_pw.cpp:22
virtual void add_to_subspace_h(T *hcc, const int n) const
Definition hs_operator.h:40
virtual void export_subspace_vec(const T *vcc, const int n, const int nband) const
Definition hs_operator.h:47
Definition vnl_pw.h:23
#define T
Definition exp.cpp:237
Definition device.cpp:21
Definition wf_op.cpp:6