QMCPACK
ScaledPadeFunctor< T > Struct Template Reference

Pade functional of

\[ u(r) = \frac{a*f(r)}{1+b*f(r)} \]

with a scale function f(r) More...

+ Inheritance diagram for ScaledPadeFunctor< T >:
+ Collaboration diagram for ScaledPadeFunctor< T >:

Public Member Functions

 ScaledPadeFunctor (real_type a=1.0, real_type b=1.0, real_type c=1.0)
 constructor More...
 
OptimizableFunctorBasemakeClone () const override
 create a clone of this object More...
 
void reset () override
 reset the internal variables. More...
 
real_type evaluate (real_type r)
 evaluate the value at r More...
 
real_type evaluate (real_type r, real_type &dudr, real_type &d2udr2)
 evaluate the value, first derivative and second derivative More...
 
real_type evaluate (real_type r, real_type &dudr, real_type &d2udr2, real_type d3udr3)
 
real_type f (real_type r) override
 evaluate the value at r More...
 
real_type df (real_type r) override
 evaluate the first derivative More...
 
bool put (xmlNodePtr cur) override
 process xmlnode and registers variables to optimize More...
 
void checkInVariablesExclusive (opt_variables_type &active) override
 check in variational parameters to the global list of parameters used by the optimizer. More...
 
void checkOutVariables (const opt_variables_type &active) override
 check out variational optimizable variables More...
 
void resetParametersExclusive (const opt_variables_type &active) override
 reset the parameters during optimizations. More...
 
- Public Member Functions inherited from OptimizableFunctorBase
 OptimizableFunctorBase (const std::string &name="")
 default constructor More...
 
virtual ~OptimizableFunctorBase ()=default
 virtual destrutor More...
 
void getIndex (const opt_variables_type &active)
 
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 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 A
 coefficients More...
 
real_type B
 
real_type C
 
real_type OneOverC
 
real_type B2
 
- Public Attributes inherited from OptimizableFunctorBase
real_type cutoff_radius = 0.0
 maximum cutoff More...
 
opt_variables_type myVars
 set of variables to be optimized More...
 

Additional Inherited Members

- Public Types inherited from OptimizableFunctorBase
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...
 

Detailed Description

template<class T>
struct qmcplusplus::ScaledPadeFunctor< T >

Pade functional of

\[ u(r) = \frac{a*f(r)}{1+b*f(r)} \]

with a scale function f(r)

Prototype of the template parameter of TwoBodyJastrow and OneBodyJastrow

Definition at line 947 of file PadeFunctors.h.

Constructor & Destructor Documentation

◆ ScaledPadeFunctor()

ScaledPadeFunctor ( real_type  a = 1.0,
real_type  b = 1.0,
real_type  c = 1.0 
)
inlineexplicit

constructor

Definition at line 954 of file PadeFunctors.h.

References ScaledPadeFunctor< T >::reset().

Referenced by ScaledPadeFunctor< T >::makeClone().

954 : A(a), B(b), C(c) { reset(); }
real_type A
coefficients
Definition: PadeFunctors.h:950
void reset() override
reset the internal variables.
Definition: PadeFunctors.h:960

Member Function Documentation

◆ checkInVariablesExclusive()

void checkInVariablesExclusive ( opt_variables_type active)
inlineoverridevirtual

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

Parameters
activea super set of optimizable variables

The existing checkInVariables implementation in WFC/SPO/.. are inclusive and it calls checkInVariables of its members class A: public SPOSet {} class B: public WFC { A objA; checkInVariables() { objA.checkInVariables(); } };

