QMCPACK
SPOSet Class Referenceabstract

base class for Single-particle orbital sets More...

+ Inheritance diagram for SPOSet:
+ Collaboration diagram for SPOSet:

Public Types

using ValueVector = OrbitalSetTraits< ValueType >::ValueVector
 
using ValueMatrix = OrbitalSetTraits< ValueType >::ValueMatrix
 
using GradVector = OrbitalSetTraits< ValueType >::GradVector
 
using GradMatrix = OrbitalSetTraits< ValueType >::GradMatrix
 
using HessVector = OrbitalSetTraits< ValueType >::HessVector
 
using HessMatrix = OrbitalSetTraits< ValueType >::HessMatrix
 
using GGGVector = OrbitalSetTraits< ValueType >::GradHessVector
 
using GGGMatrix = OrbitalSetTraits< ValueType >::GradHessMatrix
 
using SPOMap = std::map< std::string, const std::unique_ptr< const SPOSet > >
 
using OffloadMWVGLArray = Array< ValueType, 3, OffloadPinnedAllocator< ValueType > >
 
using OffloadMWVArray = Array< ValueType, 2, OffloadPinnedAllocator< ValueType > >
 
template<typename DT >
using OffloadMatrix = Matrix< DT, OffloadPinnedAllocator< DT > >
 
- Public Types inherited from QMCTraits
enum  { DIM = OHMMS_DIM, DIM_VGL = OHMMS_DIM + 2 }
 
using QTBase = QMCTypes< OHMMS_PRECISION, DIM >
 
using QTFull = QMCTypes< OHMMS_PRECISION_FULL, DIM >
 
using RealType = QTBase::RealType
 
using ComplexType = QTBase::ComplexType
 
using ValueType = QTBase::ValueType
 
using PosType = QTBase::PosType
 
using GradType = QTBase::GradType
 
using TensorType = QTBase::TensorType
 
using IndexType = OHMMS_INDEXTYPE
 define other types More...
 
using FullPrecRealType = QTFull::RealType
 
using FullPrecValueType = QTFull::ValueType
 
using PropertySetType = RecordNamedProperty< FullPrecRealType >
 define PropertyList_t More...
 
using PtclGrpIndexes = std::vector< std::pair< int, int > >
 

Public Member Functions

 SPOSet (const std::string &my_name)
 constructor More...
 
virtual ~SPOSet ()=default
 destructor More...
 
int size () const
 return the size of the orbital set Ye: this needs to be replaced by getOrbitalSetSize(); More...
 
void basic_report (const std::string &pad="") const
 print basic SPOSet information More...
 
virtual void report (const std::string &pad="") const
 print SPOSet information More...
 
int getOrbitalSetSize () const
 return the size of the orbitals More...
 
virtual bool isOptimizable () const
 Query if this SPOSet is optimizable. More...
 
virtual void extractOptimizableObjectRefs (UniqueOptObjRefs &opt_obj_refs)
 extract underlying OptimizableObject references More...
 
virtual void checkOutVariables (const opt_variables_type &active)
 check out variational optimizable variables More...
 
virtual bool isOMPoffload () const
 Query if this SPOSet uses OpenMP offload. More...
 
virtual bool hasIonDerivs () const
 Query if this SPOSet has an explicit ion dependence. More...
 
virtual void checkObject () const
 check a few key parameters before putting the SPO into a determinant More...
 
virtual bool isRotationSupported () const
 return true if this SPOSet can be wrappered by RotatedSPO More...
 
virtual void storeParamsBeforeRotation ()
 store parameters before getting destroyed by rotation. More...
 
virtual void applyRotation (const ValueMatrix &rot_mat, bool use_stored_copy=false)
 apply rotation to all the orbitals More...
 
virtual void evaluateDerivatives (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi, const int &FirstIndex, const int &LastIndex)
 Parameter derivatives of the wavefunction and the Laplacian of the wavefunction. More...
 
virtual void evaluateDerivativesWF (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, int FirstIndex, int LastIndex)
 Parameter derivatives of the wavefunction. More...
 
virtual void evaluateDerivatives (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi, const ValueType &psiCurrent, const std::vector< ValueType > &Coeff, const std::vector< size_t > &C2node_up, const std::vector< size_t > &C2node_dn, const ValueVector &detValues_up, const ValueVector &detValues_dn, const GradMatrix &grads_up, const GradMatrix &grads_dn, const ValueMatrix &lapls_up, const ValueMatrix &lapls_dn, const ValueMatrix &M_up, const ValueMatrix &M_dn, const ValueMatrix &Minv_up, const ValueMatrix &Minv_dn, const GradMatrix &B_grad, const ValueMatrix &B_lapl, const std::vector< int > &detData_up, const size_t N1, const size_t N2, const size_t NP1, const size_t NP2, const std::vector< std::vector< int >> &lookup_tbl)
 Evaluate the derivative of the optimized orbitals with respect to the parameters this is used only for MSD, to be refined for better serving both single and multi SD. More...
 
virtual void evaluateDerivativesWF (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, const QTFull::ValueType &psiCurrent, const std::vector< ValueType > &Coeff, const std::vector< size_t > &C2node_up, const std::vector< size_t > &C2node_dn, const ValueVector &detValues_up, const ValueVector &detValues_dn, const ValueMatrix &M_up, const ValueMatrix &M_dn, const ValueMatrix &Minv_up, const ValueMatrix &Minv_dn, const std::vector< int > &detData_up, const std::vector< std::vector< int >> &lookup_tbl)
 Evaluate the derivative of the optimized orbitals with respect to the parameters this is used only for MSD, to be refined for better serving both single and multi SD. More...
 
virtual void setOrbitalSetSize (int norbs)=0
 set the OrbitalSetSize More...
 
virtual void evaluateValue (const ParticleSet &P, int iat, ValueVector &psi)=0
 evaluate the values of this single-particle orbital set More...
 
virtual void evaluateDetRatios (const VirtualParticleSet &VP, ValueVector &psi, const ValueVector &psiinv, std::vector< ValueType > &ratios)
 evaluate determinant ratios for virtual moves, e.g., sphere move for nonlocalPP More...
 
virtual void evaluateDetSpinorRatios (const VirtualParticleSet &VP, ValueVector &psi, const std::pair< ValueVector, ValueVector > &spinor_multiplier, const ValueVector &invrow, std::vector< ValueType > &ratios)
 evaluate determinant ratios for virtual moves, specifically for Spinor SPOSets More...
 
virtual void evaluateDerivRatios (const VirtualParticleSet &VP, const opt_variables_type &optvars, ValueVector &psi, const ValueVector &psiinv, std::vector< ValueType > &ratios, Matrix< ValueType > &dratios, int FirstIndex, int LastIndex)
 Determinant ratios and parameter derivatives of the wavefunction for virtual moves. More...
 
virtual void mw_evaluateDetRatios (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< const VirtualParticleSet > &vp_list, const RefVector< ValueVector > &psi_list, const std::vector< const ValueType *> &invRow_ptr_list, std::vector< std::vector< ValueType >> &ratios_list) const
 evaluate determinant ratios for virtual moves, e.g., sphere move for nonlocalPP, of multiple walkers More...
 
virtual void evaluateVGL (const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi)=0
 evaluate the values, gradients and laplacians of this single-particle orbital set More...
 
virtual void evaluateVGL_spin (const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi, ValueVector &dspin)
 evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital set More...
 
virtual void mw_evaluateValue (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list) const
 evaluate the values this single-particle orbital sets of multiple walkers More...
 
