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
6#include "source_cell/klist.h"
12
14struct General_Exx_Info;
15
16namespace hamilt
17{
18
19template <typename T, typename Device = base_device::DEVICE_CPU>
20class HamiltPW : public Hamilt<T, Device>
21{
22 private:
23 // Note GetTypeReal<T>::type will
24 // return T if T is real type(float, double),
25 // otherwise return the real type of T(complex<float>, std::complex<double>)
26 using Real = typename GetTypeReal<T>::type;
28
29 public:
32 ModulePW::PW_Basis_K *wfc_basis,
33 K_Vectors *p_kv,
35 Plus_U_Base *p_dftu,
36 const UnitCell *ucell,
37 const General_Exx_Info *exx_info);
38
39 ~HamiltPW();
40
41 // for target K point, update consequence of hPsi() and matrix()
42 void updateHk(const int ik) override;
43
47 void bind_td_state(const Real *veff, const ModuleBase::Vector3<double> &A_ha);
48
49 void sPsi(
50 const T *psi_in, // psi
51 T *spsi, // spsi
52 const int nrow, // dimension of spsi: nbands * nrow
53 const int npw, // number of plane waves
54 const int nbands // number of bands
55 ) const override;
56
57 void set_exx_helper(Exx_Helper<T, Device> &exx_helper_in);
58
59 protected:
60 // used in sPhi, which are calculated in hPsi or sPhi
61 const pseudopot_cell_vnl *ppcell = nullptr;
62 const UnitCell *const ucell = nullptr;
63 mutable T *vkb = nullptr;
64 Real *qq_nt = nullptr;
65 T *qq_so = nullptr;
66
67 Device *ctx = {};
74};
75
76} // namespace hamilt
77
78#endif
Class for k-points management.
Definition klist.h:20
3 elements vector
Definition vector3.h:21
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:56
Definition dftu_base.h:21
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition potential_new.h:58
const UnitCell *const ucell
Definition hamilt_pw.h:62
void bind_td_state(const Real *veff, const ModuleBase::Vector3< double > &A_ha)
Bind local-potential buffers and Hartree vector potential for the same operation.
Definition hamilt_pw.cpp:210
T * vkb
Definition hamilt_pw.h:63
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
ModuleBase::gemv_op< T, Device > gemv_op
Definition hamilt_pw.h:68
base_device::memory::delete_memory_op< T, Device > delmem_complex_op
Definition hamilt_pw.h:72
void updateHk(const int ik) override
for target K point, update consequence of hPsi() and matrix()
Definition hamilt_pw.cpp:236
base_device::memory::synchronize_memory_op< T, Device, Device > syncmem_op
Definition hamilt_pw.h:73
const pseudopot_cell_vnl * ppcell
Definition hamilt_pw.h:61
base_device::memory::set_memory_op< T, Device > setmem_complex_op
Definition hamilt_pw.h:70
base_device::memory::resize_memory_op< T, Device > resmem_complex_op
Definition hamilt_pw.h:71
typename GetTypeReal< T >::type Real
Definition hamilt_pw.h:26
Real * qq_nt
Definition hamilt_pw.h:64
T * qq_so
Definition hamilt_pw.h:65
ModuleBase::gemm_op< T, Device > gemm_op
Definition hamilt_pw.h:69
Device * ctx
Definition hamilt_pw.h:67
~HamiltPW()
Definition hamilt_pw.cpp:201
base_device::memory::synchronize_memory_op< T, Device, base_device::DEVICE_CPU > syncmem_complex_h2d_op
Definition hamilt_pw.h:27
void set_exx_helper(Exx_Helper< T, Device > &exx_helper_in)
Definition hamilt_pw.cpp:348
void sPsi(const T *psi_in, T *spsi, const int nrow, const int npw, const int nbands) const override
Definition hamilt_pw.cpp:248
Definition hamilt.h:17
Definition vnl_pw.h:23
#define T
Definition exp.cpp:237
Definition wf_op.cpp:6
Definition exx_helper.h:14
Definition general_exx_info.h:11
T type
Definition macros.h:8
Definition math_kernel_op.h:298
Definition math_kernel_op.h:254
Definition memory_op.h:115
Definition memory_op.h:17
Definition memory_op.h:31