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

Public Types

enum  {
  PW_VALUE = BasisSet_t::PW_VALUE, PW_LAP = BasisSet_t::PW_LAP, PW_GRADX = BasisSet_t::PW_GRADX, PW_GRADY = BasisSet_t::PW_GRADY,
  PW_GRADZ = BasisSet_t::PW_GRADZ, PW_MAXINDEX = BasisSet_t::PW_MAXINDEX
}
 inherit the enum of BasisSet_t More...
 
using BasisSet_t = PWBasis
 
using PWBasisPtr = PWBasis *
 
- 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 > >
 

Public Member Functions

 PWRealOrbitalSet (const std::string &my_name)
 default constructor More...
 
std::string getClassName () const override
 return class name More...
 
 ~PWRealOrbitalSet () override
 delete BasisSet only it owns this 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 resize (PWBasisPtr bset, int nbands, bool cleanup=false)
 resize the orbital base More...
 
void addVector (const std::vector< RealType > &coefs, int jorb)
 add eigenstate for jorb-th orbital More...
 
void addVector (const std::vector< ComplexType > &coefs, int jorb)
 add eigenstate for jorb-th orbital More...
 
void setOrbitalSetSize (int norbs) override
 set the OrbitalSetSize More...
 
ValueType evaluate (int ib, const PosType &pos)
 
void evaluateValue (const ParticleSet &P, int iat, ValueVector &psi) override
 evaluate the values of this single-particle orbital set More...
 
void evaluateVGL (const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi) override
 evaluate the values, gradients and laplacians of this single-particle orbital set More...
 
void evaluate_notranspose (const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, ValueMatrix &d2logdet) override
 evaluate the values, gradients and laplacians of this single-particle orbital for [first,last) particles More...
 
void evaluate_notranspose (const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, HessMatrix &grad_grad_logdet) override
 evaluate the values, gradients and hessians of this single-particle orbital for [first,last) particles 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...
 
virtual void report (const std::string &pad="") const
 print 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 evaluate_notranspose (const ParticleSet &P, int first, int last, ValueMatrix &logdet, GradMatrix &dlogdet, HessMatrix &grad_grad_logdet, GGGMatrix &grad_grad_grad_logdet)
 evaluate the values, gradients, hessians and third derivatives of this single-particle orbital for [first,last) particles More...
 
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...
 

Public Attributes

bool OwnBasisSet
 boolean More...
 
PosType TwistAngle
 TwistAngle of this PWRealOrbitalSet. More...
 
PWBasisPtr myBasisSet
 My basis set. More...
 
IndexType BasisSetSize
 number of basis More...
 
Matrix< ComplexTypeCC
 Plane-wave coefficients of complex: (iband,g-vector) More...
 
Matrix< ComplexTypeTemp
 temporary array to perform gemm operation More...
 
Vector< ComplexTypetempPsi
 temporary complex vector before assigning to a real psi More...
 

Additional Inherited Members

- 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 31 of file PWRealOrbitalSet.h.

Member Typedef Documentation

◆ BasisSet_t

Definition at line 34 of file PWRealOrbitalSet.h.

◆ PWBasisPtr

using PWBasisPtr = PWBasis*

Definition at line 35 of file PWRealOrbitalSet.h.

Member Enumeration Documentation

◆ anonymous enum

Constructor & Destructor Documentation

◆ PWRealOrbitalSet()

PWRealOrbitalSet ( const std::string &  my_name)
inline

default constructor

Definition at line 50 of file PWRealOrbitalSet.h.

51  : SPOSet(my_name), OwnBasisSet(false), myBasisSet(nullptr), BasisSetSize(0)
52  {}
SPOSet(const std::string &my_name)
constructor
Definition: SPOSet.cpp:29
PWBasisPtr myBasisSet
My basis set.
IndexType BasisSetSize
number of basis

◆ ~PWRealOrbitalSet()

~PWRealOrbitalSet ( )
override

delete BasisSet only it owns this

Builder takes care of who owns what

Definition at line 28 of file PWRealOrbitalSet.cpp.

References PWRealOrbitalSet::myBasisSet, and PWRealOrbitalSet::OwnBasisSet.

29 {
30  if (OwnBasisSet && myBasisSet)
31  delete myBasisSet;
32 }
PWBasisPtr myBasisSet
My basis set.

Member Function Documentation

◆ addVector() [1/2]

void addVector ( const std::vector< RealType > &  coefs,
int  jorb 
)

add eigenstate for jorb-th orbital

Parameters
coefsreal input data
jorborbital index

Definition at line 56 of file PWRealOrbitalSet.cpp.

References Communicate::abort(), qmcplusplus::app_error(), PWRealOrbitalSet::CC, OHMMS::Controller, PWBasis::inputmap, and PWRealOrbitalSet::myBasisSet.

