ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
deepks_vdrpre.h
Go to the documentation of this file.
1#ifndef DEEPKS_VDRPRE_H
2#define DEEPKS_VDRPRE_H
3
4#ifdef __MLALGO
5
6#include "deepks_param.h"
10#include "source_base/timer.h"
15
16#include <torch/script.h>
17#include <torch/torch.h>
18
19namespace DeePKS_domain
20{
21//------------------------
22// deepks_vdrpre.cpp
23//------------------------
24
25// This file contains 1 subroutine for calculating v_delta,
26// cal_vdr_precalc : v_delta_r_precalc is used for training with v_delta_r label,
27// which equals gevdm * v_delta_pdm,
28// v_delta_pdm = overlap * overlap
29
30// for deepks_v_delta = -1
31// calculates v_delta_r_precalc
32
33void prepare_phialpha_iRmat(const int nlocal,
34 const int R_size,
35 const DeePKS_Param& deepks_param,
36 const std::vector<hamilt::HContainer<double>*> phialpha,
37 const UnitCell& ucell,
38 const LCAO_Orbitals& orb,
39 const Grid_Driver& GridD,
40 torch::Tensor& overlap,
41 torch::Tensor& iRmat);
42
43void cal_vdr_precalc(const int nlocal,
44 const int nat,
45 const int nks,
46 const int R_size,
47 const DeePKS_Param& deepks_param,
48 const std::vector<ModuleBase::Vector3<double>>& kvec_d,
49 const std::vector<hamilt::HContainer<double>*> phialpha,
50 const std::vector<torch::Tensor> gevdm,
51 const UnitCell& ucell,
52 const LCAO_Orbitals& orb,
53 const Parallel_Orbitals& pv,
54 const Grid_Driver& GridD,
55 torch::Tensor& vdr_precalc);
56
57int mapping_R(int R);
58torch::Tensor mapping_R(const torch::Tensor& R_tensor);
59
60template <typename T>
61int get_R_size(const hamilt::HContainer<T>& hcontainer);
62} // namespace DeePKS_domain
63#endif
64#endif
Definition sltk_grid_driver.h:43
Definition ORB_read.h:19
3 elements vector
Definition vector3.h:22
Definition parallel_orbitals.h:9
Definition unitcell.h:17
Definition hcontainer.h:144
Definition deepks_basic.h:15
void prepare_phialpha_iRmat(const int nlocal, const int R_size, const DeePKS_Param &deepks_param, const std::vector< hamilt::HContainer< double > * > phialpha, const UnitCell &ucell, const LCAO_Orbitals &orb, const Grid_Driver &GridD, torch::Tensor &overlap, torch::Tensor &iRmat)
Definition deepks_vdrpre.cpp:16
int mapping_R(int R)
Definition deepks_vdrpre.cpp:237
int get_R_size(const hamilt::HContainer< T > &hcontainer)
Definition deepks_vdrpre.cpp:265
void cal_vdr_precalc(const int nlocal, const int nat, const int nks, const int R_size, const DeePKS_Param &deepks_param, const std::vector< ModuleBase::Vector3< double > > &kvec_d, const std::vector< hamilt::HContainer< double > * > phialpha, const std::vector< torch::Tensor > gevdm, const UnitCell &ucell, const LCAO_Orbitals &orb, const Parallel_Orbitals &pv, const Grid_Driver &GridD, torch::Tensor &vdr_precalc)
Definition deepks_vdrpre.cpp:97
Definition deepks_param.h:11