ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
velocity_pw.h
Go to the documentation of this file.
1#ifndef VELOCITY_PW_H
2#define VELOCITY_PW_H
3#include "operator_pw.h"
7namespace hamilt
8{
9
10//velocity operator mv = im/\hbar * [H,r] = p + im/\hbar [V_NL, r]
11template <typename FPTYPE, typename Device = base_device::DEVICE_CPU>
13{
14 public:
16 const ModulePW::PW_Basis_K* wfcpw_in,
17 const int* isk_in,
18 pseudopot_cell_vnl* ppcell_in,
19 const UnitCell* ucell_in,
20 const bool nonlocal_in = true
21 );
22
23 ~Velocity();
24
25 void init(const int ik_in);
26
37 void act(const psi::Psi<std::complex<FPTYPE>, Device>* psi_in,
38 const int n_npwx,
39 const std::complex<FPTYPE>* tmpsi_in,
40 std::complex<FPTYPE>* tmvpsi,
41 const bool add = false) const;
42
43 bool nonlocal = true;
44
45 private:
46 const ModulePW::PW_Basis_K* wfcpw = nullptr;
47
48 const int* isk = nullptr;
49
51
52 const UnitCell* ucell = nullptr;
53
54 int ik=0;
55
56 double tpiba=0.0;
57
58 private:
59 FPTYPE* gx_ = nullptr;
60 FPTYPE* gy_ = nullptr;
61 FPTYPE* gz_ = nullptr;
62 std::complex<FPTYPE>* vkb_ = nullptr;
63 std::complex<FPTYPE>* gradvkb_ = nullptr;
64 FPTYPE* deeq_ = nullptr;
65
66 using Complex = std::complex<FPTYPE>;
74 using castmem_complex_h2d_op = base_device::memory::cast_memory_op<std::complex<FPTYPE>, std::complex<double>, Device, base_device::DEVICE_CPU>;
77};
78}
79#endif
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:57
Definition unitcell.h:16
Definition velocity_pw.h:13
FPTYPE * deeq_
[Device] D matrix for nonlocal pseudopotential
Definition velocity_pw.h:64
FPTYPE * gy_
[Device, npwx] y component of G+K
Definition velocity_pw.h:60
const UnitCell * ucell
Definition velocity_pw.h:52
bool nonlocal
Definition velocity_pw.h:43
void init(const int ik_in)
Definition velocity_pw.cpp:43
void act(const psi::Psi< std::complex< FPTYPE >, Device > *psi_in, const int n_npwx, const std::complex< FPTYPE > *tmpsi_in, std::complex< FPTYPE > *tmvpsi, const bool add=false) const
calculate \hat{v}|\psi>
Definition velocity_pw.cpp:85
~Velocity()
Definition velocity_pw.cpp:33
int ik
Definition velocity_pw.h:54
std::complex< FPTYPE > * gradvkb_
[Device, 3*nkb * npwk_max] gradient of nonlocal pseudopotential gradvkb
Definition velocity_pw.h:63
const int * isk
Definition velocity_pw.h:48
FPTYPE * gx_
[Device, npwx] x component of G+K
Definition velocity_pw.h:59
const ModulePW::PW_Basis_K * wfcpw
Definition velocity_pw.h:46
std::complex< FPTYPE > Complex
Definition velocity_pw.h:66
pseudopot_cell_vnl * ppcell
Definition velocity_pw.h:50
double tpiba
Definition velocity_pw.h:56
std::complex< FPTYPE > * vkb_
[Device, nkb * npwk_max] nonlocal pseudopotential vkb
Definition velocity_pw.h:62
FPTYPE * gz_
[Device, npwx] z component of G+K
Definition velocity_pw.h:61
Definition VNL_in_pw.h:21
Definition psi.h:37
Definition hamilt.h:12
Definition memory_op.h:61
Definition memory_op.h:77
Definition memory_op.h:17
Definition memory_op.h:31