QMCPACK
OptimizableFunctorBase Struct Referenceabstract

Base class for any functor with optimizable parameters. More...

+ Inheritance diagram for OptimizableFunctorBase:
+ Collaboration diagram for OptimizableFunctorBase:

Public Types

using real_type = optimize::VariableSet::real_type
 typedef for real values More...
 
using opt_variables_type = optimize::VariableSet
 typedef for variableset: this is going to be replaced More...
 

Public Member Functions

 OptimizableFunctorBase (const std::string &name="")
 default constructor More...
 
virtual ~OptimizableFunctorBase ()=default
 virtual destrutor More...
 
virtual void checkOutVariables (const opt_variables_type &active)=0
 check out variational optimizable variables More...
 
void getIndex (const opt_variables_type &active)
 
virtual OptimizableFunctorBasemakeClone () const =0
 create a clone of this object More...
 
virtual void reset ()=0
 reset function More...
 
virtual real_type f (real_type r)=0
 evaluate the value at r More...
 
virtual real_type df (real_type r)=0
 evaluate the first derivative More...
 
virtual bool put (xmlNodePtr cur)=0
 process xmlnode and registers variables to optimize More...
 
virtual void setDensity (real_type n)
 empty virtual function to help builder classes More...
 
virtual void setCusp (real_type cusp)
 empty virtual function to help builder classes More...
 
virtual void setPeriodic (bool periodic)
 empty virtual function to help builder classes More...
 
virtual bool evaluateDerivatives (real_type r, std::vector< qmcplusplus::TinyVector< real_type, 3 >> &derivs)
 
virtual bool evaluateDerivatives (real_type r, std::vector< real_type > &derivs)
 
virtual void setGridManager (bool willmanage)
 
virtual void checkInVariablesExclusive (opt_variables_type &active)=0
 check in variational parameters to the global list of parameters used by the optimizer. More...
 
virtual void resetParametersExclusive (const opt_variables_type &active)=0
 reset the parameters during optimizations More...
 
- Public Member Functions inherited from OptimizableObject
 OptimizableObject (const std::string &name)
 
const std::string & getName () const
 
bool isOptimized () const
 
virtual void checkInVariablesExclusive (opt_variables_type &active)=0
 check in variational parameters to the global list of parameters used by the optimizer. More...
 
virtual void resetParametersExclusive (const opt_variables_type &active)=0
 reset the parameters during optimizations. More...
 
virtual void reportStatus (std::ostream &os)
 print the state, e.g., optimizables More...
 
void setOptimization (bool state)
 
virtual void writeVariationalParameters (hdf_archive &hout)
 Write the variational parameters for this object to the VP HDF file. More...
 
virtual void readVariationalParameters (hdf_archive &hin)
 Read the variational parameters for this object from the VP HDF file. More...
 

Public Attributes

real_type cutoff_radius = 0.0
 maximum cutoff More...
 
opt_variables_type myVars
 set of variables to be optimized More...
 

Detailed Description

Base class for any functor with optimizable parameters.

Derived classes from OptimizableFunctorBase are called "functor"s and can be used as a template signature for Jastrow functions.

  • OneBodyJastroOrbital<FUNC>
  • TwoBodyJastroOrbital<FUNC> Functor in qmcpack denotes any function which returns a value at a point, e.g., GTO, STO, one-dimensional splines etc. OptimizableFunctorBase is introduced for optimizations. The virtual functions are intended for non-critical operations that are executed infrequently during optimizations.

This class handles myVars of opt_variables_type (VariableSet.h). A derived class can insert any number of variables it handles during optimizations, by calling myVars.insert(name,value); Unlike VarList which uses map, VariableSet is serialized in that the internal order is according to insert calls.

Definition at line 47 of file OptimizableFunctorBase.h.

Member Typedef Documentation

◆ opt_variables_type

typedef for variableset: this is going to be replaced

Definition at line 52 of file OptimizableFunctorBase.h.

◆ real_type

typedef for real values

Definition at line 50 of file OptimizableFunctorBase.h.

Constructor & Destructor Documentation

◆ OptimizableFunctorBase()

OptimizableFunctorBase ( const std::string &  name = "")
inline

default constructor

Definition at line 58 of file OptimizableFunctorBase.h.

58 : OptimizableObject(name) {}
OptimizableObject(const std::string &name)

◆ ~OptimizableFunctorBase()

virtual ~OptimizableFunctorBase ( )
virtualdefault

virtual destrutor

Member Function Documentation

◆ checkInVariablesExclusive()

virtual void checkInVariablesExclusive

check in variational parameters to the global list of parameters used by the optimizer.

