QMCPACK
LatticeAnalyzer< T, 2 > Struct Template Reference

specialization for 2D lattice More...

+ Collaboration diagram for LatticeAnalyzer< T, 2 >:

Public Types

using SingleParticlePos = TinyVector< T, 2 >
 
using Tensor_t = Tensor< T, 2 >
 

Public Member Functions

int operator() (const TinyVector< int, 2 > &box)
 return supercell enum More...
 
bool isDiagonalOnly (const Tensor< T, 2 > &R) const
 
SingleParticlePos calcSolidAngles (const TinyVector< SingleParticlePos, 2 > &Rv, const SingleParticlePos &OneOverLength)
 
calcWignerSeitzRadius (TinyVector< SingleParticlePos, 2 > &a)
 
calcSimulationCellRadius (TinyVector< SingleParticlePos, 2 > &a)
 

Detailed Description

template<typename T>
struct qmcplusplus::LatticeAnalyzer< T, 2 >

specialization for 2D lattice

Definition at line 144 of file LatticeAnalyzer.h.

Member Typedef Documentation

◆ SingleParticlePos

Definition at line 146 of file LatticeAnalyzer.h.

◆ Tensor_t

using Tensor_t = Tensor<T, 2>

Definition at line 147 of file LatticeAnalyzer.h.

Member Function Documentation

◆ calcSimulationCellRadius()

T calcSimulationCellRadius ( TinyVector< SingleParticlePos, 2 > &  a)
inline

Definition at line 181 of file LatticeAnalyzer.h.

References qmcplusplus::acos(), qmcplusplus::dot(), omptarget::min(), qmcplusplus::sin(), and qmcplusplus::sqrt().

182  {
183  T a0mag = std::sqrt(dot(a[0], a[0]));
184  T a1mag = std::sqrt(dot(a[1], a[1]));
185  T theta1 = std::acos(dot(a[0], a[1]) / (a0mag * a1mag));
186  T theta2 = M_PI - theta1;
187  T theta = std::min(theta1, theta2);
188  T dist = std::min(a0mag, a1mag);
189  return 0.5 * std::sin(theta) * dist;
190  // return calcWignerSeitzRadius(a);
191  }
MakeReturn< UnaryNode< FnSin, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sin(const Vector< T1, C1 > &l)
T min(T a, T b)
MakeReturn< UnaryNode< FnArcCos, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t acos(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)

◆ calcSolidAngles()

SingleParticlePos calcSolidAngles ( const TinyVector< SingleParticlePos, 2 > &  Rv,
const SingleParticlePos OneOverLength 
)
inline

Definition at line 164 of file LatticeAnalyzer.h.

References qmcplusplus::acos(), and qmcplusplus::dot().

166  {
167  const T rad_to_deg = 180.0 / M_PI;
168  return SingleParticlePos(rad_to_deg * std::acos(dot(Rv[0], Rv[1]) * OneOverLength[0] * OneOverLength[1]), 0.0);
169  }
MakeReturn< UnaryNode< FnArcCos, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t acos(const Vector< T1, C1 > &l)
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)

◆ calcWignerSeitzRadius()

T calcWignerSeitzRadius ( TinyVector< SingleParticlePos, 2 > &  a)
inline

Definition at line 171 of file LatticeAnalyzer.h.

References qmcplusplus::dot(), omptarget::min(), and qmcplusplus::sqrt().

172  {
173  T rMin;
174  T dotP = dot(a[0], a[1]);
175  SingleParticlePos L0 = a[0] - dotP * a[1];
176  SingleParticlePos L1 = a[1] - dotP * a[0];
177  rMin = 0.5 * std::min(std::sqrt(dot(L0, L0)), std::sqrt(dot(L1, L1)));
178  return rMin;
179  }
T min(T a, T b)
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)

◆ isDiagonalOnly()

bool isDiagonalOnly ( const Tensor< T, 2 > &  R) const
inline

Definition at line 158 of file LatticeAnalyzer.h.

References qmcplusplus::abs().

159  {
160  T offdiag = std::abs(R(0, 1)) + std::abs(R(1, 0));
161  return (offdiag < std::numeric_limits<T>::epsilon());
162  }
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)

◆ operator()()

int operator() ( const TinyVector< int, 2 > &  box)
inline

return supercell enum

Parameters
[in]box[2]if box[i]==1, PBC
Returns
SUPERCELL_OPEN or SUPERCELL_BULK

Definition at line 153 of file LatticeAnalyzer.h.

References qmcplusplus::SUPERCELL_BULK, and qmcplusplus::SUPERCELL_OPEN.

154  {
155  return (box[0] + 2 * box[1]) ? SUPERCELL_BULK : SUPERCELL_OPEN;
156  }

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