virtual void mw_evaluateVGL (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list, const RefVector< GradVector > &dpsi_v_list, const RefVector< ValueVector > &d2psi_v_list) const
 evaluate the values, gradients and laplacians of this single-particle orbital sets of multiple walkers More...
 
virtual void mw_evaluateVGLWithSpin (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list, const RefVector< GradVector > &dpsi_v_list, const RefVector< ValueVector > &d2psi_v_list, OffloadMatrix< ComplexType > &mw_dspin) const
 evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital sets of multiple walkers More...
 
virtual void mw_evaluateVGLandDetRatioGrads (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const std::vector< const ValueType *> &invRow_ptr_list, OffloadMWVGLArray &phi_vgl_v, std::vector< ValueType > &ratios, std::vector< GradType > &grads) const
 evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ratio and grads of multiple walkers. More...
 
virtual void mw_evaluateVGLandDetRatioGradsWithSpin (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const std::vector< const ValueType *> &invRow_ptr_list, OffloadMWVGLArray &phi_vgl_v, std::vector< ValueType > &ratios, std::vector< GradType > &grads, std::vector< ValueType > &spingrads) const
 evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ratio and grads of multiple walkers. More...
 
virtual void evaluateVGH (const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, HessVector &grad_grad_psi)
 evaluate the values, gradients and hessians of this single-particle orbital set More...
 
virtual void evaluateVGHGH (const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, HessVector &grad_grad_psi, GGGVector &grad_grad_grad_psi)
 evaluate the values, gradients, hessians, and grad hessians of this single-particle orbital set More...
 
virtual void evaluate_spin (const ParticleSet &P, int iat, ValueVector &psi, ValueVector &dpsi)
 evaluate the values of this single-particle orbital set More...
 
virtual void evaluateThirdDeriv (const ParticleSet &P, int first, int last, GGGMatrix &grad_grad_grad_logdet)
 evaluate the third derivatives of this single-particle orbital set More...
 
virtual void evaluate_notranspose (const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, ValueMatrix &d2logdet)=0
 evaluate the values, gradients and laplacians of this single-particle orbital for [first,last) particles More...
 
virtual void evaluate_notranspose_spin (const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, ValueMatrix &d2logdet, ValueMatrix &dspinlogdet)
 evaluate the values, gradients and laplacians of this single-particle orbital for [first,last) particles, including the spin gradient More...
 
virtual void mw_evaluate_notranspose (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int first, int last, const RefVector< ValueMatrix > &logdet_list, const RefVector< GradMatrix > &dlogdet_list, const RefVector< ValueMatrix > &d2logdet_list) const
 
virtual void evaluate_notranspose (const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, HessMatrix &grad_grad_logdet)
 evaluate the values, gradients and hessians of this single-particle orbital for [first,last) particles More...
 
virtual void evaluate_notranspose (const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, HessMatrix &grad_grad_logdet, GGGMatrix &grad_grad_grad_logdet)
 evaluate the values, gradients, hessians and third derivatives of this single-particle orbital for [first,last) particles More...
 
virtual void evaluateGradSource (const ParticleSet &P, int first, int last, const ParticleSet &source, int iat_src, GradMatrix &gradphi)
 evaluate the gradients of this single-particle orbital for [first,last) target particles with respect to the given source particle More...
 
virtual void evaluateGradSource (const ParticleSet &P, int first, int last, const ParticleSet &source, int iat_src, GradMatrix &grad_phi, HessMatrix &grad_grad_phi, GradMatrix &grad_lapl_phi)
 evaluate the gradients of values, gradients, laplacians of this single-particle orbital for [first,last) target particles with respect to the given source particle More...
 
virtual void evaluateGradSourceRow (const ParticleSet &P, int iel, const ParticleSet &source, int iat_src, GradVector &gradphi)
 Returns a row of d/dR_iat phi_j(r) evaluated at position r. More...
 
virtual PosType get_k (int orb)
 access the k point related to the given orbital More...
 
virtual void createResource (ResourceCollection &collection) const
 initialize a shared resource and hand it to collection More...
 
virtual void acquireResource (ResourceCollection &collection, const RefVectorWithLeader< SPOSet > &spo_list) const
 acquire a shared resource from collection More...
 
virtual void releaseResource (ResourceCollection &collection, const RefVectorWithLeader< SPOSet > &spo_list) const
 return a shared resource to collection More...
 
virtual std::unique_ptr< SPOSetmakeClone () const
 make a clone of itself every derived class must implement this to have threading working correctly. More...
 
virtual bool transformSPOSet ()
 Used only by cusp correction in AOS LCAO. More...
 
virtual void finalizeConstruction ()
 finalize the construction of SPOSet More...
 
const std::string & getName () const
 return object name More...
 
virtual std::string getClassName () const =0
 return class name More...
 

Protected Attributes

const std::string my_name_
 name of the object, unique identifier More...
 
IndexType OrbitalSetSize
 number of Single-particle orbitals More...
 
opt_variables_type myVars
 Optimizable variables. More...
 

Friends

opt_variables_typetesting::getMyVars (SPOSet &spo)
 

Detailed Description

base class for Single-particle orbital sets

SPOSet stands for S(ingle)P(article)O(rbital)Set which contains a number of single-particle orbitals with capabilities of evaluating $ \psi_j({\bf r}_i)$

Definition at line 46 of file SPOSet.h.

Member Typedef Documentation

◆ GGGMatrix

using GGGMatrix = OrbitalSetTraits<ValueType>::GradHessMatrix

Definition at line 56 of file SPOSet.h.

◆ GGGVector

using GGGVector = OrbitalSetTraits<ValueType>::GradHessVector

Definition at line 55 of file SPOSet.h.

◆ GradMatrix

Definition at line 52 of file SPOSet.h.

◆ GradVector

Definition at line 51 of file SPOSet.h.

◆ HessMatrix

Definition at line 54 of file SPOSet.h.

◆ HessVector

Definition at line 53 of file SPOSet.h.

◆ OffloadMatrix

Definition at line 61 of file SPOSet.h.

◆ OffloadMWVArray

Definition at line 59 of file SPOSet.h.

◆ OffloadMWVGLArray

Definition at line 58 of file SPOSet.h.

◆ SPOMap

using SPOMap = std::map<std::string, const std::unique_ptr<const SPOSet> >

Definition at line 57 of file SPOSet.h.

◆ ValueMatrix

Definition at line 50 of file SPOSet.h.

◆ ValueVector

Definition at line 49 of file SPOSet.h.

Constructor & Destructor Documentation

◆ SPOSet()

SPOSet ( const std::string &  my_name)

constructor

Definition at line 29 of file SPOSet.cpp.

29 : my_name_(my_name), OrbitalSetSize(0) {}
const std::string my_name_
name of the object, unique identifier
Definition: SPOSet.h:564
IndexType OrbitalSetSize
number of Single-particle orbitals
Definition: SPOSet.h:566

◆ ~SPOSet()

virtual ~SPOSet ( )
virtualdefault

destructor

Derived class destructor needs to pay extra attention to freeing memory shared among clones of SPOSet.

Member Function Documentation

◆ acquireResource()

virtual void acquireResource ( ResourceCollection collection,
const RefVectorWithLeader< SPOSet > &  spo_list 
) const
inlinevirtual

acquire a shared resource from collection

Reimplemented in RotatedSPOs, LCAOrbitalSet, SpinorSet, SplineC2ROMPTarget< ST >, and SplineC2COMPTarget< ST >.