Parameters
activea super set of optimizable variables

Referenced by CubicSplineSingle< RT, FNOUT >::checkInVariablesExclusive().

◆ checkOutVariables()

virtual void checkOutVariables ( const opt_variables_type active)
pure virtual

◆ df()

◆ evaluateDerivatives() [1/2]

virtual bool evaluateDerivatives ( real_type  r,
std::vector< qmcplusplus::TinyVector< real_type, 3 >> &  derivs 
)
inlinevirtual

Reimplemented in PadeTwo2ndOrderFunctor< T >, Pade2ndOrderFunctor< T >, BsplineFunctor< REAL >, UserFunctor< T >, and PadeFunctor< T >.

Definition at line 117 of file OptimizableFunctorBase.h.

118  {
119  return false;
120  }

◆ evaluateDerivatives() [2/2]

virtual bool evaluateDerivatives ( real_type  r,
std::vector< real_type > &  derivs 
)
inlinevirtual

◆ f()

◆ getIndex()

void getIndex ( const opt_variables_type active)
inline

Definition at line 76 of file OptimizableFunctorBase.h.

References VariableSet::getIndex(), and OptimizableFunctorBase::myVars.

76 { myVars.getIndex(active); }
int getIndex(const std::string &vname) const
return the Index vaule for the named parameter
opt_variables_type myVars
set of variables to be optimized

◆ makeClone()

◆ put()

◆ reset()

◆ resetParametersExclusive()

virtual void resetParametersExclusive

◆ setCusp()

virtual void setCusp ( real_type  cusp)
inlinevirtual

empty virtual function to help builder classes

Reimplemented in BsplineFunctor< REAL >, PadeFunctor< T >, and UserFunctor< T >.

Definition at line 111 of file OptimizableFunctorBase.h.

111 {}

◆ setDensity()

virtual void setDensity ( real_type  n)
inlinevirtual

empty virtual function to help builder classes

Definition at line 107 of file OptimizableFunctorBase.h.

107 {}

◆ setGridManager()

virtual void setGridManager ( bool  willmanage)
inlinevirtual

Definition at line 126 of file OptimizableFunctorBase.h.

126 {}

◆ setPeriodic()

virtual void setPeriodic ( bool  periodic)
inlinevirtual

empty virtual function to help builder classes

Reimplemented in BsplineFunctor< REAL >.

Definition at line 115 of file OptimizableFunctorBase.h.

115 {}

Member Data Documentation

◆ cutoff_radius

◆ myVars

set of variables to be optimized

Definition at line 56 of file OptimizableFunctorBase.h.

Referenced by PadeFunctor< T >::checkInVariablesExclusive(), UserFunctor< T >::checkInVariablesExclusive(), Pade2ndOrderFunctor< T >::checkInVariablesExclusive(), ShortRangeCuspFunctor< T >::checkInVariablesExclusive(), BsplineFunctor< REAL >::checkInVariablesExclusive(), PadeTwo2ndOrderFunctor< T >::checkInVariablesExclusive(), ScaledPadeFunctor< T >::checkInVariablesExclusive(), PolynomialFunctor3D::checkInVariablesExclusive(), PadeFunctor< T >::checkOutVariables(), UserFunctor< T >::checkOutVariables(), Pade2ndOrderFunctor< T >::checkOutVariables(), ShortRangeCuspFunctor< T >::checkOutVariables(), BsplineFunctor< REAL >::checkOutVariables(), PadeTwo2ndOrderFunctor< T >::checkOutVariables(), ScaledPadeFunctor< T >::checkOutVariables(), PolynomialFunctor3D::checkOutVariables(), OptimizableFunctorBase::getIndex(), BsplineFunctor< REAL >::initialize(), BsplineFunctor< REAL >::isOptimizable(), PadeFunctor< T >::put(), UserFunctor< T >::put(), BsplineFunctor< REAL >::put(), ShortRangeCuspFunctor< T >::put(), Pade2ndOrderFunctor< T >::put(), PadeTwo2ndOrderFunctor< T >::put(), PolynomialFunctor3D::put(), BsplineFunctor< REAL >::reportStatus(), PadeFunctor< T >::resetParametersExclusive(), UserFunctor< T >::resetParametersExclusive(), Pade2ndOrderFunctor< T >::resetParametersExclusive(), ShortRangeCuspFunctor< T >::resetParametersExclusive(), BsplineFunctor< REAL >::resetParametersExclusive(), PadeTwo2ndOrderFunctor< T >::resetParametersExclusive(), PolynomialFunctor3D::resetParametersExclusive(), and ShortRangeCuspFunctor< T >::set_variable_from_xml().


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