![]() |
QMCPACK
|
JastrowBuilder using RPA functor Modification of RPAJastrow. More...
Inheritance diagram for RPAJastrow:
Collaboration diagram for RPAJastrow:Public Member Functions | |
| RPAJastrow (ParticleSet &target) | |
| ~RPAJastrow () override | |
| std::string | getClassName () const override |
| return class name More... | |
| bool | put (xmlNodePtr cur) |
| void | buildOrbital (const std::string &name, const std::string &UL, const std::string &US, const std::string &RF, RealType R, RealType K) |
| void | makeShortRange () |
| void | makeLongRange () |
| void | setHandler (std::unique_ptr< HandlerType > Handler) |
| bool | isOptimizable () const override |
| if true, this contains optimizable components More... | |
| void | checkOutVariables (const opt_variables_type &o) override |
| check out optimizable variables More... | |
| void | extractOptimizableObjectRefs (UniqueOptObjRefs &opt_obj_refs) override |
| extract underlying OptimizableObject references More... | |
| LogValue | evaluateLog (const ParticleSet &P, ParticleSet::ParticleGradient &G, ParticleSet::ParticleLaplacian &L) override |
| evaluate the value of the WaveFunctionComponent from scratch More... | |
| PsiValue | ratio (ParticleSet &P, int iat) override |
| evaluate the ratio of the new to old WaveFunctionComponent value More... | |
| GradType | evalGrad (ParticleSet &P, int iat) override |
| return the current gradient for the iat-th particle More... | |
| PsiValue | ratioGrad (ParticleSet &P, int iat, GradType &grad_iat) override |
| evaluate the ratio of the new to old WaveFunctionComponent value and the new gradient More... | |
| void | acceptMove (ParticleSet &P, int iat, bool safe_to_delay=false) override |
| a move for iat-th particle is accepted. More... | |
| void | restore (int iat) override |
| If a move for iat-th particle is rejected, restore to the content. 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... | |
| std::unique_ptr< WaveFunctionComponent > | makeClone (ParticleSet &tqp) const override |
| this is a great deal of logic for make clone I'm wondering what is going on More... | |
| void | evaluateDerivatives (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi) override |
| Compute the derivatives of both the log of the wavefunction and kinetic energy with respect to optimizable parameters. More... | |
Public Member Functions inherited from WaveFunctionComponent | |
| 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 | isFermionic () const |
| true, if this component is fermionic More... | |
| virtual bool | isMultiDet () const |
| true, if this component is multi-determinant More... | |
| virtual void | registerTWFFastDerivWrapper (const ParticleSet &P, TWFFastDerivWrapper &twf) const |
| Register the component with the TWFFastDerivWrapper wrapper. 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 | evalGradWithSpin (ParticleSet &P, int iat, ComplexType &spingrad) |
| return the current spin gradient for the iat-th particle Default implementation assumes that WaveFunctionComponent does not explicitly depend on Spin. 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 | ratioGradWithSpin (ParticleSet &P, int iat, GradType &grad_iat, ComplexType &spingrad_iat) |
| 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... | |
| 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_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 | 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 | 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 | evaluateDerivativesWF (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi) |
| Compute the derivatives of the log of the wavefunction with respect to optimizable parameters. More... | |
| virtual void | evaluateGradDerivatives (const ParticleSet::ParticleGradient &G_in, std::vector< ValueType > &dgradlogpsi) |
Calculates the derivatives of 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... | |
Private Types | |
| using | HandlerType = LRHandlerBase |
| using | FuncType = BsplineFunctor< RealType > |
| using | GridType = LinearGrid< RealType > |
Private Attributes | |
| bool | IgnoreSpin |
| bool | DropLongRange |
| bool | DropShortRange |
| RealType | Rs |
| RealType | Kc |
| RealType | Rcut |
| std::string | ID_Rs |
| std::string | rpafunc |
| std::string | MyName |
| std::unique_ptr< HandlerType > | myHandler |
| main handler More... | |
| kSpaceJastrow * | LongRangeRPA |
| object to handle the long-range part More... | |
| WaveFunctionComponent * | ShortRangeRPA |
| FuncType * | nfunc |
| numerical function owned by ShortRangeRPA More... | |
| GridType * | myGrid |
| ParticleSet & | targetPtcl |
| UPtrVector< WaveFunctionComponent > | Psi |
| A list of WaveFunctionComponent*. More... | |
JastrowBuilder using RPA functor Modification of RPAJastrow.
Definition at line 32 of file RPAJastrow.h.
|
private |
Definition at line 35 of file RPAJastrow.h.
|
private |
Definition at line 36 of file RPAJastrow.h.
|
private |
Definition at line 34 of file RPAJastrow.h.
| RPAJastrow | ( | ParticleSet & | target | ) |
Definition at line 34 of file RPAJastrow.cpp.
|
overridedefault |
|
overridevirtual |
a move for iat-th particle is accepted.
Update the current content.
| P | target ParticleSet |
| iat | index of the particle whose new position was proposed |
| safe_to_delay | if true, delayed accept is safe. |
Implements WaveFunctionComponent.
Definition at line 246 of file RPAJastrow.cpp.
References RPAJastrow::Psi.
| void buildOrbital | ( | const std::string & | name, |
| const std::string & | UL, | ||
| const std::string & | US, | ||
| const std::string & | RF, | ||
| RealType | R, | ||
| RealType | K | ||
| ) |
Definition at line 67 of file RPAJastrow.cpp.
References qmcplusplus::app_log(), RPAJastrow::DropLongRange, RPAJastrow::DropShortRange, ParticleSet::getLattice(), ParticleSet::getSimulationCell(), ParticleSet::getTotalNum(), RPAJastrow::ID_Rs, qmcplusplus::Units::energy::K, RPAJastrow::Kc, RPAJastrow::makeLongRange(), RPAJastrow::makeShortRange(), RPAJastrow::myHandler, RPAJastrow::MyName, qmcplusplus::pow(), RPAJastrow::rpafunc, RPAJastrow::Rs, and RPAJastrow::targetPtcl.
Referenced by RPAJastrow::put().
|
overridevirtual |
check out optimizable variables
Reimplemented from WaveFunctionComponent.
Definition at line 203 of file RPAJastrow.cpp.
References WaveFunctionComponent::checkOutVariables(), kSpaceJastrow::checkOutVariables(), RPAJastrow::LongRangeRPA, and RPAJastrow::ShortRangeRPA.
|
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 272 of file RPAJastrow.cpp.
References RPAJastrow::Psi.
|
overridevirtual |
return the current gradient for the iat-th particle
| P | quantum particle set |
| iat | particle index |
Reimplemented from WaveFunctionComponent.
Definition at line 227 of file RPAJastrow.cpp.
References RPAJastrow::Psi.
|
inlineoverridevirtual |
Compute the derivatives of both the log of the wavefunction and kinetic energy with respect to optimizable parameters.
| P | particle set |
| optvars | optimizable parameters |
| dlogpsi | array of derivatives of the log of the wavefunction. Add the contribution from this component. |
| dhpsioverpsi | array of Hamiltonian derivatives. Add the kinetic energy derivatives contribution from this component. . and are from this WaveFunctionComponent. 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. |
Implements WaveFunctionComponent.
Definition at line 90 of file RPAJastrow.h.
|
overridevirtual |
evaluate the value of the WaveFunctionComponent from scratch
| [in] | P | active ParticleSet |
| [out] | G | Gradients, |
| [out] | L | Laplacians, |
Mainly for walker-by-walker move. The initial stage of particle-by-particle move also uses this. causes complete state update in WFC's
Implements WaveFunctionComponent.
Definition at line 209 of file RPAJastrow.cpp.
References WaveFunctionComponent::log_value_, and RPAJastrow::Psi.
|
inlineoverridevirtual |
extract underlying OptimizableObject references
| opt_obj_refs | aggregated list of optimizable object references |
Reimplemented from WaveFunctionComponent.
Definition at line 64 of file RPAJastrow.h.
References WaveFunctionComponent::extractOptimizableObjectRefs(), RPAJastrow::LongRangeRPA, UniqueOptObjRefs::push_back(), and RPAJastrow::ShortRangeRPA.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
if true, this contains optimizable components
Reimplemented from WaveFunctionComponent.
Definition at line 59 of file RPAJastrow.h.
|
overridevirtual |
this is a great deal of logic for make clone I'm wondering what is going on
Reimplemented from WaveFunctionComponent.
Definition at line 280 of file RPAJastrow.cpp.
References RPAJastrow::DropLongRange, RPAJastrow::DropShortRange, RPAJastrow::Kc, RPAJastrow::myHandler, RPAJastrow::Rcut, and RPAJastrow::rpafunc.
| void makeLongRange | ( | ) |
Definition at line 136 of file RPAJastrow.cpp.
References ParticleSet::getLattice(), kSpaceJastrow::ISOTROPIC, RPAJastrow::Kc, RPAJastrow::LongRangeRPA, RPAJastrow::myHandler, RPAJastrow::Psi, kSpaceJastrow::setCoefficients(), and RPAJastrow::targetPtcl.
Referenced by RPAJastrow::buildOrbital().
| void makeShortRange | ( | ) |
Definition at line 162 of file RPAJastrow.cpp.
References qmcplusplus::app_log(), qmcplusplus::Units::charge::e, BsplineFunctor< REAL >::initialize(), WaveFunctionComponent::my_name_, RPAJastrow::myHandler, RPAJastrow::nfunc, RPAJastrow::Psi, RPAJastrow::Rcut, ShortRangePartAdapter< T >::setRmax(), RPAJastrow::ShortRangeRPA, and RPAJastrow::targetPtcl.
Referenced by RPAJastrow::buildOrbital().
| bool put | ( | xmlNodePtr | cur | ) |
Definition at line 38 of file RPAJastrow.cpp.
References OhmmsAttributeSet::add(), ParameterSet::add(), qmcplusplus::app_log(), RPAJastrow::buildOrbital(), RPAJastrow::ID_Rs, RPAJastrow::Kc, RPAJastrow::MyName, ParameterSet::put(), OhmmsAttributeSet::put(), RPAJastrow::rpafunc, and RPAJastrow::Rs.
|
overridevirtual |
evaluate the ratio of the new to old WaveFunctionComponent value
| P | the active ParticleSet |
| iat | the index of a particle |

