QMCPACK
DiracDeterminantBase Class Referenceabstract
+ Inheritance diagram for DiracDeterminantBase:
+ Collaboration diagram for DiracDeterminantBase:

Public Member Functions

 DiracDeterminantBase (const std::string &class_name, std::unique_ptr< SPOSet > &&spos, int first, int last)
 constructor More...
 
 ~DiracDeterminantBase () override
 default destructor More...
 
 DiracDeterminantBase (const DiracDeterminantBase &s)=delete
 
DiracDeterminantBaseoperator= (const DiracDeterminantBase &s)=delete
 
SPOSetPtr getPhi () const
 
int getFirstIndex () const
 
int getLastIndex () const
 
virtual ValueMatrixgetPsiMinv ()
 
bool isFermionic () const final
 true, if this component is fermionic More...
 
bool isOptimizable () const final
 if true, this contains optimizable components More...
 
void extractOptimizableObjectRefs (UniqueOptObjRefs &opt_obj_refs) final
 extract underlying OptimizableObject references More...
 
void checkOutVariables (const opt_variables_type &active) final
 check out variational optimizable variables More...
 
virtual void registerTWFFastDerivWrapper (const ParticleSet &P, TWFFastDerivWrapper &twf) const override
 Register the component with the TWFFastDerivWrapper wrapper. More...
 
virtual void evaluateDerivativesWF (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi) override
 Compute the derivatives of the log of the wavefunction with respect to optimizable parameters. More...
 
virtual void evaluateDerivatives (ParticleSet &P, const opt_variables_type &active, int offset, Matrix< RealType > &dlogpsi, Array< GradType, 3 > &dG, Matrix< RealType > &dL)
 
std::unique_ptr< WaveFunctionComponentmakeClone (ParticleSet &tqp) const final
 make clone More...
 
PsiValue ratioGradWithSpin (ParticleSet &P, int iat, GradType &grad_iat, ComplexType &spingrad) override
 evaluate the ratio of the new to old WaveFunctionComponent value and the new spin gradient Default implementation assumes that WaveFunctionComponent does not explicitly depend on Spin. More...
 
GradType evalGradWithSpin (ParticleSet &P, int iat, ComplexType &spingrad) override
 return the current spin gradient for the iat-th particle Default implementation assumes that WaveFunctionComponent does not explicitly depend on Spin. More...
 
virtual std::unique_ptr< DiracDeterminantBasemakeCopy (std::unique_ptr< SPOSet > &&spo) const =0
 cloning function More...
 
virtual void evaluateDerivatives (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi)=0
 Compute the derivatives of both the log of the wavefunction and kinetic energy with respect to optimizable parameters. More...
 
virtual LogValue evaluateGL (const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L, bool fromscratch)
 compute gradients and laplacian of the TWF with respect to each particle. More...
 
virtual LogValue evaluateLog (const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L)=0
 evaluate the value of the WaveFunctionComponent from scratch More...
 
virtual void mw_evaluateGL (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, const RefVector< ParticleSet::ParticleGradient > &G_list, const RefVector< ParticleSet::ParticleLaplacian > &L_list, bool fromscratch) const
 evaluate gradients and laplacian of the same type WaveFunctionComponent of multiple walkers More...
 
virtual void mw_evaluateLog (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, const RefVector< ParticleSet::ParticleGradient > &G_list, const RefVector< ParticleSet::ParticleLaplacian > &L_list) const
 evaluate from scratch the same type WaveFunctionComponent of multiple walkers More...
 
virtual void recompute (const ParticleSet &P)
 recompute the value of the WaveFunctionComponents which require critical accuracy. More...
 
virtual void copyFromBuffer (ParticleSet &P, WFBufferType &buf)=0
 For particle-by-particle move. More...
 
virtual void registerData (ParticleSet &P, WFBufferType &buf)=0
 For particle-by-particle move. More...
 
virtual LogValue updateBuffer (ParticleSet &P, WFBufferType &buf, bool fromscratch=false)=0
 For particle-by-particle move. More...
 
virtual void acquireResource (ResourceCollection &collection, const RefVectorWithLeader< WaveFunctionComponent > &wfc_list) const
 acquire a shared resource from a collection More...
 
virtual void createResource (ResourceCollection &collection) const
 initialize a shared resource and hand it to a collection More...
 
virtual void releaseResource (ResourceCollection &collection, const RefVectorWithLeader< WaveFunctionComponent > &wfc_list) const
 return a shared resource to a collection More...
 
virtual void acceptMove (ParticleSet &P, int iat, bool safe_to_delay=false)=0
 a move for iat-th particle is accepted. More...
 
virtual void completeUpdates ()
 complete all the delayed or asynchronous operations before leaving the p-by-p move region. More...
 
virtual GradType evalGrad (ParticleSet &P, int iat)
 return the current gradient for the iat-th particle More...
 
virtual void mw_accept_rejectMove (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, const std::vector< bool > &isAccepted, bool safe_to_delay=false) const
 moves of the iat-th particle on some walkers in a batch is accepted. More...
 
virtual void mw_calcRatio (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios) const
 compute the ratio of the new to old WaveFunctionComponent value of multiple walkers More...
 
virtual void mw_completeUpdates (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list) const
 complete all the delayed or asynchronous operations for all the walkers in a batch before leaving the p-by-p move region. More...
 
template<CoordsType CT>
void mw_evalGrad (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, const int iat, TWFGrads< CT > &grads_now) const
 compute the current gradients for the iat-th particle of multiple walkers More...
 
virtual void mw_evalGrad (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< GradType > &grad_now) const
 compute the current gradients for the iat-th particle of multiple walkers More...
 
template<CoordsType CT>
void mw_ratioGrad (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios, TWFGrads< CT > &grad_new) const
 
virtual void mw_ratioGrad (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios, std::vector< GradType > &grad_new) const
 compute the ratio of the new to old WaveFunctionComponent value and the new gradient of multiple walkers More...
 
