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"
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
31
32void prepare_phialpha_iRmat(const int nlocal,
33 const int R_size,
34 const DeePKS_Param& deepks_param,
35 const std::vector<hamilt::HContainer<double>*> phialpha,
36 const UnitCell& ucell,
37 const LCAO_Orbitals& orb,
38 const Grid_Driver& GridD,
39 torch::Tensor& overlap,
40 torch::Tensor& iRmat);
41
42void cal_vdr_precalc(const int nlocal,
43 const int nat,
44 const int nks,
45 const int R_size,
46 const DeePKS_Param& deepks_param,
47 const std::vector<ModuleBase::Vector3<double>>& kvec_d,
48 const std::vector<hamilt::HContainer<double>*> phialpha,
49 const std::vector<torch::Tensor> gevdm,
50 const UnitCell& ucell,
51 const LCAO_Orbitals& orb,
52 const Parallel_Orbitals& pv,
53 const Grid_Driver& GridD,
54 torch::Tensor& vdr_precalc);
55
56int mapping_R(int R);
57torch::Tensor mapping_R(const torch::Tensor& R_tensor);
58
59template <typename T>
60int get_R_size(const hamilt::HContainer<T>& hcontainer);
61} // namespace DeePKS_domain
62#endif
63#endif
Definition sltk_grid_driver.h:40
Definition ORB_read.h:18
3 elements vector
Definition vector3.h:24
Definition parallel_orbitals.h:9
Definition unitcell.h:15
Definition hcontainer.h:144
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 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