1
- #include " ./potential .h"
1
+ #include " ./pauli_potential .h"
2
2
3
- void Potential ::init (const Input &input,
3
+ void PauliPotential ::init (const Input &input,
4
4
const int ninput,
5
5
const std::vector<std::string> &descriptor_type,
6
6
const std::vector<int > &kernel_index)
@@ -64,7 +64,7 @@ void Potential::init(const Input &input,
64
64
this ->ml_tanhq_nl = this ->descriptor2index [" tanhq_nl" ].size () > 0 ;
65
65
}
66
66
67
- torch::Tensor Potential ::get_potential (const int istru,
67
+ torch::Tensor PauliPotential ::get_potential (const int istru,
68
68
const Data &data,
69
69
const torch::Tensor &F,
70
70
const torch::Tensor &gradient,
@@ -175,31 +175,31 @@ torch::Tensor Potential::get_potential(const int istru,
175
175
return potential;
176
176
}
177
177
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)
179
179
{
180
180
// std::cout << "potGammaTerm" << std::endl;
181
181
return 1 . / 3 . * gamma
182
182
* gradient.index ({" ..." , this ->descriptor2index [" gamma" ][0 ]})
183
183
.reshape ({this ->fftdim , this ->fftdim , this ->fftdim });
184
184
}
185
185
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)
187
187
{
188
188
// std::cout << "potPTerm1" << std::endl;
189
189
return -8 . / 3 . * p
190
190
* gradient.index ({" ..." , this ->descriptor2index [" p" ][0 ]})
191
191
.reshape ({this ->fftdim , this ->fftdim , this ->fftdim });
192
192
}
193
193
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)
195
195
{
196
196
// std::cout << "potQTerm1" << std::endl;
197
197
return -5 . / 3 . * q
198
198
* gradient.index ({" ..." , this ->descriptor2index [" q" ][0 ]})
199
199
.reshape ({this ->fftdim , this ->fftdim , this ->fftdim });
200
200
}
201
201
202
- torch::Tensor Potential ::potGammanlTerm (const torch::Tensor &rho,
202
+ torch::Tensor PauliPotential ::potGammanlTerm (const torch::Tensor &rho,
203
203
const torch::Tensor &gamma,
204
204
const Kernel *kernels,
205
205
// const torch::Tensor &kernel,
@@ -222,7 +222,7 @@ torch::Tensor Potential::potGammanlTerm(const torch::Tensor &rho,
222
222
return result;
223
223
}
224
224
225
- torch::Tensor Potential ::potPPnlTerm (const torch::Tensor &rho,
225
+ torch::Tensor PauliPotential ::potPPnlTerm (const torch::Tensor &rho,
226
226
const torch::Tensor &nablaRho,
227
227
const torch::Tensor &p,
228
228
const Kernel *kernels,
@@ -268,7 +268,7 @@ torch::Tensor Potential::potPPnlTerm(const torch::Tensor &rho,
268
268
return result;
269
269
}
270
270
271
- torch::Tensor Potential ::potQQnlTerm (const torch::Tensor &rho,
271
+ torch::Tensor PauliPotential ::potQQnlTerm (const torch::Tensor &rho,
272
272
const torch::Tensor &q,
273
273
const Kernel *kernels,
274
274
// const torch::Tensor &kernel,
@@ -307,7 +307,7 @@ torch::Tensor Potential::potQQnlTerm(const torch::Tensor &rho,
307
307
return result;
308
308
}
309
309
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)
311
311
{
312
312
torch::Tensor result = torch::zeros_like (rho);
313
313
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<
321
321
return result;
322
322
}
323
323
324
- torch::Tensor Potential ::potTanhxiTerm1 (const torch::Tensor &rho,
324
+ torch::Tensor PauliPotential ::potTanhxiTerm1 (const torch::Tensor &rho,
325
325
const std::vector<torch::Tensor> &xi,
326
326
const std::vector<torch::Tensor> &tanhxi,
327
327
const torch::Tensor &gradient)
@@ -337,7 +337,7 @@ torch::Tensor Potential::potTanhxiTerm1(const torch::Tensor &rho,
337
337
return result;
338
338
}
339
339
340
- torch::Tensor Potential ::potTanhpTerm1 (const torch::Tensor &p,
340
+ torch::Tensor PauliPotential ::potTanhpTerm1 (const torch::Tensor &p,
341
341
const torch::Tensor &tanhp,
342
342
const torch::Tensor &gradient)
343
343
{
@@ -346,7 +346,7 @@ torch::Tensor Potential::potTanhpTerm1(const torch::Tensor &p,
346
346
.reshape ({this ->fftdim , this ->fftdim , this ->fftdim });
347
347
}
348
348
349
- torch::Tensor Potential ::potTanhqTerm1 (const torch::Tensor &q,
349
+ torch::Tensor PauliPotential ::potTanhqTerm1 (const torch::Tensor &q,
350
350
const torch::Tensor &tanhq,
351
351
const torch::Tensor &gradient)
352
352
{
@@ -355,7 +355,7 @@ torch::Tensor Potential::potTanhqTerm1(const torch::Tensor &q,
355
355
.reshape ({this ->fftdim , this ->fftdim , this ->fftdim });
356
356
}
357
357
358
- torch::Tensor Potential ::potXinlTerm (const torch::Tensor &rho,
358
+ torch::Tensor PauliPotential ::potXinlTerm (const torch::Tensor &rho,
359
359
const Kernel *kernels,
360
360
// const torch::Tensor &kernel,
361
361
const torch::Tensor &tauTF,
@@ -376,7 +376,7 @@ torch::Tensor Potential::potXinlTerm(const torch::Tensor &rho,
376
376
return result;
377
377
}
378
378
379
- torch::Tensor Potential ::potTanhxinlTerm (const torch::Tensor &rho,
379
+ torch::Tensor PauliPotential ::potTanhxinlTerm (const torch::Tensor &rho,
380
380
const std::vector<torch::Tensor> &tanhxi,
381
381
const Kernel *kernels,
382
382
// const torch::Tensor &kernel,
@@ -399,7 +399,7 @@ torch::Tensor Potential::potTanhxinlTerm(const torch::Tensor &rho,
399
399
return result;
400
400
}
401
401
402
- torch::Tensor Potential ::potTanhxi_nlTerm (const torch::Tensor &rho,
402
+ torch::Tensor PauliPotential ::potTanhxi_nlTerm (const torch::Tensor &rho,
403
403
const std::vector<torch::Tensor> &xi,
404
404
const std::vector<torch::Tensor> &tanhxi,
405
405
const Kernel *kernels,
@@ -428,7 +428,7 @@ torch::Tensor Potential::potTanhxi_nlTerm(const torch::Tensor &rho,
428
428
return result;
429
429
}
430
430
431
- torch::Tensor Potential ::potTanhpTanh_pnlTerm (const torch::Tensor &rho,
431
+ torch::Tensor PauliPotential ::potTanhpTanh_pnlTerm (const torch::Tensor &rho,
432
432
const torch::Tensor &nablaRho,
433
433
const torch::Tensor &p,
434
434
const torch::Tensor &tanhp,
@@ -473,7 +473,7 @@ torch::Tensor Potential::potTanhpTanh_pnlTerm(const torch::Tensor &rho,
473
473
return result;
474
474
}
475
475
476
- torch::Tensor Potential ::potTanhqTanh_qnlTerm (const torch::Tensor &rho,
476
+ torch::Tensor PauliPotential ::potTanhqTanh_qnlTerm (const torch::Tensor &rho,
477
477
const torch::Tensor &q,
478
478
const torch::Tensor &tanhq,
479
479
const std::vector<torch::Tensor> &tanh_qnl,
@@ -513,7 +513,7 @@ torch::Tensor Potential::potTanhqTanh_qnlTerm(const torch::Tensor &rho,
513
513
return result;
514
514
}
515
515
516
- torch::Tensor Potential ::potTanhpTanhp_nlTerm (const torch::Tensor &rho,
516
+ torch::Tensor PauliPotential ::potTanhpTanhp_nlTerm (const torch::Tensor &rho,
517
517
const torch::Tensor &nablaRho,
518
518
const torch::Tensor &p,
519
519
const torch::Tensor &tanhp,
@@ -557,7 +557,7 @@ torch::Tensor Potential::potTanhpTanhp_nlTerm(const torch::Tensor &rho,
557
557
return result;
558
558
}
559
559
560
- torch::Tensor Potential ::potTanhqTanhq_nlTerm (const torch::Tensor &rho,
560
+ torch::Tensor PauliPotential ::potTanhqTanhq_nlTerm (const torch::Tensor &rho,
561
561
const torch::Tensor &q,
562
562
const torch::Tensor &tanhq,
563
563
const Kernel *kernels,
@@ -596,7 +596,7 @@ torch::Tensor Potential::potTanhqTanhq_nlTerm(const torch::Tensor &rho,
596
596
return result;
597
597
}
598
598
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)
600
600
{
601
601
torch::Tensor result = torch::zeros_like (input[0 ]);
602
602
// torch::Tensor img = torch::tensor({1.0j});
@@ -611,12 +611,12 @@ torch::Tensor Potential::divergence(const torch::Tensor &input, const std::vecto
611
611
return result;
612
612
}
613
613
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)
615
615
{
616
616
return torch::real (torch::fft::ifftn (torch::fft::fftn (input) * -gg));
617
617
}
618
618
619
- torch::Tensor Potential ::dtanh (const torch::Tensor &tanhx, const double chi)
619
+ torch::Tensor PauliPotential ::dtanh (const torch::Tensor &tanhx, const double chi)
620
620
{
621
621
return (torch::ones_like (tanhx) - tanhx * tanhx) * chi;
622
622
// return (1. - tanhx * tanhx) * chi;
0 commit comments