virtual PsiValue ratio (ParticleSet &P, int iat)=0
 evaluate the ratio of the new to old WaveFunctionComponent value More...
 
virtual PsiValue ratioGrad (ParticleSet &P, int iat, GradType &grad_iat)
 evaluate the ratio of the new to old WaveFunctionComponent value and the new gradient More...
 
virtual void restore (int iat)=0
 If a move for iat-th particle is rejected, restore to the content. More...
 
virtual GradType evalGradSource (ParticleSet &P, ParticleSet &source, int iat)
 return the logarithmic gradient for the iat-th particle of the source particleset More...
 
virtual GradType evalGradSource (ParticleSet &P, ParticleSet &source, int iat, TinyVector< ParticleSet::ParticleGradient, OHMMS_DIM > &grad_grad, TinyVector< ParticleSet::ParticleLaplacian, OHMMS_DIM > &lapl_grad)
 Adds the gradient w.r.t. More...
 
virtual void evaluateHessian (ParticleSet &P, HessVector &grad_grad_psi_all)
 
virtual void evaluateRatios (const VirtualParticleSet &VP, std::vector< ValueType > &ratios)
 evaluate ratios to evaluate the non-local PP More...
 
virtual void evaluateRatiosAlltoOne (ParticleSet &P, std::vector< ValueType > &ratios)
 evaluate the ratios of one virtual move with respect to all the particles More...
 
virtual void evaluateSpinorRatios (const VirtualParticleSet &VP, const std::pair< ValueVector, ValueVector > &spinor_multiplier, std::vector< ValueType > &ratios)
 Used by SOECPComponent for faster SOC evaluation. More...
 
virtual void mw_evaluateRatios (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< const VirtualParticleSet > &vp_list, std::vector< std::vector< ValueType >> &ratios) const
 evaluate ratios to evaluate the non-local PP multiple walkers More...
 
- Public Member Functions inherited from WaveFunctionComponent
const LogValueget_log_value () const
 
 WaveFunctionComponent (const std::string &obj_name="")
 default constructor More...
 
virtual ~WaveFunctionComponent ()
 default destructor More...
 
virtual void checkSanity () const
 Validate the internal consistency of the object. More...
 
const std::string & getName () const
 return object name More...
 
virtual std::string getClassName () const =0
 return class name More...
 
PsiValue getValue () const
 assembles the full value More...
 
virtual bool isMultiDet () const
 true, if this component is multi-determinant More...
 
virtual LogValue evaluateLog (const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L)=0
 evaluate the value of the WaveFunctionComponent from scratch More...
 
virtual void mw_evaluateLog (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, const RefVector< ParticleSet::ParticleGradient > &G_list, const RefVector< ParticleSet::ParticleLaplacian > &L_list) const
 evaluate from scratch the same type WaveFunctionComponent of multiple walkers More...
 
virtual void recompute (const ParticleSet &P)
 recompute the value of the WaveFunctionComponents which require critical accuracy. More...
 
virtual void mw_recompute (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< bool > &recompute) const
 
virtual void evaluateHessian (ParticleSet &P, HessVector &grad_grad_psi_all)
 
virtual void prepareGroup (ParticleSet &P, int ig)
 Prepare internal data for updating WFC correspond to a particle group It should be called before moving particles of a given group. More...
 
virtual void mw_prepareGroup (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int ig) const
 
virtual GradType evalGrad (ParticleSet &P, int iat)
 return the current gradient for the iat-th particle More...
 
template<CoordsType CT>
void mw_evalGrad (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, const int iat, TWFGrads< CT > &grads_now) const
 compute the current gradients for the iat-th particle of multiple walkers More...
 
virtual void mw_evalGrad (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< GradType > &grad_now) const
 compute the current gradients for the iat-th particle of multiple walkers More...
 
virtual GradType evalGradSource (ParticleSet &P, ParticleSet &source, int iat)
 return the logarithmic gradient for the iat-th particle of the source particleset More...
 
virtual GradType evalGradSource (ParticleSet &P, ParticleSet &source, int iat, TinyVector< ParticleSet::ParticleGradient, OHMMS_DIM > &grad_grad, TinyVector< ParticleSet::ParticleLaplacian, OHMMS_DIM > &lapl_grad)
 Adds the gradient w.r.t. More...
 
virtual PsiValue ratioGrad (ParticleSet &P, int iat, GradType &grad_iat)
 evaluate the ratio of the new to old WaveFunctionComponent value and the new gradient More...
 
template<CoordsType CT>
void mw_ratioGrad (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios, TWFGrads< CT > &grad_new) const
 
virtual void mw_ratioGrad (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios, std::vector< GradType > &grad_new) const
 compute the ratio of the new to old WaveFunctionComponent value and the new gradient of multiple walkers More...
 
virtual void acceptMove (ParticleSet &P, int iat, bool safe_to_delay=false)=0
 a move for iat-th particle is accepted. More...
 
virtual void mw_accept_rejectMove (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, const std::vector< bool > &isAccepted, bool safe_to_delay=false) const
 moves of the iat-th particle on some walkers in a batch is accepted. More...
 
virtual void completeUpdates ()
 complete all the delayed or asynchronous operations before leaving the p-by-p move region. More...
 
virtual void mw_completeUpdates (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list) const
 complete all the delayed or asynchronous operations for all the walkers in a batch before leaving the p-by-p move region. More...
 
virtual void restore (int iat)=0
 If a move for iat-th particle is rejected, restore to the content. More...
 
virtual PsiValue ratio (ParticleSet &P, int iat)=0
 evaluate the ratio of the new to old WaveFunctionComponent value More...
 
virtual void mw_calcRatio (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios) const
 compute the ratio of the new to old WaveFunctionComponent value of multiple walkers More...
 
virtual LogValue evaluateGL (const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L, bool fromscratch)
 compute gradients and laplacian of the TWF with respect to each particle. More...
 
