QMCPACK
YukawaBreakup< T > Struct Template Reference

RPABreakUp. More...

+ Collaboration diagram for YukawaBreakup< T >:

Public Member Functions

 YukawaBreakup ()
 
void reset (ParticleSet &ref)
 
void reset (ParticleSet &ref, T rs)
 
operator() (T r, T rinv) const
 
df (T r) const
 
Fk (T k, T rc) const
 
Xk (T k, T rc) const
 
integrate_r2 (T rc) const
 
Uk (T kk) const
 return RPA value at |k| More...
 
derivUk (T kk) const
 return d u(k)/d rs More...
 

Public Attributes

Rs
 
SqrtRs
 
OneOverSqrtRs
 
NormFactor
 

Detailed Description

template<class T = double>
struct qmcplusplus::YukawaBreakup< T >

RPABreakUp.

A Func for LRHandlerTemp. Four member functions have to be provided

  • reset(T volume) : reset the normalization factor
  • operator() (T r, T rinv) const : return a value of the original function e.g., 1.0/r
  • Fk(T k, T rc)
  • Xk(T k, T rc)

Definition at line 37 of file LRBreakupUtilities.h.

Constructor & Destructor Documentation

◆ YukawaBreakup()

YukawaBreakup ( )
inline

Definition at line 43 of file LRBreakupUtilities.h.

43 {}

Member Function Documentation

◆ derivUk()

T derivUk ( kk) const
inline

return d u(k)/d rs

Implement a correct one

Definition at line 109 of file LRBreakupUtilities.h.

References YukawaBreakup< T >::NormFactor.

109 { return NormFactor / kk; }

◆ df()

T df ( r) const
inline

Definition at line 74 of file LRBreakupUtilities.h.

References qmcplusplus::exp(), YukawaBreakup< T >::OneOverSqrtRs, YukawaBreakup< T >::Rs, and YukawaBreakup< T >::SqrtRs.

75  {
76  if (r < std::numeric_limits<T>::epsilon())
77  return -0.5 + r * OneOverSqrtRs / 3.0;
78  else
79  {
80  T rinv = 1.0 / r;
81  T exponential = std::exp(-r * OneOverSqrtRs);
82  return -Rs * rinv * rinv * (1.0 - exponential) + exponential * rinv * SqrtRs;
83  }
84  }
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)

◆ Fk()

T Fk ( k,
rc 
) const
inline

Definition at line 86 of file LRBreakupUtilities.h.

References YukawaBreakup< T >::Xk().

86 { return -Xk(k, rc); }

◆ integrate_r2()

T integrate_r2 ( rc) const
inline

Definition at line 98 of file LRBreakupUtilities.h.

98 { return 0.0; }

◆ operator()()

T operator() ( r,
rinv 
) const
inline

Definition at line 64 of file LRBreakupUtilities.h.

References qmcplusplus::exp(), YukawaBreakup< T >::OneOverSqrtRs, YukawaBreakup< T >::Rs, and YukawaBreakup< T >::SqrtRs.

65  {
66  if (r < std::numeric_limits<T>::epsilon())
67  return SqrtRs - 0.5 * r;
68  else
69  return Rs * rinv * (1.0 - std::exp(-r * OneOverSqrtRs));
70  //if (r > 1e-10) return Rs*rinv*(1.0 - std::exp(-r*OneOverSqrtRs));
71  //return 1.0 / OneOverSqrtRs - 0.5 * r;
72  }
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)

◆ reset() [1/2]

void reset ( ParticleSet ref)
inline

Definition at line 45 of file LRBreakupUtilities.h.

References ParticleSet::getLattice(), ParticleSet::getTotalNum(), YukawaBreakup< T >::NormFactor, YukawaBreakup< T >::OneOverSqrtRs, qmcplusplus::pow(), YukawaBreakup< T >::Rs, qmcplusplus::sqrt(), and YukawaBreakup< T >::SqrtRs.

46  {
47  NormFactor = 4.0 * M_PI / ref.getLattice().Volume;
48  T Density = ref.getTotalNum() / ref.getLattice().Volume;
49  Rs = std::pow(3.0 / (4.0 * M_PI * Density), 1.0 / 3.0);
50  SqrtRs = std::sqrt(Rs);
51  OneOverSqrtRs = 1.0 / SqrtRs;
52  }
MakeReturn< BinaryNode< FnPow, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t, typename CreateLeaf< Vector< T2, C2 > >::Leaf_t > >::Expression_t pow(const Vector< T1, C1 > &l, const Vector< T2, C2 > &r)
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

◆ reset() [2/2]

void reset ( ParticleSet ref,
rs 
)
inline

Definition at line 54 of file LRBreakupUtilities.h.

References ParticleSet::getLattice(), YukawaBreakup< T >::NormFactor, YukawaBreakup< T >::OneOverSqrtRs, YukawaBreakup< T >::Rs, qmcplusplus::sqrt(), and YukawaBreakup< T >::SqrtRs.

55  {
56  NormFactor = 4.0 * M_PI / ref.getLattice().Volume;
57  //NormFactor*=(rs*rs*rs)/(Rs*Rs*Rs);
58  Rs = rs;
59  SqrtRs = std::sqrt(Rs);
60  OneOverSqrtRs = 1.0 / SqrtRs;
61  }
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)

◆ Uk()

T Uk ( kk) const
inline

return RPA value at |k|

Parameters
kk|k|^2

Definition at line 103 of file LRBreakupUtilities.h.

References YukawaBreakup< T >::NormFactor, and YukawaBreakup< T >::Rs.

◆ Xk()

T Xk ( k,
rc 
) const
inline

Definition at line 88 of file LRBreakupUtilities.h.

References qmcplusplus::cos(), qmcplusplus::exp(), YukawaBreakup< T >::NormFactor, YukawaBreakup< T >::OneOverSqrtRs, YukawaBreakup< T >::Rs, and qmcplusplus::sin().

Referenced by YukawaBreakup< T >::Fk().

89  {
90  T coskr = std::cos(k * rc);
91  T sinkr = std::sin(k * rc);
92  T oneOverK = 1.0 / k;
93  return -NormFactor * Rs *
94  (coskr * oneOverK * oneOverK -
95  std::exp(-rc * OneOverSqrtRs) * (coskr - OneOverSqrtRs * sinkr * oneOverK) / (k * k + 1.0 / Rs));
96  }
MakeReturn< UnaryNode< FnSin, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sin(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnCos, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t cos(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)

Member Data Documentation

◆ NormFactor

◆ OneOverSqrtRs

◆ Rs

◆ SqrtRs


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