Definition at line 532 of file SPOSet.h.

532 {}

◆ applyRotation()

void applyRotation ( const ValueMatrix rot_mat,
bool  use_stored_copy = false 
)
virtual

apply rotation to all the orbitals

Reimplemented in SplineC2C< ST >, SplineR2R< ST >, LCAOrbitalSet, and SpinorSet.

Definition at line 255 of file SPOSet.cpp.

References SPOSet::getClassName(), and SPOSet::isRotationSupported().

256 {
257  if (isRotationSupported())
258  throw std::logic_error("Bug!! " + getClassName() +
259  "::applyRotation "
260  "must be overloaded when the SPOSet supports rotation.");
261 }
virtual std::string getClassName() const =0
return class name
virtual bool isRotationSupported() const
return true if this SPOSet can be wrappered by RotatedSPO
Definition: SPOSet.h:114

◆ basic_report()

void basic_report ( const std::string &  pad = "") const

print basic SPOSet information

Definition at line 230 of file SPOSet.cpp.

References qmcplusplus::app_log(), and SPOSet::size().

Referenced by SPOSet::report().

231 {
232  app_log() << pad << "size = " << size() << std::endl;
233  app_log() << pad << "state info:" << std::endl;
234  //states.report(pad+" ");
235  app_log().flush();
236 }
std::ostream & app_log()
Definition: OutputManager.h:65
int size() const
return the size of the orbital set Ye: this needs to be replaced by getOrbitalSetSize(); ...
Definition: SPOSet.h:75

◆ checkObject()

virtual void checkObject ( ) const
inlinevirtual

check a few key parameters before putting the SPO into a determinant

Reimplemented in RotatedSPOs, and LCAOrbitalSet.

Definition at line 111 of file SPOSet.h.

111 {}

◆ checkOutVariables()

void checkOutVariables ( const opt_variables_type active)
virtual

check out variational optimizable variables

Parameters
activea super set of optimizable variables

Reimplemented in RotatedSPOs, and ConstantSPOSet.

Definition at line 39 of file SPOSet.cpp.

References SPOSet::getClassName(), and SPOSet::isOptimizable().

40 {
41  if (isOptimizable())
42  throw std::logic_error("Bug!! " + getClassName() +
43  "::checkOutVariables "
44  "must be overloaded when the SPOSet is optimizable.");
45 }
virtual std::string getClassName() const =0
return class name
virtual bool isOptimizable() const
Query if this SPOSet is optimizable.
Definition: SPOSet.h:91

◆ createResource()

virtual void createResource ( ResourceCollection collection) const
inlinevirtual

initialize a shared resource and hand it to collection

Reimplemented in RotatedSPOs, LCAOrbitalSet, SpinorSet, SplineC2ROMPTarget< ST >, and SplineC2COMPTarget< ST >.

Definition at line 528 of file SPOSet.h.

528 {}

◆ evaluate_notranspose() [1/3]

virtual void evaluate_notranspose ( const ParticleSet P,
int  first,
int  last,
ValueMatrix logdet,
GradMatrix dlogdet,
ValueMatrix d2logdet 
)
pure virtual

evaluate the values, gradients and laplacians of this single-particle orbital for [first,last) particles

Parameters
[in]Pcurrent ParticleSet
[in]firststarting index of the particles
[in]lastending index of the particles
[out]logdetdeterminant matrix to be inverted
[out]dlogdetgradients
[out]d2logdetlaplacians

Implemented in DummySPOSetWithoutMW, RotatedSPOs, SplineC2ROMPTarget< ST >, SplineC2COMPTarget< ST >, LCAOrbitalSet, SpinorSet, BsplineSet, PWRealOrbitalSet, PWOrbitalSet, SHOSet, CompositeSPOSet, ConstantSPOSet, LCAOrbitalSetWithCorrection, FakeSPO, and FreeOrbital.

Referenced by SPOSet::mw_evaluate_notranspose().

◆ evaluate_notranspose() [2/3]

void evaluate_notranspose ( const ParticleSet P,
int  first,
int  last,
ValueMatrix logdet,
GradMatrix dlogdet,
HessMatrix grad_grad_logdet 
)
virtual

evaluate the values, gradients and hessians of this single-particle orbital for [first,last) particles

Parameters
Pcurrent ParticleSet
firststarting index of the particles
lastending index of the particles
logdetdeterminant matrix to be inverted
dlogdetgradients
grad_grad_logdethessians

Reimplemented in RotatedSPOs, BsplineSet, LCAOrbitalSet, SHOSet, PWRealOrbitalSet, CompositeSPOSet, and FreeOrbital.

Definition at line 203 of file SPOSet.cpp.

209 {
210  throw std::runtime_error("Need specialization of SPOSet::evaluate_notranspose() for grad_grad_logdet. \n");
211 }

◆ evaluate_notranspose() [3/3]

void evaluate_notranspose ( const ParticleSet P,
int  first,
int  last,
ValueMatrix logdet,
GradMatrix dlogdet,
HessMatrix grad_grad_logdet,
GGGMatrix grad_grad_grad_logdet 
)
virtual

evaluate the values, gradients, hessians and third derivatives of this single-particle orbital for [first,last) particles

Parameters
Pcurrent ParticleSet
firststarting index of the particles
lastending index of the particles
logdetdeterminant matrix to be inverted
dlogdetgradients
grad_grad_logdethessians
grad_grad_grad_logdetthird derivatives

Reimplemented in RotatedSPOs, BsplineSet, LCAOrbitalSet, SHOSet, CompositeSPOSet, and FreeOrbital.

Definition at line 213 of file SPOSet.cpp.

220 {
221  throw std::runtime_error("Need specialization of SPOSet::evaluate_notranspose() for grad_grad_grad_logdet. \n");
222 }

◆ evaluate_notranspose_spin()

void evaluate_notranspose_spin ( const ParticleSet P,
int  first,
int  last,
ValueMatrix logdet,
GradMatrix dlogdet,
ValueMatrix d2logdet,
ValueMatrix dspinlogdet 
)
virtual

evaluate the values, gradients and laplacians of this single-particle orbital for [first,last) particles, including the spin gradient

Parameters
Pcurrent ParticleSet
firststarting index of the particles
lastending index of the particles
logdetdeterminant matrix to be inverted
dlogdetgradients
d2logdetlaplacians
dspinlogdet,spingradients

default implementation will abort for all SPOSets except SpinorSet

Reimplemented in SpinorSet.

Definition at line 178 of file SPOSet.cpp.

References SPOSet::getClassName().

185 {
186  throw std::runtime_error("Need specialization of " + getClassName() +
187  "::evaluate_notranspose_spin(P,iat,psi,dpsi,d2logdet, dspin_logdet) (vector quantities)\n");
188 }
virtual std::string getClassName() const =0
return class name

◆ evaluate_spin()

void evaluate_spin ( const ParticleSet P,
int  iat,
ValueVector psi,
ValueVector dpsi 
)
virtual

evaluate the values of this single-particle orbital set

Parameters
Pcurrent ParticleSet
iatactive particle
psivalues of the SPO

Reimplemented in RotatedSPOs, and SpinorSet.

Definition at line 409 of file SPOSet.cpp.

References SPOSet::getClassName().

410 {
411  throw std::runtime_error("Need specialization of " + getClassName() +
412  "::evaluate_spin(P,iat,psi,dpsi) (vector quantities)\n");
413 }
virtual std::string getClassName() const =0
return class name