virtual void mw_evaluateGL (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, const RefVector< ParticleSet::ParticleGradient > &G_list, const RefVector< ParticleSet::ParticleLaplacian > &L_list, bool fromscratch) const
 evaluate gradients and laplacian of the same type WaveFunctionComponent of multiple walkers More...
 
virtual void registerData (ParticleSet &P, WFBufferType &buf)=0
 For particle-by-particle move. More...
 
virtual LogValue updateBuffer (ParticleSet &P, WFBufferType &buf, bool fromscratch=false)=0
 For particle-by-particle move. More...
 
virtual void copyFromBuffer (ParticleSet &P, WFBufferType &buf)=0
 For particle-by-particle move. More...
 
virtual void createResource (ResourceCollection &collection) const
 initialize a shared resource and hand it to a collection More...
 
virtual void acquireResource (ResourceCollection &collection, const RefVectorWithLeader< WaveFunctionComponent > &wfc_list) const
 acquire a shared resource from a collection More...
 
virtual void releaseResource (ResourceCollection &collection, const RefVectorWithLeader< WaveFunctionComponent > &wfc_list) const
 return a shared resource to a collection More...
 
virtual RealType KECorrection ()
 Return the Chiesa kinetic energy correction. More...
 
virtual void evaluateDerivatives (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi)=0
 Compute the derivatives of both the log of the wavefunction and kinetic energy with respect to optimizable parameters. More...
 
virtual void evaluateGradDerivatives (const ParticleSet::ParticleGradient &G_in, std::vector< ValueType > &dgradlogpsi)
 Calculates the derivatives of $ \nabla \textnormal{log} \psi_f $ with respect to the optimizable parameters, and the dot product of this is then performed with the passed-in G_in gradient vector. More...
 
virtual void finalizeOptimization ()
 
virtual void evaluateRatiosAlltoOne (ParticleSet &P, std::vector< ValueType > &ratios)
 evaluate the ratios of one virtual move with respect to all the particles More...
 
virtual void evaluateRatios (const VirtualParticleSet &VP, std::vector< ValueType > &ratios)
 evaluate ratios to evaluate the non-local PP More...
 
virtual void evaluateSpinorRatios (const VirtualParticleSet &VP, const std::pair< ValueVector, ValueVector > &spinor_multiplier, std::vector< ValueType > &ratios)
 Used by SOECPComponent for faster SOC evaluation. More...
 
virtual void mw_evaluateRatios (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< const VirtualParticleSet > &vp_list, std::vector< std::vector< ValueType >> &ratios) const
 evaluate ratios to evaluate the non-local PP multiple walkers More...
 
virtual void evaluateDerivRatios (const VirtualParticleSet &VP, const opt_variables_type &optvars, std::vector< ValueType > &ratios, Matrix< ValueType > &dratios)
 evaluate ratios to evaluate the non-local PP More...
 
virtual void mw_evalGradWithSpin (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< GradType > &grad_now, std::vector< ComplexType > &spingrad_now) const
 compute the current gradients and spin gradients for the iat-th particle of multiple walkers More...
 
virtual void mw_ratioGradWithSpin (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios, std::vector< GradType > &grad_new, std::vector< ComplexType > &spingrad_new) const
 compute the ratio of the new to old WaveFunctionComponent value and the new gradient/spingradient of multiple walkers More...
 

Static Protected Member Functions

static bool checkG (const GradType &g)
 

Protected Attributes

NewTimerUpdateTimer
 Timers. More...
 
NewTimerRatioTimer
 
NewTimerInverseTimer
 
NewTimerBufferTimer
 
NewTimerSPOVTimer
 
NewTimerSPOVGLTimer
 
const std::unique_ptr< SPOSetPhi
 a set of single-particle orbitals used to fill in the values of the matrix More...
 
const int FirstIndex
 index of the first particle with respect to the particle set More...
 
const int LastIndex
 index of the last particle with respect to the particle set More...
 
const int NumOrbitals
 number of single-particle orbitals which belong to this Dirac determinant More...
 
const int NumPtcls
 number of particles which belong to this Dirac determinant More...
 
ValueMatrix dummy_vmt
 
- Protected Attributes inherited from WaveFunctionComponent
const std::string my_name_
 Name of the object It is required to be different for objects of the same derived type like multiple J1. More...
 
LogValue log_value_
 Current $\log\phi $. More...
 

Additional Inherited Members

- Public Types inherited from WaveFunctionComponent
enum  {
  ORB_PBYP_RATIO, ORB_PBYP_ALL, ORB_PBYP_PARTIAL, ORB_WALKER,
  ORB_ALLWALKER
}
 enum for a update mode More...
 
using Walker_t = ParticleSet::Walker_t
 
using WFBufferType = Walker_t::WFBuffer_t
 
using BufferType = Walker_t::Buffer_t
 
using RealMatrix_t = OrbitalSetTraits< RealType >::ValueMatrix
 
using ValueVector = OrbitalSetTraits< ValueType >::ValueVector
 
using ValueMatrix = OrbitalSetTraits< ValueType >::ValueMatrix
 
using GradMatrix = OrbitalSetTraits< ValueType >::GradMatrix
 
using HessType = OrbitalSetTraits< ValueType >::HessType
 
using HessVector = OrbitalSetTraits< ValueType >::HessVector
 
using LogValue = std::complex< QTFull::RealType >
 
using PsiValue = QTFull::ValueType
 
- 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 Attributes inherited from WaveFunctionComponent
int UpdateMode
 current update mode More...
 
opt_variables_type myVars
 list of variables this WaveFunctionComponent handles More...
 
size_t Bytes_in_WFBuffer
 Bytes in WFBuffer. More...
 

Detailed Description

Definition at line 33 of file DiracDeterminantBase.h.

Constructor & Destructor Documentation

◆ DiracDeterminantBase() [1/2]

