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

Public Member Functions

 FreeOrbital (const std::string &my_name, const std::vector< PosType > &kpts_cart)
 
 ~FreeOrbital ()
 
std::string getClassName () const override
 return class name More...
 
void evaluate_notranspose (const ParticleSet &P, int first, int last, ValueMatrix &phi, GradMatrix &dphi, ValueMatrix &d2phi) override
 evaluate the values, gradients and laplacians of this single-particle orbital for [first,last) particles More...
 
void evaluateVGL (const ParticleSet &P, int i, ValueVector &pvec, GradVector &dpvec, ValueVector &d2pvec) override
 evaluate the values, gradients and laplacians of this single-particle orbital set More...
 
void evaluateValue (const ParticleSet &P, int iat, ValueVector &pvec) override
 evaluate the values of this single-particle orbital set More...
 
void evaluate_notranspose (const ParticleSet &P, int first, int last, ValueMatrix &phi, GradMatrix &dphi, HessMatrix &d2phi_mat) override
 evaluate the values, gradients and hessians of this single-particle orbital for [first,last) particles More...
 
void evaluate_notranspose (const ParticleSet &P, int first, int last, ValueMatrix &phi, GradMatrix &dphi, HessMatrix &d2phi_mat, GGGMatrix &d3phi_mat) override
 evaluate the values, gradients, hessians and third derivatives of this single-particle orbital for [first,last) particles More...
 
void report (const std::string &pad) const override
 print SPOSet information More...
 
std::unique_ptr< SPOSetmakeClone () const override
 make a clone of itself every derived class must implement this to have threading working correctly. More...
 
void setOrbitalSetSize (int norbs) override
 set the OrbitalSetSize More...
 
- Public Member Functions inherited from SPOSet
 SPOSet (const std::string &my_name)
 constructor More...
 
virtual ~SPOSet ()=default
 destructor More...
 
int size () const
 return the size of the orbital set Ye: this needs to be replaced by getOrbitalSetSize(); More...
 
void basic_report (const std::string &pad="") const
 print basic SPOSet information More...
 
int getOrbitalSetSize () const
 return the size of the orbitals More...
 
virtual bool isOptimizable () const
 Query if this SPOSet is optimizable. More...
 
virtual void extractOptimizableObjectRefs (UniqueOptObjRefs &opt_obj_refs)
 extract underlying OptimizableObject references More...
 
virtual void checkOutVariables (const opt_variables_type &active)
 check out variational optimizable variables More...
 
virtual bool isOMPoffload () const
 Query if this SPOSet uses OpenMP offload. More...
 
virtual bool hasIonDerivs () const
 Query if this SPOSet has an explicit ion dependence. More...
 
virtual void checkObject () const
 check a few key parameters before putting the SPO into a determinant More...
 
virtual bool isRotationSupported () const
 return true if this SPOSet can be wrappered by RotatedSPO More...
 
virtual void storeParamsBeforeRotation ()
 store parameters before getting destroyed by rotation. More...
 
virtual void applyRotation (const ValueMatrix &rot_mat, bool use_stored_copy=false)
 apply rotation to all the orbitals More...
 
virtual void evaluateDerivatives (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi, const int &FirstIndex, const int &LastIndex)
 Parameter derivatives of the wavefunction and the Laplacian of the wavefunction. More...
 
virtual void evaluateDerivativesWF (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, int FirstIndex, int LastIndex)
 Parameter derivatives of the wavefunction. More...
 
virtual void evaluateDerivatives (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi, const ValueType &psiCurrent, const std::vector< ValueType > &Coeff, const std::vector< size_t > &C2node_up, const std::vector< size_t > &C2node_dn, const ValueVector &detValues_up, const ValueVector &detValues_dn, const GradMatrix &grads_up, const GradMatrix &grads_dn, const ValueMatrix &lapls_up, const ValueMatrix &lapls_dn, const ValueMatrix &M_up, const ValueMatrix &M_dn, const ValueMatrix &Minv_up, const ValueMatrix &Minv_dn, const GradMatrix &B_grad, const ValueMatrix &B_lapl, const std::vector< int > &detData_up, const size_t N1, const size_t N2, const size_t NP1, const size_t NP2, const std::vector< std::vector< int >> &lookup_tbl)
 Evaluate the derivative of the optimized orbitals with respect to the parameters this is used only for MSD, to be refined for better serving both single and multi SD. More...
 