◆ evaluateDerivatives() [1/2]

void evaluateDerivatives ( ParticleSet P,
const opt_variables_type optvars,
Vector< ValueType > &  dlogpsi,
Vector< ValueType > &  dhpsioverpsi,
const int &  FirstIndex,
const int &  LastIndex 
)
virtual

Parameter derivatives of the wavefunction and the Laplacian of the wavefunction.

Reimplemented in RotatedSPOs.

Definition at line 263 of file SPOSet.cpp.

References SPOSet::getClassName(), and SPOSet::isOptimizable().

269 {
270  if (isOptimizable())
271  throw std::logic_error("Bug!! " + getClassName() +
272  "::evaluateDerivatives "
273  "must be overloaded when the SPOSet is optimizable.");
274 }
virtual std::string getClassName() const =0
return class name
virtual bool isOptimizable() const
Query if this SPOSet is optimizable.
Definition: SPOSet.h:91

◆ evaluateDerivatives() [2/2]

void evaluateDerivatives ( ParticleSet P,
const opt_variables_type optvars,
Vector< ValueType > &  dlogpsi,
Vector< ValueType > &  dhpsioverpsi,
const ValueType psiCurrent,
const std::vector< ValueType > &  Coeff,
const std::vector< size_t > &  C2node_up,
const std::vector< size_t > &  C2node_dn,
const ValueVector detValues_up,
const ValueVector detValues_dn,
const GradMatrix grads_up,
const GradMatrix grads_dn,
const ValueMatrix lapls_up,
const ValueMatrix lapls_dn,
const ValueMatrix M_up,
const ValueMatrix M_dn,
const ValueMatrix Minv_up,
const ValueMatrix Minv_dn,
const GradMatrix B_grad,
const ValueMatrix B_lapl,
const std::vector< int > &  detData_up,
const size_t  N1,
const size_t  N2,
const size_t  NP1,
const size_t  NP2,
const std::vector< std::vector< int >> &  lookup_tbl 
)
virtual

Evaluate the derivative of the optimized orbitals with respect to the parameters this is used only for MSD, to be refined for better serving both single and multi SD.

Reimplemented in RotatedSPOs.

Definition at line 310 of file SPOSet.cpp.

References SPOSet::getClassName(), and SPOSet::isOptimizable().

336 {
337  if (isOptimizable())
338  throw std::logic_error("Bug!! " + getClassName() +
339  "::evaluateDerivatives "
340  "must be overloaded when the SPOSet is optimizable.");
341 }
virtual std::string getClassName() const =0
return class name
virtual bool isOptimizable() const
Query if this SPOSet is optimizable.
Definition: SPOSet.h:91

◆ evaluateDerivativesWF() [1/2]

void evaluateDerivativesWF ( ParticleSet P,
const opt_variables_type optvars,
Vector< ValueType > &  dlogpsi,
int  FirstIndex,
int  LastIndex 
)
virtual

Parameter derivatives of the wavefunction.

Reimplemented in RotatedSPOs.

Definition at line 276 of file SPOSet.cpp.

References SPOSet::getClassName(), and SPOSet::isOptimizable().

281 {
282  if (isOptimizable())
283  throw std::logic_error("Bug!! " + getClassName() +
284  "::evaluateDerivativesWF "
285  "must be overloaded when the SPOSet is optimizable.");
286 }
virtual std::string getClassName() const =0
return class name
virtual bool isOptimizable() const
Query if this SPOSet is optimizable.
Definition: SPOSet.h:91

◆ evaluateDerivativesWF() [2/2]

void evaluateDerivativesWF ( ParticleSet P,
const opt_variables_type optvars,
Vector< ValueType > &  dlogpsi,
const QTFull::ValueType psiCurrent,
const std::vector< ValueType > &  Coeff,
const std::vector< size_t > &  C2node_up,
const std::vector< size_t > &  C2node_dn,
const ValueVector detValues_up,
const ValueVector detValues_dn,
const ValueMatrix M_up,
const ValueMatrix M_dn,
const ValueMatrix Minv_up,
const ValueMatrix Minv_dn,
const std::vector< int > &  detData_up,
const std::vector< std::vector< int >> &  lookup_tbl 
)
virtual

Evaluate the derivative of the optimized orbitals with respect to the parameters this is used only for MSD, to be refined for better serving both single and multi SD.

Reimplemented in RotatedSPOs.

Definition at line 346 of file SPOSet.cpp.

References SPOSet::getClassName(), and SPOSet::isOptimizable().

361 {
362  if (isOptimizable())
363  throw std::logic_error("Bug!! " + getClassName() +
364  "::evaluateDerivativesWF "
365  "must be overloaded when the SPOSet is optimizable.");
366 }
virtual std::string getClassName() const =0
return class name
virtual bool isOptimizable() const
Query if this SPOSet is optimizable.
Definition: SPOSet.h:91

◆ evaluateDerivRatios()

void evaluateDerivRatios ( const VirtualParticleSet VP,
const opt_variables_type optvars,
ValueVector psi,
const ValueVector psiinv,
std::vector< ValueType > &  ratios,
Matrix< ValueType > &  dratios,
int  FirstIndex,
int  LastIndex 
)
virtual

Determinant ratios and parameter derivatives of the wavefunction for virtual moves.

Reimplemented in RotatedSPOs.

Definition at line 288 of file SPOSet.cpp.

References SPOSet::evaluateDetRatios(), SPOSet::getClassName(), and SPOSet::isOptimizable().

296 {
297  // Match the fallback in WaveFunctionComponent that evaluates just the ratios
298  evaluateDetRatios(VP, psi, psiinv, ratios);
299 
300  if (isOptimizable())
301  throw std::logic_error("Bug!! " + getClassName() +
302  "::evaluateDerivRatios "
303  "must be overloaded when the SPOSet is optimizable.");
304 }
virtual std::string getClassName() const =0
return class name
virtual bool isOptimizable() const
Query if this SPOSet is optimizable.
Definition: SPOSet.h:91
virtual void evaluateDetRatios(const VirtualParticleSet &VP, ValueVector &psi, const ValueVector &psiinv, std::vector< ValueType > &ratios)
evaluate determinant ratios for virtual moves, e.g., sphere move for nonlocalPP
Definition: SPOSet.cpp:47

◆ evaluateDetRatios()

void evaluateDetRatios ( const VirtualParticleSet VP,
ValueVector psi,
const ValueVector psiinv,
std::vector< ValueType > &  ratios 
)
virtual

evaluate determinant ratios for virtual moves, e.g., sphere move for nonlocalPP

Parameters
VPvirtual particle set
psivalues of the SPO, used as a scratch space if needed
psiinvthe row of inverse slater matrix corresponding to the particle moved virtually
ratiosreturn determinant ratios

Reimplemented in RotatedSPOs, SplineC2ROMPTarget< ST >, SplineC2COMPTarget< ST >, SplineC2C< ST >, and LCAOrbitalSet.

Definition at line 47 of file SPOSet.cpp.

References qmcplusplus::simd::dot(), SPOSet::evaluateValue(), and VirtualParticleSet::getTotalNum().

Referenced by SPOSet::evaluateDerivRatios().

51 {
52  assert(psi.size() == psiinv.size());
53  for (int iat = 0; iat < VP.getTotalNum(); ++iat)
54  {
55  evaluateValue(VP, iat, psi);
56  ratios[iat] = simd::dot(psi.data(), psiinv.data(), psi.size());
57  }
58 }
T dot(const T *restrict a, const T *restrict b, int n, TRES res=TRES())
dot product
virtual void evaluateValue(const ParticleSet &P, int iat, ValueVector &psi)=0
evaluate the values of this single-particle orbital set