57 {
58  int ng = myBasisSet->inputmap.size();
59  if (ng != coefs.size())
60  {
61  app_error() << " Input G map does not match the basis size of wave functions " << std::endl;
63  }
64  //drop G points for the given TwistAngle
65  const std::vector<int>& inputmap(myBasisSet->inputmap);
66  for (int ig = 0; ig < ng; ig++)
67  {
68  if (inputmap[ig] > -1)
69  CC[jorb][inputmap[ig]] = coefs[ig];
70  }
71 }
std::ostream & app_error()
Definition: OutputManager.h:67
Communicate * Controller
Global Communicator for a process.
Definition: Communicate.cpp:35
Matrix< ComplexType > CC
Plane-wave coefficients of complex: (iband,g-vector)
PWBasisPtr myBasisSet
My basis set.
void abort() const
std::vector< int > inputmap
Definition: PWBasis.h:108

◆ addVector() [2/2]

void addVector ( const std::vector< ComplexType > &  coefs,
int  jorb 
)

add eigenstate for jorb-th orbital

Parameters
coefscomplex input data
jorborbital index

Definition at line 73 of file PWRealOrbitalSet.cpp.

References Communicate::abort(), qmcplusplus::app_error(), PWRealOrbitalSet::CC, OHMMS::Controller, PWBasis::inputmap, and PWRealOrbitalSet::myBasisSet.

74 {
75  int ng = myBasisSet->inputmap.size();
76  if (ng != coefs.size())
77  {
78  app_error() << " Input G map does not match the basis size of wave functions " << std::endl;
80  }
81  //drop G points for the given TwistAngle
82  const std::vector<int>& inputmap(myBasisSet->inputmap);
83  for (int ig = 0; ig < ng; ig++)
84  {
85  if (inputmap[ig] > -1)
86  CC[jorb][inputmap[ig]] = coefs[ig];
87  }
88 }
std::ostream & app_error()
Definition: OutputManager.h:67
Communicate * Controller
Global Communicator for a process.
Definition: Communicate.cpp:35
Matrix< ComplexType > CC
Plane-wave coefficients of complex: (iband,g-vector)
PWBasisPtr myBasisSet
My basis set.
void abort() const
std::vector< int > inputmap
Definition: PWBasis.h:108

◆ evaluate()

ValueType evaluate ( int  ib,
const PosType pos 
)
inline

Definition at line 85 of file PWRealOrbitalSet.h.

References PWRealOrbitalSet::BasisSetSize, PWRealOrbitalSet::CC, Vector< T, Alloc >::data(), BLAS::dot(), PWBasis::evaluate(), PWRealOrbitalSet::myBasisSet, qmcplusplus::real(), and PWBasis::Zv.

86  {
87  myBasisSet->evaluate(pos);
88  return real(BLAS::dot(BasisSetSize, CC[ib], myBasisSet->Zv.data()));
89  }
void evaluate(const PosType &pos)
Definition: PWBasis.h:284
float real(const float &c)
real part of a scalar. Cannot be replaced by std::real due to AFQMC specific needs.
Vector< ComplexType > Zv
Definition: PWBasis.h:89
Matrix< ComplexType > CC
Plane-wave coefficients of complex: (iband,g-vector)
PWBasisPtr myBasisSet
My basis set.
static T dot(int n, const T *restrict a, const T *restrict b)
Definition: BLAS.hpp:304
IndexType BasisSetSize
number of basis

◆ evaluate_notranspose() [1/2]

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 123 of file PWRealOrbitalSet.cpp.

References PWRealOrbitalSet::CC, qmcplusplus::convertToReal(), Matrix< T, Alloc >::data(), PWBasis::evaluateAll(), PWRealOrbitalSet::myBasisSet, SPOSet::OrbitalSetSize, qmcplusplus::MatrixOperators::product(), PWRealOrbitalSet::PW_GRADX, PWRealOrbitalSet::PW_GRADY, PWRealOrbitalSet::PW_GRADZ, PWRealOrbitalSet::PW_LAP, PWRealOrbitalSet::PW_MAXINDEX, PWRealOrbitalSet::PW_VALUE, qmcplusplus::real(), PWRealOrbitalSet::Temp, and PWBasis::Z.