DiracDeterminantBase ( const std::string &  class_name,
std::unique_ptr< SPOSet > &&  spos,
int  first,
int  last 
)
inline

constructor

Parameters
sposthe single-particle orbital set.
firstindex of the first particle
lastindex of last particle

Definition at line 41 of file DiracDeterminantBase.h.

42  : UpdateTimer(createGlobalTimer(class_name + "::update", timer_level_fine)),
43  RatioTimer(createGlobalTimer(class_name + "::ratio", timer_level_fine)),
44  InverseTimer(createGlobalTimer(class_name + "::inverse", timer_level_fine)),
45  BufferTimer(createGlobalTimer(class_name + "::buffer", timer_level_fine)),
46  SPOVTimer(createGlobalTimer(class_name + "::spoval", timer_level_fine)),
47  SPOVGLTimer(createGlobalTimer(class_name + "::spovgl", timer_level_fine)),
48  Phi(std::move(spos)),
49  FirstIndex(first),
50  LastIndex(last),
51  NumOrbitals(last - first),
52  NumPtcls(last - first)
53  {}
const int FirstIndex
index of the first particle with respect to the particle set
const std::unique_ptr< SPOSet > Phi
a set of single-particle orbitals used to fill in the values of the matrix
NewTimer & createGlobalTimer(const std::string &myname, timer_levels mylevel)
const int LastIndex
index of the last particle with respect to the particle set
const int NumOrbitals
number of single-particle orbitals which belong to this Dirac determinant
const int NumPtcls
number of particles which belong to this Dirac determinant

◆ ~DiracDeterminantBase()

~DiracDeterminantBase ( )
inlineoverride

default destructor

Definition at line 56 of file DiracDeterminantBase.h.

56 {}

◆ DiracDeterminantBase() [2/2]

Member Function Documentation

◆ acceptMove()

virtual void acceptMove

a move for iat-th particle is accepted.

Update the current content.

Parameters
Ptarget ParticleSet
iatindex of the particle whose new position was proposed
safe_to_delayif true, delayed accept is safe.

◆ acquireResource()

virtual void acquireResource
inline

acquire a shared resource from a collection

Definition at line 430 of file WaveFunctionComponent.h.

432  {}

◆ checkG()

static bool checkG ( const GradType g)
inlinestaticprotected

Definition at line 192 of file DiracDeterminantBase.h.

References qmcplusplus::abs(), qmcplusplus::dot(), qmcplusplus::isinf(), and qmcplusplus::isnan().

193  {
194 #if !defined(NDEBUG)
195  auto g_mag = std::abs(dot(g, g));
196  if (qmcplusplus::isnan(g_mag))
197  throw std::runtime_error("gradient of NaN");
198  if (qmcplusplus::isinf(g_mag))
199  throw std::runtime_error("gradient of inf");
200  if (g_mag < std::abs(std::numeric_limits<RealType>::epsilon()))
201  {
202  std::cerr << "evalGrad gradient is " << g[0] << ' ' << g[1] << ' ' << g[2] << '\n';
203  throw std::runtime_error("gradient of zero");
204  }
205 #endif
206  return true;
207  }
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
bool isinf(float a)
return true if the value is Inf.
Definition: math.cpp:24
bool isnan(float a)
return true if the value is NaN.
Definition: math.cpp:18

◆ checkOutVariables()

void checkOutVariables ( const opt_variables_type active)
inlinefinalvirtual

check out variational optimizable variables

Parameters
activea super set of optimizable variables

Reimplemented from WaveFunctionComponent.

Definition at line 81 of file DiracDeterminantBase.h.

References DiracDeterminantBase::Phi.

82  {
83  if (Phi->isOptimizable())
84  Phi->checkOutVariables(active);
85  }
const std::unique_ptr< SPOSet > Phi
a set of single-particle orbitals used to fill in the values of the matrix

◆ completeUpdates()

virtual void completeUpdates
inline

complete all the delayed or asynchronous operations before leaving the p-by-p move region.

Must be called at the end of each substep if p-by-p move is used. This function was initially introduced for determinant delayed updates to complete all the delayed operations. It has been extended to handle asynchronous operations on accellerators before leaving the p-by-p move region.

Definition at line 338 of file WaveFunctionComponent.h.

338 {}

◆ copyFromBuffer()

virtual void copyFromBuffer

For particle-by-particle move.

Copy data or attach memory from a walker buffer to the objects of this class. The log value, P.G and P.L contribution from the objects of this class are also added.

Parameters
Pparticle set
bufAnonymous storage

◆ createResource()

virtual void createResource
inline

initialize a shared resource and hand it to a collection

Definition at line 426 of file WaveFunctionComponent.h.

426 {}

◆ evalGrad()

virtual GradType evalGrad
inline

return the current gradient for the iat-th particle

Parameters
Pquantum particle set
iatparticle index
Returns
the gradient of the iat-th particle

Definition at line 206 of file WaveFunctionComponent.h.

207  {
208  APP_ABORT("WaveFunctionComponent::evalGradient is not implemented in " + getClassName() + " class.");
209  return GradType();
210  }
QTBase::GradType GradType
Definition: Configuration.h:62
virtual std::string getClassName() const =0
return class name
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ evalGradSource() [1/2]

virtual GradType evalGradSource
inline

return the logarithmic gradient for the iat-th particle of the source particleset

Parameters
Pquantumparticle set
iatparticle index
Returns
the gradient of the iat-th particle

Definition at line 247 of file WaveFunctionComponent.h.

248  {
249  // unit_test_hamiltonian calls this function incorrectly; do not abort for now
250  // APP_ABORT("WaveFunctionComponent::evalGradSource is not implemented");
251  return GradType();
252  }
QTBase::GradType GradType
Definition: Configuration.h:62

◆ evalGradSource() [2/2]

virtual GradType evalGradSource
inline

Adds the gradient w.r.t.