virtual void evaluateDerivativesWF (ParticleSet &P, const opt_variables_type &optvars, Vector< ValueType > &dlogpsi, const QTFull::ValueType &psiCurrent, const std::vector< ValueType > &Coeff, const std::vector< size_t > &C2node_up, const std::vector< size_t > &C2node_dn, const ValueVector &detValues_up, const ValueVector &detValues_dn, const ValueMatrix &M_up, const ValueMatrix &M_dn, const ValueMatrix &Minv_up, const ValueMatrix &Minv_dn, const std::vector< int > &detData_up, const std::vector< std::vector< int >> &lookup_tbl)
 Evaluate the derivative of the optimized orbitals with respect to the parameters this is used only for MSD, to be refined for better serving both single and multi SD. More...
 
virtual void evaluateDetRatios (const VirtualParticleSet &VP, ValueVector &psi, const ValueVector &psiinv, std::vector< ValueType > &ratios)
 evaluate determinant ratios for virtual moves, e.g., sphere move for nonlocalPP More...
 
virtual void evaluateDetSpinorRatios (const VirtualParticleSet &VP, ValueVector &psi, const std::pair< ValueVector, ValueVector > &spinor_multiplier, const ValueVector &invrow, std::vector< ValueType > &ratios)
 evaluate determinant ratios for virtual moves, specifically for Spinor SPOSets More...
 
virtual void evaluateDerivRatios (const VirtualParticleSet &VP, const opt_variables_type &optvars, ValueVector &psi, const ValueVector &psiinv, std::vector< ValueType > &ratios, Matrix< ValueType > &dratios, int FirstIndex, int LastIndex)
 Determinant ratios and parameter derivatives of the wavefunction for virtual moves. More...
 
virtual void mw_evaluateDetRatios (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< const VirtualParticleSet > &vp_list, const RefVector< ValueVector > &psi_list, const std::vector< const ValueType *> &invRow_ptr_list, std::vector< std::vector< ValueType >> &ratios_list) const
 evaluate determinant ratios for virtual moves, e.g., sphere move for nonlocalPP, of multiple walkers More...
 
virtual void evaluateVGL_spin (const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi, ValueVector &dspin)
 evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital set More...
 
virtual void mw_evaluateValue (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list) const
 evaluate the values this single-particle orbital sets of multiple walkers More...
 
virtual void mw_evaluateVGL (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list, const RefVector< GradVector > &dpsi_v_list, const RefVector< ValueVector > &d2psi_v_list) const
 evaluate the values, gradients and laplacians of this single-particle orbital sets of multiple walkers More...
 
virtual void mw_evaluateVGLWithSpin (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const RefVector< ValueVector > &psi_v_list, const RefVector< GradVector > &dpsi_v_list, const RefVector< ValueVector > &d2psi_v_list, OffloadMatrix< ComplexType > &mw_dspin) const
 evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital sets of multiple walkers More...
 
virtual void mw_evaluateVGLandDetRatioGrads (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const std::vector< const ValueType *> &invRow_ptr_list, OffloadMWVGLArray &phi_vgl_v, std::vector< ValueType > &ratios, std::vector< GradType > &grads) const
 evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ratio and grads of multiple walkers. More...
 
virtual void mw_evaluateVGLandDetRatioGradsWithSpin (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int iat, const std::vector< const ValueType *> &invRow_ptr_list, OffloadMWVGLArray &phi_vgl_v, std::vector< ValueType > &ratios, std::vector< GradType > &grads, std::vector< ValueType > &spingrads) const
 evaluate the values, gradients and laplacians of this single-particle orbital sets and determinant ratio and grads of multiple walkers. More...
 
virtual void evaluateVGH (const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, HessVector &grad_grad_psi)
 evaluate the values, gradients and hessians of this single-particle orbital set More...
 
virtual void evaluateVGHGH (const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, HessVector &grad_grad_psi, GGGVector &grad_grad_grad_psi)
 evaluate the values, gradients, hessians, and grad hessians of this single-particle orbital set More...
 
virtual void evaluate_spin (const ParticleSet &P, int iat, ValueVector &psi, ValueVector &dpsi)
 evaluate the values of this single-particle orbital set More...
 
