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#include "source_lcao/module_dftu/dftu.h" // mohan add 2025-11-05
23
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
44 HamiltLCAO(const UnitCell& ucell,
45 const Grid_Driver& grid_d,
46 const Parallel_Orbitals* paraV,
48 const K_Vectors& kv_in,
49 const TwoCenterBundle& two_center_bundle,
50 const LCAO_Orbitals& orb,
52 Plus_U* p_dftu, // mohan add 2025-11-05
53 Setup_DeePKS<TK> &deepks,
54 const int istep,
55 Exx_NAO<TK> &exx_nao);
56
60 HamiltLCAO(const UnitCell& ucell,
61 const Grid_Driver& grid_d,
62 const Parallel_Orbitals* paraV,
63 const K_Vectors& kv_in,
64 const TwoCenterIntegrator& intor_overlap_orb,
65 const std::vector<double>& orb_cutoff);
66
68 {
69 if (this->ops != nullptr)
70 {
71 delete this->ops;
72 }
73 delete this->hR;
74 delete this->sR;
75 delete this->hsk;
76 }
77
80
82 TK* getHk() const
83 {
84 return this->hsk->get_hk();
85 }
86
88 TK* getSk() const
89 {
90 return this->hsk->get_sk();
91 }
92
93 int get_size_hsk() const
94 {
95 return this->hsk->get_size();
96 }
97
100 {
101 return this->hR;
102 }
103 const HContainer<TR>* getHR() const
104 {
105 return this->hR;
106 }
107
110 {
111 return this->sR;
112 }
113 const HContainer<TR>* getSR() const
114 {
115 return this->sR;
116 }
117
118#ifdef __MLALGO
121 {
122 return this->V_delta_R;
123 }
124#endif
125
127 void refresh() override;
128
129 // for target K point, update consequence of hPsi() and matrix()
130 virtual void updateHk(const int ik) override;
131
140 void updateSk(const int ik, const int hk_type = 0);
141
142 // core function: return H(k) and S(k) matrixs for direct solving eigenvalues.
143 // not used in PW base
144 void matrix(MatrixBlock<TK>& hk_in, MatrixBlock<TK>& sk_in) override;
145
146 private:
147
148 const K_Vectors* kv = nullptr;
149
151 HContainer<TR>* hR = nullptr;
152
154 HContainer<TR>* sR = nullptr;
155
156#ifdef __MLALGO
158#endif
159
162
163 // special case for NSPIN=2 , data of HR should be separated into two parts
164 // save them in this->hRS2;
165 std::vector<TR> hRS2;
166
168
173
174 const int istep = 0;
175};
176
177} // namespace hamilt
178
179#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 dftu.h:20
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:33
void refresh() override
refresh the status of HR
Definition hamilt_lcao.cpp:496
std::vector< TR > hRS2
Definition hamilt_lcao.h:165
TK * getHk() const
get H(k) pointer
Definition hamilt_lcao.h:82
virtual void updateHk(const int ik) override
for target K point, update consequence of hPsi() and matrix()
Definition hamilt_lcao.cpp:470
int current_spin
Definition hamilt_lcao.h:172
const int istep
Definition hamilt_lcao.h:174
void updateSk(const int ik, const int hk_type=0)
special for LCAO, update SK only
Definition hamilt_lcao.cpp:521
int refresh_times
Definition hamilt_lcao.h:167
const K_Vectors * kv
Definition hamilt_lcao.h:148
std::pair< int, std::array< int, 3 > > TAC
Definition hamilt_lcao.h:37
int get_size_hsk() const
Definition hamilt_lcao.h:93
Operator< TK > *& getOperator()
get pointer of Operator<TK> ops
Definition hamilt_lcao.cpp:515
const HContainer< TR > * getSR() const
Definition hamilt_lcao.h:113
HS_Matrix_K< TK > * hsk
Hamiltonian and overlap matrices for a specific k point.
Definition hamilt_lcao.h:161
TK * getSk() const
get S(k) pointer
Definition hamilt_lcao.h:88
HContainer< TR > * hR
Real space Hamiltonian H(R), where R is the Bravis lattice vector.
Definition hamilt_lcao.h:151
HContainer< TR > * V_delta_R
Definition hamilt_lcao.h:157
HContainer< TR > *& getHR()
get HR pointer of *this->hR, which is a HContainerand contains H(R)
Definition hamilt_lcao.h:99
~HamiltLCAO()
Definition hamilt_lcao.h:67
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:120
HContainer< TR > * sR
Real space overlap matrix S(R), where R is the Bravis lattice vector.
Definition hamilt_lcao.h:154
HContainer< TR > *& getSR()
get SR pointer of *this->sR, which is a HContainerand contains S(R)
Definition hamilt_lcao.h:109
const HContainer< TR > * getHR() const
Definition hamilt_lcao.h:103
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