the iat-th particle of the source particleset (ions) of the logarithmic gradient and laplacian w.r.t. the target paritlceset (electrons).

Parameters
Pquantum particle set (electrons)
sourceclassical particle set (ions)
iatparticle index of source (ion)
theion gradient of the elctron gradient
theion gradient of the elctron laplacian.
Returns
the log gradient of psi w.r.t. the source particle iat

Definition at line 264 of file WaveFunctionComponent.h.

269  {
270  return GradType();
271  }
QTBase::GradType GradType
Definition: Configuration.h:62

◆ evalGradWithSpin()

GradType evalGradWithSpin ( ParticleSet P,
int  iat,
ComplexType spingrad 
)
inlineoverridevirtual

return the current spin gradient for the iat-th particle Default implementation assumes that WaveFunctionComponent does not explicitly depend on Spin.

Parameters
Pquantum particle set
iatparticle index
Returns
the spin gradient of the iat-th particle

Reimplemented from WaveFunctionComponent.

Reimplemented in DiracDeterminantBatched< PL, VT, FPVT >, and DummyDiracDetWithoutMW.

Definition at line 157 of file DiracDeterminantBase.h.

References APP_ABORT.

158  {
159  APP_ABORT(" DiracDeterminantBase::evalGradWithSpin(): Implementation required\n");
160  return GradType();
161  }
QTBase::GradType GradType
Definition: Configuration.h:62
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ evaluateDerivatives() [1/2]

virtual void evaluateDerivatives

Compute the derivatives of both the log of the wavefunction and kinetic energy with respect to optimizable parameters.

Parameters
Pparticle set
optvarsoptimizable parameters
dlogpsiarray of derivatives of the log of the wavefunction. Add the contribution from this component.
dhpsioverpsiarray of Hamiltonian derivatives. Add the kinetic energy derivatives contribution from this component. $ -\frac{1}{2}{\partial}_\alpha \tilde L - G \cdot {\partial}_\alpha \tilde G $. $ \tilde L $ and $ \tilde G $ are from this WaveFunctionComponent. $ G $ is from TrialWaveFunction. The 1/m factor is applied in TrialWaveFunction. This is a bug when the particle set doesn't hold equal mass particles.

◆ evaluateDerivatives() [2/2]

virtual void evaluateDerivatives ( ParticleSet P,
const opt_variables_type active,
int  offset,
Matrix< RealType > &  dlogpsi,
Array< GradType, 3 > &  dG,
Matrix< RealType > &  dL 
)
inlinevirtual

Definition at line 135 of file DiracDeterminantBase.h.

References APP_ABORT.

141  {
142  APP_ABORT(" Illegal action. Cannot use DiracDeterminantBase::evaluateDerivatives");
143  }
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ evaluateDerivativesWF()

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

Compute the derivatives of the log of the wavefunction with respect to optimizable parameters.

parameters

Parameters
Pparticle set
optvarsoptimizable parameters
dlogpsiarray of derivatives of the log of the wavefunction. Note: this function differs from the evaluateDerivatives function in the way that it only computes the derivative of the log of the wavefunction.

Reimplemented from WaveFunctionComponent.

Reimplemented in DiracDeterminantBatched< PL, VT, FPVT >, and DiracDeterminant< DU_TYPE >.

Definition at line 92 of file DiracDeterminantBase.h.

95  {
96  // assume no orbital optimization. If implemented, override this function
97  }

◆ evaluateGL()

compute gradients and laplacian of the TWF with respect to each particle.

Parameters
Pparticle set
GGradients, $\nabla\ln\Psi$
LLaplacians, $\nabla^2\ln\Psi$
fromscratchif true and this WFC is sensitive to numeical error accumulation, all the internal data are recomputed from scratch.
Returns
log(psi)

Definition at line 178 of file WaveFunctionComponent.cpp.

182 {
183  return evaluateLog(P, G, L);
184 }
virtual LogValue evaluateLog(const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L)=0
evaluate the value of the WaveFunctionComponent from scratch

◆ evaluateHessian()

virtual void evaluateHessian
inline

Definition at line 182 of file WaveFunctionComponent.h.

183  {
184  APP_ABORT("WaveFunctionComponent::evaluateHessian is not implemented in " + getClassName() + " class.");
185  }
virtual std::string getClassName() const =0
return class name
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ evaluateLog()

virtual LogValue evaluateLog

evaluate the value of the WaveFunctionComponent from scratch

Parameters
[in]Pactive ParticleSet
[out]GGradients, $\nabla\ln\Psi$
[out]LLaplacians, $\nabla^2\ln\Psi$
Returns
the log value

Mainly for walker-by-walker move. The initial stage of particle-by-particle move also uses this. causes complete state update in WFC's

◆ evaluateRatios()

void evaluateRatios

evaluate ratios to evaluate the non-local PP

Parameters
VPVirtualParticleSet
ratiosratios with new positions VP.R[k] the VP.refPtcl

Definition at line 238 of file WaveFunctionComponent.cpp.

239 {
240  std::ostringstream o;
241  o << "WaveFunctionComponent::evaluateRatios is not implemented by " << getClassName();
242  APP_ABORT(o.str());
243 }
virtual std::string getClassName() const =0
return class name
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ evaluateRatiosAlltoOne()

void evaluateRatiosAlltoOne

evaluate the ratios of one virtual move with respect to all the particles

Parameters
Preference particleset
ratios$ ratios[i]=\{{\bf R}\}\rightarrow {r_0,\cdots,r_i^p=pos,\cdots,r_{N-1}}$

Definition at line 231 of file WaveFunctionComponent.cpp.

232 {
233  assert(P.getTotalNum() == ratios.size());
234  for (int i = 0; i < P.getTotalNum(); ++i)
235  ratios[i] = ratio(P, i);
236 }
virtual PsiValue ratio(ParticleSet &P, int iat)=0
evaluate the ratio of the new to old WaveFunctionComponent value