◆ evaluateDetSpinorRatios()

void evaluateDetSpinorRatios ( const VirtualParticleSet VP,
ValueVector psi,
const std::pair< ValueVector, ValueVector > &  spinor_multiplier,
const ValueVector invrow,
std::vector< ValueType > &  ratios 
)
virtual

evaluate determinant ratios for virtual moves, specifically for Spinor SPOSets

Parameters
VPvirtual particle set
psivalues of the SPO, used as a scratch space if needed
spinor_multiplierfactor to apply to the up and down components independently
invrowthe row of inverse slater matrix corresponding to the particle moved virtually
ratiosreturn determinant ratios

Reimplemented in SpinorSet.

Definition at line 60 of file SPOSet.cpp.

References SPOSet::getClassName().

65 {
66  throw std::runtime_error("Need specialization of " + getClassName() + "::evaluateDetSpinorRatios");
67 }
virtual std::string getClassName() const =0
return class name

◆ evaluateGradSource() [1/2]

void evaluateGradSource ( const ParticleSet P,
int  first,
int  last,
const ParticleSet source,
int  iat_src,
GradMatrix gradphi 
)
virtual

evaluate the gradients of this single-particle orbital for [first,last) target particles with respect to the given source particle

Parameters
Pcurrent ParticleSet
firststarting index of the particles
lastending index of the particles
iat_srcsource particle index
gradphigradients

Reimplemented in RotatedSPOs, BsplineSet, LCAOrbitalSet, SpinorSet, and SHOSet.

Definition at line 369 of file SPOSet.cpp.

References SPOSet::getClassName(), and SPOSet::hasIonDerivs().

375 {
376  if (hasIonDerivs())
377  throw std::logic_error("Bug!! " + getClassName() +
378  "::evaluateGradSource "
379  "must be overloaded when the SPOSet has ion derivatives.");
380 }
virtual std::string getClassName() const =0
return class name
virtual bool hasIonDerivs() const
Query if this SPOSet has an explicit ion dependence.
Definition: SPOSet.h:108

◆ evaluateGradSource() [2/2]

void evaluateGradSource ( const ParticleSet P,
int  first,
int  last,
const ParticleSet source,
int  iat_src,
GradMatrix grad_phi,
HessMatrix grad_grad_phi,
GradMatrix grad_lapl_phi 
)
virtual

evaluate the gradients of values, gradients, laplacians of this single-particle orbital for [first,last) target particles with respect to the given source particle

Parameters
Pcurrent ParticleSet
firststarting index of the particles
lastending index of the particles
iat_srcsource particle index
gradphigradients of values
grad_grad_phigradients of gradients
grad_lapl_phigradients of laplacians

Reimplemented in RotatedSPOs, BsplineSet, LCAOrbitalSet, and SHOSet.

Definition at line 382 of file SPOSet.cpp.

References SPOSet::getClassName(), and SPOSet::hasIonDerivs().

390 {
391  if (hasIonDerivs())
392  throw std::logic_error("Bug!! " + getClassName() +
393  "::evaluateGradSource "
394  "must be overloaded when the SPOSet has ion derivatives.");
395 }
virtual std::string getClassName() const =0
return class name
virtual bool hasIonDerivs() const
Query if this SPOSet has an explicit ion dependence.
Definition: SPOSet.h:108

◆ evaluateGradSourceRow()

void evaluateGradSourceRow ( const ParticleSet P,
int  iel,
const ParticleSet source,
int  iat_src,
GradVector gradphi 
)
virtual

Returns a row of d/dR_iat phi_j(r) evaluated at position r.

Parameters
[in]Pparticle set.
[in]ielThe electron at which to evaluate phi(r_iel)
[in]sourceion particle set.
[in]iat_srcion ID w.r.t. which to take derivative.
[in,out]gradphiVector of d/dR_iat phi_j(r).
Returns
Void

Reimplemented in LCAOrbitalSet.

Definition at line 397 of file SPOSet.cpp.

References SPOSet::getClassName(), and SPOSet::hasIonDerivs().

402 {
403  if (hasIonDerivs())
404  throw std::logic_error("Bug!! " + getClassName() +
405  "::evaluateGradSourceRow "
406  "must be overloaded when the SPOSet has ion derivatives.");
407 }
virtual std::string getClassName() const =0
return class name
virtual bool hasIonDerivs() const
Query if this SPOSet has an explicit ion dependence.
Definition: SPOSet.h:108

◆ evaluateThirdDeriv()

void evaluateThirdDeriv ( const ParticleSet P,
int  first,
int  last,
GGGMatrix grad_grad_grad_logdet 
)
virtual

evaluate the third derivatives of this single-particle orbital set

Parameters
Pcurrent ParticleSet
firstfirst particle
lastlast particle
grad_grad_grad_logdetthird derivatives of the SPO

Reimplemented in SHOSet.

Definition at line 173 of file SPOSet.cpp.

174 {
175  throw std::runtime_error("Need specialization of SPOSet::evaluateThirdDeriv(). \n");
176 }

◆ evaluateValue()

◆ evaluateVGH()

void evaluateVGH ( const ParticleSet P,
int  iat,
ValueVector psi,
GradVector dpsi,
HessVector grad_grad_psi 
)
virtual

evaluate the values, gradients and hessians of this single-particle orbital set

Parameters
Pcurrent ParticleSet
iatactive particle
psivalues of the SPO
dpsigradients of the SPO
grad_grad_psihessians of the SPO

Reimplemented in RotatedSPOs, SplineC2ROMPTarget< ST >, SplineC2COMPTarget< ST >, SplineC2C< ST >, SplineR2R< ST >, SplineC2R< ST >, and LCAOrbitalSet.

Definition at line 238 of file SPOSet.cpp.

References SPOSet::getClassName().

Referenced by BsplineSet::evaluate_notranspose().

239 {
240  throw std::runtime_error("Need specialization of " + getClassName() +
241  "::evaluate(P,iat,psi,dpsi,dhpsi) (vector quantities)\n");
242 }
virtual std::string getClassName() const =0
return class name

◆ evaluateVGHGH()

void evaluateVGHGH ( const ParticleSet P,
int  iat,
ValueVector psi,
GradVector dpsi,
HessVector grad_grad_psi,
GGGVector grad_grad_grad_psi 
)
virtual

evaluate the values, gradients, hessians, and grad hessians of this single-particle orbital set

Parameters
Pcurrent ParticleSet
iatactive particle
psivalues of the SPO
dpsigradients of the SPO
grad_grad_psihessians of the SPO
grad_grad_grad_psigrad hessians of the SPO

Reimplemented in RotatedSPOs, SplineC2ROMPTarget< ST >, SplineC2COMPTarget< ST >, SplineC2C< ST >, SplineR2R< ST >, SplineC2R< ST >, and LCAOrbitalSet.

Definition at line 244 of file SPOSet.cpp.

References SPOSet::getClassName().

Referenced by BsplineSet::evaluate_notranspose().

250 {
251  throw std::runtime_error("Need specialization of " + getClassName() +
252  "::evaluate(P,iat,psi,dpsi,dhpsi,dghpsi) (vector quantities)\n");
253 }
virtual std::string getClassName() const =0
return class name

◆ evaluateVGL()

virtual void evaluateVGL ( const ParticleSet P,
int  iat,
ValueVector psi,
GradVector dpsi,
ValueVector d2psi 
)
pure virtual