virtual void evaluateThirdDeriv (const ParticleSet &P, int first, int last, GGGMatrix &grad_grad_grad_logdet)
 evaluate the third derivatives of this single-particle orbital set More...
 
virtual void evaluate_notranspose_spin (const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, ValueMatrix &d2logdet, ValueMatrix &dspinlogdet)
 evaluate the values, gradients and laplacians of this single-particle orbital for [first,last) particles, including the spin gradient More...
 
virtual void mw_evaluate_notranspose (const RefVectorWithLeader< SPOSet > &spo_list, const RefVectorWithLeader< ParticleSet > &P_list, int first, int last, const RefVector< ValueMatrix > &logdet_list, const RefVector< GradMatrix > &dlogdet_list, const RefVector< ValueMatrix > &d2logdet_list) const
 
virtual void evaluateGradSource (const ParticleSet &P, int first, int last, const ParticleSet &source, int iat_src, GradMatrix &gradphi)
 evaluate the gradients of this single-particle orbital for [first,last) target particles with respect to the given source particle More...
 
virtual void evaluateGradSource (const ParticleSet &P, int first, int last, const ParticleSet &source, int iat_src, GradMatrix &grad_phi, HessMatrix &grad_grad_phi, GradMatrix &grad_lapl_phi)
 evaluate the gradients of values, gradients, laplacians of this single-particle orbital for [first,last) target particles with respect to the given source particle More...
 
virtual void evaluateGradSourceRow (const ParticleSet &P, int iel, const ParticleSet &source, int iat_src, GradVector &gradphi)
 Returns a row of d/dR_iat phi_j(r) evaluated at position r. More...
 
virtual PosType get_k (int orb)
 access the k point related to the given orbital More...
 
virtual void createResource (ResourceCollection &collection) const
 initialize a shared resource and hand it to collection More...
 
virtual void acquireResource (ResourceCollection &collection, const RefVectorWithLeader< SPOSet > &spo_list) const
 acquire a shared resource from collection More...
 
virtual void releaseResource (ResourceCollection &collection, const RefVectorWithLeader< SPOSet > &spo_list) const
 return a shared resource to collection More...
 
virtual bool transformSPOSet ()
 Used only by cusp correction in AOS LCAO. More...
 
virtual void finalizeConstruction ()
 finalize the construction of SPOSet More...
 
const std::string & getName () const
 return object name More...
 

Private Attributes

const std::vector< PosTypekvecs
 
const int mink
 
const int maxk
 
std::vector< RealTypek2neg
 

Additional Inherited Members

- Public Types inherited from SPOSet
using ValueVector = OrbitalSetTraits< ValueType >::ValueVector
 
using ValueMatrix = OrbitalSetTraits< ValueType >::ValueMatrix
 
using GradVector = OrbitalSetTraits< ValueType >::GradVector
 
using GradMatrix = OrbitalSetTraits< ValueType >::GradMatrix
 
using HessVector = OrbitalSetTraits< ValueType >::HessVector
 
using HessMatrix = OrbitalSetTraits< ValueType >::HessMatrix
 
using GGGVector = OrbitalSetTraits< ValueType >::GradHessVector
 
using GGGMatrix = OrbitalSetTraits< ValueType >::GradHessMatrix
 
using SPOMap = std::map< std::string, const std::unique_ptr< const SPOSet > >
 
using OffloadMWVGLArray = Array< ValueType, 3, OffloadPinnedAllocator< ValueType > >
 
using OffloadMWVArray = Array< ValueType, 2, OffloadPinnedAllocator< ValueType > >
 
template<typename DT >
using OffloadMatrix = Matrix< DT, OffloadPinnedAllocator< DT > >
 
- Public Types inherited from QMCTraits
enum  { DIM = OHMMS_DIM, DIM_VGL = OHMMS_DIM + 2 }
 
using QTBase = QMCTypes< OHMMS_PRECISION, DIM >
 
using QTFull = QMCTypes< OHMMS_PRECISION_FULL, DIM >
 
using RealType = QTBase::RealType
 
using ComplexType = QTBase::ComplexType
 
using ValueType = QTBase::ValueType
 
using PosType = QTBase::PosType
 
using GradType = QTBase::GradType
 
using TensorType = QTBase::TensorType
 
using IndexType = OHMMS_INDEXTYPE
 define other types More...
 
using FullPrecRealType = QTFull::RealType
 
using FullPrecValueType = QTFull::ValueType
 
