ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hamilt_pw.h
Go to the documentation of this file.
1#ifndef HAMILTPW_H
2#define HAMILTPW_H
3
5#include "source_cell/klist.h"
12#include "source_lcao/module_dftu/dftu.h" // mohan add 2025-11-06
13
14namespace hamilt
15{
16
17template <typename T, typename Device = base_device::DEVICE_CPU>
18class HamiltPW : public Hamilt<T, Device>
19{
20 private:
21 // Note GetTypeReal<T>::type will
22 // return T if T is real type(float, double),
23 // otherwise return the real type of T(complex<float>, std::complex<double>)
24 using Real = typename GetTypeReal<T>::type;
25
26 public:
27
29 ModulePW::PW_Basis_K* wfc_basis,
30 K_Vectors* p_kv,
32 Plus_U *p_dftu, // mohan add 2025-11-06
33 const UnitCell* ucell);
34
35 template<typename T_in, typename Device_in = Device>
37
38 ~HamiltPW();
39
40 // for target K point, update consequence of hPsi() and matrix()
41 void updateHk(const int ik) override;
42
43 void sPsi(const T* psi_in, // psi
44 T* spsi, // spsi
45 const int nrow, // dimension of spsi: nbands * nrow
46 const int npw, // number of plane waves
47 const int nbands // number of bands
48 ) const override;
49
50 void set_exx_helper(Exx_Helper<T, Device>& exx_helper_in);
51
52protected:
53 // used in sPhi, which are calculated in hPsi or sPhi
54 const pseudopot_cell_vnl* ppcell = nullptr;
55 const UnitCell* const ucell = nullptr;
56 mutable T* vkb = nullptr;
57 Real* qq_nt = nullptr;
58 T* qq_so = nullptr;
59
60 Device* ctx = {};
67};
68
69} // namespace hamilt
70
71#endif
Definition klist.h:12
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:56
Definition dftu.h:19
Definition unitcell.h:15
Definition potential_new.h:48
Definition hamilt_pw.h:19
const UnitCell *const ucell
Definition hamilt_pw.h:55
T * vkb
Definition hamilt_pw.h:56
void updateHk(const int ik) override
for target K point, update consequence of hPsi() and matrix()
Definition hamilt_pw.cpp:157
const pseudopot_cell_vnl * ppcell
Definition hamilt_pw.h:54
typename GetTypeReal< T >::type Real
Definition hamilt_pw.h:24
Real * qq_nt
Definition hamilt_pw.h:57
T * qq_so
Definition hamilt_pw.h:58
Device * ctx
Definition hamilt_pw.h:60
~HamiltPW()
Definition hamilt_pw.cpp:148
void set_exx_helper(Exx_Helper< T, Device > &exx_helper_in)
Definition hamilt_pw.cpp:394
void sPsi(const T *psi_in, T *spsi, const int nrow, const int npw, const int nbands) const override
Definition hamilt_pw.cpp:245
Definition hamilt.h:17
Definition vnl_pw.h:21
#define T
Definition exp.cpp:237
Definition hamilt.h:13
Definition exx_helper.h:14
T type
Definition macros.h:8
Definition math_kernel_op.h:216
Definition math_kernel_op.h:191
Definition memory_op.h:115
Definition memory_op.h:17
Definition memory_op.h:31