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"
12
13#include <vector>
14
15#include "source_lcao/setup_deepks.h" // mohan add 20251008
16
17#ifdef __EXX
19#endif
20
21#include "source_lcao/setup_exx.h" // for exx, mohan add 20251022
22
23namespace hamilt
24{
25
26// template first for type of k space H matrix elements
27// template second for type of temporary matrix,
28// gamma_only fix-gamma-matrix + S-gamma,
29// multi-k fix-Real + S-Real
30template <typename TK, typename TR>
31class HamiltLCAO : public Hamilt<TK>
32{
33 public:
34
35
36 using TAC = std::pair<int, std::array<int, 3>>;
37
38
43 HamiltLCAO(const UnitCell& ucell,
44 const Grid_Driver& grid_d,
45 const Parallel_Orbitals* paraV,
47 const K_Vectors& kv_in,
48 const TwoCenterBundle& two_center_bundle,
49 const LCAO_Orbitals& orb,
51 Setup_DeePKS<TK> &deepks,
52 const int istep,
53 Exx_NAO<TK> &exx_nao);
54
58 HamiltLCAO(const UnitCell& ucell,
59 const Grid_Driver& grid_d,
60 const Parallel_Orbitals* paraV,
61 const K_Vectors& kv_in,
62 const TwoCenterIntegrator& intor_overlap_orb,
63 const std::vector<double>& orb_cutoff);
64
66 {
67 if (this->ops != nullptr)
68 {
69 delete this->ops;
70 }
71 delete this->hR;
72 delete this->sR;
73 delete this->hsk;
74 }
75
78
80 TK* getHk() const
81 {
82 return this->hsk->get_hk();
83 }
84
86 TK* getSk() const
87 {
88 return this->hsk->get_sk();
89 }
90
91 int get_size_hsk() const
92 {
93 return this->hsk->get_size();
94 }
95
98 {
99 return this->hR;
100 }
101 const HContainer<TR>* getHR() const
102 {
103 return this->hR;
104 }
105
108 {
109 return this->sR;
110 }
111 const HContainer<TR>* getSR() const
112 {
113 return this->sR;
114 }
115
116#ifdef __MLALGO
119 {
120 return this->V_delta_R;
121 }
122#endif
123
125 void refresh() override;
126
127 // for target K point, update consequence of hPsi() and matrix()
128 virtual void updateHk(const int ik) override;
129
138 void updateSk(const int ik, const int hk_type = 0);
139
140 // core function: return H(k) and S(k) matrixs for direct solving eigenvalues.
141 // not used in PW base
142 void matrix(MatrixBlock<TK>& hk_in, MatrixBlock<TK>& sk_in) override;
143
144 private:
145
146 const K_Vectors* kv = nullptr;
147
149 HContainer<TR>* hR = nullptr;
150
152 HContainer<TR>* sR = nullptr;
153
154#ifdef __MLALGO
156#endif
157
160
161 // special case for NSPIN=2 , data of HR should be separated into two parts
162 // save them in this->hRS2;
163 std::vector<TR> hRS2;
164
166
171
172 const int istep = 0;
173};
174
175} // namespace hamilt
176
177#endif
Definition setup_exx.h:19
Definition sltk_grid_driver.h:43
Definition klist.h:13
Definition ORB_read.h:19
Definition parallel_orbitals.h:9
Definition setup_deepks.h:23
Definition two_center_bundle.h:11
A class to compute two-center integrals.
Definition two_center_integrator.h:35
Definition unitcell.h:17
Definition density_matrix.h:36
Definition potential_new.h:49
Definition hcontainer.h:144
Definition hs_matrix_k.hpp:11
Definition hamilt_lcao.h:32
void refresh() override
refresh the status of HR
Definition hamilt_lcao.cpp:493
std::vector< TR > hRS2
Definition hamilt_lcao.h:163
TK * getHk() const
get H(k) pointer
Definition hamilt_lcao.h:80
virtual void updateHk(const int ik) override
for target K point, update consequence of hPsi() and matrix()
Definition hamilt_lcao.cpp:467
int current_spin
Definition hamilt_lcao.h:170
const int istep
Definition hamilt_lcao.h:172
void updateSk(const int ik, const int hk_type=0)
special for LCAO, update SK only
Definition hamilt_lcao.cpp:518
int refresh_times
Definition hamilt_lcao.h:165
const K_Vectors * kv
Definition hamilt_lcao.h:146
std::pair< int, std::array< int, 3 > > TAC
Definition hamilt_lcao.h:36
int get_size_hsk() const
Definition hamilt_lcao.h:91
Operator< TK > *& getOperator()
get pointer of Operator<TK> ops
Definition hamilt_lcao.cpp:512
const HContainer< TR > * getSR() const
Definition hamilt_lcao.h:111
HS_Matrix_K< TK > * hsk
Hamiltonian and overlap matrices for a specific k point.
Definition hamilt_lcao.h:159
TK * getSk() const
get S(k) pointer
Definition hamilt_lcao.h:86
HContainer< TR > * hR
Real space Hamiltonian H(R), where R is the Bravis lattice vector.
Definition hamilt_lcao.h:149
HContainer< TR > * V_delta_R
Definition hamilt_lcao.h:155
HContainer< TR > *& getHR()
get HR pointer of *this->hR, which is a HContainerand contains H(R)
Definition hamilt_lcao.h:97
~HamiltLCAO()
Definition hamilt_lcao.h:65
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:118
HContainer< TR > * sR
Real space overlap matrix S(R), where R is the Bravis lattice vector.
Definition hamilt_lcao.h:152
HContainer< TR > *& getSR()
get SR pointer of *this->sR, which is a HContainerand contains S(R)
Definition hamilt_lcao.h:107
const HContainer< TR > * getHR() const
Definition hamilt_lcao.h:101
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
Definition matrixblock.h:9