129 {
130  for (int iat = first, i = 0; iat < last; iat++, i++)
131  {
132  myBasisSet->evaluateAll(P, iat);
134  const ComplexType* restrict tptr = Temp.data();
135  for (int j = 0; j < OrbitalSetSize; j++, tptr += PW_MAXINDEX)
136  {
137  convertToReal(tptr[PW_VALUE], logdet(i, j));
138  convertToReal(tptr[PW_LAP], d2logdet(i, j));
139 #if OHMMS_DIM == 3
140  dlogdet(i, j) = GradType(tptr[PW_GRADX].real(), tptr[PW_GRADY].real(), tptr[PW_GRADZ].real());
141 #elif OHMMS_DIM == 2
142  dlogdet(i, j) = GradType(tptr[PW_GRADX].real(), tptr[PW_GRADY].real());
143 #elif OHMMS_DIM == 1
144  dlogdet(i, j) = GradType(tptr[PW_GRADX].real());
145 #else
146 #error "Only physical dimensions 1/2/3 are supported."
147 #endif
148  }
149  }
150 }
void evaluateAll(const ParticleSet &P, int iat)
Definition: PWBasis.h:291
QTBase::GradType GradType
Definition: Configuration.h:62
void convertToReal(const T1 &in, T2 &out)
generic conversion from type T1 to type T2 using implicit conversion
Definition: ConvertToReal.h:32
float real(const float &c)
real part of a scalar. Cannot be replaced by std::real due to AFQMC specific needs.
QTBase::ComplexType ComplexType
Definition: Configuration.h:59
Matrix< ComplexType > Temp
temporary array to perform gemm operation
Matrix< ComplexType > CC
Plane-wave coefficients of complex: (iband,g-vector)
PWBasisPtr myBasisSet
My basis set.
void product(const Matrix< T > &A, const Matrix< T > &B, Matrix< T > &C)
static function to perform C=AB for real matrices
Matrix< ComplexType > Z
Definition: PWBasis.h:87
IndexType OrbitalSetSize
number of Single-particle orbitals
Definition: SPOSet.h:566

◆ evaluate_notranspose() [2/2]

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

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 102 of file PWRealOrbitalSet.h.

References APP_ABORT.

108  {
109  APP_ABORT("Need specialization of evaluate_notranspose() for grad_grad_logdet. \n");
110  }
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ 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 90 of file PWRealOrbitalSet.cpp.

References ParticleSet::activeR(), PWRealOrbitalSet::CC, PWBasis::evaluate(), PWRealOrbitalSet::myBasisSet, SPOSet::OrbitalSetSize, qmcplusplus::MatrixOperators::product(), qmcplusplus::real(), PWRealOrbitalSet::tempPsi, and PWBasis::Zv.

91 {
92  myBasisSet->evaluate(P.activeR(iat));
94  for (int j = 0; j < OrbitalSetSize; j++)
95  psi[j] = tempPsi[j].real();
96 }
void evaluate(const PosType &pos)
Definition: PWBasis.h:284
float real(const float &c)
real part of a scalar. Cannot be replaced by std::real due to AFQMC specific needs.
Vector< ComplexType > Zv
Definition: PWBasis.h:89
Matrix< ComplexType > CC
Plane-wave coefficients of complex: (iband,g-vector)
PWBasisPtr myBasisSet
My basis set.
void product(const Matrix< T > &A, const Matrix< T > &B, Matrix< T > &C)
static function to perform C=AB for real matrices
IndexType OrbitalSetSize
number of Single-particle orbitals
Definition: SPOSet.h:566
Vector< ComplexType > tempPsi
temporary complex vector before assigning to a real psi

◆ 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 98 of file PWRealOrbitalSet.cpp.

References PWRealOrbitalSet::CC, Matrix< T, Alloc >::data(), PWBasis::evaluateAll(), PWRealOrbitalSet::myBasisSet, SPOSet::OrbitalSetSize, qmcplusplus::MatrixOperators::product(), PWRealOrbitalSet::PW_GRADX, PWRealOrbitalSet::PW_GRADY, PWRealOrbitalSet::PW_GRADZ, PWRealOrbitalSet::PW_LAP, PWRealOrbitalSet::PW_MAXINDEX, PWRealOrbitalSet::PW_VALUE, qmcplusplus::real(), PWRealOrbitalSet::Temp, and PWBasis::Z.

103 {
104  myBasisSet->evaluateAll(P, iat);
106  const ComplexType* restrict tptr = Temp.data();
107  for (int j = 0; j < OrbitalSetSize; j++, tptr += PW_MAXINDEX)
108  {
109  psi[j] = tptr[PW_VALUE].real();
110  d2psi[j] = tptr[PW_LAP].real();
111 #if OHMMS_DIM == 3
112  dpsi[j] = GradType(tptr[PW_GRADX].real(), tptr[PW_GRADY].real(), tptr[PW_GRADZ].real());
113 #elif OHMMS_DIM == 2
114  dpsi[j] = GradType(tptr[PW_GRADX].real(), tptr[PW_GRADY].real());
115 #elif OHMMS_DIM == 1
116  dpsi[j] = GradType(tptr[PW_GRADX].real());
117 #else
118 #error "Only physical dimensions 1/2/3 are supported."
119 #endif
120  }
121 }
void evaluateAll(const ParticleSet &P, int iat)
Definition: PWBasis.h:291
QTBase::GradType GradType
Definition: Configuration.h:62
float real(const float &c)
real part of a scalar. Cannot be replaced by std::real due to AFQMC specific needs.
QTBase::ComplexType ComplexType
Definition: Configuration.h:59
Matrix< ComplexType > Temp
temporary array to perform gemm operation
Matrix< ComplexType > CC
Plane-wave coefficients of complex: (iband,g-vector)
PWBasisPtr myBasisSet
My basis set.
void product(const Matrix< T > &A, const Matrix< T > &B, Matrix< T > &C)
static function to perform C=AB for real matrices
Matrix< ComplexType > Z
Definition: PWBasis.h:87
IndexType OrbitalSetSize
number of Single-particle orbitals
Definition: SPOSet.h:566

