QMCPACK
SOECPComponent.cpp
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) 2020 QMCPACK developers.
6 //
7 // File developed by: Raymond C. Clay, rclay@sandia.gov, Sandia National Laboratories
8 // Cody A. Melton, cmelton@sandia.gov, Sandia National Laboratories
9 //
10 // File created by: Raymond C. Clay, rclay@sandia.gov, Sandia National Laboratories
11 //////////////////////////////////////////////////////////////////////////////////////
12 
13 
14 #include "Particle/DistanceTable.h"
15 #include "SOECPComponent.h"
16 #include "Numerics/Ylm.h"
17 #include "CPU/BLAS.hpp"
18 #include "NLPPJob.h"
19 
20 namespace qmcplusplus
21 {
23  : lmax_(0), nchannel_(0), nknot_(0), sknot_(0), total_knots_(0), rmax_(-1), vp_(nullptr)
24 {}
25 
27 {
28  for (int i = 0; i < sopp_m_.size(); i++)
29  delete sopp_m_[i];
30  if (vp_)
31  delete vp_;
32 }
33 
34 void SOECPComponent::print(std::ostream& os) {}
35 
37 {
38  assert(vp_ == nullptr);
42 }
43 
45 {
46  if (vp_)
47  delete vp_;
48  vp_ = nullptr;
49 }
50 
52 {
53  angpp_m_.push_back(l);
54  sopp_m_.push_back(pp);
55 }
56 
58 {
59  SOECPComponent* myclone = new SOECPComponent(*this);
60  for (int i = 0; i < sopp_m_.size(); i++)
61  myclone->sopp_m_[i] = sopp_m_[i]->makeClone();
62  if (vp_)
63  myclone->vp_ = new VirtualParticleSet(qp, total_knots_);
64  return myclone;
65 }
66 
67 void SOECPComponent::resize_warrays(int n, int m, int s)
68 {
69  vrad_.resize(m);
70  rrotsgrid_m_.resize(n);
71  nchannel_ = sopp_m_.size();
72  nknot_ = sgridxyz_m_.size();
73  sknot_ = s;
74  if (sknot_ % 2 != 0 && sknot_ > 0)
75  throw std::runtime_error("Spin integration uses Simpson's rule. Must have even number of knots in this case");
76 
77  //Need +1 for Simpsons rule to include both end points.
78  //sknot here refers to the number of subintervals for integration
79  total_knots_ = nknot_ * (sknot_ + 1);
80  psiratio_.resize(total_knots_);
81  deltaV_.resize(total_knots_);
82  deltaS_.resize(total_knots_);
84  if (m != nchannel_)
85  {
86  APP_ABORT("SOECPComponent::resize_warrays has incorrect number of radial channels\n");
87  }
88 }
89 
90 int SOECPComponent::kroneckerDelta(int x, int y) { return (x == y) ? 1 : 0; }
91 
93 {
94  switch (dim)
95  {
96  case 0:
97  return ComplexType(std::cos(s1 + s2), 0.0);
98  case 1:
99  return ComplexType(std::sin(s1 + s2), 0.0);
100  case 2:
101  return ComplexType(0.0, std::sin(s1 - s2));
102  default:
103  APP_ABORT("SOECPComponent::sMatrixElements invalid operator dimension\n");
104  return 0;
105  }
106 }
107 
109 {
110  ComplexType val;
111  RealType onehalf = 0.5;
112  RealType zero = 0.0;
113  switch (dim)
114  {
115  case 0: //x
116  val = onehalf *
117  ComplexType(std::sqrt(l * (l + 1) - m2 * (m2 + 1)) * kroneckerDelta(m1, m2 + 1) +
118  std::sqrt(l * (l + 1) - m2 * (m2 - 1)) * kroneckerDelta(m1, m2 - 1),
119  zero);
120  return val;
121  case 1:
122  val = onehalf *
123  ComplexType(0.0,
124  std::sqrt(l * (l + 1) - m2 * (m2 - 1)) * kroneckerDelta(m1, m2 - 1) -
125  std::sqrt(l * (l + 1) - m2 * (m2 + 1)) * kroneckerDelta(m1, m2 + 1));
126  return val;
127  case 2:
128  val = ComplexType(m2 * kroneckerDelta(m1, m2), zero);
129  return val;
130  default:
131  APP_ABORT("SOECPComponent::lMatrixElements Invalid operator dimension\n");
132  return 0;
133  }
134 }
135 
137 {
138  RealType pm = plus ? RealType(1) : RealType(-1);
139  RealType mp = -1 * pm;
140 
141 
142  ComplexType lx = lmMatrixElements(l, m1, m2, 0);
143  ComplexType ly = lmMatrixElements(l, m1, m2, 1);
144  ComplexType lz = lmMatrixElements(l, m1, m2, 2);
145 
146  RealType cos2s = std::cos(2 * spin);
147  RealType sin2s = std::sin(2 * spin);
148  ComplexType phase(cos2s, mp * sin2s);
149  ComplexType eye(0, 1);
150  RealType onehalf = 0.5;
151  ComplexType val = onehalf * (pm * lz + phase * (lx + pm * eye * ly));
152  return val;
153 }
154 
156  int iat,
157  TrialWaveFunction& Psi,
158  int iel,
159  RealType r,
160  const PosType& dr)
161 {
162  RealType sold = W.spins[iel];
163  buildTotalQuadrature(r, dr, sold);
164 
165  if (vp_)
166  {
167  vp_->makeMovesWithSpin(W, iel, deltaV_, deltaS_, true, iat);
169  }
170  else
171  for (int iq = 0; iq < total_knots_; iq++)
172  {
173  W.makeMoveWithSpin(iel, deltaV_[iq], deltaS_[iq]);
174  psiratio_[iq] = Psi.calcRatio(W, iel);
175  W.rejectMove(iel);
176  Psi.resetPhaseDiff();
177  }
178 
179  return calculateProjector(r, dr, sold);
180 }
181 
183 {
184  ComplexType pairpot;
185  for (int iq = 0; iq < total_knots_; iq++)
186  {
187  RealType snew = sold + deltaS_[iq];
188  ComplexType lsum;
189  for (int il = 0; il < nchannel_; il++)
190  {
191  int l = il + 1; //nchannels starts at l=1, so 0th element is p not s
192  ComplexType msums;
193  for (int m1 = -l; m1 <= l; m1++)
194  {
195  ComplexType Y = sphericalHarmonic(l, m1, dr);
196  for (int m2 = -l; m2 <= l; m2++)
197  {
198  ComplexType ldots;
199  for (int id = 0; id < 3; id++)
200  ldots += lmMatrixElements(l, m1, m2, id) * sMatrixElements(sold, snew, id);
202  msums += Y * cY * ldots;
203  }
204  }
205  lsum += vrad_[il] * msums;
206  }
207  pairpot += psiratio_[iq] * lsum * spin_quad_weights_[iq];
208  }
209  return std::real(pairpot);
210 }
211 
213  const int iat,
214  const TrialWaveFunction& psi,
215  const int iel,
216  const RealType r,
217  const PosType& dr)
218 {
219 #ifdef QMC_COMPLEX
220  RealType sold = W.spins[iel];
221 
223  std::pair<ValueVector, ValueVector> spinor_multiplier;
224  auto& up_row = spinor_multiplier.first;
225  auto& dn_row = spinor_multiplier.second;
226  up_row.resize(nknot_);
227  dn_row.resize(nknot_);
228 
229  //buildQuadraturePointDeltaPositions
230  for (int j = 0; j < nknot_; j++)
231  deltaV_[j] = r * rrotsgrid_m_[j] - dr;
232  vp_->makeMoves(W, iel, deltaV_, true, iat);
233 
234  //calculate radial potentials
235  for (int ip = 0; ip < nchannel_; ip++)
236  vrad_[ip] = sopp_m_[ip]->splint(r);
237 
238  for (int iq = 0; iq < nknot_; iq++)
239  {
240  up_row[iq] = 0.0;
241  dn_row[iq] = 0.0;
242  for (int il = 0; il < nchannel_; il++)
243  {
244  int l = il + 1;
245  for (int m1 = -l; m1 <= l; m1++)
246  {
247  ComplexType Y = sphericalHarmonic(l, m1, dr);
248  for (int m2 = -l; m2 <= l; m2++)
249  {
251  ComplexType so_up = matrixElementDecomposed(l, m1, m2, sold, true);
252  ComplexType so_dn = matrixElementDecomposed(l, m1, m2, sold, false);
253  RealType fourpi = 4.0 * M_PI;
254  //Note: Need 4pi weight. In Normal NonLocalECP, 1/4Pi generated from transformation to legendre polynomials and gets absorbed into the
255  // quadrature integration. We don't get the 1/4Pi from legendre here, so we need to scale by 4Pi.
256  up_row[iq] += fourpi * vrad_[il] * Y * cY * so_up;
257  dn_row[iq] += fourpi * vrad_[il] * Y * cY * so_dn;
258  }
259  }
260  }
261  }
262 
263  psi.evaluateSpinorRatios(*vp_, spinor_multiplier, psiratio_);
264  ComplexType pairpot;
265  for (size_t iq = 0; iq < nknot_; iq++)
266  pairpot += psiratio_[iq] * sgridweight_m_[iq];
267  return std::real(pairpot);
268 #else
269  throw std::runtime_error("SOECPComponent::evaluateOneBodyOpMatrixContribution only implemented in complex build");
270 #endif
271 }
272 
274  const RefVectorWithLeader<ParticleSet>& p_list,
276  const RefVector<const NLPPJob<RealType>>& joblist,
277  std::vector<RealType>& pairpots,
278  ResourceCollection& collection)
279 {
280  auto& soecp_component_leader = soecp_component_list.getLeader();
281  if (soecp_component_leader.vp_)
282  {
283  // Compute ratios with VP
284  RefVectorWithLeader<VirtualParticleSet> vp_list(*soecp_component_leader.vp_);
285  RefVectorWithLeader<const VirtualParticleSet> const_vp_list(*soecp_component_leader.vp_);
288  RefVector<std::vector<ValueType>> psiratios_list;
289  vp_list.reserve(soecp_component_list.size());
290  const_vp_list.reserve(soecp_component_list.size());
291  deltaV_list.reserve(soecp_component_list.size());
292  deltaS_list.reserve(soecp_component_list.size());
293  psiratios_list.reserve(soecp_component_list.size());
294 
295  for (size_t i = 0; i < soecp_component_list.size(); i++)
296  {
297  SOECPComponent& component(soecp_component_list[i]);
298  const NLPPJob<RealType>& job = joblist[i];
299  const RealType sold = p_list[i].spins[job.electron_id];
300 
301  component.buildTotalQuadrature(job.ion_elec_dist, job.ion_elec_displ, sold);
302 
303  vp_list.push_back(*component.vp_);
304  const_vp_list.push_back(*component.vp_);
305  deltaV_list.push_back(component.deltaV_);
306  deltaS_list.push_back(component.deltaS_);
307  psiratios_list.push_back(component.psiratio_);
308  }
309 
310  ResourceCollectionTeamLock<VirtualParticleSet> vp_res_lock(collection, vp_list);
311 
312  VirtualParticleSet::mw_makeMovesWithSpin(vp_list, p_list, deltaV_list, deltaS_list, joblist, true);
313 
314  TrialWaveFunction::mw_evaluateRatios(psi_list, const_vp_list, psiratios_list);
315  }
316  else
317  {
318  // Compute ratios without VP. Slow
319  for (size_t i = 0; i < p_list.size(); i++)
320  {
321  SOECPComponent& component(soecp_component_list[i]);
322  ParticleSet& W(p_list[i]);
323  TrialWaveFunction& psi(psi_list[i]);
324  const NLPPJob<RealType>& job = joblist[i];
325 
326  const RealType sold = W.spins[job.electron_id];
327  component.buildTotalQuadrature(job.ion_elec_dist, job.ion_elec_displ, sold);
328 
329  for (int j = 0; j < component.total_knots_; j++)
330  {
331  W.makeMoveWithSpin(job.electron_id, component.deltaV_[j], component.deltaS_[j]);
332  component.psiratio_[j] = psi.calcRatio(W, job.electron_id);
333  W.rejectMove(job.electron_id);
334  psi.resetPhaseDiff();
335  }
336  }
337  }
338 
339  for (size_t i = 0; i < p_list.size(); i++)
340  {
341  SOECPComponent& component(soecp_component_list[i]);
342  const NLPPJob<RealType>& job = joblist[i];
343  const RealType sold = p_list[i].spins[job.electron_id];
344  pairpots[i] = component.calculateProjector(job.ion_elec_dist, job.ion_elec_displ, sold);
345  }
346 }
347 
349  int iat,
350  TrialWaveFunction& Psi,
351  int iel,
352  RealType r,
353  const PosType& dr,
354  const opt_variables_type& optvars,
355  const Vector<ValueType>& dlogpsi,
356  Vector<ValueType>& dhpsioverpsi)
357 {
358 #ifndef QMC_COMPLEX
359  throw std::runtime_error("SOECPComponent::evaluateValueAndDerivatives should not be called in real build\n");
360 #else
361 
362  const size_t num_vars = optvars.num_active_vars;
363  dratio_.resize(total_knots_, num_vars);
364  dlogpsi_vp_.resize(dlogpsi.size());
365  wvec_.resize(total_knots_);
366 
367  RealType sold = W.spins[iel];
368  buildTotalQuadrature(r, dr, sold);
369 
370  //Now we have all the spin and spatial quadrature points acculated to use in evaluation
371  //Now we need to obtain dlogpsi and dlogpsi_vp
372  if (vp_)
373  {
374  // Compute ratios with VP
375  vp_->makeMovesWithSpin(W, iel, deltaV_, deltaS_, true, iat);
376  Psi.evaluateDerivRatios(*vp_, optvars, psiratio_, dratio_);
377  }
378  else
379  for (int iq = 0; iq < total_knots_; iq++)
380  {
381  PosType posold = W.R[iel];
382  W.makeMoveWithSpin(iel, deltaV_[iq], deltaS_[iq]);
383  psiratio_[iq] = Psi.calcRatio(W, iel);
384  Psi.acceptMove(W, iel);
385  W.acceptMove(iel);
386 
387  std::fill(dlogpsi_vp_.begin(), dlogpsi_vp_.end(), 0.0);
388  Psi.evaluateDerivativesWF(W, optvars, dlogpsi_vp_);
389  for (int v = 0; v < dlogpsi_vp_.size(); ++v)
390  dratio_(iq, v) = dlogpsi_vp_[v] - dlogpsi[v];
391 
392  W.makeMoveWithSpin(iel, -deltaV_[iq], -deltaS_[iq]);
393  Psi.calcRatio(W, iel);
394  Psi.acceptMove(W, iel);
395  W.acceptMove(iel);
396  }
397 
398  ComplexType pairpot;
399  for (int iq = 0; iq < total_knots_; iq++)
400  {
401  ComplexType lsum;
402  for (int il = 0; il < nchannel_; il++)
403  {
404  int l = il + 1;
405  ComplexType msums;
406  for (int m1 = -l; m1 <= l; m1++)
407  {
408  ComplexType Y = sphericalHarmonic(l, m1, dr);
409  for (int m2 = -l; m2 <= l; m2++)
410  {
411  ComplexType ldots;
412  for (int id = 0; id < 3; id++)
413  ldots += lmMatrixElements(l, m1, m2, id) * sMatrixElements(W.spins[iel], W.spins[iel] + deltaS_[iq], id);
415  msums += Y * cY * ldots;
416  }
417  }
418  lsum += sopp_m_[il]->splint(r) * msums;
419  }
420  wvec_[iq] = lsum * psiratio_[iq] * spin_quad_weights_[iq];
421  pairpot += wvec_[iq];
422  }
423 
424  BLAS::gemv('N', num_vars, total_knots_, 1.0, dratio_.data(), num_vars, wvec_.data(), 1, 1.0, dhpsioverpsi.data(), 1);
425 
426  return std::real(pairpot);
427 #endif
428 }
429 
430 void SOECPComponent::buildTotalQuadrature(const RealType r, const PosType& dr, const RealType sold)
431 {
432  int count = 0;
433  RealType smin(0.0);
434  RealType smax(TWOPI);
435  RealType dS = (smax - smin) / sknot_; //step size for spin
436 
437 
438  //for a given spin point in the Simpsons integration, this will copy the spatial quadrature points into
439  //the global quadrature arrays which includes spin and spatial quadrature.
440  //Sets deltaS_, deltaV_, and spin_quad_weights_ accordingly.
441  auto addSpatialQuadrature = [&](const int is, const RealType r, const PosType& dr, const RealType ds,
442  const RealType spin_weight) {
443  for (int iq = 0; iq < nknot_; iq++)
444  {
445  int offset = is * nknot_ + iq;
446  deltaV_[offset] = r * rrotsgrid_m_[iq] - dr;
447  deltaS_[offset] = ds;
448  //spin integral norm is 1/(2.0 * pi), spatial integral has 4.0 * pi, so overall weight is 2
449  spin_quad_weights_[offset] = 2.0 * spin_weight * sgridweight_m_[iq];
450  count++;
451  }
452  };
453 
454  //simpsons 1/3 rule for spin integral
455 
456  //odd points
457  for (int is = 1; is <= sknot_ - 1; is += 2)
458  {
459  RealType snew = smin + is * dS;
460  addSpatialQuadrature(is, r, dr, snew - sold, RealType(4. / 3.) * dS);
461  }
462 
463  //even points
464  for (int is = 2; is <= sknot_ - 2; is += 2)
465  {
466  RealType snew = smin + is * dS;
467  addSpatialQuadrature(is, r, dr, snew - sold, RealType(2. / 3.) * dS);
468  }
469 
470  //end points
471  addSpatialQuadrature(0, r, dr, smin - sold, RealType(1. / 3.) * dS);
472  addSpatialQuadrature(sknot_, r, dr, smax - sold, RealType(1. / 3.) * dS);
473 
474  assert(count == total_knots_);
475 
476  //also set the radial function
477  for (int ip = 0; ip < nchannel_; ip++)
478  vrad_[ip] = sopp_m_[ip]->splint(r);
479 }
480 
482 {
483  for (int i = 0; i < sgridxyz_m_.size(); i++)
484  rrotsgrid_m_[i] = dot(rmat, sgridxyz_m_[i]);
485 }
486 
487 } // namespace qmcplusplus
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Definition: OhmmsVector.h:166
int nchannel_
the number of non-local channels
void evaluateSpinorRatios(const VirtualParticleSet &VP, const std::pair< ValueVector, ValueVector > &spinor_multiplier, std::vector< ValueType > &ratios) const
Used by SOECPComponent to do faster SOC evaluation.
ValueType calcRatio(ParticleSet &P, int iat, ComputeType ct=ComputeType::ALL)
compute psi(R_new) / psi(R_current) ratio It returns a complex value if the wavefunction is complex...
void pause()
Pause the summary and log streams.
QMCTraits::RealType real
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
ParticleScalar spins
internal spin variables for dynamical spin calculations
Definition: ParticleSet.h:81
QTBase::RealType RealType
Definition: Configuration.h:58
RealType evaluateOneExactSpinIntegration(ParticleSet &W, const int iat, const TrialWaveFunction &psi, const int iel, const RealType r, const PosType &dr)
void rotateQuadratureGrid(const TensorType &rmat)
void acceptMove(ParticleSet &P, int iat, bool safe_to_delay=false)
update the state with the new data
Vector< ValueType > dlogpsi_vp_
aligned_vector< int > angpp_m_
Angular momentum map.
MakeReturn< UnaryNode< FnSin, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sin(const Vector< T1, C1 > &l)
void evaluateDerivativesWF(ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi)
void makeMovesWithSpin(const ParticleSet &refp, int jel, const std::vector< PosType > &deltaV, const std::vector< RealType > &deltaS, bool sphere=false, int iat=-1)
move virtual particles to new postions and update distance tables
A ParticleSet that handles virtual moves of a selected particle of a given physical ParticleSet Virtu...
void makeMoves(const ParticleSet &refp, int jel, const std::vector< PosType > &deltaV, bool sphere=false, int iat=-1)
move virtual particles to new postions and update distance tables
std::vector< ValueType > vrad_
void resize_warrays(int n, int m, int s)
VirtualParticleSet * vp_
QTBase::ComplexType ComplexType
Definition: Configuration.h:59
void buildTotalQuadrature(const RealType r, const PosType &dr, const RealType sold)
class SOECPComponent brief Computes the nonlocal spin-orbit interaction .
void resize(size_type n, size_type m)
Resize the container.
Definition: OhmmsMatrix.h:99
OrbitalSetTraits< ValueType >::ValueVector ValueVector
static ComplexType sMatrixElements(RealType s1, RealType s2, int dim)
OutputManagerClass outputManager(Verbosity::HIGH)
static ComplexType matrixElementDecomposed(int l, int m1, int m2, RealType spin, bool plus=true)
static void gemv(int n, int m, const double *restrict amat, const double *restrict x, double *restrict y)
Definition: BLAS.hpp:118
void resume()
Resume the summary and log streams.
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
std::vector< PosType > deltaV_
size_type size() const
return the current size
Definition: OhmmsVector.h:162
MakeReturn< UnaryNode< FnCos, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t cos(const Vector< T1, C1 > &l)
static ComplexType lmMatrixElements(int l, int m1, int m2, int dim)
RealType calculateProjector(RealType r, const PosType &dr, RealType sold)
std::vector< ValueType > psiratio_
void rejectMove(Index_t iat)
reject a proposed move in regular mode
OrbitalSetTraits< ValueType >::ValueVector ValueVector
Definition: SPOSet.h:49
class to handle a set of variables that can be modified during optimizations
Definition: VariableSet.h:49
void makeMoveWithSpin(Index_t iat, const SingleParticlePos &displ, const Scalar_t &sdispl)
makeMove, but now includes an update to the spin variable
ParticlePos R
Position.
Definition: ParticleSet.h:79
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27
RealType evaluateValueAndDerivatives(ParticleSet &P, int iat, TrialWaveFunction &psi, int iel, RealType r, const PosType &dr, const opt_variables_type &optvars, const Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi)
void initVirtualParticle(const ParticleSet &qp)
void print(std::ostream &os)
const RealType ion_elec_dist
Definition: NLPPJob.h:32
std::vector< RadialPotentialType * > sopp_m_
Non-Local part of the pseudo-potential.
float conj(const float &c)
Workaround to allow conj on scalar to return real instead of complex.
std::vector< ValueType > wvec_
static void mw_makeMovesWithSpin(const RefVectorWithLeader< VirtualParticleSet > &vp_list, const RefVectorWithLeader< ParticleSet > &p_list, const RefVector< const std::vector< PosType >> &deltaV_list, const RefVector< const std::vector< RealType >> &deltaS_list, const RefVector< const NLPPJob< RealType >> &joblist, bool sphere)
std::vector< std::reference_wrapper< T > > RefVector
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
void add(int l, RadialPotentialType *pp)
add a new Spin-Orbit component
Class to represent a many-body trial wave function.
const int electron_id
Definition: NLPPJob.h:31
std::vector< RealType > sgridweight_m_
handles acquire/release resource by the consumer (RefVectorWithLeader type).
RealType evaluateOne(ParticleSet &W, int iat, TrialWaveFunction &Psi, int iel, RealType r, const PosType &dr)
Evaluate the spin orbit pp contribution to total energy from ion "iat" and electron "iel"...
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
meta data for NLPP calculation of a pair of ion and electron This is not just meta data...
static int kroneckerDelta(int x, int y)
void evaluateDerivRatios(const VirtualParticleSet &VP, const opt_variables_type &optvars, std::vector< ValueType > &ratios, Matrix< ValueType > &dratio)
compute both ratios and deriatives of ratio with respect to the optimizables
SOECPComponent * makeClone(const ParticleSet &qp)
std::complex< T > sphericalHarmonic(const int l, const int m, const TinyVector< T, 3 > &r)
wrapper for Ylm, which can take any normal position vector as an argument param[in] l angular momentu...
Definition: Ylm.h:141
const PosType ion_elec_displ
Definition: NLPPJob.h:33
void acceptMove(Index_t iat)
accept the move and update the particle attribute by the proposed move in regular mode ...
std::vector< RealType > deltaS_
static void mw_evaluateRatios(const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< const VirtualParticleSet > &Vp_list, const RefVector< std::vector< ValueType >> &ratios_list, ComputeType ct=ComputeType::ALL)
batched version of evaluateRatios Note: unlike other mw_ static functions, *this is the batch leader ...
Matrix< ValueType > dratio_
void evaluateRatios(const VirtualParticleSet &VP, std::vector< ValueType > &ratios, ComputeType ct=ComputeType::ALL)
compulte multiple ratios to handle non-local moves and other virtual moves
std::vector< RealType > spin_quad_weights_
int num_active_vars
number of active variables
Definition: VariableSet.h:60
static void mw_evaluateOne(const RefVectorWithLeader< SOECPComponent > &soecp_component_list, const RefVectorWithLeader< ParticleSet > &p_list, const RefVectorWithLeader< TrialWaveFunction > &psi_list, const RefVector< const NLPPJob< RealType >> &joblist, std::vector< RealType > &pairpots, ResourceCollection &collection)