QMCPACK
DriftModifierUNR Class Reference
+ Inheritance diagram for DriftModifierUNR:
+ Collaboration diagram for DriftModifierUNR:

Public Types

using RealType = QMCTraits::RealType
 
using PosType = QMCTraits::PosType
 
- Public Types inherited from DriftModifierBase
using RealType = QMCTraits::RealType
 
using PosType = QMCTraits::PosType
 
using GradType = QMCTraits::GradType
 
using ComplexType = QMCTraits::ComplexType
 

Public Member Functions

void getDrifts (RealType tau, const std::vector< GradType > &qf, std::vector< PosType > &) const final
 
void getDrift (RealType tau, const GradType &qf, PosType &drift) const final
 evaluate a drift with a real force More...
 
void getDrifts (RealType tau, const std::vector< ComplexType > &qf, std::vector< ParticleSet::Scalar_t > &drift) const final
 
void getDrift (RealType tau, const ComplexType &qf, ParticleSet::Scalar_t &drift) const final
 
bool parseXML (xmlNodePtr cur) final
 
 DriftModifierUNR (RealType a=1.0)
 
- Public Member Functions inherited from DriftModifierBase
template<CoordsType CT>
void getDrifts (const TauParams< RealType, CT > &taus, const TWFGrads< CT > &qf, MCCoords< CT > &drifts) const
 
virtual ~DriftModifierBase ()
 

Private Attributes

RealType a_
 JCP1993 Umrigar et eq. (35) "a" parameter is set to 1.0. More...
 

Additional Inherited Members

- Protected Attributes inherited from DriftModifierBase
std::string ClassName
 

Detailed Description

Definition at line 20 of file DriftModifierUNR.h.

Member Typedef Documentation

◆ PosType

Definition at line 24 of file DriftModifierUNR.h.

◆ RealType

Definition at line 23 of file DriftModifierUNR.h.

Constructor & Destructor Documentation

◆ DriftModifierUNR()

DriftModifierUNR ( RealType  a = 1.0)
inline

Definition at line 38 of file DriftModifierUNR.h.

38 : a_(a) {}
RealType a_
JCP1993 Umrigar et eq. (35) "a" parameter is set to 1.0.

Member Function Documentation

◆ getDrift() [1/2]

void getDrift ( RealType  tau,
const GradType qf,
PosType drift 
) const
finalvirtual

evaluate a drift with a real force

Parameters
tautimestep
qfquantum force
driftoutput

Implements DriftModifierBase.

Definition at line 20 of file DriftModifierUNR.cpp.

References DriftModifierUNR::a_, qmcplusplus::convertToReal(), qmcplusplus::dot(), and qmcplusplus::sqrt().

Referenced by DriftModifierUNR::getDrifts(), and qmcplusplus::TEST_CASE().

21 {
22  // convert the complex WF gradient to real
23  convertToReal(qf, drift);
24  RealType vsq = dot(drift, drift);
25  RealType sc = vsq < std::numeric_limits<RealType>::epsilon()
26  ? tau
27  : ((-1.0 + std::sqrt(1.0 + 2.0 * a_ * tau * vsq)) / (a_ * vsq));
28  //Apply the umrigar scaling to drift.
29  drift *= sc;
30 }
void convertToReal(const T1 &in, T2 &out)
generic conversion from type T1 to type T2 using implicit conversion
Definition: ConvertToReal.h:32
RealType a_
JCP1993 Umrigar et eq. (35) "a" parameter is set to 1.0.
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
QMCTraits::RealType RealType
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)

◆ getDrift() [2/2]

void getDrift ( RealType  tau,
const ComplexType qf,
ParticleSet::Scalar_t drift 
) const
finalvirtual

Implements DriftModifierBase.

Definition at line 32 of file DriftModifierUNR.cpp.

References DriftModifierUNR::a_, qmcplusplus::convertToReal(), and qmcplusplus::sqrt().

33 {
34  // convert the complex WF gradient to real
35  convertToReal(qf, drift);
36  RealType vsq = drift * drift;
37  RealType sc = vsq < std::numeric_limits<RealType>::epsilon()
38  ? tau
39  : ((-1.0 + std::sqrt(1.0 + 2.0 * a_ * tau * vsq)) / (a_ * vsq));
40  //Apply the umrigar scaling to drift.
41  drift *= sc;
42 }
void convertToReal(const T1 &in, T2 &out)
generic conversion from type T1 to type T2 using implicit conversion
Definition: ConvertToReal.h:32
RealType a_
JCP1993 Umrigar et eq. (35) "a" parameter is set to 1.0.
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
QMCTraits::RealType RealType

◆ getDrifts() [1/2]

void getDrifts ( RealType  tau,
const std::vector< GradType > &  qf,
std::vector< PosType > &  drift 
) const
finalvirtual

Implements DriftModifierBase.

Definition at line 44 of file DriftModifierUNR.cpp.

References DriftModifierUNR::getDrift().

45 {
46  for (int i = 0; i < qf.size(); ++i)
47  getDrift(tau, qf[i], drift[i]);
48 }
void getDrift(RealType tau, const GradType &qf, PosType &drift) const final
evaluate a drift with a real force

◆ getDrifts() [2/2]

void getDrifts ( RealType  tau,
const std::vector< ComplexType > &  qf,
std::vector< ParticleSet::Scalar_t > &  drift 
) const
finalvirtual

Implements DriftModifierBase.

Definition at line 50 of file DriftModifierUNR.cpp.

References DriftModifierUNR::getDrift().

53 {
54  for (int i = 0; i < qf.size(); ++i)
55  getDrift(tau, qf[i], drift[i]);
56 }
void getDrift(RealType tau, const GradType &qf, PosType &drift) const final
evaluate a drift with a real force

◆ parseXML()

bool parseXML ( xmlNodePtr  cur)
finalvirtual

Reimplemented from DriftModifierBase.

Definition at line 58 of file DriftModifierUNR.cpp.

References DriftModifierUNR::a_, ParameterSet::add(), qmcplusplus::app_log(), and ParameterSet::put().

59 {
60  ParameterSet m_param;
61  m_param.add(a_, "drift_UNR_a");
62  m_param.put(cur);
63  app_log() << " Set drift_modifier UNR parameter a = " << a_ << std::endl;
64  return true;
65 }
std::ostream & app_log()
Definition: OutputManager.h:65
bool put(std::istream &is) override
read from std::istream
Definition: ParameterSet.h:42
RealType a_
JCP1993 Umrigar et eq. (35) "a" parameter is set to 1.0.
class to handle a set of parameters
Definition: ParameterSet.h:27
void add(PDT &aparam, const std::string &aname_in, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new parameter corresponding to an xmlNode <parameter>

Member Data Documentation

◆ a_

RealType a_
private

JCP1993 Umrigar et eq. (35) "a" parameter is set to 1.0.

Definition at line 42 of file DriftModifierUNR.h.

Referenced by DriftModifierUNR::getDrift(), and DriftModifierUNR::parseXML().


The documentation for this class was generated from the following files: