ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hamilt_lcao.h
Go to the documentation of this file.
1#ifndef HAMILT_LCAO_H
2#define HAMILT_LCAO_H
3
5#include "source_cell/klist.h"
14
15#include <vector>
16
17#ifdef __MLALGO
19#endif
20
21#ifdef __EXX
23#endif
24namespace hamilt
25{
26
27// template first for type of k space H matrix elements
28// template second for type of temporary matrix,
29// gamma_only fix-gamma-matrix + S-gamma,
30// multi-k fix-Real + S-Real
31template <typename TK, typename TR>
32class HamiltLCAO : public Hamilt<TK>
33{
34 public:
35
36
37 using TAC = std::pair<int, std::array<int, 3>>;
38
39
45 Gint_k* GK_in,
46 const UnitCell& ucell,
47 const Grid_Driver& grid_d,
48 const Parallel_Orbitals* paraV,
50 const K_Vectors& kv_in,
51 const TwoCenterBundle& two_center_bundle,
52 const LCAO_Orbitals& orb,
54#ifdef __MLALGO
55 ,
56 LCAO_Deepks<TK>* ld_in
57#endif
58#ifdef __EXX
59 ,
60 const int istep,
61 int* exx_two_level_step = nullptr,
62 std::vector<std::map<int, std::map<TAC, RI::Tensor<double>>>>* Hexxd = nullptr,
63 std::vector<std::map<int, std::map<TAC, RI::Tensor<std::complex<double>>>>>* Hexxc = nullptr
64#endif
65 );
66
70 HamiltLCAO(const UnitCell& ucell,
71 const Grid_Driver& grid_d,
72 const Parallel_Orbitals* paraV,
73 const K_Vectors& kv_in,
74 const TwoCenterIntegrator& intor_overlap_orb,
75 const std::vector<double>& orb_cutoff);
76
78 {
79 if (this->ops != nullptr)
80 {
81 delete this->ops;
82 }
83 delete this->hR;
84 delete this->sR;
85 delete this->hsk;
86 }
87
90
92 TK* getHk() const
93 {
94 return this->hsk->get_hk();
95 }
96
98 TK* getSk() const
99 {
100 return this->hsk->get_sk();
101 }
102
103 int get_size_hsk() const
104 {
105 return this->hsk->get_size();
106 }
107
110 {
111 return this->hR;
112 }
113
116 {
117 return this->sR;
118 }
119
120#ifdef __MLALGO
123 {
124 return this->V_delta_R;
125 }
126#endif
127
129 void refresh() override;
130
131 // for target K point, update consequence of hPsi() and matrix()
132 virtual void updateHk(const int ik) override;
133
142 void updateSk(const int ik, const int hk_type = 0);
143
144 // core function: return H(k) and S(k) matrixs for direct solving eigenvalues.
145 // not used in PW base
146 void matrix(MatrixBlock<TK>& hk_in, MatrixBlock<TK>& sk_in) override;
147
148 private:
149
150 const K_Vectors* kv = nullptr;
151
153 HContainer<TR>* hR = nullptr;
154
156 HContainer<TR>* sR = nullptr;
157
158#ifdef __MLALGO
160#endif
161
164
165 // special case for NSPIN=2 , data of HR should be separated into two parts
166 // save them in this->hRS2;
167 std::vector<TR> hRS2;
168
170
175
176 const int istep = 0;
177};
178
179} // namespace hamilt
180
181#endif
Definition gint_gamma.h:23
Definition gint_k.h:13
Definition sltk_grid_driver.h:43
Definition klist.h:13
Definition LCAO_deepks.h:52
Definition ORB_read.h:19
Definition parallel_orbitals.h:9
Definition two_center_bundle.h:11
A class to compute two-center integrals.
Definition two_center_integrator.h:35
Definition unitcell.h:16
Definition density_matrix.h:36
Definition potential_new.h:48
Definition hcontainer.h:144
Definition hs_matrix_k.hpp:11
Definition hamilt_lcao.h:33
void refresh() override
refresh the status of HR
Definition hamilt_lcao.cpp:490
std::vector< TR > hRS2
Definition hamilt_lcao.h:167
TK * getHk() const
get H(k) pointer
Definition hamilt_lcao.h:92
virtual void updateHk(const int ik) override
for target K point, update consequence of hPsi() and matrix()
Definition hamilt_lcao.cpp:464
int current_spin
Definition hamilt_lcao.h:174
const int istep
Definition hamilt_lcao.h:176
void updateSk(const int ik, const int hk_type=0)
special for LCAO, update SK only
Definition hamilt_lcao.cpp:515
int refresh_times
Definition hamilt_lcao.h:169
const K_Vectors * kv
Definition hamilt_lcao.h:150
std::pair< int, std::array< int, 3 > > TAC
Definition hamilt_lcao.h:37
int get_size_hsk() const
Definition hamilt_lcao.h:103
Operator< TK > *& getOperator()
get pointer of Operator<TK> ops
Definition hamilt_lcao.cpp:509
HS_Matrix_K< TK > * hsk
Hamiltonian and overlap matrices for a specific k point.
Definition hamilt_lcao.h:163
TK * getSk() const
get S(k) pointer
Definition hamilt_lcao.h:98
HContainer< TR > * hR
Real space Hamiltonian H(R), where R is the Bravis lattice vector.
Definition hamilt_lcao.h:153
HContainer< TR > * V_delta_R
Definition hamilt_lcao.h:159
HContainer< TR > *& getHR()
get HR pointer of *this->hR, which is a HContainerand contains H(R)
Definition hamilt_lcao.h:109
~HamiltLCAO()
Definition hamilt_lcao.h:77
HContainer< TR > *& get_V_delta_R()
get V_delta_R pointer of *this->V_delta_R, which is a HContainerand contains V_delta(R)
Definition hamilt_lcao.h:122
HContainer< TR > * sR
Real space overlap matrix S(R), where R is the Bravis lattice vector.
Definition hamilt_lcao.h:156
HContainer< TR > *& getSR()
get SR pointer of *this->sR, which is a HContainerand contains S(R)
Definition hamilt_lcao.h:115
Definition hamilt.h:16
virtual std::vector< TK > matrix()
Definition hamilt.h:54
Operator< TK, base_device::DEVICE_CPU > * ops
first node operator, add operations from each operators
Definition hamilt.h:61
Definition operator.h:38
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 matrixblock.h:9