◆ evaluateVGL_spin()

void evaluateVGL_spin ( const ParticleSet P,
int  iat,
ValueVector psi,
GradVector dpsi,
ValueVector d2psi,
ValueVector dspin 
)
virtual

evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital set

Parameters
Pcurrent ParticleSet
iatactive particle
psivalues of the SPO
dpsigradients of the SPO
d2psilaplacians of the SPO
dspinspin gradients of the SPO

Reimplemented in RotatedSPOs, SpinorSet, and CompositeSPOSet.

Definition at line 83 of file SPOSet.cpp.

Referenced by CompositeSPOSet::evaluateVGL_spin().

89 {
90  throw std::runtime_error("Need specialization of SPOSet::evaluateVGL_spin");
91 }

◆ extractOptimizableObjectRefs()

void extractOptimizableObjectRefs ( UniqueOptObjRefs opt_obj_refs)
virtual

extract underlying OptimizableObject references

Parameters
opt_obj_refsaggregated list of optimizable object references

Reimplemented in RotatedSPOs.

Definition at line 31 of file SPOSet.cpp.

References SPOSet::getClassName(), and SPOSet::isOptimizable().

32 {
33  if (isOptimizable())
34  throw std::logic_error("Bug!! " + getClassName() +
35  "::extractOptimizableObjectRefs "
36  "must be overloaded when the SPOSet is optimizable.");
37 }
virtual std::string getClassName() const =0
return class name
virtual bool isOptimizable() const
Query if this SPOSet is optimizable.
Definition: SPOSet.h:91

◆ finalizeConstruction()

virtual void finalizeConstruction ( )
inlinevirtual

finalize the construction of SPOSet

for example, classes serving accelerators may need to transfer data from host to device after the host side objects are built.

Reimplemented in SplineC2ROMPTarget< ST >, SplineC2COMPTarget< ST >, LCAOrbitalSet, and LCAOrbitalSetWithCorrection.

Definition at line 554 of file SPOSet.h.

554 {}

◆ get_k()

virtual PosType get_k ( int  orb)
inlinevirtual

access the k point related to the given orbital

Definition at line 524 of file SPOSet.h.

524 { return PosType(); }
QTBase::PosType PosType
Definition: Configuration.h:61

◆ getClassName()

◆ getName()

const std::string& getName ( ) const
inline

return object name

Definition at line 557 of file SPOSet.h.

References SPOSet::my_name_.

Referenced by RotatedSPOs::readVariationalParameters(), and RotatedSPOs::writeVariationalParameters().

557 { return my_name_; }
const std::string my_name_
name of the object, unique identifier
Definition: SPOSet.h:564

◆ getOrbitalSetSize()

◆ hasIonDerivs()

virtual bool hasIonDerivs ( ) const
inlinevirtual

Query if this SPOSet has an explicit ion dependence.

returns true if it does.

Reimplemented in LCAOrbitalSet, RotatedSPOs, and SpinorSet.

Definition at line 108 of file SPOSet.h.

Referenced by SPOSet::evaluateGradSource(), and SPOSet::evaluateGradSourceRow().

108 { return false; }

◆ isOMPoffload()

virtual bool isOMPoffload ( ) const
inlinevirtual

Query if this SPOSet uses OpenMP offload.

Reimplemented in SplineC2ROMPTarget< ST >, SplineC2COMPTarget< ST >, LCAOrbitalSet, RotatedSPOs, and SpinorSet.

Definition at line 104 of file SPOSet.h.

104 { return false; }

◆ isOptimizable()

virtual bool isOptimizable ( ) const
inlinevirtual

Query if this SPOSet is optimizable.

Reimplemented in RotatedSPOs, and SpinorSet.

Definition at line 91 of file SPOSet.h.

Referenced by SPOSet::checkOutVariables(), SPOSet::evaluateDerivatives(), SPOSet::evaluateDerivativesWF(), SPOSet::evaluateDerivRatios(), and SPOSet::extractOptimizableObjectRefs().

91 { return false; }

◆ isRotationSupported()

virtual bool isRotationSupported ( ) const
inlinevirtual

return true if this SPOSet can be wrappered by RotatedSPO

Reimplemented in SplineC2C< ST >, SplineR2R< ST >, LCAOrbitalSet, and SpinorSet.

Definition at line 114 of file SPOSet.h.

Referenced by SPOSet::applyRotation().

114 { return false; }

◆ makeClone()

std::unique_ptr< SPOSet > makeClone ( ) const
virtual

make a clone of itself every derived class must implement this to have threading working correctly.

Reimplemented in SpinorSet, SplineC2ROMPTarget< ST >, SplineC2COMPTarget< ST >, RotatedSPOs, BsplineSet, SplineC2R< ST >, SplineC2C< ST >, SplineR2R< ST >, SHOSet, LCAOrbitalSet, FreeOrbital, PWRealOrbitalSet, PWOrbitalSet, CompositeSPOSet, LCAOrbitalSetWithCorrection, FakeSPO, and ConstantSPOSet.

Definition at line 225 of file SPOSet.cpp.

References SPOSet::getClassName().

Referenced by SlaterDetBuilder::buildComponent(), CompositeSPOSetBuilder::createSPOSetFromXML(), and SlaterDetBuilder::putDeterminant().

226 {
227  throw std::runtime_error("Missing SPOSet::makeClone for " + getClassName());
228 }
virtual std::string getClassName() const =0
return class name

◆ mw_evaluate_notranspose()

void mw_evaluate_notranspose ( const RefVectorWithLeader< SPOSet > &  spo_list,
const RefVectorWithLeader< ParticleSet > &  P_list,
int  first,
int  last,
const RefVector< ValueMatrix > &  logdet_list,
const RefVector< GradMatrix > &  dlogdet_list,
const RefVector< ValueMatrix > &  d2logdet_list 
) const
virtual

Reimplemented in RotatedSPOs, SpinorSet, and BsplineSet.

Definition at line 190 of file SPOSet.cpp.

References SPOSet::evaluate_notranspose(), and RefVectorWithLeader< T >::getLeader().

