1- #include " ./potential .h"
1+ #include " ./pauli_potential .h"
22
3- void Potential ::init (const Input &input,
3+ void PauliPotential ::init (const Input &input,
44 const int ninput,
55 const std::vector<std::string> &descriptor_type,
66 const std::vector<int > &kernel_index)
@@ -64,7 +64,7 @@ void Potential::init(const Input &input,
6464 this ->ml_tanhq_nl = this ->descriptor2index [" tanhq_nl" ].size () > 0 ;
6565}
6666
67- torch::Tensor Potential ::get_potential (const int istru,
67+ torch::Tensor PauliPotential ::get_potential (const int istru,
6868 const Data &data,
6969 const torch::Tensor &F,
7070 const torch::Tensor &gradient,
@@ -175,31 +175,31 @@ torch::Tensor Potential::get_potential(const int istru,
175175 return potential;
176176}
177177
178- torch::Tensor Potential ::potGammaTerm (const torch::Tensor &gamma, const torch::Tensor &gradient)
178+ torch::Tensor PauliPotential ::potGammaTerm (const torch::Tensor &gamma, const torch::Tensor &gradient)
179179{
180180 // std::cout << "potGammaTerm" << std::endl;
181181 return 1 . / 3 . * gamma
182182 * gradient.index ({" ..." , this ->descriptor2index [" gamma" ][0 ]})
183183 .reshape ({this ->fftdim , this ->fftdim , this ->fftdim });
184184}
185185
186- torch::Tensor Potential ::potPTerm1 (const torch::Tensor &p, const torch::Tensor &gradient)
186+ torch::Tensor PauliPotential ::potPTerm1 (const torch::Tensor &p, const torch::Tensor &gradient)
187187{
188188 // std::cout << "potPTerm1" << std::endl;
189189 return -8 . / 3 . * p
190190 * gradient.index ({" ..." , this ->descriptor2index [" p" ][0 ]})
191191 .reshape ({this ->fftdim , this ->fftdim , this ->fftdim });
192192}
193193
194- torch::Tensor Potential ::potQTerm1 (const torch::Tensor &q, const torch::Tensor &gradient)
194+ torch::Tensor PauliPotential ::potQTerm1 (const torch::Tensor &q, const torch::Tensor &gradient)
195195{
196196 // std::cout << "potQTerm1" << std::endl;
197197 return -5 . / 3 . * q
198198 * gradient.index ({" ..." , this ->descriptor2index [" q" ][0 ]})
199199 .reshape ({this ->fftdim , this ->fftdim , this ->fftdim });
200200}
201201
202- torch::Tensor Potential ::potGammanlTerm (const torch::Tensor &rho,
202+ torch::Tensor PauliPotential ::potGammanlTerm (const torch::Tensor &rho,
203203 const torch::Tensor &gamma,
204204 const Kernel *kernels,
205205 // const torch::Tensor &kernel,
@@ -222,7 +222,7 @@ torch::Tensor Potential::potGammanlTerm(const torch::Tensor &rho,
222222 return result;
223223}
224224
225- torch::Tensor Potential ::potPPnlTerm (const torch::Tensor &rho,
225+ torch::Tensor PauliPotential ::potPPnlTerm (const torch::Tensor &rho,
226226 const torch::Tensor &nablaRho,
227227 const torch::Tensor &p,
228228 const Kernel *kernels,
@@ -268,7 +268,7 @@ torch::Tensor Potential::potPPnlTerm(const torch::Tensor &rho,
268268 return result;
269269}
270270
271- torch::Tensor Potential ::potQQnlTerm (const torch::Tensor &rho,
271+ torch::Tensor PauliPotential ::potQQnlTerm (const torch::Tensor &rho,
272272 const torch::Tensor &q,
273273 const Kernel *kernels,
274274 // const torch::Tensor &kernel,
@@ -307,7 +307,7 @@ torch::Tensor Potential::potQQnlTerm(const torch::Tensor &rho,
307307 return result;
308308}
309309
310- torch::Tensor Potential ::potXiTerm1 (const torch::Tensor &rho, const std::vector<torch::Tensor> &xi, const torch::Tensor &gradient)
310+ torch::Tensor PauliPotential ::potXiTerm1 (const torch::Tensor &rho, const std::vector<torch::Tensor> &xi, const torch::Tensor &gradient)
311311{
312312 torch::Tensor result = torch::zeros_like (rho);
313313 for (int ik = 0 ; ik < this ->descriptor2kernel [" xi" ].size (); ++ik)
@@ -321,7 +321,7 @@ torch::Tensor Potential::potXiTerm1(const torch::Tensor &rho, const std::vector<
321321 return result;
322322}
323323
324- torch::Tensor Potential ::potTanhxiTerm1 (const torch::Tensor &rho,
324+ torch::Tensor PauliPotential ::potTanhxiTerm1 (const torch::Tensor &rho,
325325 const std::vector<torch::Tensor> &xi,
326326 const std::vector<torch::Tensor> &tanhxi,
327327 const torch::Tensor &gradient)
@@ -337,7 +337,7 @@ torch::Tensor Potential::potTanhxiTerm1(const torch::Tensor &rho,
337337 return result;
338338}
339339
340- torch::Tensor Potential ::potTanhpTerm1 (const torch::Tensor &p,
340+ torch::Tensor PauliPotential ::potTanhpTerm1 (const torch::Tensor &p,
341341 const torch::Tensor &tanhp,
342342 const torch::Tensor &gradient)
343343{
@@ -346,7 +346,7 @@ torch::Tensor Potential::potTanhpTerm1(const torch::Tensor &p,
346346 .reshape ({this ->fftdim , this ->fftdim , this ->fftdim });
347347}
348348
349- torch::Tensor Potential ::potTanhqTerm1 (const torch::Tensor &q,
349+ torch::Tensor PauliPotential ::potTanhqTerm1 (const torch::Tensor &q,
350350 const torch::Tensor &tanhq,
351351 const torch::Tensor &gradient)
352352{
@@ -355,7 +355,7 @@ torch::Tensor Potential::potTanhqTerm1(const torch::Tensor &q,
355355 .reshape ({this ->fftdim , this ->fftdim , this ->fftdim });
356356}
357357
358- torch::Tensor Potential ::potXinlTerm (const torch::Tensor &rho,
358+ torch::Tensor PauliPotential ::potXinlTerm (const torch::Tensor &rho,
359359 const Kernel *kernels,
360360 // const torch::Tensor &kernel,
361361 const torch::Tensor &tauTF,
@@ -376,7 +376,7 @@ torch::Tensor Potential::potXinlTerm(const torch::Tensor &rho,
376376 return result;
377377}
378378
379- torch::Tensor Potential ::potTanhxinlTerm (const torch::Tensor &rho,
379+ torch::Tensor PauliPotential ::potTanhxinlTerm (const torch::Tensor &rho,
380380 const std::vector<torch::Tensor> &tanhxi,
381381 const Kernel *kernels,
382382 // const torch::Tensor &kernel,
@@ -399,7 +399,7 @@ torch::Tensor Potential::potTanhxinlTerm(const torch::Tensor &rho,
399399 return result;
400400}
401401
402- torch::Tensor Potential ::potTanhxi_nlTerm (const torch::Tensor &rho,
402+ torch::Tensor PauliPotential ::potTanhxi_nlTerm (const torch::Tensor &rho,
403403 const std::vector<torch::Tensor> &xi,
404404 const std::vector<torch::Tensor> &tanhxi,
405405 const Kernel *kernels,
@@ -428,7 +428,7 @@ torch::Tensor Potential::potTanhxi_nlTerm(const torch::Tensor &rho,
428428 return result;
429429}
430430
431- torch::Tensor Potential ::potTanhpTanh_pnlTerm (const torch::Tensor &rho,
431+ torch::Tensor PauliPotential ::potTanhpTanh_pnlTerm (const torch::Tensor &rho,
432432 const torch::Tensor &nablaRho,
433433 const torch::Tensor &p,
434434 const torch::Tensor &tanhp,
@@ -473,7 +473,7 @@ torch::Tensor Potential::potTanhpTanh_pnlTerm(const torch::Tensor &rho,
473473 return result;
474474}
475475
476- torch::Tensor Potential ::potTanhqTanh_qnlTerm (const torch::Tensor &rho,
476+ torch::Tensor PauliPotential ::potTanhqTanh_qnlTerm (const torch::Tensor &rho,
477477 const torch::Tensor &q,
478478 const torch::Tensor &tanhq,
479479 const std::vector<torch::Tensor> &tanh_qnl,
@@ -513,7 +513,7 @@ torch::Tensor Potential::potTanhqTanh_qnlTerm(const torch::Tensor &rho,
513513 return result;
514514}
515515
516- torch::Tensor Potential ::potTanhpTanhp_nlTerm (const torch::Tensor &rho,
516+ torch::Tensor PauliPotential ::potTanhpTanhp_nlTerm (const torch::Tensor &rho,
517517 const torch::Tensor &nablaRho,
518518 const torch::Tensor &p,
519519 const torch::Tensor &tanhp,
@@ -557,7 +557,7 @@ torch::Tensor Potential::potTanhpTanhp_nlTerm(const torch::Tensor &rho,
557557 return result;
558558}
559559
560- torch::Tensor Potential ::potTanhqTanhq_nlTerm (const torch::Tensor &rho,
560+ torch::Tensor PauliPotential ::potTanhqTanhq_nlTerm (const torch::Tensor &rho,
561561 const torch::Tensor &q,
562562 const torch::Tensor &tanhq,
563563 const Kernel *kernels,
@@ -596,7 +596,7 @@ torch::Tensor Potential::potTanhqTanhq_nlTerm(const torch::Tensor &rho,
596596 return result;
597597}
598598
599- torch::Tensor Potential ::divergence (const torch::Tensor &input, const std::vector<torch::Tensor> &grid)
599+ torch::Tensor PauliPotential ::divergence (const torch::Tensor &input, const std::vector<torch::Tensor> &grid)
600600{
601601 torch::Tensor result = torch::zeros_like (input[0 ]);
602602 // torch::Tensor img = torch::tensor({1.0j});
@@ -611,12 +611,12 @@ torch::Tensor Potential::divergence(const torch::Tensor &input, const std::vecto
611611 return result;
612612}
613613
614- torch::Tensor Potential ::Laplacian (const torch::Tensor &input, const torch::Tensor &gg)
614+ torch::Tensor PauliPotential ::Laplacian (const torch::Tensor &input, const torch::Tensor &gg)
615615{
616616 return torch::real (torch::fft::ifftn (torch::fft::fftn (input) * -gg));
617617}
618618
619- torch::Tensor Potential ::dtanh (const torch::Tensor &tanhx, const double chi)
619+ torch::Tensor PauliPotential ::dtanh (const torch::Tensor &tanhx, const double chi)
620620{
621621 return (torch::ones_like (tanhx) - tanhx * tanhx) * chi;
622622 // return (1. - tanhx * tanhx) * chi;
0 commit comments