QMCPACK
Backflow_eI_spin.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
8 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
9 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
10 //
11 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
12 //////////////////////////////////////////////////////////////////////////////////////
13 
14 
15 #ifndef QMCPLUSPLUS_BACKFLOW_ELEC_ION_SPINH
16 #define QMCPLUSPLUS_BACKFLOW_ELEC_ION_SPINH
19 #include <cmath>
20 #include <vector>
21 
22 namespace qmcplusplus
23 {
24 template<class FT>
26 {
27 private:
28  /// distance table index
29  const int myTableIndex_;
30 
31 public:
32  bool Spin;
36  /** index offset for the source particles
37  *
38  * The loop over the particles is replaced by a double loop as
39  * for(int sg=0;sg<F.rows();++sg)
40  * for(int s=s_offset[sg]; s<s_offset[sg+1];++s)
41  */
42  std::vector<int> s_offset;
43  /** index offset for the target particles
44  *
45  * The loop over the particles is replaced by a double loop as
46  * for(int tg=0;tg<F.cols();++tg)
47  * for(int t=t_offset[tg]; t<t_offset[tg+1];++t)
48  */
49  std::vector<int> t_offset;
50 
52  : BackflowFunctionBase(ions, els), myTableIndex_(els.addTable(ions)), Spin(false)
53  {
54  throw std::runtime_error(
55  "Backflow_eI_spin is not ready for SoA! Please submit a feature request if it is needed!\n");
56  RadFunc.resize(ions.groups(), els.groups());
57  for (int i = 0; i < RadFunc.size(); ++i)
58  RadFunc(i) = 0;
59  Fmask.resize(ions.groups(), els.groups());
60  Fmask = -1;
62  s_offset.resize(ions.groups() + 1, 0);
63  t_offset.resize(els.groups() + 1, 0);
64  for (int s = 0; s < ions.groups(); ++s)
65  s_offset[s + 1] = ions.last(s);
66  for (int t = 0; t < els.groups(); ++t)
67  t_offset[t + 1] = els.last(t);
68  offsetPrms.resize(ions.groups(), els.groups());
69  offsetPrms = 0;
70  }
71 
72  ~Backflow_eI_spin() override
73  {
74  for (int i = 0; i < RadFunc.size(); ++i)
75  if (RadFunc[i])
76  delete RadFunc[i];
77  }
78 
79  void addFunc(int source_g, FT* afunc, int target_g)
80  {
81  if (target_g < 0)
82  {
83  if (Spin)
84  {
85  APP_ABORT("Cannot mix spin-dependent with spin-indepdentent Jastrow");
86  }
87  int pid = source_g * RadFunc.cols();
88  for (int ig = 0; ig < RadFunc.cols(); ++ig)
89  {
90  RadFunc(source_g, ig) = afunc;
91  Fmask(source_g, ig) = pid;
92  }
93  app_log() << " Adding functor of type " << source_g << " for all the target. " << std::endl;
94  }
95  else
96  {
97  Spin = true;
98  RadFunc(source_g, target_g) = afunc;
99  Fmask(source_g, target_g) = source_g * RadFunc.cols() + target_g;
100  app_log() << " Adding functor of type " << source_g << " for the target type " << target_g << std::endl;
101  }
102  }
103 
104  std::unique_ptr<BackflowFunctionBase> makeClone(ParticleSet& tqp) const override
105  {
106  auto clone = std::make_unique<Backflow_eI_spin<FT>>(CenterSys, tqp);
107  clone->resize(NumTargets, NumCenters);
108  clone->indexOfFirstParam = indexOfFirstParam;
109  clone->offsetPrms = offsetPrms;
110  clone->numParams = numParams;
111  clone->derivs = derivs;
112  if (Spin)
113  {
114  for (int sg = 0; sg < RadFunc.rows(); ++sg)
115  for (int tg = 0; tg < RadFunc.rows(); ++tg)
116  if (RadFunc(sg, tg))
117  clone->addFunc(sg, new FT(*RadFunc(sg, tg)), tg);
118  }
119  else
120  {
121  for (int sg = 0; sg < RadFunc.rows(); ++sg)
122  if (RadFunc(sg, 0))
123  clone->addFunc(sg, new FT(*RadFunc(sg, 0)), -1);
124  }
125  return clone;
126  }
127 
128  void reportStatus(std::ostream& os) override
129  {
130  std::cerr << RadFunc.size() << std::endl;
131  std::cerr << isOptimizable() << std::endl;
132  std::cerr << myTableIndex_ << std::endl;
133  std::cerr << offsetPrms << std::endl;
134  }
135 
136  void resetParameters(const opt_variables_type& active) override
137  {
138  for (int i = 0; i < RadFunc.size(); ++i)
139  if (Fmask(i) == i)
140  RadFunc(i)->resetParameters(active);
141  }
142 
143  void checkInVariables(opt_variables_type& active) override
144  {
145  //myVars.clear();
146  for (int i = 0; i < RadFunc.size(); ++i)
147  if (Fmask(i) == i)
148  RadFunc(i)->checkInVariables(active);
149  }
150 
151  void checkOutVariables(const opt_variables_type& active) override
152  {
153  for (int i = 0; i < RadFunc.size(); ++i)
154  if (Fmask(i) == i)
155  RadFunc(i)->checkOutVariables(active);
156  }
157 
158  inline bool isOptimizable() override
159  {
160  for (int i = 0; i < RadFunc.size(); ++i)
161  if (Fmask(i) == i && RadFunc(i)->isOptimizable())
162  return true;
163  return false;
164  }
165 
166  inline int indexOffset() override
167  {
168  for (int i = 0; i < RadFunc.size(); ++i)
169  if (Fmask(i) == i)
170  return RadFunc(i)->myVars.where(0);
171  return -1;
172  }
173 
174  // only elements of qp coordinates that changed should be copied
175  inline void acceptMove(int iat, int UpdateMode) override
176  {
177  int num;
178  switch (UpdateMode)
179  {
180  case ORB_PBYP_RATIO:
181  num = UIJ.cols();
182  for (int i = 0; i < num; i++)
183  UIJ(iat, i) = UIJ_temp[i];
184  break;
185  case ORB_PBYP_PARTIAL:
186  num = UIJ.cols();
187  for (int i = 0; i < num; i++)
188  UIJ(iat, i) = UIJ_temp[i];
189  num = AIJ.cols();
190  for (int i = 0; i < num; i++)
191  AIJ(iat, i) = AIJ_temp[i];
192  break;
193  case ORB_PBYP_ALL:
194  num = UIJ.cols();
195  for (int i = 0; i < num; i++)
196  UIJ(iat, i) = UIJ_temp[i];
197  num = AIJ.cols();
198  for (int i = 0; i < num; i++)
199  AIJ(iat, i) = AIJ_temp[i];
200  num = BIJ.cols();
201  for (int i = 0; i < num; i++)
202  BIJ(iat, i) = BIJ_temp[i];
203  break;
204  default:
205  num = UIJ.cols();
206  for (int i = 0; i < num; i++)
207  UIJ(iat, i) = UIJ_temp[i];
208  num = AIJ.cols();
209  for (int i = 0; i < num; i++)
210  AIJ(iat, i) = AIJ_temp[i];
211  num = BIJ.cols();
212  for (int i = 0; i < num; i++)
213  BIJ(iat, i) = BIJ_temp[i];
214  break;
215  }
216  UIJ_temp = 0.0;
217  AIJ_temp = 0.0;
218  BIJ_temp = 0.0;
219  }
220 
221  inline void restore(int iat, int UpdateType) override
222  {
223  UIJ_temp = 0.0;
224  AIJ_temp = 0.0;
225  BIJ_temp = 0.0;
226  }
227 
228  void registerData(WFBufferType& buf) override
229  {
230  FirstOfU = &(UIJ(0, 0)[0]);
232  FirstOfA = &(AIJ(0, 0)[0]);
234  FirstOfB = &(BIJ(0, 0)[0]);
236  buf.add(FirstOfU, LastOfU);
237  buf.add(FirstOfA, LastOfA);
238  buf.add(FirstOfB, LastOfB);
239  }
240 
241  /** calculate quasi-particle coordinates only
242  */
243  inline void evaluate(const ParticleSet& P, ParticleSet& QP) override
244  {
245  APP_ABORT("SoA implementation needed for Backflow_eI_spin::evaluate")
246  //RealType du, d2u;
247  //const auto& myTable = P.getDistTableAB(myTableIndex_);
248  //for (int sg = 0; sg < RadFunc.rows(); ++sg)
249  //{
250  // for (int iat = s_offset[sg]; iat < s_offset[sg + 1]; ++iat)
251  // {
252  // int nn = myTable.M[iat]; //starting nn for the iat-th source
253  // for (int tg = 0; tg < RadFunc.cols(); ++tg)
254  // {
255  // FT* func = RadFunc(sg, tg);
256  // if (func)
257  // for (int jat = t_offset[tg]; jat < t_offset[tg + 1]; ++jat, ++nn)
258  // {
259  // RealType uij = func->evaluate(myTable.r(nn), du, d2u);
260  // QP.R[jat] += (UIJ(jat, iat) = uij * myTable.dr(nn)); // dr(ij) = r_j-r_i
261  // }
262  // else
263  // nn += t_offset[tg + 1] - t_offset[tg]; //move forward by the number of particles in the group tg
264  // }
265  // }
266  //}
267  }
268 
269 
270  inline void evaluate(const ParticleSet& P, ParticleSet& QP, GradVector& Bmat, HessMatrix& Amat)
271  {
272  APP_ABORT("SoA implementation needed for Backflow_eI_spin::evaluate")
273  //RealType du, d2u, temp;
274  //const auto& myTable = P.getDistTableAB(myTableIndex_);
275  //for (int sg = 0; sg < RadFunc.rows(); ++sg)
276  //{
277  // for (int iat = s_offset[sg]; iat < s_offset[sg + 1]; ++iat)
278  // {
279  // int nn = myTable.M[iat]; //starting nn for the iat-th source
280  // for (int tg = 0; tg < RadFunc.cols(); ++tg)
281  // {
282  // FT* func = RadFunc(sg, tg);
283  // if (func)
284  // for (int jat = t_offset[tg]; jat < t_offset[tg + 1]; ++jat, ++nn)
285  // {
286  // RealType uij = func->evaluate(myTable.r(nn), du, d2u);
287  // //PosType u = uij*myTable.dr(nn);
288  // du *= myTable.rinv(nn);
289  // QP.R[jat] += (UIJ(jat, iat) = uij * myTable.dr(nn));
290  // HessType& hess = AIJ(jat, iat);
291  // hess = du * outerProduct(myTable.dr(nn), myTable.dr(nn));
292  // hess[0] += uij;
293  // hess[4] += uij;
294  // hess[8] += uij;
295  // Amat(jat, jat) += hess;
296  // //u = (d2u+4.0*du)*myTable.dr(nn);
297  // Bmat[jat] += (BIJ(jat, iat) = (d2u + 4.0 * du) * myTable.dr(nn));
298  // }
299  // else
300  // nn += t_offset[tg + 1] - t_offset[tg]; //move forward by the number of particles in the group tg
301  // }
302  // }
303  //}
304  }
305 
306 
307  /** calculate quasi-particle coordinates, Bmat and Amat
308  */
309  inline void evaluate(const ParticleSet& P, ParticleSet& QP, GradMatrix& Bmat_full, HessMatrix& Amat) override
310  {
311  APP_ABORT("SoA implementation needed for Backflow_eI_spin::evaluate")
312  //RealType du, d2u;
313  //const auto& myTable = P.getDistTableAB(myTableIndex_);
314  //for (int sg = 0; sg < RadFunc.rows(); ++sg)
315  //{
316  // for (int iat = s_offset[sg]; iat < s_offset[sg + 1]; ++iat)
317  // {
318  // int nn = myTable.M[iat]; //starting nn for the iat-th source
319  // for (int tg = 0; tg < RadFunc.cols(); ++tg)
320  // {
321  // FT* func = RadFunc(sg, tg);
322  // if (func)
323  // for (int jat = t_offset[tg]; jat < t_offset[tg + 1]; ++jat, ++nn)
324  // {
325  // RealType uij = func->evaluate(myTable.r(nn), du, d2u);
326  // du *= myTable.rinv(nn);
327  // //PosType u = uij*myTable.dr(nn);
328  // QP.R[jat] += (UIJ(jat, iat) = uij * myTable.dr(nn));
329  // HessType& hess = AIJ(jat, iat);
330  // hess = du * outerProduct(myTable.dr(nn), myTable.dr(nn));
331  // hess[0] += uij;
332  // hess[4] += uij;
333  // hess[8] += uij;
334  // Amat(jat, jat) += hess;
335  // // this will create problems with QMC_COMPLEX, because Bmat is ValueType and dr is RealType
336  // //u = (d2u+4.0*du)*myTable.dr(nn);
337  // Bmat_full(jat, jat) += (BIJ(jat, iat) = (d2u + 4.0 * du) * myTable.dr(nn));
338  // }
339  // else
340  // nn += t_offset[tg + 1] - t_offset[tg]; //move forward by the number of particles in the group tg
341  // }
342  // }
343  //}
344  }
345 
346  /** calculate quasi-particle coordinates after pbyp move
347  */
348  inline void evaluatePbyP(const ParticleSet& P,
350  const std::vector<int>& index) override
351  {
352  evaluatePbyP(P, index[0], newQP);
353  }
354 
355 
356  /** calculate quasi-particle coordinates after pbyp move
357  */
358  inline void evaluatePbyP(const ParticleSet& P, int iat, ParticleSet::ParticlePos& newQP) override
359  {
360  APP_ABORT("SoA implementation needed for Backflow_eI_spin::evaluatePbyP")
361  //RealType du, d2u;
362  //const auto& myTable = P.getDistTableAB(myTableIndex_);
363  //int tg = P.GroupID[iat]; //species of this particle
364  //for (int sg = 0; sg < RadFunc.rows(); ++sg)
365  //{
366  // FT* func = RadFunc(sg, tg);
367  // if (func)
368  // {
369  // for (int j = s_offset[sg]; j < s_offset[sg + 1]; ++j)
370  // {
371  // RealType uij = func->evaluate(myTable.Temp[j].r1, du, d2u);
372  // PosType u = (UIJ_temp[j] = uij * myTable.Temp[j].dr1) - UIJ(iat, j);
373  // newQP[iat] += u;
374  // }
375  // }
376  //}
377  }
378 
379  inline void evaluatePbyP(const ParticleSet& P,
381  const std::vector<int>& index,
382  HessMatrix& Amat) override
383  {
384  evaluatePbyP(P, index[0], newQP, Amat);
385  }
386 
387  inline void evaluatePbyP(const ParticleSet& P, int iat, ParticleSet::ParticlePos& newQP, HessMatrix& Amat) override
388  {
389  APP_ABORT("SoA implementation needed for Backflow_eI_spin::evaluatePbyP")
390  //RealType du, d2u;
391  //const auto& myTable = P.getDistTableAB(myTableIndex_);
392  //int tg = P.GroupID[iat]; //species of this particle
393  //for (int sg = 0; sg < RadFunc.rows(); ++sg)
394  //{
395  // FT* func = RadFunc(sg, tg);
396  // if (func)
397  // {
398  // for (int j = s_offset[sg]; j < s_offset[sg + 1]; ++j)
399  // {
400  // RealType uij = func->evaluate(myTable.Temp[j].r1, du, d2u);
401  // PosType u = (UIJ_temp[j] = uij * myTable.Temp[j].dr1) - UIJ(iat, j);
402  // newQP[iat] += u;
403  // HessType& hess = AIJ_temp[j];
404  // hess = (du * myTable.Temp[j].rinv1) * outerProduct(myTable.Temp[j].dr1, myTable.Temp[j].dr1);
405  // hess[0] += uij;
406  // hess[4] += uij;
407  // hess[8] += uij;
408  // // should I expand this??? Is the compiler smart enough???
409  // Amat(iat, iat) += (hess - AIJ(iat, j));
410  // }
411  // }
412  //}
413  }
414 
415  inline void evaluatePbyP(const ParticleSet& P,
417  const std::vector<int>& index,
418  GradMatrix& Bmat_full,
419  HessMatrix& Amat) override
420  {
421  evaluatePbyP(P, index[0], newQP, Bmat_full, Amat);
422  }
423 
424  inline void evaluatePbyP(const ParticleSet& P,
425  int iat,
427  GradMatrix& Bmat_full,
428  HessMatrix& Amat) override
429  {
430  APP_ABORT("SoA implementation needed for Backflow_eI_spin::evaluatePbyP")
431  //RealType du, d2u;
432  //const auto& myTable = P.getDistTableAB(myTableIndex_);
433  //int tg = P.GroupID[iat]; //species of this particle
434  //for (int sg = 0; sg < RadFunc.rows(); ++sg)
435  //{
436  // FT* func = RadFunc(sg, tg);
437  // if (func)
438  // {
439  // for (int j = s_offset[sg]; j < s_offset[sg + 1]; ++j)
440  // {
441  // RealType uij = func->evaluate(myTable.Temp[j].r1, du, d2u);
442  // PosType u = (UIJ_temp[j] = uij * myTable.Temp[j].dr1) - UIJ(iat, j);
443  // newQP[iat] += u;
444  // du *= myTable.Temp[j].rinv1;
445  // HessType& hess = AIJ_temp[j];
446  // hess = du * outerProduct(myTable.Temp[j].dr1, myTable.Temp[j].dr1);
447  // hess[0] += uij;
448  // hess[4] += uij;
449  // hess[8] += uij;
450  // Amat(iat, iat) += (hess - AIJ(iat, j));
451  // BIJ_temp[j] = (d2u + 4.0 * du) * myTable.Temp[j].dr1;
452  // Bmat_full(iat, iat) += (BIJ_temp[j] - BIJ(iat, j));
453  // }
454  // }
455  //}
456  }
457 
458  /** calculate only Bmat
459  * This is used in pbyp moves, in updateBuffer()
460  */
461  inline void evaluateBmatOnly(const ParticleSet& P, GradMatrix& Bmat_full) override
462  {
463  APP_ABORT("SoA implementation needed for Backflow_eI_spin::evaluateBmatOnly")
464  //RealType du, d2u;
465  //const auto& myTable = P.getDistTableAB(myTableIndex_);
466  //for (int sg = 0; sg < RadFunc.rows(); ++sg)
467  //{
468  // for (int iat = s_offset[sg]; iat < s_offset[sg + 1]; ++iat)
469  // {
470  // int nn = myTable.M[iat]; //starting nn for the iat-th source
471  // for (int tg = 0; tg < RadFunc.cols(); ++tg)
472  // {
473  // FT* func = RadFunc(sg, tg);
474  // if (func)
475  // for (int jat = t_offset[tg]; jat < t_offset[tg + 1]; ++jat, ++nn)
476  // {
477  // RealType uij = func->evaluate(myTable.r(nn), du, d2u);
478  // Bmat_full(jat, jat) += (BIJ(jat, iat) = (d2u + 4.0 * du * myTable.rinv(nn)) * myTable.dr(nn));
479  // }
480  // else
481  // nn += t_offset[tg + 1] - t_offset[tg]; //move forward by the number of particles in the group tg
482  // }
483  // }
484  //}
485  }
486 
487  /** calculate quasi-particle coordinates, Bmat and Amat
488  * calculate derivatives wrt to variational parameters
489  */
490  inline void evaluateWithDerivatives(const ParticleSet& P,
491  ParticleSet& QP,
492  GradMatrix& Bmat_full,
493  HessMatrix& Amat,
494  GradMatrix& Cmat,
495  GradMatrix& Ymat,
496  HessArray& Xmat) override
497  {
498  APP_ABORT("SoA implementation needed for Backflow_eI_spin::evaluateWithDerivatives")
499  //RealType du, d2u;
500  //const auto& myTable = P.getDistTableAB(myTableIndex_);
501  //for (int sg = 0; sg < RadFunc.rows(); ++sg)
502  //{
503  // for (int iat = s_offset[sg]; iat < s_offset[sg + 1]; ++iat)
504  // {
505  // int nn = myTable.M[iat]; //starting nn for the iat-th source
506  // for (int tg = 0; tg < RadFunc.cols(); ++tg)
507  // {
508  // FT* func = RadFunc(sg, tg);
509  // if (func)
510  // for (int jat = t_offset[tg]; jat < t_offset[tg + 1]; ++jat, ++nn)
511  // {
512  // RealType uij = func->evaluate(myTable.r(nn), du, d2u);
513  // // std::fill(derivs.begin(),derivs.end(),0.0);
514  // int NPrms = func->NumParams;
515  // std::vector<TinyVector<RealType, 3>> derivsju(NPrms);
516  // func->evaluateDerivatives(myTable.r(nn), derivsju);
517  // du *= myTable.rinv(nn);
518  // //PosType u = uij*myTable.dr(nn);
519  // QP.R[jat] += (UIJ(jat, iat) = uij * myTable.dr(nn));
520  // HessType op = outerProduct(myTable.dr(nn), myTable.dr(nn));
521  // HessType& hess = AIJ(jat, iat);
522  // hess = du * op;
523  // hess[0] += uij;
524  // hess[4] += uij;
525  // hess[8] += uij;
526  // Amat(jat, jat) += hess;
527  // // this will create problems with QMC_COMPLEX, because Bmat is ValueType and dr is RealType
528  // //u = (d2u+4.0*du)*myTable.dr(nn);
529  // Bmat_full(jat, jat) += (BIJ(jat, iat) = (d2u + 4.0 * du) * myTable.dr(nn));
530  // //WARNINGL offsetPrms
531  // for (int prm = 0, la = indexOfFirstParam + offsetPrms(sg, tg); prm < NPrms; prm++, la++)
532  // {
533  // Cmat(la, jat) += myTable.dr(nn) * derivsju[prm][0];
534  // Xmat(la, jat, jat) += (derivsju[prm][1] * myTable.rinv(nn)) * op;
535  // Xmat(la, jat, jat)[0] += derivsju[prm][0];
536  // Xmat(la, jat, jat)[4] += derivsju[prm][0];
537  // Xmat(la, jat, jat)[8] += derivsju[prm][0];
538  // Ymat(la, jat) += (derivsju[prm][2] + 4.0 * derivsju[prm][1] * myTable.rinv(nn)) * myTable.dr(nn);
539  // }
540  // }
541  // else
542  // nn += t_offset[tg + 1] - t_offset[tg]; //move forward by the number of particles in the group tg
543  // }
544  // }
545  //}
546  }
547 };
548 } // namespace qmcplusplus
549 
550 #endif
int NumTargets
number of quantum particles
void evaluate(const ParticleSet &P, ParticleSet &QP, GradVector &Bmat, HessMatrix &Amat)
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
void addFunc(int source_g, FT *afunc, int target_g)
void acceptMove(int iat, int UpdateMode) override
void resetParameters(const opt_variables_type &active) override
Backflow_eI_spin(ParticleSet &ions, ParticleSet &els)
std::ostream & app_log()
Definition: OutputManager.h:65
Base class for backflow transformations.
void resize(size_type n, size_type m)
Resize the container.
Definition: OhmmsMatrix.h:99
void evaluate(const ParticleSet &P, ParticleSet &QP) override
calculate quasi-particle coordinates only
Attaches a unit to a Vector for IO.
void evaluate(const ParticleSet &P, ParticleSet &QP, GradMatrix &Bmat_full, HessMatrix &Amat) override
calculate quasi-particle coordinates, Bmat and Amat
int NumCenters
number of centers, e.g., ions
#define OHMMS_DIM
Definition: config.h:64
size_type cols() const
Definition: OhmmsMatrix.h:78
void evaluatePbyP(const ParticleSet &P, int iat, ParticleSet::ParticlePos &newQP, HessMatrix &Amat) override
calculate quasi-particle coordinates and Amat after pbyp move
int groups() const
return the number of groups
Definition: ParticleSet.h:511
void evaluatePbyP(const ParticleSet &P, int iat, ParticleSet::ParticlePos &newQP, GradMatrix &Bmat_full, HessMatrix &Amat) override
calculate quasi-particle coordinates, Bmat and Amat after pbyp move
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
size_type size() const
Definition: OhmmsMatrix.h:76
const int myTableIndex_
distance table index
std::vector< int > s_offset
index offset for the source particles
void evaluatePbyP(const ParticleSet &P, ParticleSet::ParticlePos &newQP, const std::vector< int > &index, GradMatrix &Bmat_full, HessMatrix &Amat) override
calculate quasi-particle coordinates, Bmat and Amat after pbyp move
void checkInVariables(opt_variables_type &active) override
class to handle a set of variables that can be modified during optimizations
Definition: VariableSet.h:49
void evaluateBmatOnly(const ParticleSet &P, GradMatrix &Bmat_full) override
calculate only Bmat This is used in pbyp moves, in updateBuffer()
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27
void registerData(WFBufferType &buf) override
int last(int igroup) const
return the last index of a group i
Definition: ParticleSet.h:517
void reportStatus(std::ostream &os) override
std::vector< int > t_offset
index offset for the target particles
size_type rows() const
Definition: OhmmsMatrix.h:77
ParticleSet & CenterSys
Reference to the center.
void checkOutVariables(const opt_variables_type &active) override
void evaluatePbyP(const ParticleSet &P, int iat, ParticleSet::ParticlePos &newQP) override
calculate quasi-particle coordinates after pbyp move
void evaluateWithDerivatives(const ParticleSet &P, ParticleSet &QP, GradMatrix &Bmat_full, HessMatrix &Amat, GradMatrix &Cmat, GradMatrix &Ymat, HessArray &Xmat) override
calculate quasi-particle coordinates, Bmat and Amat calculate derivatives wrt to variational paramete...
std::vector< TinyVector< RealType, 3 > > derivs
void restore(int iat, int UpdateType) override
void evaluatePbyP(const ParticleSet &P, ParticleSet::ParticlePos &newQP, const std::vector< int > &index) override
calculate quasi-particle coordinates after pbyp move
void evaluatePbyP(const ParticleSet &P, ParticleSet::ParticlePos &newQP, const std::vector< int > &index, HessMatrix &Amat) override
calculate quasi-particle coordinates and Amat after pbyp move
void add(std::complex< T1 > &x)
Definition: PooledMemory.h:113
std::unique_ptr< BackflowFunctionBase > makeClone(ParticleSet &tqp) const override