using PropertySetType = RecordNamedProperty< FullPrecRealType >
 define PropertyList_t More...
 
using PtclGrpIndexes = std::vector< std::pair< int, int > >
 
- Protected Attributes inherited from SPOSet
const std::string my_name_
 name of the object, unique identifier More...
 
IndexType OrbitalSetSize
 number of Single-particle orbitals More...
 
opt_variables_type myVars
 Optimizable variables. More...
 

Detailed Description

Definition at line 24 of file FreeOrbital.h.

Constructor & Destructor Documentation

◆ FreeOrbital()

FreeOrbital ( const std::string &  my_name,
const std::vector< PosType > &  kpts_cart 
)

Definition at line 5 of file FreeOrbital.cpp.

References qmcplusplus::dot(), FreeOrbital::k2neg, FreeOrbital::kvecs, FreeOrbital::maxk, and SPOSet::OrbitalSetSize.

6  : SPOSet(my_name),
7  kvecs(kpts_cart),
8 #ifdef QMC_COMPLEX
9  mink(0), // first k at twist may not be 0
10 #else
11  mink(1), // treat k=0 as special case
12 #endif
13  maxk(kpts_cart.size())
14 {
15 #ifdef QMC_COMPLEX
17 #else
18  OrbitalSetSize = 2 * maxk - 1; // k=0 has no (cos, sin) split
19 #endif
20  k2neg.resize(maxk);
21  for (int ik = 0; ik < maxk; ik++)
22  k2neg[ik] = -dot(kvecs[ik], kvecs[ik]);
23 }
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
IndexType OrbitalSetSize
number of Single-particle orbitals
Definition: SPOSet.h:566
const std::vector< PosType > kvecs
Definition: FreeOrbital.h:68
SPOSet(const std::string &my_name)
constructor
Definition: SPOSet.cpp:29
std::vector< RealType > k2neg
Definition: FreeOrbital.h:71

◆ ~FreeOrbital()

Definition at line 25 of file FreeOrbital.cpp.

25 {}

Member Function Documentation

◆ evaluate_notranspose() [1/3]

void evaluate_notranspose ( const ParticleSet P,
int  first,
int  last,
ValueMatrix logdet,
GradMatrix dlogdet,
ValueMatrix d2logdet 
)
overridevirtual

evaluate the values, gradients and laplacians of this single-particle orbital for [first,last) particles

Parameters
[in]Pcurrent ParticleSet
[in]firststarting index of the particles
[in]lastending index of the particles
[out]logdetdeterminant matrix to be inverted
[out]dlogdetgradients
[out]d2logdetlaplacians

Implements SPOSet.

Definition at line 77 of file FreeOrbital.cpp.

References FreeOrbital::evaluateVGL(), and SPOSet::OrbitalSetSize.

83 {
84  for (int iat = first, i = 0; iat < last; iat++, i++)
85  {
86  ValueVector p(phi[i], OrbitalSetSize);
87  GradVector dp(dphi[i], OrbitalSetSize);
88  ValueVector d2p(d2phi[i], OrbitalSetSize);
89  evaluateVGL(P, iat, p, dp, d2p);
90  }
91 }
void evaluateVGL(const ParticleSet &P, int i, ValueVector &pvec, GradVector &dpvec, ValueVector &d2pvec) override
evaluate the values, gradients and laplacians of this single-particle orbital set ...
Definition: FreeOrbital.cpp:27
IndexType OrbitalSetSize
number of Single-particle orbitals
Definition: SPOSet.h:566
OrbitalSetTraits< ValueType >::GradVector GradVector
Definition: SPOSet.h:51
OrbitalSetTraits< ValueType >::ValueVector ValueVector
Definition: SPOSet.h:49

◆ evaluate_notranspose() [2/3]

void evaluate_notranspose ( const ParticleSet P,
int  first,
int  last,
ValueMatrix logdet,
GradMatrix dlogdet,
HessMatrix grad_grad_logdet 
)
overridevirtual

evaluate the values, gradients and hessians of this single-particle orbital for [first,last) particles

Parameters
Pcurrent ParticleSet
firststarting index of the particles
lastending index of the particles
logdetdeterminant matrix to be inverted
dlogdetgradients
grad_grad_logdethessians

Reimplemented from SPOSet.

Definition at line 93 of file FreeOrbital.cpp.

