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 Parallel_Orbitals& pv,
40 const Grid_Driver& GridD,
41 torch::Tensor& overlap,
42 torch::Tensor& iRmat);
43
44void cal_vdr_precalc(const int nlocal,
45 const int nat,
46 const int nks,
47 const int R_size,
48 const DeePKS_Param& deepks_param,
49 const std::vector<ModuleBase::Vector3<double>>& kvec_d,
50 const std::vector<hamilt::HContainer<double>*> phialpha,
51 const std::vector<torch::Tensor> gevdm,
52 const UnitCell& ucell,
53 const LCAO_Orbitals& orb,
54 const Parallel_Orbitals& pv,
55 const Grid_Driver& GridD,
56 torch::Tensor& vdr_precalc);
57
58int mapping_R(int R);
59torch::Tensor mapping_R(const torch::Tensor& R_tensor);
60
61template <typename T>
62int get_R_size(const hamilt::HContainer<T>& hcontainer);
63} // namespace DeePKS_domain
64#endif
65#endif
Definition deepks_basic.h:12
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 Parallel_Orbitals &pv, const Grid_Driver &GridD, torch::Tensor &overlap, torch::Tensor &iRmat)
Definition deepks_vdrpre.cpp:16
int mapping_R(int R)
Definition deepks_vdrpre.cpp:245
int get_R_size(const hamilt::HContainer< T > &hcontainer)
Definition deepks_vdrpre.cpp:273
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:105
Grid_Driver class for neighbor search interface.