![]() |
QMCPACK
|
Classes | |
struct | DiracDeterminantBatchedMultiWalkerResource |
Public Member Functions | |
DiracDeterminantBatched (std::unique_ptr< SPOSet > &&spos, int first, int last, int ndelay=1, DetMatInvertor matrix_inverter_kind=DetMatInvertor::ACCEL) | |
constructor More... | |
DiracDeterminantBatched (const DiracDeterminantBatched &s)=delete | |
DiracDeterminantBatched & | operator= (const DiracDeterminantBatched &s)=delete |
std::string | getClassName () const override |
return class name More... | |
void | evaluateDerivatives (ParticleSet &P, const opt_variables_type &active, Vector< Value > &dlogpsi, Vector< Value > &dhpsioverpsi) override |
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... | |
void | registerData (ParticleSet &P, WFBufferType &buf) override |
For particle-by-particle move. More... | |
LogValue | updateBuffer (ParticleSet &P, WFBufferType &buf, bool fromscratch=false) override |
For particle-by-particle move. More... | |
void | copyFromBuffer (ParticleSet &P, WFBufferType &buf) override |
For particle-by-particle move. More... | |
PsiValue | ratio (ParticleSet &P, int iat) override |
return the ratio only for the iat-th partcle move More... | |
void | mw_calcRatio (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios) const override |
void | evaluateRatios (const VirtualParticleSet &VP, std::vector< Value > &ratios) override |
compute multiple ratios for a particle move More... | |
void | evaluateSpinorRatios (const VirtualParticleSet &VP, const std::pair< ValueVector, ValueVector > &spinor_multiplier, std::vector< Value > &ratios) override |
void | mw_evaluateRatios (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< const VirtualParticleSet > &vp_list, std::vector< std::vector< Value >> &ratios) const override |
void | evaluateDerivRatios (const VirtualParticleSet &VP, const opt_variables_type &optvars, std::vector< ValueType > &ratios, Matrix< ValueType > &dratios) override |
evaluate ratios to evaluate the non-local PP More... | |
PsiValue | ratioGrad (ParticleSet &P, int iat, Grad &grad_iat) override |
void | mw_ratioGrad (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios, std::vector< Grad > &grad_new) const override |
void | mw_ratioGradWithSpin (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< PsiValue > &ratios, std::vector< Grad > &grad_new, std::vector< ComplexType > &spingrad_new) const override |
PsiValue | ratioGradWithSpin (ParticleSet &P, int iat, Grad &grad_iat, ComplexType &spingrad) override |
Grad | evalGrad (ParticleSet &P, int iat) override |
return the current gradient for the iat-th particle More... | |
void | mw_evalGrad (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< Grad > &grad_now) const override |
Grad | 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... | |
void | mw_evalGradWithSpin (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, int iat, std::vector< Grad > &grad_now, std::vector< ComplexType > &spingrad_now) const override |
Grad | evalGradSource (ParticleSet &P, ParticleSet &source, int iat) override |
Grad | evalGradSource (ParticleSet &P, ParticleSet &source, int iat, TinyVector< ParticleSet::ParticleGradient, OHMMS_DIM > &grad_grad, TinyVector< ParticleSet::ParticleLaplacian, OHMMS_DIM > &lapl_grad) override |
Adds the gradient w.r.t. More... | |
void | acceptMove (ParticleSet &P, int iat, bool safe_to_delay=false) override |
move was accepted, update the real container More... | |
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 override |
moves of the iat-th particle on some walkers in a batch is accepted. More... | |
void | completeUpdates () override |
complete any left over determinant matrix updates. More... | |
void | mw_completeUpdates (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list) const override |
complete all the delayed or asynchronous operations for all the walkers in a batch before leaving the p-by-p move region. More... | |
void | restore (int iat) override |
move was rejected. More... | |
LogValue | evaluateLog (const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L) override |
evaluate from scratch pretty much everything for this single walker determinant More... | |
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 override |
evaluate from scratch the same type WaveFunctionComponent of multiple walkers More... | |
void | recompute (const ParticleSet &P) override |
recompute the value of the WaveFunctionComponents which require critical accuracy. More... | |
void | mw_recompute (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< bool > &recompute) const override |
Does a Phi->mw_evaluate_notranspose then mw_invertPsiM over a set of elements filtered based on the recompute mask. More... | |
LogValue | evaluateGL (const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L, bool fromscratch) override |
compute gradients and laplacian of the TWF with respect to each particle. More... | |
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 override |
evaluate gradients and laplacian of the same type WaveFunctionComponent of multiple walkers More... | |
void | evaluateHessian (ParticleSet &P, HessVector &grad_grad_psi) override |
void | createResource (ResourceCollection &collection) const override |
initialize a shared resource and hand it to a collection More... | |
void | acquireResource (ResourceCollection &collection, const RefVectorWithLeader< WaveFunctionComponent > &wfc_list) const override |
acquire a shared resource from a collection More... | |
void | releaseResource (ResourceCollection &collection, const RefVectorWithLeader< WaveFunctionComponent > &wfc_list) const override |
return a shared resource to a collection More... | |
void | registerTWFFastDerivWrapper (const ParticleSet &P, TWFFastDerivWrapper &twf) const override |
Register the component with the TWFFastDerivWrapper wrapper. More... | |
std::unique_ptr< DiracDeterminantBase > | makeCopy (std::unique_ptr< SPOSet > &&spo) const override |
cloning function More... | |
void | evaluateRatiosAlltoOne (ParticleSet &P, std::vector< Value > &ratios) override |
const auto & | get_psiMinv () const |
![]() | |
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 | |
DiracDeterminantBase & | operator= (const DiracDeterminantBase &s)=delete |
SPOSetPtr | getPhi () const |
int | getFirstIndex () const |
int | getLastIndex () const |
virtual ValueMatrix & | getPsiMinv () |
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 | evaluateDerivatives (ParticleSet &P, const opt_variables_type &active, int offset, Matrix< RealType > &dlogpsi, Array< GradType, 3 > &dG, Matrix< RealType > &dL) |
std::unique_ptr< WaveFunctionComponent > | makeClone (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... | |
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... | |
![]() | |
const LogValue & | get_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... | |
PsiValue | getValue () const |
assembles the full value More... | |
virtual bool | isMultiDet () const |
true, if this component is multi-determinant More... | |
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 |
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 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 | 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 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 ![]() | |
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 | 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... | |
Private Member Functions | |
void | resize (int nel, int morb) |
reset the size: with the number of particles and number of orbtials More... | |
void | computeGL (ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L) const |
compute G and L assuming psiMinv, dpsiM, d2psiM are ready for use More... | |
void | invertPsiM (const DualMatrix< Value > &psiM, DualMatrix< Value > &psiMinv) |
single invert logdetT(psiM) as a side effect this->log_value_ gets the log determinant of logdetT More... | |
void | resizeScratchObjectsForIonDerivs () |
Resize all temporary arrays required for force computation. More... | |
Static Private Member Functions | |
static void | mw_invertPsiM (const RefVectorWithLeader< WaveFunctionComponent > &wfc_list, const RefVector< const DualMatrix< Value >> &logdetT_list, const RefVector< DualMatrix< Value >> &a_inv_lis) |
Inverts and finds log det for a batch of matrices. More... | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
static bool | checkG (const GradType &g) |
![]() | |
NewTimer & | UpdateTimer |
Timers. More... | |
NewTimer & | RatioTimer |
NewTimer & | InverseTimer |
NewTimer & | BufferTimer |
NewTimer & | SPOVTimer |
NewTimer & | SPOVGLTimer |
const std::unique_ptr< SPOSet > | Phi |
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 |
![]() | |
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 ![]() | |
Definition at line 75 of file DiracDeterminantBatched.h.
using DetInverter = typename DetInverterSelector<PL, FPVT>::Inverter |
Definition at line 79 of file DiracDeterminantBatched.h.
using DualMatrix = Matrix<DT, OffloadPinnedAllocator<DT> > |
Definition at line 94 of file DiracDeterminantBatched.h.
using DualVector = Vector<DT, OffloadPinnedAllocator<DT> > |
Definition at line 92 of file DiracDeterminantBatched.h.
using DualVGLVector = VectorSoaContainer<Value, DIM + 2, OffloadPinnedAllocator<Value> > |
Definition at line 97 of file DiracDeterminantBatched.h.
using FullPrecGrad = TinyVector<FullPrecValue, DIM> |
Definition at line 88 of file DiracDeterminantBatched.h.
using FullPrecValue = typename WFT::FullPrecValue |
Definition at line 82 of file DiracDeterminantBatched.h.
Definition at line 85 of file DiracDeterminantBatched.h.
Definition at line 86 of file DiracDeterminantBatched.h.
using LogValue = typename WFT::LogValue |
Definition at line 84 of file DiracDeterminantBatched.h.
using OffloadMatrix = Matrix<DT, OffloadPinnedAllocator<DT> > |
Definition at line 96 of file DiracDeterminantBatched.h.
using OffloadMWVGLArray = typename SPOSet::OffloadMWVGLArray |
Definition at line 99 of file DiracDeterminantBatched.h.
using PsiValue = typename WFT::PsiValue |
Definition at line 83 of file DiracDeterminantBatched.h.
Definition at line 87 of file DiracDeterminantBatched.h.
using UpdateEngine = typename UpdateEngineSelector<PL, VT>::Engine |
Definition at line 78 of file DiracDeterminantBatched.h.
using Value = typename WFT::Value |
Definition at line 81 of file DiracDeterminantBatched.h.
using WFT = WaveFunctionTypes<VT, FPVT> |
Definition at line 80 of file DiracDeterminantBatched.h.
DiracDeterminantBatched | ( | std::unique_ptr< SPOSet > && | spos, |
int | first, | ||
int | last, | ||
int | ndelay = 1 , |
||
DetMatInvertor | matrix_inverter_kind = DetMatInvertor::ACCEL |
||
) |
constructor
spos | the single-particle orbital set |
first | index of the first particle |
last | index of last particle |
ndelay | delayed update rank |
spos | the single-particle orbital set |
first | index of the first particle |
Definition at line 62 of file DiracDeterminantBatched.cpp.
References RotatedSPOs::buildOptVariables(), DiracDeterminantBase::NumPtcls, DiracDeterminantBase::Phi, and DiracDeterminantBatched< PL, VT, FPVT >::resize().
|
delete |
|
overridevirtual |
move was accepted, update the real container
Implements WaveFunctionComponent.
Definition at line 456 of file DiracDeterminantBatched.cpp.
References qmcplusplus::convertValueToLog(), and qmcplusplus::simd::copy().
|
overridevirtual |
acquire a shared resource from a collection
Reimplemented from WaveFunctionComponent.
Definition at line 1228 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), RefVectorWithLeader< T >::getCastedLeader(), ResourceCollection::lendResource(), DiracDeterminantBatched< PL, VT, FPVT >::mw_res_handle_, and DiracDeterminantBatched< PL, VT, FPVT >::DiracDeterminantBatchedMultiWalkerResource< PL, VT, FPVT >::psiMinv_refs.
|
overridevirtual |
complete any left over determinant matrix updates.
Usually this is the end of pbyp moves for a given spin of electrons The psiM, dpsiM, d2psiM should be up-to-date on both device and host sides.
Reimplemented from WaveFunctionComponent.
Definition at line 548 of file DiracDeterminantBatched.cpp.
|
private |
compute G and L assuming psiMinv, dpsiM, d2psiM are ready for use
Definition at line 610 of file DiracDeterminantBatched.cpp.
References qmcplusplus::simd::dot(), and qmcplusplus::dot().
|
overridevirtual |
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.
P | particle set |
buf | Anonymous storage |
Implements WaveFunctionComponent.
Definition at line 736 of file DiracDeterminantBatched.cpp.
References PooledMemory< T_scalar, Alloc >::get().
|
overridevirtual |
initialize a shared resource and hand it to a collection
Reimplemented from WaveFunctionComponent.
Definition at line 1220 of file DiracDeterminantBatched.cpp.
References ResourceCollection::addResource().
|
overridevirtual |
return the current gradient for the iat-th particle
P | quantum particle set |
iat | particle index |
Reimplemented from WaveFunctionComponent.
Definition at line 178 of file DiracDeterminantBatched.cpp.
References qmcplusplus::simd::dot().
|
overridevirtual |
Note: Can result in substantial CPU memory allocation on first call. 31 * n^2 * sizeof(Value) bytes per DDB
Reimplemented from WaveFunctionComponent.
Definition at line 928 of file DiracDeterminantBatched.cpp.
References qmcplusplus::simd::dot().
|
overridevirtual |
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).
P | quantum particle set (electrons) |
source | classical particle set (ions) |
iat | particle index of source (ion) |
the | ion gradient of the elctron gradient |
the | ion gradient of the elctron laplacian. |
Reimplemented from WaveFunctionComponent.
Definition at line 974 of file DiracDeterminantBatched.cpp.
References OHMMS_DIM.
|
overridevirtual |
return the current spin gradient for the iat-th particle Default implementation assumes that WaveFunctionComponent does not explicitly depend on Spin.
P | quantum particle set |
iat | particle index |
Reimplemented from DiracDeterminantBase.
Definition at line 224 of file DiracDeterminantBatched.cpp.
References qmcplusplus::simd::dot().
|
override |
Definition at line 1188 of file DiracDeterminantBatched.cpp.
|
overridevirtual |
Compute the derivatives of the log of the wavefunction with respect to optimizable parameters.
parameters
P | particle set |
optvars | optimizable parameters |
dlogpsi | array 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 DiracDeterminantBase.
Definition at line 1197 of file DiracDeterminantBatched.cpp.
|
overridevirtual |
evaluate ratios to evaluate the non-local PP
VP | VirtualParticleSet |
ratios | ratios with new positions VP.R[k] the VP.refPtcl |
dratios | Nq x Num_param matrix. ![]() |
Reimplemented from WaveFunctionComponent.
Definition at line 893 of file DiracDeterminantBatched.cpp.
References qmcplusplus::syclBLAS::copy_n(), and VirtualParticleSet::refPtcl.
|
overridevirtual |
compute gradients and laplacian of the TWF with respect to each particle.
P | particle set |
G | Gradients, ![]() |
L | Laplacians, ![]() |
fromscratch | if true and this WFC is sensitive to numeical error accumulation, all the internal data are recomputed from scratch. |
Reimplemented from WaveFunctionComponent.
Definition at line 623 of file DiracDeterminantBatched.cpp.
|
overridevirtual |
Reimplemented from WaveFunctionComponent.
Definition at line 947 of file DiracDeterminantBatched.cpp.
References qmcplusplus::simd::dot(), and qmcplusplus::outerProduct().
|
overridevirtual |
evaluate from scratch pretty much everything for this single walker determinant
Calculate the log value of the Dirac determinant for particles.
return of the log of the dirac determinant is the least of what it does.
call to generate valid initial state for determinant and when you suspect psiMinv or other state variables may have picked up error.
P | input configuration containing N particles |
G | a vector containing N gradients |
L | a vector containing N laplacians |
Add the gradient and laplacian contribution of the determinant to G(radient) and L(aplacian) for local energy calculations.
Implements WaveFunctionComponent.
Definition at line 1065 of file DiracDeterminantBatched.cpp.
|
override |
compute multiple ratios for a particle move
Definition at line 823 of file DiracDeterminantBatched.cpp.
References qmcplusplus::syclBLAS::copy_n(), and VirtualParticleSet::refPtcl.
|
override |
Definition at line 905 of file DiracDeterminantBatched.cpp.
References qmcplusplus::simd::dot().
|
override |
Definition at line 837 of file DiracDeterminantBatched.cpp.
References qmcplusplus::syclBLAS::copy_n(), and VirtualParticleSet::refPtcl.
|
inline |
Definition at line 283 of file DiracDeterminantBatched.h.
References DiracDeterminantBatched< PL, VT, FPVT >::psiMinv_.
|
inlineoverridevirtual |
return class name
Implements WaveFunctionComponent.
Definition at line 117 of file DiracDeterminantBatched.h.
|
private |
single invert logdetT(psiM) as a side effect this->log_value_ gets the log determinant of logdetT
Definition at line 85 of file DiracDeterminantBatched.cpp.
References Matrix< T, Alloc >::updateTo().
|
overridevirtual |
cloning function
tqp | target particleset |
spo | spo set |
This interface is exposed only to SlaterDet and its derived classes can overwrite to clone itself correctly.
Implements DiracDeterminantBase.
Definition at line 1212 of file DiracDeterminantBatched.cpp.
|
overridevirtual |
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.
wfc_list | the list of WaveFunctionComponent pointers of the same component in a walker batch |
p_list | the list of ParticleSet pointers in a walker batch |
iat | particle index |
safe_to_delay | if true, delayed accept is safe. |
Reimplemented from WaveFunctionComponent.
Definition at line 480 of file DiracDeterminantBatched.cpp.
References qmcplusplus::convertValueToLog(), qmcplusplus::det(), qmcplusplus::ewaldref::DIM, RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), and DiracDeterminantBatched< PL, VT, FPVT >::mw_res_handle_.
|
override |
Definition at line 772 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), and DiracDeterminantBatched< PL, VT, FPVT >::mw_res_handle_.
|
overridevirtual |
complete all the delayed or asynchronous operations for all the walkers in a batch before leaving the p-by-p move region.
Reimplemented from WaveFunctionComponent.
Definition at line 561 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), DiracDeterminantBatched< PL, VT, FPVT >::mw_res_handle_, and qmcplusplus::queue.
|
override |
Definition at line 189 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), qmcplusplus::ewaldref::DIM, RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), and DiracDeterminantBatched< PL, VT, FPVT >::mw_res_handle_.
|
override |
Definition at line 240 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), qmcplusplus::ewaldref::DIM, RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), SPOSet::mw_evaluateVGLWithSpin(), and DiracDeterminantBatched< PL, VT, FPVT >::mw_res_handle_.
|
overridevirtual |
evaluate gradients and laplacian of the same type WaveFunctionComponent of multiple walkers
wfc_list | the list of WaveFunctionComponent pointers of the same component in a walker batch |
p_list | the list of ParticleSet pointers in a walker batch |
G_list | the list of Gradients pointers in a walker batch, ![]() |
L_list | the list of Laplacians pointers in a walker batch, ![]() |
fromscratch | if true and this WFC is sensitive to numerical error accumulation, all the internal data are recomputed from scratch. |
Reimplemented from WaveFunctionComponent.
Definition at line 646 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), and RefVectorWithLeader< T >::getLeader().
|
overridevirtual |
evaluate from scratch the same type WaveFunctionComponent of multiple walkers
wfc_list | the list of WaveFunctionComponent pointers of the same component in a walker batch |
p_list | the list of ParticleSet pointers in a walker batch |
G_list | the list of Gradients pointers in a walker batch, ![]() |
L_list | the list of Laplacians pointers in a walker batch, ![]() |
values | the log WF values of walkers in a batch |
Reimplemented from WaveFunctionComponent.
Definition at line 1076 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), RefVectorWithLeader< T >::getCastedElement(), and RefVectorWithLeader< T >::getLeader().
|
override |
Definition at line 854 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), RefVectorWithLeader< T >::getCastedElement(), and RefVectorWithLeader< T >::getLeader().
|
staticprivate |
Inverts and finds log det for a batch of matrices.
Right now this takes filtered lists and the full recompute mask. It passes all these elements down to the det_engine_. This allows minimal change for implementation code while establishing the API I'd prefer for direct inversion. I think the det_engine_ mw method should receive the complete list of walker elements and the implementation should decide what to do re the compute mask. See future PR for those changes, or drop of compute_mask argument.
Definition at line 99 of file DiracDeterminantBatched.cpp.
References qmcplusplus::ACCEL, DiracDeterminantBatched< PL, VT, FPVT >::accel_inverter_, qmcplusplus::det(), RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), ResourceHandle< RS >::getResource(), DiracDeterminantBatched< PL, VT, FPVT >::mw_res_handle_, and DiracDeterminantBatched< PL, VT, FPVT >::resize().
|
override |
Definition at line 324 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), and DiracDeterminantBatched< PL, VT, FPVT >::mw_res_handle_.
|
override |
Definition at line 373 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), and DiracDeterminantBatched< PL, VT, FPVT >::mw_res_handle_.
|
overridevirtual |
Does a Phi->mw_evaluate_notranspose then mw_invertPsiM over a set of elements filtered based on the recompute mask.
Reimplemented from WaveFunctionComponent.
Definition at line 1109 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), and qmcplusplus::queue.
|
delete |
|
overridevirtual |
return the ratio only for the iat-th partcle move
P | current configuration |
iat | the particle thas is being moved |
Implements WaveFunctionComponent.
Definition at line 755 of file DiracDeterminantBatched.cpp.
References qmcplusplus::simd::dot().
|
override |
Definition at line 301 of file DiracDeterminantBatched.cpp.
References qmcplusplus::simd::dot().
|
override |
Definition at line 427 of file DiracDeterminantBatched.cpp.
References qmcplusplus::simd::dot().
|
overridevirtual |
recompute the value of the WaveFunctionComponents which require critical accuracy.
needed for Slater Determinants but not needed for most types of WaveFunctionComponents
Reimplemented from WaveFunctionComponent.
Definition at line 1094 of file DiracDeterminantBatched.cpp.
|
overridevirtual |
For particle-by-particle move.
Requests space in the buffer based on the data type sizes of the objects in this class.
P | particle set |
buf | Anonymous storage |
Implements WaveFunctionComponent.
Definition at line 712 of file DiracDeterminantBatched.cpp.
References PooledMemory< T_scalar, Alloc >::add().
|
overridevirtual |
Register the component with the TWFFastDerivWrapper wrapper.
Reimplemented from DiracDeterminantBase.
Definition at line 1205 of file DiracDeterminantBatched.cpp.
References ParticleSet::getGroupID(), and qmcplusplus::twf.
|
overridevirtual |
return a shared resource to a collection
Reimplemented from WaveFunctionComponent.
Definition at line 1249 of file DiracDeterminantBatched.cpp.
References qmcplusplus::det(), RefVectorWithLeader< T >::getCastedLeader(), DiracDeterminantBatched< PL, VT, FPVT >::mw_res_handle_, and ResourceCollection::takebackResource().
|
private |
reset the size: with the number of particles and number of orbtials
Definition at line 154 of file DiracDeterminantBatched.cpp.
Referenced by DiracDeterminantBatched< PL, VT, FPVT >::DiracDeterminantBatched(), and DiracDeterminantBatched< PL, VT, FPVT >::mw_invertPsiM().
|
private |
Resize all temporary arrays required for force computation.
Definition at line 916 of file DiracDeterminantBatched.cpp.
|
overridevirtual |
move was rejected.
copy the real container to the temporary to move on
Implements WaveFunctionComponent.
Definition at line 542 of file DiracDeterminantBatched.cpp.
|
overridevirtual |
For particle-by-particle move.
Put the objects of this class in the walker buffer or forward the memory cursor.
P | particle set |
buf | Anonymous storage |
fromscratch | request recomputing the precision critical pieces of wavefunction from scratch |
Implements WaveFunctionComponent.
Definition at line 721 of file DiracDeterminantBatched.cpp.
References ParticleSet::G, ParticleSet::L, and PooledMemory< T_scalar, Alloc >::put().
|
private |
matrix inversion engine this a crowd scope resource and only the leader engine gets it
Definition at line 349 of file DiracDeterminantBatched.h.
Referenced by DiracDeterminantBatched< PL, VT, FPVT >::mw_invertPsiM().
|
private |
timers
Definition at line 382 of file DiracDeterminantBatched.h.
|
private |
Delayed update engine 1 per walker.
Definition at line 343 of file DiracDeterminantBatched.h.
|
private |
Definition at line 382 of file DiracDeterminantBatched.h.
|
private |
slow but doesn't consume device memory
Definition at line 346 of file DiracDeterminantBatched.h.
|
private |
selected scheme for inversion with walker batching
Definition at line 379 of file DiracDeterminantBatched.h.
|
private |
Definition at line 336 of file DiracDeterminantBatched.h.
Referenced by DiracDeterminantBatched< PL, VT, FPVT >::acquireResource(), DiracDeterminantBatched< PL, VT, FPVT >::mw_accept_rejectMove(), DiracDeterminantBatched< PL, VT, FPVT >::mw_calcRatio(), DiracDeterminantBatched< PL, VT, FPVT >::mw_completeUpdates(), DiracDeterminantBatched< PL, VT, FPVT >::mw_evalGrad(), DiracDeterminantBatched< PL, VT, FPVT >::mw_evalGradWithSpin(), DiracDeterminantBatched< PL, VT, FPVT >::mw_invertPsiM(), DiracDeterminantBatched< PL, VT, FPVT >::mw_ratioGrad(), DiracDeterminantBatched< PL, VT, FPVT >::mw_ratioGradWithSpin(), and DiracDeterminantBatched< PL, VT, FPVT >::releaseResource().
|
private |
maximal number of delayed updates
Definition at line 376 of file DiracDeterminantBatched.h.