References ParticleSet::activeR(), qmcplusplus::dot(), FreeOrbital::kvecs, FreeOrbital::maxk, FreeOrbital::mink, OHMMS_DIM, SPOSet::OrbitalSetSize, and qmcplusplus::sincos().

99 {
100  RealType sinkr, coskr;
101  ValueType phi_of_r;
102  for (int iat = first, i = 0; iat < last; iat++, i++)
103  {
104  ValueVector p(phi[i], OrbitalSetSize);
105  GradVector dp(dphi[i], OrbitalSetSize);
106  HessVector hess(d2phi_mat[i], OrbitalSetSize);
107 
108  const PosType& r = P.activeR(iat);
109  for (int ik = mink; ik < maxk; ik++)
110  {
111  sincos(dot(kvecs[ik], r), &sinkr, &coskr);
112 #ifdef QMC_COMPLEX
113  // phi(r) = cos(kr)+i*sin(kr)
114  phi_of_r = ValueType(coskr, sinkr);
115  p[ik] = phi_of_r;
116  // i*phi(r) = -sin(kr) + i*cos(kr)
117  dp[ik] = ValueType(-sinkr, coskr) * kvecs[ik];
118  for (int la = 0; la < OHMMS_DIM; la++)
119  {
120  hess[ik](la, la) = -phi_of_r * (kvecs[ik])[la] * (kvecs[ik])[la];
121  for (int lb = la + 1; lb < OHMMS_DIM; lb++)
122  {
123  hess[ik](la, lb) = -phi_of_r * (kvecs[ik])[la] * (kvecs[ik])[lb];
124  hess[ik](lb, la) = hess[ik](la, lb);
125  }
126  }
127 #else
128  const int j2 = 2 * ik;
129  const int j1 = j2 - 1;
130  p[j1] = coskr;
131  p[j2] = sinkr;
132  dp[j1] = -sinkr * kvecs[ik];
133  dp[j2] = coskr * kvecs[ik];
134  for (int la = 0; la < OHMMS_DIM; la++)
135  {
136  hess[j1](la, la) = -coskr * (kvecs[ik])[la] * (kvecs[ik])[la];
137  hess[j2](la, la) = -sinkr * (kvecs[ik])[la] * (kvecs[ik])[la];
138  for (int lb = la + 1; lb < OHMMS_DIM; lb++)
139  {
140  hess[j1](la, lb) = -coskr * (kvecs[ik])[la] * (kvecs[ik])[lb];
141  hess[j2](la, lb) = -sinkr * (kvecs[ik])[la] * (kvecs[ik])[lb];
142  hess[j1](lb, la) = hess[j1](la, lb);
143  hess[j2](lb, la) = hess[j2](la, lb);
144  }
145  }
146 #endif
147  }
148 #ifndef QMC_COMPLEX
149  p[0] = 1.0;
150  dp[0] = 0.0;
151  hess[0] = 0.0;
152 #endif
153  }
154 }
void sincos(T a, T *restrict s, T *restrict c)
sincos function wrapper
Definition: math.hpp:77
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
QTBase::ValueType ValueType
Definition: Configuration.h:60
IndexType OrbitalSetSize
number of Single-particle orbitals
Definition: SPOSet.h:566
QMCTraits::PosType PosType
OrbitalSetTraits< ValueType >::HessVector HessVector
Definition: SPOSet.h:53
#define OHMMS_DIM
Definition: config.h:64
const std::vector< PosType > kvecs
Definition: FreeOrbital.h:68
OrbitalSetTraits< ValueType >::GradVector GradVector
Definition: SPOSet.h:51
OrbitalSetTraits< ValueType >::ValueVector ValueVector
Definition: SPOSet.h:49
QMCTraits::RealType RealType

◆ evaluate_notranspose() [3/3]

void evaluate_notranspose ( const ParticleSet P,
int  first,
int  last,
ValueMatrix logdet,
GradMatrix dlogdet,
HessMatrix grad_grad_logdet,
GGGMatrix grad_grad_grad_logdet 
)
overridevirtual

evaluate the values, gradients, hessians and third derivatives of this single-particle orbital for [first,last) particles

Parameters
Pcurrent ParticleSet
firststarting index of the particles
lastending index of the particles
logdetdeterminant matrix to be inverted
dlogdetgradients
grad_grad_logdethessians
grad_grad_grad_logdetthird derivatives