Specialized for particle-by-particle move
Implements WaveFunctionComponent.
Definition at line 219 of file RPAJastrow.cpp.
References RPAJastrow::Psi.
|
overridevirtual |
evaluate the ratio of the new to old WaveFunctionComponent value and the new gradient
| P | the active ParticleSet |
| iat | the index of a particle |
| grad_iat | Gradient for the active particle |
Reimplemented from WaveFunctionComponent.
Definition at line 235 of file RPAJastrow.cpp.
References RPAJastrow::Psi.
|
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 258 of file RPAJastrow.cpp.
References RPAJastrow::Psi.
|
overridevirtual |
If a move for iat-th particle is rejected, restore to the content.
| iat | index of the particle whose new position was proposed |
Ye: hopefully we can gradually move away from restore
Implements WaveFunctionComponent.
Definition at line 252 of file RPAJastrow.cpp.
References RPAJastrow::Psi.
|
inline |
Definition at line 57 of file RPAJastrow.h.
References RPAJastrow::myHandler.
|
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 264 of file RPAJastrow.cpp.
References WaveFunctionComponent::log_value_, and RPAJastrow::Psi.
|
private |
Definition at line 98 of file RPAJastrow.h.
Referenced by RPAJastrow::buildOrbital(), and RPAJastrow::makeClone().
|
private |
Definition at line 99 of file RPAJastrow.h.
Referenced by RPAJastrow::buildOrbital(), and RPAJastrow::makeClone().
|
private |
Definition at line 103 of file RPAJastrow.h.
Referenced by RPAJastrow::buildOrbital(), and RPAJastrow::put().
|
private |
Definition at line 97 of file RPAJastrow.h.
|
private |
Definition at line 101 of file RPAJastrow.h.
Referenced by RPAJastrow::buildOrbital(), RPAJastrow::makeClone(), RPAJastrow::makeLongRange(), and RPAJastrow::put().
|
private |
object to handle the long-range part
Definition at line 112 of file RPAJastrow.h.
Referenced by RPAJastrow::checkOutVariables(), RPAJastrow::extractOptimizableObjectRefs(), and RPAJastrow::makeLongRange().
|
private |
Definition at line 118 of file RPAJastrow.h.
|
private |
main handler
Definition at line 110 of file RPAJastrow.h.
Referenced by RPAJastrow::buildOrbital(), RPAJastrow::makeClone(), RPAJastrow::makeLongRange(), RPAJastrow::makeShortRange(), and RPAJastrow::setHandler().
|
private |
Definition at line 105 of file RPAJastrow.h.
Referenced by RPAJastrow::buildOrbital(), and RPAJastrow::put().
|
private |
numerical function owned by ShortRangeRPA
Definition at line 117 of file RPAJastrow.h.
Referenced by RPAJastrow::makeShortRange().
|
private |
A list of WaveFunctionComponent*.
Definition at line 121 of file RPAJastrow.h.
Referenced by RPAJastrow::acceptMove(), RPAJastrow::copyFromBuffer(), RPAJastrow::evalGrad(), RPAJastrow::evaluateLog(), RPAJastrow::makeLongRange(), RPAJastrow::makeShortRange(), RPAJastrow::ratio(), RPAJastrow::ratioGrad(), RPAJastrow::registerData(), RPAJastrow::restore(), and RPAJastrow::updateBuffer().
|
private |
Definition at line 102 of file RPAJastrow.h.
Referenced by RPAJastrow::makeClone(), and RPAJastrow::makeShortRange().
|
private |
Definition at line 104 of file RPAJastrow.h.
Referenced by RPAJastrow::buildOrbital(), RPAJastrow::makeClone(), and RPAJastrow::put().
|
private |
Definition at line 100 of file RPAJastrow.h.
Referenced by RPAJastrow::buildOrbital(), and RPAJastrow::put().
|
private |
objects to handle the short-range part two-body Jastrow function
Definition at line 115 of file RPAJastrow.h.
Referenced by RPAJastrow::checkOutVariables(), RPAJastrow::extractOptimizableObjectRefs(), and RPAJastrow::makeShortRange().
|
private |
Definition at line 119 of file RPAJastrow.h.
Referenced by RPAJastrow::buildOrbital(), RPAJastrow::makeLongRange(), and RPAJastrow::makeShortRange().