◆ evaluateSpinorRatios()

void evaluateSpinorRatios

Used by SOECPComponent for faster SOC evaluation.

Definition at line 245 of file WaveFunctionComponent.cpp.

246 {
247  evaluateRatios(P, ratios);
248 }
virtual void evaluateRatios(const VirtualParticleSet &VP, std::vector< ValueType > &ratios)
evaluate ratios to evaluate the non-local PP

◆ extractOptimizableObjectRefs()

void extractOptimizableObjectRefs ( UniqueOptObjRefs opt_obj_refs)
inlinefinalvirtual

extract underlying OptimizableObject references

Parameters
opt_obj_refsaggregated list of optimizable object references

Reimplemented from WaveFunctionComponent.

Definition at line 76 of file DiracDeterminantBase.h.

References DiracDeterminantBase::Phi.

77  {
78  Phi->extractOptimizableObjectRefs(opt_obj_refs);
79  }
const std::unique_ptr< SPOSet > Phi
a set of single-particle orbitals used to fill in the values of the matrix

◆ getFirstIndex()

int getFirstIndex ( ) const
inline

Definition at line 66 of file DiracDeterminantBase.h.

References DiracDeterminantBase::FirstIndex.

66 { return FirstIndex; }
const int FirstIndex
index of the first particle with respect to the particle set

◆ getLastIndex()

int getLastIndex ( ) const
inline

Definition at line 67 of file DiracDeterminantBase.h.

References DiracDeterminantBase::LastIndex.

67 { return LastIndex; }
const int LastIndex
index of the last particle with respect to the particle set

◆ getPhi()

SPOSetPtr getPhi ( ) const
inline

Definition at line 63 of file DiracDeterminantBase.h.

References DiracDeterminantBase::Phi.

63 { return Phi.get(); }
const std::unique_ptr< SPOSet > Phi
a set of single-particle orbitals used to fill in the values of the matrix

◆ getPsiMinv()

virtual ValueMatrix& getPsiMinv ( )
inlinevirtual

Reimplemented in DiracDeterminant< DU_TYPE >.

Definition at line 70 of file DiracDeterminantBase.h.

References DiracDeterminantBase::dummy_vmt.

◆ isFermionic()

bool isFermionic ( ) const
inlinefinalvirtual

true, if this component is fermionic

Reimplemented from WaveFunctionComponent.

Definition at line 73 of file DiracDeterminantBase.h.

73 { return true; }

◆ isOptimizable()

bool isOptimizable ( ) const
inlinefinalvirtual

if true, this contains optimizable components

Reimplemented from WaveFunctionComponent.

Definition at line 74 of file DiracDeterminantBase.h.

References DiracDeterminantBase::Phi.

74 { return Phi->isOptimizable(); }
const std::unique_ptr< SPOSet > Phi
a set of single-particle orbitals used to fill in the values of the matrix

◆ makeClone()

std::unique_ptr<WaveFunctionComponent> makeClone ( ParticleSet tqp) const
inlinefinalvirtual

make clone

Parameters
tqptarget Quantum ParticleSet
deepcopyif true, make a decopy

If not true, return a proxy class

Reimplemented from WaveFunctionComponent.

Definition at line 146 of file DiracDeterminantBase.h.

References APP_ABORT.

147  {
148  APP_ABORT(" Illegal action. Cannot use DiracDeterminantBase::makeClone");
149  return std::unique_ptr<DiracDeterminantBase>();
150  }
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ makeCopy()

virtual std::unique_ptr<DiracDeterminantBase> makeCopy ( std::unique_ptr< SPOSet > &&  spo) const
pure virtual

cloning function

Parameters
tqptarget particleset
spospo set

This interface is exposed only to SlaterDet and its derived classes can overwrite to clone itself correctly.

Implemented in DiracDeterminantBatched< PL, VT, FPVT >, DiracDeterminant< DU_TYPE >, DiracDeterminantWithBackflow, and DummyDiracDetWithoutMW.

◆ mw_accept_rejectMove()

void mw_accept_rejectMove

moves of the iat-th particle on some walkers in a batch is accepted.

Update the current content. Note that all the lists only include accepted walkers.

Parameters
wfc_listthe list of WaveFunctionComponent pointers of the same component in a walker batch
p_listthe list of ParticleSet pointers in a walker batch
iatparticle index
safe_to_delayif true, delayed accept is safe.

Definition at line 157 of file WaveFunctionComponent.cpp.

162 {
163  assert(this == &wfc_list.getLeader());
164  for (int iw = 0; iw < wfc_list.size(); iw++)
165  if (isAccepted[iw])
166  wfc_list[iw].acceptMove(p_list[iw], iat, safe_to_delay);
167  else
168  wfc_list[iw].restore(iat);
169 }

◆ mw_calcRatio()

void mw_calcRatio

compute the ratio of the new to old WaveFunctionComponent value of multiple walkers