Reimplemented from SPOSet.

Definition at line 156 of file FreeOrbital.cpp.

References ParticleSet::activeR(), qmcplusplus::dot(), FreeOrbital::kvecs, FreeOrbital::maxk, FreeOrbital::mink, OHMMS_DIM, SPOSet::OrbitalSetSize, and qmcplusplus::sincos().

163 {
164  RealType sinkr, coskr;
165  ValueType phi_of_r;
166  for (int iat = first, i = 0; iat < last; iat++, i++)
167  {
168  ValueVector p(phi[i], OrbitalSetSize);
169  GradVector dp(dphi[i], OrbitalSetSize);
170  HessVector hess(d2phi_mat[i], OrbitalSetSize);
171  GGGVector ggg(d3phi_mat[i], OrbitalSetSize);
172 
173  const PosType& r = P.activeR(iat);
174  for (int ik = mink; ik < maxk; ik++)
175  {
176  sincos(dot(kvecs[ik], r), &sinkr, &coskr);
177 #ifdef QMC_COMPLEX
178  const ValueType compi(0, 1);
179  phi_of_r = ValueType(coskr, sinkr);
180  p[ik] = phi_of_r;
181  dp[ik] = compi * phi_of_r * kvecs[ik];
182  for (int la = 0; la < OHMMS_DIM; la++)
183  {
184  hess[ik](la, la) = -phi_of_r * (kvecs[ik])[la] * (kvecs[ik])[la];
185  for (int lb = la + 1; lb < OHMMS_DIM; lb++)
186  {
187  hess[ik](la, lb) = -phi_of_r * (kvecs[ik])[la] * (kvecs[ik])[lb];
188  hess[ik](lb, la) = hess[ik](la, lb);
189  }
190  }
191  for (int la = 0; la < OHMMS_DIM; la++)
192  {
193  ggg[ik][la] = compi * (kvecs[ik])[la] * hess[ik];
194  }
195 #else
196  const int j2 = 2 * ik;
197  const int j1 = j2 - 1;
198  p[j1] = coskr;
199  p[j2] = sinkr;
200  dp[j1] = -sinkr * kvecs[ik];
201  dp[j2] = coskr * kvecs[ik];
202  for (int la = 0; la < OHMMS_DIM; la++)
203  {
204  hess[j1](la, la) = -coskr * (kvecs[ik])[la] * (kvecs[ik])[la];
205  hess[j2](la, la) = -sinkr * (kvecs[ik])[la] * (kvecs[ik])[la];
206  ggg[j1][la](la, la) = sinkr * (kvecs[ik])[la] * (kvecs[ik])[la] * (kvecs[ik])[la];
207  ggg[j2][la](la, la) = -coskr * (kvecs[ik])[la] * (kvecs[ik])[la] * (kvecs[ik])[la];
208  for (int lb = la + 1; lb < OHMMS_DIM; lb++)
209  {
210  hess[j1](la, lb) = -coskr * (kvecs[ik])[la] * (kvecs[ik])[lb];
211  hess[j2](la, lb) = -sinkr * (kvecs[ik])[la] * (kvecs[ik])[lb];
212  hess[j1](lb, la) = hess[j1](la, lb);
213  hess[j2](lb, la) = hess[j2](la, lb);
214  ggg[j1][la](lb, la) = sinkr * (kvecs[ik])[la] * (kvecs[ik])[lb] * (kvecs[ik])[la];
215  ggg[j2][la](lb, la) = -coskr * (kvecs[ik])[la] * (kvecs[ik])[lb] * (kvecs[ik])[la];
216  ggg[j1][la](la, lb) = ggg[j1][la](lb, la);
217  ggg[j2][la](la, lb) = ggg[j2][la](lb, la);
218  ggg[j1][lb](la, la) = ggg[j1][la](lb, la);
219  ggg[j2][lb](la, la) = ggg[j2][la](lb, la);
220  ggg[j1][la](lb, lb) = sinkr * (kvecs[ik])[la] * (kvecs[ik])[lb] * (kvecs[ik])[lb];
221  ggg[j2][la](lb, lb) = -coskr * (kvecs[ik])[la] * (kvecs[ik])[lb] * (kvecs[ik])[lb];
222  ggg[j1][lb](la, lb) = ggg[j1][la](lb, lb);
223  ggg[j2][lb](la, lb) = ggg[j2][la](lb, lb);
224  ggg[j1][lb](lb, la) = ggg[j1][la](lb, lb);
225  ggg[j2][lb](lb, la) = ggg[j2][la](lb, lb);
226  for (int lc = lb + 1; lc < OHMMS_DIM; lc++)
227  {
228  ggg[j1][la](lb, lc) = sinkr * (kvecs[ik])[la] * (kvecs[ik])[lb] * (kvecs[ik])[lc];
229  ggg[j2][la](lb, lc) = -coskr * (kvecs[ik])[la] * (kvecs[ik])[lb] * (kvecs[ik])[lc];
230  ggg[j1][la](lc, lb) = ggg[j1][la](lb, lc);
231  ggg[j2][la](lc, lb) = ggg[j2][la](lb, lc);
232  ggg[j1][lb](la, lc) = ggg[j1][la](lb, lc);
233  ggg[j2][lb](la, lc) = ggg[j2][la](lb, lc);
234  ggg[j1][lb](lc, la) = ggg[j1][la](lb, lc);
235  ggg[j2][lb](lc, la) = ggg[j2][la](lb, lc);
236  ggg[j1][lc](la, lb) = ggg[j1][la](lb, lc);
237  ggg[j2][lc](la, lb) = ggg[j2][la](lb, lc);
238  ggg[j1][lc](lb, la) = ggg[j1][la](lb, lc);
239  ggg[j2][lc](lb, la) = ggg[j2][la](lb, lc);
240  }
241  }
242  }
243 #endif
244  }
245 #ifndef QMC_COMPLEX
246  p[0] = 1.0;
247  dp[0] = 0.0;
248  hess[0] = 0.0;
249  ggg[0] = 0.0;
250 #endif
251  }
252 }
void sincos(T a, T *restrict s, T *restrict c)
sincos function wrapper
Definition: math.hpp:77
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
QTBase::ValueType ValueType
Definition: Configuration.h:60
IndexType OrbitalSetSize
number of Single-particle orbitals
Definition: SPOSet.h:566
QMCTraits::PosType PosType
OrbitalSetTraits< ValueType >::HessVector HessVector
Definition: SPOSet.h:53
#define OHMMS_DIM
Definition: config.h:64
const std::vector< PosType > kvecs
Definition: FreeOrbital.h:68
OrbitalSetTraits< ValueType >::GradHessVector GGGVector
Definition: SPOSet.h:55
OrbitalSetTraits< ValueType >::GradVector GradVector
Definition: SPOSet.h:51
OrbitalSetTraits< ValueType >::ValueVector ValueVector
Definition: SPOSet.h:49
QMCTraits::RealType RealType

