ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
kernel.h
Go to the documentation of this file.
1#ifndef KERNEL_H
2#define KERNEL_H
3
4#include <torch/torch.h>
5
6class Kernel
7{
8 // ------------ fill the kernel in reciprocal space ----------
9 public:
10 Kernel(){};
11
12 void set_para(const int kernel_type_in, const double scaling_in, const double yukawa_alpha_in, const std::string &kernel_file_in)
13 {
14 this->kernel_type = kernel_type_in;
15 this->scaling = scaling_in;
16 this->yukawa_alpha = yukawa_alpha_in;
17 this->kernel_file = kernel_file_in;
18 }
19
20 int kernel_type = 0; // 1: WT, 2: Yukawa
21 double scaling = 0.;
22 double yukawa_alpha = 0.;
23 std::string kernel_file = "none";
24 std::vector<torch::Tensor> kernel;
25
26 void fill_kernel(const int fftdim,
27 const int ndata,
28 const torch::Tensor &rho,
29 const double *volume,
30 const std::string *cell,
31 const torch::Device device,
32 const std::vector<torch::Tensor> &fft_gg);
33 double wt_kernel(double eta, double tf_weight = 1., double vw_weight = 1.);
34 double yukawa_kernel(double eta, double alpha);
35 void read_kernel(const int fftdim,
36 const int ndata,
37 const torch::Tensor &rho,
38 const double *volume,
39 const std::string *cell,
40 const torch::Device device,
41 const std::vector<torch::Tensor> &fft_gg);
42};
43#endif
Definition kernel.h:7
void read_kernel(const int fftdim, const int ndata, const torch::Tensor &rho, const double *volume, const std::string *cell, const torch::Device device, const std::vector< torch::Tensor > &fft_gg)
Definition kernel.cpp:113
double wt_kernel(double eta, double tf_weight=1., double vw_weight=1.)
Definition kernel.cpp:60
Kernel()
Definition kernel.h:10
void set_para(const int kernel_type_in, const double scaling_in, const double yukawa_alpha_in, const std::string &kernel_file_in)
Definition kernel.h:12
int kernel_type
Definition kernel.h:20
void fill_kernel(const int fftdim, const int ndata, const torch::Tensor &rho, const double *volume, const std::string *cell, const torch::Device device, const std::vector< torch::Tensor > &fft_gg)
Definition kernel.cpp:3
double yukawa_alpha
Definition kernel.h:22
double yukawa_kernel(double eta, double alpha)
Definition kernel.cpp:107
double scaling
Definition kernel.h:21
std::string kernel_file
Definition kernel.h:23
std::vector< torch::Tensor > kernel
Definition kernel.h:24