Parameters
wfc_listthe list of WaveFunctionComponent pointers of the same component in a walker batch
p_listthe list of ParticleSet pointers in a walker batch
iatparticle index
ratiosthe list of WF ratios of a walker batch, $ \Psi( \{ {\bf R}^{'} \} )/ \Psi( \{ {\bf R}\})$

Definition at line 104 of file WaveFunctionComponent.cpp.

108 {
109  assert(this == &wfc_list.getLeader());
110  for (int iw = 0; iw < wfc_list.size(); iw++)
111  ratios[iw] = wfc_list[iw].ratio(p_list[iw], iat);
112 }
virtual PsiValue ratio(ParticleSet &P, int iat)=0
evaluate the ratio of the new to old WaveFunctionComponent value

◆ mw_completeUpdates()

void mw_completeUpdates

complete all the delayed or asynchronous operations for all the walkers in a batch before leaving the p-by-p move region.

Definition at line 171 of file WaveFunctionComponent.cpp.

172 {
173  assert(this == &wfc_list.getLeader());
174  for (int iw = 0; iw < wfc_list.size(); iw++)
175  wfc_list[iw].completeUpdates();
176 }
virtual void completeUpdates()
complete all the delayed or asynchronous operations before leaving the p-by-p move region...

◆ mw_evalGrad() [1/2]

void mw_evalGrad

compute the current gradients for the iat-th particle of multiple walkers

Parameters
wfc_listthe list of WaveFunctionComponent pointers of the same component in a walker batch
p_listthe list of ParticleSet pointers in a walker batch
iatparticle index
grad_nowthe list of gradients in a walker batch, $\nabla\ln\Psi$

Definition at line 80 of file WaveFunctionComponent.cpp.

84 {
85  assert(this == &wfc_list.getLeader());
86  for (int iw = 0; iw < wfc_list.size(); iw++)
87  grad_now[iw] = wfc_list[iw].evalGrad(p_list[iw], iat);
88 }
virtual GradType evalGrad(ParticleSet &P, int iat)
return the current gradient for the iat-th particle

◆ mw_evalGrad() [2/2]

void mw_evalGrad ( CoordsType  CT)

compute the current gradients for the iat-th particle of multiple walkers

Parameters
[out]grad_nowthe list of gradients in a walker batch, $\nabla\ln\Psi$

Definition at line 69 of file WaveFunctionComponent.cpp.

73 {
74  if constexpr (CT == CoordsType::POS_SPIN)
75  mw_evalGradWithSpin(wfc_list, p_list, iat, grad_now.grads_positions, grad_now.grads_spins);
76  else
77  mw_evalGrad(wfc_list, p_list, iat, grad_now.grads_positions);
78 }
void mw_evalGrad(const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, const int iat, TWFGrads< CT > &grads_now) const
compute the current gradients for the iat-th particle of multiple walkers
virtual void mw_evalGradWithSpin(const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< GradType > &grad_now, std::vector< ComplexType > &spingrad_now) const
compute the current gradients and spin gradients for the iat-th particle of multiple walkers ...

◆ mw_evaluateGL()

void mw_evaluateGL

evaluate gradients and laplacian of the same type WaveFunctionComponent of multiple walkers

Parameters
wfc_listthe list of WaveFunctionComponent pointers of the same component in a walker batch
p_listthe list of ParticleSet pointers in a walker batch
G_listthe list of Gradients pointers in a walker batch, $\nabla\ln\Psi$
L_listthe list of Laplacians pointers in a walker batch, $\nabla^2\ln\Psi$
fromscratchif true and this WFC is sensitive to numerical error accumulation, all the internal data are recomputed from scratch.

Definition at line 186 of file WaveFunctionComponent.cpp.

191 {
192  assert(this == &wfc_list.getLeader());
193  for (int iw = 0; iw < wfc_list.size(); iw++)
194  wfc_list[iw].evaluateGL(p_list[iw], G_list[iw], L_list[iw], fromscratch);
195 }
virtual LogValue evaluateGL(const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L, bool fromscratch)
compute gradients and laplacian of the TWF with respect to each particle.

◆ mw_evaluateLog()

void mw_evaluateLog

evaluate from scratch the same type WaveFunctionComponent of multiple walkers

Parameters
wfc_listthe list of WaveFunctionComponent pointers of the same component in a walker batch
p_listthe list of ParticleSet pointers in a walker batch
G_listthe list of Gradients pointers in a walker batch, $\nabla\ln\Psi$
L_listthe list of Laplacians pointers in a walker batch, $\nabla^2\ln\Psi$
valuesthe log WF values of walkers in a batch

Definition at line 31 of file WaveFunctionComponent.cpp.

35 {
36  assert(this == &wfc_list.getLeader());
37  for (int iw = 0; iw < wfc_list.size(); iw++)
38  wfc_list[iw].evaluateLog(p_list[iw], G_list[iw], L_list[iw]);
39 }
virtual LogValue evaluateLog(const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L)=0
evaluate the value of the WaveFunctionComponent from scratch

◆ mw_evaluateRatios()

void mw_evaluateRatios

evaluate ratios to evaluate the non-local PP multiple walkers

Parameters
wfc_listthe list of WaveFunctionComponent references of the same component in a walker batch
vp_listthe list of VirtualParticleSet references in a walker batch
ratiosof all the virtual moves of all the walkers

Definition at line 250 of file WaveFunctionComponent.cpp.

253 {
254  assert(this == &wfc_list.getLeader());
255  for (int iw = 0; iw < wfc_list.size(); iw++)
256  wfc_list[iw].evaluateRatios(vp_list[iw], ratios[iw]);
257 }
virtual void evaluateRatios(const VirtualParticleSet &VP, std::vector< ValueType > &ratios)
evaluate ratios to evaluate the non-local PP

◆ mw_ratioGrad() [1/2]

void mw_ratioGrad ( CoordsType  CT)

Definition at line 122 of file WaveFunctionComponent.cpp.

127 {
128  if constexpr (CT == CoordsType::POS_SPIN)
129  mw_ratioGradWithSpin(wfc_list, p_list, iat, ratios, grad_new.grads_positions, grad_new.grads_spins);
130  else
131  mw_ratioGrad(wfc_list, p_list, iat, ratios, grad_new.grads_positions);
132 }
virtual void mw_ratioGradWithSpin(const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios, std::vector< GradType > &grad_new, std::vector< ComplexType > &spingrad_new) const
compute the ratio of the new to old WaveFunctionComponent value and the new gradient/spingradient of ...
void mw_ratioGrad(const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios, TWFGrads< CT > &grad_new) const

◆ mw_ratioGrad() [2/2]

void mw_ratioGrad

compute the ratio of the new to old WaveFunctionComponent value and the new gradient of multiple walkers

Parameters
wfc_listthe list of WaveFunctionComponent pointers of the same component in a walker batch
p_listthe list of ParticleSet pointers in a walker batch
iatparticle index
ratiosthe list of WF ratios of a walker batch, $ \Psi( \{ {\bf R}^{'} \} )/ \Psi( \{ {\bf R}\})$
grad_nowthe list of new gradients in a walker batch, $\nabla\ln\Psi$

Definition at line 134 of file WaveFunctionComponent.cpp.

139 {
140  assert(this == &wfc_list.getLeader());
141  for (int iw = 0; iw < wfc_list.size(); iw++)
142  ratios[iw] = wfc_list[iw].ratioGrad(p_list[iw], iat, grad_new[iw]);
143 }
virtual PsiValue ratioGrad(ParticleSet &P, int iat, GradType &grad_iat)
evaluate the ratio of the new to old WaveFunctionComponent value and the new gradient ...

◆ operator=()

DiracDeterminantBase& operator= ( const DiracDeterminantBase s)
delete

◆ ratio()

virtual PsiValue ratio

evaluate the ratio of the new to old WaveFunctionComponent value

Parameters
Pthe active ParticleSet
iatthe index of a particle
Returns
$ \psi( \{ {\bf R}^{'} \} )/ \psi( \{ {\bf R}\})$

Specialized for particle-by-particle move

◆ ratioGrad()

PsiValue ratioGrad

evaluate the ratio of the new to old WaveFunctionComponent value and the new gradient

Parameters
Pthe active ParticleSet
iatthe index of a particle
grad_iatGradient for the active particle

Definition at line 115 of file WaveFunctionComponent.cpp.

116 {
117  APP_ABORT("WaveFunctionComponent::ratioGrad is not implemented in " + getClassName() + " class.");
118  return ValueType();
119 }
virtual std::string getClassName() const =0
return class name
QTBase::ValueType ValueType
Definition: Configuration.h:60
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ ratioGradWithSpin()

PsiValue ratioGradWithSpin ( ParticleSet P,
int  iat,
GradType grad_iat,
ComplexType spingrad_iat 
)
inlineoverridevirtual

evaluate the ratio of the new to old WaveFunctionComponent value and the new spin gradient Default implementation assumes that WaveFunctionComponent does not explicitly depend on Spin.

Parameters
Pthe active ParticleSet
iatthe index of a particle
grad_iatrealspace gradient for the active particle
spingrad_iatspin gradient for the active particle

Reimplemented from WaveFunctionComponent.

Reimplemented in DummyDiracDetWithoutMW.

Definition at line 152 of file DiracDeterminantBase.h.

References APP_ABORT.

153  {
154  APP_ABORT(" DiracDeterminantBase::ratioGradWithSpin(): Implementation required\n");
155  return 0.0;
156  }
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ recompute()

void recompute

recompute the value of the WaveFunctionComponents which require critical accuracy.

needed for Slater Determinants but not needed for most types of WaveFunctionComponents

Definition at line 41 of file WaveFunctionComponent.cpp.

42 {
43  ParticleSet::ParticleGradient temp_G(P.getTotalNum());
44  ParticleSet::ParticleLaplacian temp_L(P.getTotalNum());
45 
46  evaluateLog(P, temp_G, temp_L);
47 }
virtual LogValue evaluateLog(const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L)=0
evaluate the value of the WaveFunctionComponent from scratch
ParticleAttrib< QTFull::ValueType > ParticleLaplacian
Definition: Configuration.h:96
ParticleAttrib< QTFull::GradType > ParticleGradient
Definition: Configuration.h:95

◆ registerData()

virtual void registerData

For particle-by-particle move.

Requests space in the buffer based on the data type sizes of the objects in this class.

Parameters
Pparticle set
bufAnonymous storage

◆ registerTWFFastDerivWrapper()

virtual void registerTWFFastDerivWrapper ( const ParticleSet P,
TWFFastDerivWrapper twf 
) const
inlineoverridevirtual

Register the component with the TWFFastDerivWrapper wrapper.

Reimplemented from WaveFunctionComponent.

Reimplemented in DiracDeterminantBatched< PL, VT, FPVT >, and DiracDeterminant< DU_TYPE >.

Definition at line 87 of file DiracDeterminantBase.h.

88  {
89  throw std::runtime_error("DiracDeterminantBase::registerTWFFastDerivWrapper must be overridden\n");
90  }

◆ releaseResource()

virtual void releaseResource
inline

return a shared resource to a collection

Definition at line 436 of file WaveFunctionComponent.h.

438  {}

◆ restore()

virtual void restore

If a move for iat-th particle is rejected, restore to the content.

Parameters
iatindex of the particle whose new position was proposed

Ye: hopefully we can gradually move away from restore

◆ updateBuffer()

virtual LogValue updateBuffer

For particle-by-particle move.

Put the objects of this class in the walker buffer or forward the memory cursor.

Parameters
Pparticle set
bufAnonymous storage
fromscratchrequest recomputing the precision critical pieces of wavefunction from scratch
Returns
log value of the wavefunction.

Member Data Documentation

◆ BufferTimer

NewTimer & BufferTimer
protected

Definition at line 173 of file DiracDeterminantBase.h.

◆ dummy_vmt

ValueMatrix dummy_vmt
protected

Definition at line 189 of file DiracDeterminantBase.h.

Referenced by DiracDeterminantBase::getPsiMinv().

◆ FirstIndex

◆ InverseTimer

◆ LastIndex

◆ NumOrbitals

◆ NumPtcls

◆ Phi

◆ RatioTimer

NewTimer & RatioTimer
protected

Definition at line 173 of file DiracDeterminantBase.h.

◆ SPOVGLTimer

NewTimer & SPOVGLTimer
protected

Definition at line 173 of file DiracDeterminantBase.h.

◆ SPOVTimer

NewTimer & SPOVTimer
protected

Definition at line 173 of file DiracDeterminantBase.h.

◆ UpdateTimer

NewTimer& UpdateTimer
protected

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