◆ evaluateValue()

void evaluateValue ( const ParticleSet P,
int  iat,
ValueVector psi 
)
overridevirtual

evaluate the values of this single-particle orbital set

Parameters
Pcurrent ParticleSet
iatactive particle
psivalues of the SPO

Implements SPOSet.

Definition at line 56 of file FreeOrbital.cpp.

References ParticleSet::activeR(), qmcplusplus::dot(), FreeOrbital::kvecs, FreeOrbital::maxk, FreeOrbital::mink, and qmcplusplus::sincos().

57 {
58  const PosType& r = P.activeR(iat);
59  RealType sinkr, coskr;
60  for (int ik = mink; ik < maxk; ik++)
61  {
62  sincos(dot(kvecs[ik], r), &sinkr, &coskr);
63 #ifdef QMC_COMPLEX
64  pvec[ik] = ValueType(coskr, sinkr);
65 #else
66  const int j2 = 2 * ik;
67  const int j1 = j2 - 1;
68  pvec[j1] = coskr;
69  pvec[j2] = sinkr;
70 #endif
71  }
72 #ifndef QMC_COMPLEX
73  pvec[0] = 1.0;
74 #endif
75 }
void sincos(T a, T *restrict s, T *restrict c)
sincos function wrapper
Definition: math.hpp:77
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
QTBase::ValueType ValueType
Definition: Configuration.h:60
QMCTraits::PosType PosType
const std::vector< PosType > kvecs
Definition: FreeOrbital.h:68
QMCTraits::RealType RealType

◆ evaluateVGL()

void evaluateVGL ( const ParticleSet P,
int  iat,
ValueVector psi,
GradVector dpsi,
ValueVector d2psi 
)
overridevirtual

