ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
nonlocal_workspace.h
Go to the documentation of this file.
1#ifndef PW_NONLOCAL_WORKSPACE_H
2#define PW_NONLOCAL_WORKSPACE_H
3
5#include <cstddef>
6
7namespace hamilt
8{
10template <typename T, typename Device>
12{
13 private:
14 T *becp_ = nullptr;
15 T *ps_ = nullptr;
16 size_t becp_capacity_ = 0;
17 size_t ps_capacity_ = 0;
18
19 void project(
20 const T *vkb,
21 const T *psi,
22 const int npw,
23 const int ldv,
24 const int ldp,
25 const int nkb,
26 const int bands);
27 void contract(
28 const UnitCell &cell,
29 const pseudopot_cell_vnl &pp,
30 const int spin,
31 const int npol,
32 const int bands);
33 void back_project(
34 const T *vkb,
35 T *hpsi,
36 const int npw,
37 const int ldv,
38 const int ldp,
39 const int nkb,
40 const int bands);
41
42 public:
43 NonlocalWorkspace() = default;
47
49 void apply(
50 const UnitCell &cell,
51 const pseudopot_cell_vnl &pp,
52 const ModulePW::PW_Basis_K &basis,
53 const int spin,
54 const int bands,
55 const int nbasis,
56 const int npol,
57 const int npw,
58 const bool is_first_node,
59 const T *vkb,
60 const T *psi,
61 T *hpsi);
62
64 T *get_becp() const { return becp_; }
65
71 const UnitCell &cell,
72 const pseudopot_cell_vnl &pp,
73 const ModulePW::PW_Basis_K &basis,
74 int spin,
75 int bands,
76 int nbasis,
77 int npol,
78 int npw,
79 const T *vkb,
80 const T *psi);
81 const T *projections() const { return becp_; }
82 const T *contracted() const { return ps_; }
83};
84} // namespace hamilt
85#endif
Special pw_basis class. It includes different k-points.
Definition pw_basis_k.h:56
Provide the basic information about unitcell.
Definition unitcell.h:16
T * ps_
Definition nonlocal_workspace.h:15
void contract(const UnitCell &cell, const pseudopot_cell_vnl &pp, const int spin, const int npol, const int bands)
Definition nonlocal_workspace.cpp:72
void project(const T *vkb, const T *psi, const int npw, const int ldv, const int ldp, const int nkb, const int bands)
Definition nonlocal_workspace.cpp:44
size_t ps_capacity_
Definition nonlocal_workspace.h:17
NonlocalWorkspace & operator=(const NonlocalWorkspace &)=delete
T * becp_
Definition nonlocal_workspace.h:14
const T * contracted() const
Definition nonlocal_workspace.h:82
const T * projections() const
Definition nonlocal_workspace.h:81
~NonlocalWorkspace()
Definition nonlocal_workspace.cpp:37
void project_contract(const UnitCell &cell, const pseudopot_cell_vnl &pp, const ModulePW::PW_Basis_K &basis, int spin, int bands, int nbasis, int npol, int npw, const T *vkb, const T *psi)
Project and contract on every pool rank, including empty PW partitions; bands counts spin-component c...
Definition nonlocal_workspace.cpp:154
NonlocalWorkspace(const NonlocalWorkspace &)=delete
T * get_becp() const
Borrow the most recently computed projection coefficients.
Definition nonlocal_workspace.h:64
size_t becp_capacity_
Definition nonlocal_workspace.h:16
void apply(const UnitCell &cell, const pseudopot_cell_vnl &pp, const ModulePW::PW_Basis_K &basis, const int spin, const int bands, const int nbasis, const int npol, const int npw, const bool is_first_node, const T *vkb, const T *psi, T *hpsi)
Apply beta D beta-dagger, preserving pool collectives on empty ranks.
Definition nonlocal_workspace.cpp:124
void back_project(const T *vkb, T *hpsi, const int npw, const int ldv, const int ldp, const int nkb, const int bands)
Definition nonlocal_workspace.cpp:103
Definition vnl_pw.h:23
#define T
Definition exp.cpp:237
Definition wf_op.cpp:6
Definition diag_lcao.h:14