ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
deepks_vdelta.h
Go to the documentation of this file.
1#ifndef DEEPKS_VDELTA_H
2#define DEEPKS_VDELTA_H
3
4#ifdef __MLALGO
8
9// break the circular dependency of HamiltLCAO
10namespace hamilt
11{
12template <typename TK, typename TR>
13class HamiltLCAO;
14}
15namespace DeePKS_domain
16{
17//------------------------
18// deepks_vdelta.cpp
19//------------------------
20
21// This file contains 2 subroutine for calculating e_delta_bands
22// 1. cal_e_delta_band : calculates e_delta_bands
23// 2. collect_h_mat, which collect H(k) data from different processes
24
26template <typename TK>
27void cal_e_delta_band(const std::vector<std::vector<TK>>& dm,
28 const std::vector<std::vector<TK>>& V_delta,
29 const int nks,
30 const int nspin,
31 const Parallel_Orbitals* pv,
32 double& e_delta_band);
33
34// Collect data in h_in to matrix h_out. Note that left lower trianger in h_out is filled
35template <typename TK, typename TH>
36void collect_h_mat(const Parallel_Orbitals& pv,
37 const std::vector<std::vector<TK>>& h_in,
38 std::vector<TH>& h_out,
39 const int nlocal,
40 const int nks);
41
42// Get H(k) or S(k) matrix from p_hamilt and store it in h_tot
43template <typename TK, typename TH, typename TR>
44void get_h_tot(const Parallel_Orbitals& pv,
46 std::vector<TH>& h_tot,
47 const int nlocal,
48 const int nks,
49 const char matrix_type); // 'H' for H(k), 'S' for S(k)
50} // namespace DeePKS_domain
51#endif
52#endif
Definition parallel_orbitals.h:9
Definition hamilt_lcao.h:33
Definition deepks_basic.h:14
void get_h_tot(const Parallel_Orbitals &pv, hamilt::HamiltLCAO< TK, TR > *p_ham, std::vector< TH > &h_tot, const int nlocal, const int nks, const char matrix_type)
Definition deepks_vdelta.cpp:133
void cal_e_delta_band(const std::vector< std::vector< TK > > &dm, const std::vector< std::vector< TK > > &V_delta, const int nks, const int nspin, const Parallel_Orbitals *pv, double &e_delta_band)
calculate tr(\rho V_delta)
Definition deepks_vdelta.cpp:22
void collect_h_mat(const Parallel_Orbitals &pv, const std::vector< std::vector< TK > > &h_in, std::vector< TH > &h_out, const int nlocal, const int nks)
Definition deepks_vdelta.cpp:70
Definition hamilt.h:12