evaluate the values, gradients and laplacians of this single-particle orbital set

Parameters
Pcurrent ParticleSet
iatactive particle
psivalues of the SPO
dpsigradients of the SPO
d2psilaplacians of the SPO

Implements SPOSet.

Definition at line 27 of file FreeOrbital.cpp.

References ParticleSet::activeR(), qmcplusplus::dot(), FreeOrbital::k2neg, FreeOrbital::kvecs, FreeOrbital::maxk, FreeOrbital::mink, and qmcplusplus::sincos().

Referenced by FreeOrbital::evaluate_notranspose().

28 {
29  const PosType& r = P.activeR(iat);
30  RealType sinkr, coskr;
31  for (int ik = mink; ik < maxk; ik++)
32  {
33  sincos(dot(kvecs[ik], r), &sinkr, &coskr);
34 #ifdef QMC_COMPLEX
35  pvec[ik] = ValueType(coskr, sinkr);
36  dpvec[ik] = ValueType(-sinkr, coskr) * kvecs[ik];
37  d2pvec[ik] = ValueType(k2neg[ik] * coskr, k2neg[ik] * sinkr);
38 #else
39  const int j2 = 2 * ik;
40  const int j1 = j2 - 1;
41  pvec[j1] = coskr;
42  pvec[j2] = sinkr;
43  dpvec[j1] = -sinkr * kvecs[ik];
44  dpvec[j2] = coskr * kvecs[ik];
45  d2pvec[j1] = k2neg[ik] * coskr;
46  d2pvec[j2] = k2neg[ik] * sinkr;
47 #endif
48  }
49 #ifndef QMC_COMPLEX
50  pvec[0] = 1.0;
51  dpvec[0] = 0.0;
52  d2pvec[0] = 0.0;
53 #endif
54 }
void sincos(T a, T *restrict s, T *restrict c)
sincos function wrapper
Definition: math.hpp:77
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
QTBase::ValueType ValueType
Definition: Configuration.h:60
QMCTraits::PosType PosType
const std::vector< PosType > kvecs
Definition: FreeOrbital.h:68
std::vector< RealType > k2neg
Definition: FreeOrbital.h:71
QMCTraits::RealType RealType

◆ getClassName()

std::string getClassName ( ) const
inlineoverridevirtual

return class name

Implements SPOSet.

Definition at line 30 of file FreeOrbital.h.

30 { return "FreeOrbital"; }

◆ makeClone()

std::unique_ptr<SPOSet> makeClone ( ) const
inlineoverridevirtual

make a clone of itself every derived class must implement this to have threading working correctly.

Reimplemented from SPOSet.

Definition at line 64 of file FreeOrbital.h.

64 { return std::make_unique<FreeOrbital>(*this); }

◆ report()

void report ( const std::string &  pad) const
overridevirtual

print SPOSet information

Reimplemented from SPOSet.

Definition at line 254 of file FreeOrbital.cpp.

References qmcplusplus::app_log(), and FreeOrbital::kvecs.

255 {
256  app_log() << pad << "FreeOrbital report" << std::endl;
257  for (int ik = 0; ik < kvecs.size(); ik++)
258  {
259  app_log() << pad << ik << " " << kvecs[ik] << std::endl;
260  }
261  app_log() << pad << "end FreeOrbital report" << std::endl;
262  app_log().flush();
263 }
const std::vector< PosType > kvecs
Definition: FreeOrbital.h:68
std::ostream & app_log()
Definition: OutputManager.h:65

◆ setOrbitalSetSize()

void setOrbitalSetSize ( int  norbs)
inlineoverridevirtual

set the OrbitalSetSize

Parameters
norbsnumber of single-particle orbitals Ye: I prefer to remove this interface in the future. SPOSet builders need to handle the size correctly. It doesn't make sense allowing to set the value at any place in the code.

Implements SPOSet.

Definition at line 65 of file FreeOrbital.h.

65 { throw std::runtime_error("not implemented"); }

Member Data Documentation

◆ k2neg

std::vector<RealType> k2neg
private

Definition at line 71 of file FreeOrbital.h.

Referenced by FreeOrbital::evaluateVGL(), and FreeOrbital::FreeOrbital().

◆ kvecs

◆ maxk

◆ mink

const int mink
private

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