20 #ifndef QMCPLUSPLUS_SINGLEPARTICLEORBITALSETBASE_H 21 #define QMCPLUSPLUS_SINGLEPARTICLEORBITALSETBASE_H 32 class ResourceCollection;
57 using SPOMap = std::map<std::string, const std::unique_ptr<const SPOSet>>;
64 SPOSet(
const std::string& my_name);
125 const int& FirstIndex,
126 const int& LastIndex);
143 const std::vector<ValueType>& Coeff,
144 const std::vector<size_t>& C2node_up,
145 const std::vector<size_t>& C2node_dn,
158 const std::vector<int>& detData_up,
163 const std::vector<std::vector<int>>& lookup_tbl);
172 const std::vector<ValueType>& Coeff,
173 const std::vector<size_t>& C2node_up,
174 const std::vector<size_t>& C2node_dn,
181 const std::vector<int>& detData_up,
182 const std::vector<std::vector<int>>& lookup_tbl);
207 std::vector<ValueType>& ratios);
218 const std::pair<ValueVector, ValueVector>& spinor_multiplier,
220 std::vector<ValueType>& ratios);
228 std::vector<ValueType>& ratios,
244 const std::vector<const ValueType*>& invRow_ptr_list,
245 std::vector<std::vector<ValueType>>& ratios_list)
const;
313 OffloadMatrix<ComplexType>& mw_dspin)
const;
326 const std::vector<const ValueType*>& invRow_ptr_list,
328 std::vector<ValueType>& ratios,
329 std::vector<GradType>& grads)
const;
345 const std::vector<const ValueType*>& invRow_ptr_list,
347 std::vector<ValueType>& ratios,
348 std::vector<GradType>& grads,
349 std::vector<ValueType>& spingrads)
const;
541 [[noreturn]]
virtual std::unique_ptr<SPOSet>
makeClone()
const;
virtual void evaluate_notranspose(const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, ValueMatrix &d2logdet)=0
evaluate the values, gradients and laplacians of this single-particle orbital for [first...
base class for Single-particle orbital sets
SPOSet(const std::string &my_name)
constructor
OrbitalSetTraits< ValueType >::HessVector HessVector
virtual void checkObject() const
check a few key parameters before putting the SPO into a determinant
virtual void storeParamsBeforeRotation()
store parameters before getting destroyed by rotation.
Declaration of OptimizableObject.
helper functions for EinsplineSetBuilder
const std::string my_name_
name of the object, unique identifier
virtual void evaluateDerivativesWF(ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, int FirstIndex, int LastIndex)
Parameter derivatives of the wavefunction.
virtual std::unique_ptr< SPOSet > makeClone() const
make a clone of itself every derived class must implement this to have threading working correctly...
virtual bool isOMPoffload() const
Query if this SPOSet uses OpenMP offload.
virtual void evaluateDerivRatios(const VirtualParticleSet &VP, const opt_variables_type &optvars, ValueVector &psi, const ValueVector &psiinv, std::vector< ValueType > &ratios, Matrix< ValueType > &dratios, int FirstIndex, int LastIndex)
Determinant ratios and parameter derivatives of the wavefunction for virtual moves.
A ParticleSet that handles virtual moves of a selected particle of a given physical ParticleSet Virtu...
virtual void evaluateVGH(const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, HessVector &grad_grad_psi)
evaluate the values, gradients and hessians of this single-particle orbital set
opt_variables_type myVars
Optimizable variables.
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
int size() const
return the size of the orbital set Ye: this needs to be replaced by getOrbitalSetSize(); ...
virtual void applyRotation(const ValueMatrix &rot_mat, bool use_stored_copy=false)
apply rotation to all the orbitals
OrbitalSetTraits< ValueType >::ValueVector ValueVector
void basic_report(const std::string &pad="") const
print basic SPOSet information
A proxy class to the quantum ParticleSet.
virtual void evaluateDetSpinorRatios(const VirtualParticleSet &VP, ValueVector &psi, const std::pair< ValueVector, ValueVector > &spinor_multiplier, const ValueVector &invrow, std::vector< ValueType > &ratios)
evaluate determinant ratios for virtual moves, specifically for Spinor SPOSets
virtual void mw_evaluateVGLandDetRatioGradsWithSpin(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const std::vector< const ValueType *> &invRow_ptr_list, OffloadMWVGLArray &phi_vgl_v, std::vector< ValueType > &ratios, std::vector< GradType > &grads, std::vector< ValueType > &spingrads) const
evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ra...
OrbitalSetTraits< ValueType >::GradMatrix GradMatrix
virtual void evaluateValue(const ParticleSet &P, int iat, ValueVector &psi)=0
evaluate the values of this single-particle orbital set
Specialized paritlce class for atomistic simulations.
virtual void evaluateGradSourceRow(const ParticleSet &P, int iel, const ParticleSet &source, int iat_src, GradVector &gradphi)
Returns a row of d/dR_iat phi_j(r) evaluated at position r.
virtual void mw_evaluateValue(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list) const
evaluate the values this single-particle orbital sets of multiple walkers
Array< ValueType, 3, OffloadPinnedAllocator< ValueType > > OffloadMWVGLArray
virtual std::string getClassName() const =0
return class name
virtual void mw_evaluate_notranspose(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int first, int last, const RefVector< ValueMatrix > &logdet_list, const RefVector< GradMatrix > &dlogdet_list, const RefVector< ValueMatrix > &d2logdet_list) const
virtual void mw_evaluateVGL(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list, const RefVector< GradVector > &dpsi_v_list, const RefVector< ValueVector > &d2psi_v_list) const
evaluate the values, gradients and laplacians of this single-particle orbital sets of multiple walker...
virtual void mw_evaluateVGLandDetRatioGrads(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const std::vector< const ValueType *> &invRow_ptr_list, OffloadMWVGLArray &phi_vgl_v, std::vector< ValueType > &ratios, std::vector< GradType > &grads) const
evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ra...
virtual void setOrbitalSetSize(int norbs)=0
set the OrbitalSetSize
OrbitalSetTraits< ValueType >::ValueVector ValueVector
virtual void evaluateVGL(const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi)=0
evaluate the values, gradients and laplacians of this single-particle orbital set ...
virtual void finalizeConstruction()
finalize the construction of SPOSet
virtual void evaluateVGL_spin(const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi, ValueVector &dspin)
evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital set ...
class to handle a set of variables that can be modified during optimizations
virtual ~SPOSet()=default
destructor
virtual bool isOptimizable() const
Query if this SPOSet is optimizable.
int getOrbitalSetSize() const
return the size of the orbitals
virtual void acquireResource(ResourceCollection &collection, const RefVectorWithLeader< SPOSet > &spo_list) const
acquire a shared resource from collection
IndexType OrbitalSetSize
number of Single-particle orbitals
optimize::VariableSet opt_variables_type
OHMMS_INDEXTYPE IndexType
define other types
virtual bool hasIonDerivs() const
Query if this SPOSet has an explicit ion dependence.
virtual PosType get_k(int orb)
access the k point related to the given orbital
opt_variables_type & getMyVars(SPOSet &spo)
virtual void evaluateDetRatios(const VirtualParticleSet &VP, ValueVector &psi, const ValueVector &psiinv, std::vector< ValueType > &ratios)
evaluate determinant ratios for virtual moves, e.g., sphere move for nonlocalPP
virtual void releaseResource(ResourceCollection &collection, const RefVectorWithLeader< SPOSet > &spo_list) const
return a shared resource to collection
std::vector< std::reference_wrapper< T > > RefVector
virtual void evaluateDerivatives(ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi, const int &FirstIndex, const int &LastIndex)
Parameter derivatives of the wavefunction and the Laplacian of the wavefunction.
virtual void evaluateThirdDeriv(const ParticleSet &P, int first, int last, GGGMatrix &grad_grad_grad_logdet)
evaluate the third derivatives of this single-particle orbital set
OrbitalSetTraits< ValueType >::GradHessVector GGGVector
OrbitalSetTraits< ValueType >::GradVector GradVector
virtual void mw_evaluateVGLWithSpin(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list, const RefVector< GradVector > &dpsi_v_list, const RefVector< ValueVector > &d2psi_v_list, OffloadMatrix< ComplexType > &mw_dspin) const
evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital sets ...
virtual bool transformSPOSet()
Used only by cusp correction in AOS LCAO.
std::map< std::string, const std::unique_ptr< const SPOSet > > SPOMap
virtual void mw_evaluateDetRatios(const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< const VirtualParticleSet > &vp_list, const RefVector< ValueVector > &psi_list, const std::vector< const ValueType *> &invRow_ptr_list, std::vector< std::vector< ValueType >> &ratios_list) const
evaluate determinant ratios for virtual moves, e.g., sphere move for nonlocalPP, of multiple walkers ...
virtual void evaluate_notranspose_spin(const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, ValueMatrix &d2logdet, ValueMatrix &dspinlogdet)
evaluate the values, gradients and laplacians of this single-particle orbital for [first...
LatticeGaussianProduct::ValueType ValueType
virtual void extractOptimizableObjectRefs(UniqueOptObjRefs &opt_obj_refs)
extract underlying OptimizableObject references
virtual bool isRotationSupported() const
return true if this SPOSet can be wrappered by RotatedSPO
virtual void checkOutVariables(const opt_variables_type &active)
check out variational optimizable variables
const std::string & getName() const
return object name
trait class to handel a set of Orbitals
OrbitalSetTraits< ValueType >::GradHessMatrix GGGMatrix
A D-dimensional Array class based on PETE.
virtual void createResource(ResourceCollection &collection) const
initialize a shared resource and hand it to collection
virtual void evaluateVGHGH(const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, HessVector &grad_grad_psi, GGGVector &grad_grad_grad_psi)
evaluate the values, gradients, hessians, and grad hessians of this single-particle orbital set ...
virtual void report(const std::string &pad="") const
print SPOSet information
virtual void evaluateGradSource(const ParticleSet &P, int first, int last, const ParticleSet &source, int iat_src, GradMatrix &gradphi)
evaluate the gradients of this single-particle orbital for [first,last) target particles with respect...
OrbitalSetTraits< ValueType >::HessMatrix HessMatrix
virtual void evaluate_spin(const ParticleSet &P, int iat, ValueVector &psi, ValueVector &dpsi)
evaluate the values of this single-particle orbital set