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
9#include "source_base/timer.h"
14
15#include <torch/script.h>
16#include <torch/torch.h>
17
18namespace DeePKS_domain
19{
20//------------------------
21// deepks_vdrpre.cpp
22//------------------------
23
24// This file contains 1 subroutine for calculating v_delta,
25// cal_vdr_precalc : v_delta_r_precalc is used for training with v_delta_r label,
26// which equals gevdm * v_delta_pdm,
27// v_delta_pdm = overlap * overlap
28
29// for deepks_v_delta = -1
30// calculates v_delta_r_precalc
31void prepare_phialpha_r(const int nlocal,
32 const int lmaxd,
33 const int inlmax,
34 const int nat,
35 const int R_size,
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& phialpha_r_out);
42
43void cal_vdr_precalc(const int nlocal,
44 const int lmaxd,
45 const int inlmax,
46 const int nat,
47 const int nks,
48 const int R_size,
49 const std::vector<int>& inl2l,
50 const std::vector<ModuleBase::Vector3<double>>& kvec_d,
51 const std::vector<hamilt::HContainer<double>*> phialpha,
52 const std::vector<torch::Tensor> gevdm,
53 const ModuleBase::IntArray* inl_index,
54 const UnitCell& ucell,
55 const LCAO_Orbitals& orb,
56 const Parallel_Orbitals& pv,
57 const Grid_Driver& GridD,
58 torch::Tensor& vdr_precalc);
59
60int mapping_R(int R);
61
62template <typename T>
63int get_R_size(const hamilt::HContainer<T>& hcontainer);
64} // namespace DeePKS_domain
65#endif
66#endif
Definition sltk_grid_driver.h:43
Definition ORB_read.h:19
Integer array.
Definition intarray.h:20
3 elements vector
Definition vector3.h:22
Definition parallel_orbitals.h:9
Definition unitcell.h:16
Definition hcontainer.h:144
Definition deepks_basic.h:14
int mapping_R(int R)
Definition deepks_vdrpre.cpp:235
void cal_vdr_precalc(const int nlocal, const int lmaxd, const int inlmax, const int nat, const int nks, const int R_size, const std::vector< int > &inl2l, const std::vector< ModuleBase::Vector3< double > > &kvec_d, const std::vector< hamilt::HContainer< double > * > phialpha, const std::vector< torch::Tensor > gevdm, const ModuleBase::IntArray *inl_index, const UnitCell &ucell, const LCAO_Orbitals &orb, const Parallel_Orbitals &pv, const Grid_Driver &GridD, torch::Tensor &vdr_precalc)
Definition deepks_vdrpre.cpp:102
void prepare_phialpha_r(const int nlocal, const int lmaxd, const int inlmax, const int nat, const int R_size, const std::vector< hamilt::HContainer< double > * > phialpha, const UnitCell &ucell, const LCAO_Orbitals &orb, const Parallel_Orbitals &pv, const Grid_Driver &GridD, torch::Tensor &phialpha_r_out)
Definition deepks_vdrpre.cpp:16
int get_R_size(const hamilt::HContainer< T > &hcontainer)
Definition deepks_vdrpre.cpp:254