◆ getClassName()

std::string getClassName ( ) const
inlineoverridevirtual

return class name

Implements SPOSet.

Definition at line 54 of file PWRealOrbitalSet.h.

54 { return "PWRealOrbitalSet"; }

◆ makeClone()

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

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

Reimplemented from SPOSet.

Definition at line 34 of file PWRealOrbitalSet.cpp.

References PWRealOrbitalSet::myBasisSet.

35 {
36  auto myclone = std::make_unique<PWRealOrbitalSet>(*this);
37  myclone->myBasisSet = new PWBasis(*myBasisSet);
38  return myclone;
39 }
PWBasisPtr myBasisSet
My basis set.

◆ resize()

void resize ( PWBasisPtr  bset,
int  nbands,
bool  cleanup = false 
)

resize the orbital base

Parameters
bsetPWBasis
nbandsnumber of bands
cleaupif true, owns PWBasis. Will clean up.

Definition at line 43 of file PWRealOrbitalSet.cpp.

References qmcplusplus::app_log(), PWRealOrbitalSet::BasisSetSize, PWRealOrbitalSet::CC, PWRealOrbitalSet::myBasisSet, PWBasis::NumPlaneWaves, SPOSet::OrbitalSetSize, PWRealOrbitalSet::OwnBasisSet, PWRealOrbitalSet::PW_MAXINDEX, Matrix< T, Alloc >::resize(), Vector< T, Alloc >::resize(), PWRealOrbitalSet::Temp, and PWRealOrbitalSet::tempPsi.

44 {
45  myBasisSet = bset;
46  OrbitalSetSize = nbands;
47  OwnBasisSet = cleanup;
52  app_log() << " PWRealOrbitalSet::resize OrbitalSetSize =" << OrbitalSetSize << " BasisSetSize = " << BasisSetSize
53  << std::endl;
54 }
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Definition: OhmmsVector.h:166
std::ostream & app_log()
Definition: OutputManager.h:65
void resize(size_type n, size_type m)
Resize the container.
Definition: OhmmsMatrix.h:99
Matrix< ComplexType > Temp
temporary array to perform gemm operation
Matrix< ComplexType > CC
Plane-wave coefficients of complex: (iband,g-vector)
PWBasisPtr myBasisSet
My basis set.
IndexType OrbitalSetSize
number of Single-particle orbitals
Definition: SPOSet.h:566
IndexType BasisSetSize
number of basis
int NumPlaneWaves
total number of basis functions
Definition: PWBasis.h:111
Vector< ComplexType > tempPsi
temporary complex vector before assigning to a real psi

◆ setOrbitalSetSize()

void setOrbitalSetSize ( int  norbs)
overridevirtual

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 41 of file PWRealOrbitalSet.cpp.

41 {}

Member Data Documentation

◆ BasisSetSize

IndexType BasisSetSize

number of basis

Definition at line 123 of file PWRealOrbitalSet.h.

Referenced by PWRealOrbitalSet::evaluate(), and PWRealOrbitalSet::resize().

◆ CC

◆ myBasisSet

◆ OwnBasisSet

bool OwnBasisSet

boolean

If true, this has to delete the BasisSet

Definition at line 117 of file PWRealOrbitalSet.h.

Referenced by PWRealOrbitalSet::resize(), and PWRealOrbitalSet::~PWRealOrbitalSet().

◆ Temp

temporary array to perform gemm operation

Definition at line 127 of file PWRealOrbitalSet.h.

Referenced by PWRealOrbitalSet::evaluate_notranspose(), PWRealOrbitalSet::evaluateVGL(), and PWRealOrbitalSet::resize().

◆ tempPsi

Vector<ComplexType> tempPsi

temporary complex vector before assigning to a real psi

Definition at line 129 of file PWRealOrbitalSet.h.

Referenced by PWRealOrbitalSet::evaluateValue(), and PWRealOrbitalSet::resize().

◆ TwistAngle

PosType TwistAngle

TwistAngle of this PWRealOrbitalSet.

Definition at line 119 of file PWRealOrbitalSet.h.


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