197 {
198  assert(this == &spo_list.getLeader());
199  for (int iw = 0; iw < spo_list.size(); iw++)
200  spo_list[iw].evaluate_notranspose(P_list[iw], first, last, logdet_list[iw], dlogdet_list[iw], d2logdet_list[iw]);
201 }
virtual void evaluate_notranspose(const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, ValueMatrix &d2logdet)=0
evaluate the values, gradients and laplacians of this single-particle orbital for [first...

◆ mw_evaluateDetRatios()

void mw_evaluateDetRatios ( const RefVectorWithLeader< SPOSet > &  spo_list,
const RefVectorWithLeader< const VirtualParticleSet > &  vp_list,
const RefVector< ValueVector > &  psi_list,
const std::vector< const ValueType *> &  invRow_ptr_list,
std::vector< std::vector< ValueType >> &  ratios_list 
) const
virtual

evaluate determinant ratios for virtual moves, e.g., sphere move for nonlocalPP, of multiple walkers

Parameters
spo_listthe list of SPOSet pointers in a walker batch
vp_lista list of virtual particle sets in a walker batch
psi_lista list of values of the SPO, used as a scratch space if needed
invRow_ptr_lista list of pointers to the rows of inverse slater matrix corresponding to the particles moved virtually
ratios_lista list of returning determinant ratios

Reimplemented in RotatedSPOs, SplineC2ROMPTarget< ST >, SplineC2COMPTarget< ST >, and LCAOrbitalSet.

Definition at line 69 of file SPOSet.cpp.

References RefVectorWithLeader< T >::getLeader(), and SPOSet::size().

Referenced by LCAOrbitalSet::mw_evaluateDetRatios(), HybridRepCplx< SPLINEBASE >::mw_evaluateDetRatios(), and HybridRepReal< SPLINEBASE >::mw_evaluateDetRatios().

74 {
75  assert(this == &spo_list.getLeader());
76  for (int iw = 0; iw < spo_list.size(); iw++)
77  {
78  Vector<ValueType> invRow(const_cast<ValueType*>(invRow_ptr_list[iw]), psi_list[iw].get().size());
79  spo_list[iw].evaluateDetRatios(vp_list[iw], psi_list[iw], invRow, ratios_list[iw]);
80  }
81 }
int size() const
return the size of the orbital set Ye: this needs to be replaced by getOrbitalSetSize(); ...
Definition: SPOSet.h:75

◆ mw_evaluateValue()

void mw_evaluateValue ( const RefVectorWithLeader< SPOSet > &  spo_list,
const RefVectorWithLeader< ParticleSet > &  P_list,
int  iat,
const RefVector< ValueVector > &  psi_v_list 
) const
virtual

evaluate the values this single-particle orbital sets of multiple walkers

Parameters
spo_listthe list of SPOSet pointers in a walker batch
P_listthe list of ParticleSet pointers in a walker batch
iatactive particle
psi_v_listthe list of value vector pointers in a walker batch

Reimplemented in DummySPOSetWithMW, RotatedSPOs, and LCAOrbitalSet.

Definition at line 105 of file SPOSet.cpp.

References SPOSet::evaluateValue(), and RefVectorWithLeader< T >::getLeader().

Referenced by LCAOrbitalSet::mw_evaluateValue().

109 {
110  assert(this == &spo_list.getLeader());
111  for (int iw = 0; iw < spo_list.size(); iw++)
112  spo_list[iw].evaluateValue(P_list[iw], iat, psi_v_list[iw]);
113 }
virtual void evaluateValue(const ParticleSet &P, int iat, ValueVector &psi)=0
evaluate the values of this single-particle orbital set

◆ mw_evaluateVGL()

void mw_evaluateVGL ( const RefVectorWithLeader< SPOSet > &  spo_list,
const RefVectorWithLeader< ParticleSet > &  P_list,
int  iat,
const RefVector< ValueVector > &  psi_v_list,
const RefVector< GradVector > &  dpsi_v_list,
const RefVector< ValueVector > &  d2psi_v_list 
) const
virtual

evaluate the values, gradients and laplacians of this single-particle orbital sets of multiple walkers

Parameters
spo_listthe list of SPOSet pointers in a walker batch
P_listthe list of ParticleSet pointers in a walker batch
iatactive particle
psi_v_listthe list of value vector pointers in a walker batch
dpsi_v_listthe list of gradient vector pointers in a walker batch
d2psi_v_listthe list of laplacian vector pointers in a walker batch

Reimplemented in RotatedSPOs, SplineC2ROMPTarget< ST >, SplineC2COMPTarget< ST >, and LCAOrbitalSet.

Definition at line 93 of file SPOSet.cpp.

References SPOSet::evaluateVGL(), and RefVectorWithLeader< T >::getLeader().

Referenced by BsplineSet::mw_evaluate_notranspose(), LCAOrbitalSet::mw_evaluateVGL(), HybridRepCplx< SPLINEBASE >::mw_evaluateVGL(), and HybridRepReal< SPLINEBASE >::mw_evaluateVGL().

99 {
100  assert(this == &spo_list.getLeader());
101  for (int iw = 0; iw < spo_list.size(); iw++)
102  spo_list[iw].evaluateVGL(P_list[iw], iat, psi_v_list[iw], dpsi_v_list[iw], d2psi_v_list[iw]);
103 }
virtual void evaluateVGL(const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi)=0
evaluate the values, gradients and laplacians of this single-particle orbital set ...

◆ mw_evaluateVGLandDetRatioGrads()

void mw_evaluateVGLandDetRatioGrads ( const RefVectorWithLeader< SPOSet > &  spo_list,
const RefVectorWithLeader< ParticleSet > &  P_list,
int  iat,
const std::vector< const ValueType *> &  invRow_ptr_list,
OffloadMWVGLArray phi_vgl_v,
std::vector< ValueType > &  ratios,
std::vector< GradType > &  grads 
) const
virtual

evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ratio and grads of multiple walkers.

Device data of phi_vgl_v must be up-to-date upon return

Parameters
spo_listthe list of SPOSet pointers in a walker batch
P_listthe list of ParticleSet pointers in a walker batch
iatactive particle
phi_vgl_vorbital values, gradients and laplacians of all the walkers
psi_ratio_grads_vdeterminant ratio and grads of all the walkers

Reimplemented in RotatedSPOs, SplineC2ROMPTarget< ST >, SplineC2COMPTarget< ST >, and LCAOrbitalSet.

Definition at line 126 of file SPOSet.cpp.

References Array< T, D, ALLOC >::data_at(), QMCTraits::DIM, QMCTraits::DIM_VGL, qmcplusplus::simd::dot(), RefVectorWithLeader< T >::getLeader(), Array< T, D, ALLOC >::size(), and Array< T, D, ALLOC >::updateTo().

Referenced by LCAOrbitalSet::mw_evaluateVGLandDetRatioGrads(), HybridRepCplx< SPLINEBASE >::mw_evaluateVGLandDetRatioGrads(), and HybridRepReal< SPLINEBASE >::mw_evaluateVGLandDetRatioGrads().

133 {
134  assert(this == &spo_list.getLeader());
135  assert(phi_vgl_v.size(0) == DIM_VGL);
136  assert(phi_vgl_v.size(1) == spo_list.size());
137  const size_t nw = spo_list.size();
138  const size_t norb_requested = phi_vgl_v.size(2);
139  GradVector dphi_v(norb_requested);
140  for (int iw = 0; iw < nw; iw++)
141  {
142  ValueVector phi_v(phi_vgl_v.data_at(0, iw, 0), norb_requested);
143  ValueVector d2phi_v(phi_vgl_v.data_at(4, iw, 0), norb_requested);
144  spo_list[iw].evaluateVGL(P_list[iw], iat, phi_v, dphi_v, d2phi_v);
145 
146  ratios[iw] = simd::dot(invRow_ptr_list[iw], phi_v.data(), norb_requested);
147  grads[iw] = simd::dot(invRow_ptr_list[iw], dphi_v.data(), norb_requested) / ratios[iw];
148 
149  // transpose the array of gradients to SoA in phi_vgl_v
150  for (size_t idim = 0; idim < DIM; idim++)
151  {
152  ValueType* phi_g = phi_vgl_v.data_at(idim + 1, iw, 0);
153  for (size_t iorb = 0; iorb < norb_requested; iorb++)
154  phi_g[iorb] = dphi_v[iorb][idim];
155  }
156  }
157  phi_vgl_v.updateTo();
158 }
T dot(const T *restrict a, const T *restrict b, int n, TRES res=TRES())
dot product
QTBase::ValueType ValueType
Definition: Configuration.h:60
OrbitalSetTraits< ValueType >::ValueVector ValueVector
Definition: SPOSet.h:49
OrbitalSetTraits< ValueType >::GradVector GradVector
Definition: SPOSet.h:51

◆ mw_evaluateVGLandDetRatioGradsWithSpin()

void mw_evaluateVGLandDetRatioGradsWithSpin ( const RefVectorWithLeader< SPOSet > &  spo_list,
const RefVectorWithLeader< ParticleSet > &  P_list,
int  iat,
const std::vector< const ValueType *> &  invRow_ptr_list,
OffloadMWVGLArray phi_vgl_v,
std::vector< ValueType > &  ratios,
std::vector< GradType > &  grads,
std::vector< ValueType > &  spingrads 
) const
virtual

evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ratio and grads of multiple walkers.

Device data of phi_vgl_v must be up-to-date upon return. Includes spin gradients

Parameters
spo_listthe list of SPOSet pointers in a walker batch
P_listthe list of ParticleSet pointers in a walker batch
iatactive particle
phi_vgl_vorbital values, gradients and laplacians of all the walkers
ratios,ratiosof all walkers
grads,spatialgradients of all walkers
spingrads,spingradients of all walkers

Reimplemented in RotatedSPOs, and SpinorSet.

Definition at line 160 of file SPOSet.cpp.

References SPOSet::getClassName().

168 {
169  throw std::runtime_error("Need specialization of " + getClassName() +
170  "::mw_evaluateVGLandDetRatioGradsWithSpin(). \n");
171 }
virtual std::string getClassName() const =0
return class name

◆ mw_evaluateVGLWithSpin()

void mw_evaluateVGLWithSpin ( const RefVectorWithLeader< SPOSet > &  spo_list,
const RefVectorWithLeader< ParticleSet > &  P_list,
int  iat,
const RefVector< ValueVector > &  psi_v_list,
const RefVector< GradVector > &  dpsi_v_list,
const RefVector< ValueVector > &  d2psi_v_list,
OffloadMatrix< ComplexType > &  mw_dspin 
) const
virtual

evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital sets of multiple walkers

Parameters
spo_listthe list of SPOSet pointers in a walker batch
P_listthe list of ParticleSet pointers in a walker batch
iatactive particle
psi_v_listthe list of value vector pointers in a walker batch
dpsi_v_listthe list of gradient vector pointers in a walker batch
d2psi_v_listthe list of laplacian vector pointers in a walker batch
mw_dspinis a dual matrix of spin gradients [nw][norb] Note that the device side of mw_dspin is up to date

Reimplemented in RotatedSPOs, and SpinorSet.

Definition at line 115 of file SPOSet.cpp.

References SPOSet::getClassName().

Referenced by DiracDeterminantBatched< PL, VT, FPVT >::mw_evalGradWithSpin().

122 {
123  throw std::runtime_error(getClassName() + "::mw_evaluateVGLWithSpin() is not supported. \n");
124 }
virtual std::string getClassName() const =0
return class name

◆ releaseResource()

virtual void releaseResource ( ResourceCollection collection,
const RefVectorWithLeader< SPOSet > &  spo_list 
) const
inlinevirtual

return a shared resource to collection

Reimplemented in RotatedSPOs, LCAOrbitalSet, SpinorSet, SplineC2ROMPTarget< ST >, and SplineC2COMPTarget< ST >.

Definition at line 536 of file SPOSet.h.

536 {}

◆ report()

virtual void report ( const std::string &  pad = "") const
inlinevirtual

print SPOSet information

Reimplemented in SHOSet, and FreeOrbital.

Definition at line 83 of file SPOSet.h.

References SPOSet::basic_report().

83 { basic_report(pad); }
void basic_report(const std::string &pad="") const
print basic SPOSet information
Definition: SPOSet.cpp:230

◆ setOrbitalSetSize()

virtual void setOrbitalSetSize ( int  norbs)
pure virtual

set the OrbitalSetSize

Parameters
norbsnumber of single-particle orbitals Ye: I prefer to remove this interface in the future. SPOSet builders need to handle the size correctly. It doesn't make sense allowing to set the value at any place in the code.

Implemented in DummySPOSetWithoutMW, RotatedSPOs, BsplineSet, SHOSet, PWRealOrbitalSet, LCAOrbitalSet, PWOrbitalSet, FreeOrbital, CompositeSPOSet, LCAOrbitalSetWithCorrection, SpinorSet, ConstantSPOSet, and FakeSPO.

◆ size()

◆ storeParamsBeforeRotation()

virtual void storeParamsBeforeRotation ( )
inlinevirtual

store parameters before getting destroyed by rotation.

Reimplemented in SplineC2C< ST >, SplineR2R< ST >, LCAOrbitalSet, and SpinorSet.

Definition at line 116 of file SPOSet.h.

116 {}

◆ transformSPOSet()

virtual bool transformSPOSet ( )
inlinevirtual

Used only by cusp correction in AOS LCAO.

Ye: the SoA LCAO moves all this responsibility to the builder. This interface should be removed with AoS.

Definition at line 547 of file SPOSet.h.

547 { return true; }

Friends And Related Function Documentation

◆ testing::getMyVars

Member Data Documentation

◆ my_name_

const std::string my_name_
protected

◆ myVars

◆ OrbitalSetSize

IndexType OrbitalSetSize
protected

number of Single-particle orbitals

Definition at line 566 of file SPOSet.h.

Referenced by CompositeSPOSet::add(), LCAOrbitalSet::applyRotation(), LCAOrbitalSet::checkObject(), CompositeSPOSet::CompositeSPOSet(), ConstantSPOSet::ConstantSPOSet(), FreeOrbital::evaluate_notranspose(), FakeSPO::evaluate_notranspose(), PWOrbitalSet::evaluate_notranspose(), PWRealOrbitalSet::evaluate_notranspose(), LCAOrbitalSet::evaluate_notranspose(), FakeSPO::evaluateValue(), ConstantSPOSet::evaluateValue(), LCAOrbitalSet::evaluateValue(), PWRealOrbitalSet::evaluateValue(), RotatedSPOs::evaluateValue(), LCAOrbitalSet::evaluateVGH(), RotatedSPOs::evaluateVGH(), LCAOrbitalSet::evaluateVGHGH(), FakeSPO::evaluateVGL(), ConstantSPOSet::evaluateVGL(), PWOrbitalSet::evaluateVGL(), LCAOrbitalSet::evaluateVGL(), PWRealOrbitalSet::evaluateVGL(), RotatedSPOs::evaluateVGL(), RotatedSPOs::evaluateVGL_spin(), FreeOrbital::FreeOrbital(), SPOSet::getOrbitalSetSize(), SHOSet::initialize(), LCAOrbitalSet::LCAOrbitalSet(), LCAOrbitalSetWithCorrection::LCAOrbitalSetWithCorrection(), ConstantSPOSet::makeClone(), LCAOrbitalSet::mw_evaluateValue(), LCAOrbitalSet::mw_evaluateValueImplGEMM(), LCAOrbitalSet::mw_evaluateValueVPsImplGEMM(), LCAOrbitalSet::mw_evaluateVGL(), LCAOrbitalSet::mw_evaluateVGLImplGEMM(), PWOrbitalSet::resize(), PWRealOrbitalSet::resize(), RotatedSPOs::RotatedSPOs(), FakeSPO::setOrbitalSetSize(), SpinorSet::setOrbitalSetSize(), BsplineSet::setOrbitalSetSize(), ConstantSPOSet::setRefEGrads(), ConstantSPOSet::setRefELapls(), ConstantSPOSet::setRefVals(), and SPOSet::size().


The documentation for this class was generated from the following files: