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
7
8// break the circular dependency of HamiltLCAO
9namespace hamilt
10{
11template <typename TK, typename TR>
12class HamiltLCAO;
13}
14namespace DeePKS_domain
15{
16//------------------------
17// deepks_vdelta.cpp
18//------------------------
19
20// This file contains 2 subroutine for calculating e_delta_bands
21// 1. cal_e_delta_band : calculates e_delta_bands
22// 2. collect_h_mat, which collect H(k) data from different processes
23
25template <typename TK>
26void cal_e_delta_band(const std::vector<std::vector<TK>>& dm,
27 const std::vector<std::vector<TK>>& V_delta,
28 const int nks,
29 const int nspin,
30 const Parallel_Orbitals* pv,
31 double& e_delta_band);
32
33// Collect data in h_in to matrix h_out. Note that left lower trianger in h_out is filled
34template <typename TK, typename TH>
35void collect_h_mat(const Parallel_Orbitals& pv,
36 const std::vector<std::vector<TK>>& h_in,
37 std::vector<TH>& h_out,
38 const int nlocal,
39 const int nks);
40
41// Get H(k) or S(k) matrix from p_hamilt and store it in h_tot
42template <typename TK, typename TH, typename TR>
43void get_h_tot(const Parallel_Orbitals& pv,
45 std::vector<TH>& h_tot,
46 const int nlocal,
47 const int nks,
48 const char matrix_type); // 'H' for H(k), 'S' for S(k)
49} // namespace DeePKS_domain
50#endif
51#endif
Definition parallel_orbitals.h:9
Definition hamilt_lcao.h:33
Definition deepks_basic.h:12
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:13