With OptimizableObject, class A: public OptimizableObject {} class B: public OptimizableObject { A objA; checkInVariablesExclusive() { // should not call objA.checkInVariablesExclusive() if objA has been extracted; } }; A vector of OptimizableObject, will be created by calling extractOptimizableObjects(). All the checkInVariablesExclusive() will be called through this vector and thus checkInVariablesExclusive implementation should only handle non-OptimizableObject members.

Implements OptimizableObject.

Definition at line 1019 of file PadeFunctors.h.

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

1019 { active.insertFrom(myVars); }
opt_variables_type myVars
set of variables to be optimized

◆ checkOutVariables()

void checkOutVariables ( const opt_variables_type active)
inlineoverridevirtual

check out variational optimizable variables

Parameters
activea super set of optimizable variables

Implements OptimizableFunctorBase.

Definition at line 1021 of file PadeFunctors.h.

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

1021 { 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

◆ df()

real_type df ( real_type  r)
inlineoverridevirtual

evaluate the first derivative

Parameters
rdistance

virtual function necessary for a transformation to a numerical functor

Implements OptimizableFunctorBase.

Definition at line 1010 of file PadeFunctors.h.

References ScaledPadeFunctor< T >::evaluate().

1011  {
1012  real_type dudr, d2udr2;
1013  real_type res = evaluate(r, dudr, d2udr2);
1014  return dudr;
1015  }
real_type evaluate(real_type r)
evaluate the value at r
Definition: PadeFunctors.h:970
OHMMS_PRECISION real_type

◆ evaluate() [1/3]

real_type evaluate ( real_type  r)
inline

evaluate the value at r

Parameters
rthe distance
Returns
$ u(r_{eff}) = a*r_{eff}/(1+b*r_{eff}) $

Definition at line 970 of file PadeFunctors.h.

References ScaledPadeFunctor< T >::A, ScaledPadeFunctor< T >::B, ScaledPadeFunctor< T >::C, qmcplusplus::exp(), and ScaledPadeFunctor< T >::OneOverC.

Referenced by ScaledPadeFunctor< T >::df(), and ScaledPadeFunctor< T >::f().

971  {
972  real_type reff((1.0 - std::exp(-C * r)) * OneOverC);
973  return A * reff / (1.0 + B * reff);
974  }
real_type A
coefficients
Definition: PadeFunctors.h:950
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
OHMMS_PRECISION real_type

◆ evaluate() [2/3]

real_type evaluate ( real_type  r,
real_type dudr,
real_type d2udr2 
)
inline

evaluate the value, first derivative and second derivative

Parameters
rthe distance
dudrreturn value $ du/dr$
d2udr2return value $ d^2u/dr^2 $
Returns
$ u(r_{eff}) = a*r_{eff}/(1+b*r_{eff}) $

Definition at line 982 of file PadeFunctors.h.

References ScaledPadeFunctor< T >::A, ScaledPadeFunctor< T >::B, ScaledPadeFunctor< T >::B2, ScaledPadeFunctor< T >::C, qmcplusplus::exp(), and ScaledPadeFunctor< T >::OneOverC.

983  {
984  real_type reff_1(std::exp(-C * r));
985  real_type reff((1.0 - reff_1) * OneOverC);
986  real_type u(1.0 / (1.0 + B * reff));
987  real_type auu(A * u * u);
988  dudr = reff_1 * auu;
989  //d2udr=auu*(-C*reff_1*reff_2-B2*reff_1*reff_1*u);
990  d2udr2 = -reff_1 * auu * (C + B2 * reff_1 * u);
991  return A * u * reff;
992  }
real_type A
coefficients
Definition: PadeFunctors.h:950
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
OHMMS_PRECISION real_type

◆ evaluate() [3/3]

real_type evaluate ( real_type  r,
real_type dudr,
real_type d2udr2,
real_type  d3udr3 
)
inline

Definition at line 994 of file PadeFunctors.h.

References ScaledPadeFunctor< T >::A, ScaledPadeFunctor< T >::B, ScaledPadeFunctor< T >::B2, ScaledPadeFunctor< T >::C, qmcplusplus::exp(), and ScaledPadeFunctor< T >::OneOverC.

995  {
996  real_type reff_1(std::exp(-C * r));
997  real_type reff((1.0 - reff_1) * OneOverC);
998  real_type u(1.0 / (1.0 + B * reff));
999  real_type auu(A * u * u);
1000  dudr = reff_1 * auu;
1001  //d2udr=auu*(-C*reff_1*reff_2-B2*reff_1*reff_1*u);
1002  d2udr2 = -reff_1 * auu * (C + B2 * reff_1 * u);
1003  std::cerr << "Third derivative not imlemented for Pade functor.\n";
1004  return A * u * reff;
1005  }
real_type A
coefficients
Definition: PadeFunctors.h:950
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
OHMMS_PRECISION real_type

◆ f()

real_type f ( real_type  r)
inlineoverridevirtual

evaluate the value at r

Parameters
rdistance

virtual function necessary for a transformation to a numerical functor

Implements OptimizableFunctorBase.

Definition at line 1008 of file PadeFunctors.h.

References ScaledPadeFunctor< T >::evaluate().

1008 { return evaluate(r); }
real_type evaluate(real_type r)
evaluate the value at r
Definition: PadeFunctors.h:970

◆ makeClone()

OptimizableFunctorBase* makeClone ( ) const
inlineoverridevirtual

create a clone of this object

Implements OptimizableFunctorBase.

Definition at line 956 of file PadeFunctors.h.

References ScaledPadeFunctor< T >::ScaledPadeFunctor().

956 { return new ScaledPadeFunctor(*this); }
ScaledPadeFunctor(real_type a=1.0, real_type b=1.0, real_type c=1.0)
constructor
Definition: PadeFunctors.h:954

◆ put()

bool put ( xmlNodePtr  cur)
inlineoverridevirtual

process xmlnode and registers variables to optimize

Parameters
curxmlNode for a functor

Implements OptimizableFunctorBase.

Definition at line 1017 of file PadeFunctors.h.

1017 { return true; }

◆ reset()

void reset ( )
inlineoverridevirtual

◆ resetParametersExclusive()

void resetParametersExclusive ( const opt_variables_type active)
inlineoverridevirtual

reset the parameters during optimizations.

Exclusive, see checkInVariablesExclusive

Implements OptimizableObject.

Definition at line 1023 of file PadeFunctors.h.

References ScaledPadeFunctor< T >::B, ScaledPadeFunctor< T >::B2, ScaledPadeFunctor< T >::C, and ScaledPadeFunctor< T >::OneOverC.

1024  {
1025  OneOverC = 1.0 / C;
1026  B2 = 2.0 * B;
1027  }

Member Data Documentation

◆ A

coefficients

Definition at line 950 of file PadeFunctors.h.

Referenced by ScaledPadeFunctor< T >::evaluate().

◆ B

◆ B2

◆ C

◆ OneOverC


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