QMCPACK
KspaceEwaldTerm Class Reference

Functor for term within the k-space sum in Drummond 2008 formula 6. More...

+ Collaboration diagram for KspaceEwaldTerm:

Public Member Functions

 KspaceEwaldTerm (const RealVec &r_in, const RealMat &b_in, real_t kconst_in, real_t kfactor_in)
 
real_t operator() (const IntVec &i) const
 

Private Attributes

const RealVec r
 The inter-particle separation vector. More...
 
const RealMat b
 The k-space cell axes. More...
 
const real_t kconst
 The constant -^2/2 in Drummond 2008 formula 6. More...
 
const real_t kfactor
 The constant 4/ in Drummond 2008 formula 6. More...
 

Detailed Description

Functor for term within the k-space sum in Drummond 2008 formula 6.

Definition at line 98 of file EwaldRef.cpp.

Constructor & Destructor Documentation

◆ KspaceEwaldTerm()

KspaceEwaldTerm ( const RealVec r_in,
const RealMat b_in,
real_t  kconst_in,
real_t  kfactor_in 
)
inline

Definition at line 111 of file EwaldRef.cpp.

112  : r(r_in), b(b_in), kconst(kconst_in), kfactor(kfactor_in)
113  {}
const RealMat b
The k-space cell axes.
Definition: EwaldRef.cpp:104
const real_t kconst
The constant -^2/2 in Drummond 2008 formula 6.
Definition: EwaldRef.cpp:106
const RealVec r
The inter-particle separation vector.
Definition: EwaldRef.cpp:102
const real_t kfactor
The constant 4/ in Drummond 2008 formula 6.
Definition: EwaldRef.cpp:108

Member Function Documentation

◆ operator()()

real_t operator() ( const IntVec i) const
inline

Definition at line 115 of file EwaldRef.cpp.

References KspaceEwaldTerm::b, qmcplusplus::cos(), qmcplusplus::dot(), qmcplusplus::exp(), KspaceEwaldTerm::kconst, KspaceEwaldTerm::kfactor, and KspaceEwaldTerm::r.

116  {
117  RealVec Kv = dot(i, b);
118  real_t K2 = dot(Kv, Kv);
119  real_t Kr = dot(Kv, r);
120  real_t km = kfactor * std::exp(kconst * K2) * std::cos(Kr) / K2;
121  return km;
122  }
MakeReturn< UnaryNode< FnCos, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t cos(const Vector< T1, C1 > &l)
TinyVector< real_t, DIM > RealVec
Type for floating point vectors of length DIM.
Definition: EwaldRef.h:48
const RealMat b
The k-space cell axes.
Definition: EwaldRef.cpp:104
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
const real_t kconst
The constant -^2/2 in Drummond 2008 formula 6.
Definition: EwaldRef.cpp:106
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
double real_t
Type for floating point numbers.
Definition: EwaldRef.h:44
const RealVec r
The inter-particle separation vector.
Definition: EwaldRef.cpp:102
const real_t kfactor
The constant 4/ in Drummond 2008 formula 6.
Definition: EwaldRef.cpp:108

Member Data Documentation

◆ b

const RealMat b
private

The k-space cell axes.

Definition at line 104 of file EwaldRef.cpp.

Referenced by KspaceEwaldTerm::operator()().

◆ kconst

const real_t kconst
private

The constant -^2/2 in Drummond 2008 formula 6.

Definition at line 106 of file EwaldRef.cpp.

Referenced by KspaceEwaldTerm::operator()().

◆ kfactor

const real_t kfactor
private

The constant 4/ in Drummond 2008 formula 6.

Definition at line 108 of file EwaldRef.cpp.

Referenced by KspaceEwaldTerm::operator()().

◆ r

const RealVec r
private

The inter-particle separation vector.

Definition at line 102 of file EwaldRef.cpp.

Referenced by KspaceEwaldTerm::operator()().


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