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

Public Member Functions

 CompositeSPOSet (const std::string &my_name)
 
 CompositeSPOSet (const CompositeSPOSet &other)
 
 ~CompositeSPOSet () override
 
std::string getClassName () const override
 return class name More...
 
void add (std::unique_ptr< SPOSet > component)
 add a sposet component to this composite sposet More...
 
void report ()
 print out component info More...
 
void setOrbitalSetSize (int norbs) override
 size is determined by component sposets and nothing else 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 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 evaluateVGL_spin (const ParticleSet &P, int iat, ValueVector &psi, GradVector &dpsi, ValueVector &d2psi, ValueVector &dspin_psi) override
 evaluate the values, gradients and laplacians and spin gradient of this single-particle orbital set More...
 
void not_implemented (const std::string &method)
 unimplemented functions call this to abort 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 &ddlogdet) 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 &logdet, GradMatrix &dlogdet, HessMatrix &ddlogdet, GGGMatrix &dddlogdet) override
 evaluate the values, gradients, hessians and third derivatives 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 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...
 

Public Attributes

std::vector< std::unique_ptr< SPOSet > > components
 component SPOSets More...
 
std::vector< ValueVectorcomponent_values
 temporary storage for values More...
 
std::vector< GradVectorcomponent_gradients
 temporary storage for gradients More...
 
std::vector< ValueVectorcomponent_laplacians
 temporary storage for laplacians More...
 
std::vector< ValueVectorcomponent_spin_gradients
 temporary storage for spin gradients More...
 
std::vector< int > component_offsets
 store the precomputed offsets More...
 

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 25 of file CompositeSPOSet.h.

Constructor & Destructor Documentation

◆ CompositeSPOSet() [1/2]

CompositeSPOSet ( const std::string &  my_name)

Definition at line 42 of file CompositeSPOSet.cpp.

References CompositeSPOSet::component_offsets, and SPOSet::OrbitalSetSize.

42  : SPOSet(my_name)
43 {
44  OrbitalSetSize = 0;
45  component_offsets.reserve(4);
46 }
SPOSet(const std::string &my_name)
constructor
Definition: SPOSet.cpp:29
std::vector< int > component_offsets
store the precomputed offsets
IndexType OrbitalSetSize
number of Single-particle orbitals
Definition: SPOSet.h:566

◆ CompositeSPOSet() [2/2]

CompositeSPOSet ( const CompositeSPOSet other)

Definition at line 48 of file CompositeSPOSet.cpp.

References CompositeSPOSet::add(), and CompositeSPOSet::components.

48  : SPOSet(other)
49 {
50  for (auto& element : other.components)
51  {
52  this->add(element->makeClone());
53  }
54 }
SPOSet(const std::string &my_name)
constructor
Definition: SPOSet.cpp:29
void add(std::unique_ptr< SPOSet > component)
add a sposet component to this composite sposet

◆ ~CompositeSPOSet()

~CompositeSPOSet ( )
overridedefault

Member Function Documentation

◆ add()

void add ( std::unique_ptr< SPOSet component)

add a sposet component to this composite sposet

Definition at line 58 of file CompositeSPOSet.cpp.

References CompositeSPOSet::component_gradients, CompositeSPOSet::component_laplacians, CompositeSPOSet::component_offsets, CompositeSPOSet::component_spin_gradients, CompositeSPOSet::component_values, CompositeSPOSet::components, and SPOSet::OrbitalSetSize.

Referenced by CompositeSPOSet::CompositeSPOSet(), OneBodyDensityMatrices::OneBodyDensityMatrices(), DensityMatrices1B::set_state(), and qmcplusplus::TEST_CASE().

59 {
60  if (components.empty())
61  component_offsets.push_back(0); //add 0
62 
63  int norbs = component->size();
64  components.push_back(std::move(component));
65  component_values.emplace_back(norbs);
66  component_gradients.emplace_back(norbs);
67  component_laplacians.emplace_back(norbs);
68  component_spin_gradients.emplace_back(norbs);
69 
70  OrbitalSetSize += norbs;
72 }
std::vector< int > component_offsets
store the precomputed offsets
std::vector< ValueVector > component_values
temporary storage for values
IndexType OrbitalSetSize
number of Single-particle orbitals
Definition: SPOSet.h:566
std::vector< ValueVector > component_laplacians
temporary storage for laplacians
std::vector< std::unique_ptr< SPOSet > > components
component SPOSets
std::vector< GradVector > component_gradients
temporary storage for gradients
std::vector< ValueVector > component_spin_gradients
temporary storage for spin gradients

◆ 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 142 of file CompositeSPOSet.cpp.

References CompositeSPOSet::component_offsets, CompositeSPOSet::components, qmcplusplus::MatrixOperators::insert_columns(), and qmcplusplus::n.

Referenced by qmcplusplus::TEST_CASE().

148 {
149  const int nat = last - first;
150  for (int c = 0; c < components.size(); ++c)
151  {
152  int norb = components[c]->size();
153  ValueMatrix v(nat, norb);
154  GradMatrix g(nat, norb);
155  ValueMatrix l(nat, norb);
156  components[c]->evaluate_notranspose(P, first, last, v, g, l);
157  int n = component_offsets[c];
159  MatrixOperators::insert_columns(g, dlogdet, n);
160  MatrixOperators::insert_columns(l, d2logdet, n);
161  }
162 }
std::vector< int > component_offsets
store the precomputed offsets
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
Definition: SPOSet.h:50
OrbitalSetTraits< ValueType >::GradMatrix GradMatrix
Definition: SPOSet.h:52
void insert_columns(const MAT1 &small, MAT2 &big, int offset_c)
copy a small matrix (N, M1) to a big matrix (N, M2), M2>M1
std::vector< std::unique_ptr< SPOSet > > components
component SPOSets

◆ 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 164 of file CompositeSPOSet.cpp.

References CompositeSPOSet::component_offsets, CompositeSPOSet::components, qmcplusplus::MatrixOperators::insert_columns(), and qmcplusplus::n.

170 {
171  const int nat = last - first;
172  for (int c = 0; c < components.size(); ++c)
173  {
174  int norb = components[c]->size();
175  ValueMatrix v(nat, norb);
176  GradMatrix g(nat, norb);
177  HessMatrix h(nat, norb);
178  components[c]->evaluate_notranspose(P, first, last, v, g, h);
179  int n = component_offsets[c];
181  MatrixOperators::insert_columns(g, dlogdet, n);
182  MatrixOperators::insert_columns(h, grad_grad_logdet, n);
183  }
184 }
std::vector< int > component_offsets
store the precomputed offsets
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
Definition: SPOSet.h:50
OrbitalSetTraits< ValueType >::GradMatrix GradMatrix
Definition: SPOSet.h:52
void insert_columns(const MAT1 &small, MAT2 &big, int offset_c)
copy a small matrix (N, M1) to a big matrix (N, M2), M2>M1
std::vector< std::unique_ptr< SPOSet > > components
component SPOSets
OrbitalSetTraits< ValueType >::HessMatrix HessMatrix
Definition: SPOSet.h:54

◆ 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 186 of file CompositeSPOSet.cpp.

References CompositeSPOSet::not_implemented().

193 {
194  not_implemented("evaluate_notranspose(P,first,last,logdet,dlogdet,ddlogdet,dddlogdet)");
195 }
void not_implemented(const std::string &method)
unimplemented functions call this to abort

◆ 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 88 of file CompositeSPOSet.cpp.

References CompositeSPOSet::component_values, CompositeSPOSet::components, copy(), SPOSet::evaluateValue(), qmcplusplus::n, and SPOSet::size().

Referenced by DensityMatrices1B::update_basis(), OneBodyDensityMatrices::updateBasis(), and OneBodyDensityMatrices::updateBasisWithSpin().

89 {
90  int n = 0;
91  for (int c = 0; c < components.size(); ++c)
92  {
93  SPOSet& component = *components[c];
94  ValueVector& values = component_values[c];
95  component.evaluateValue(P, iat, values);
96  std::copy(values.begin(), values.end(), psi.begin() + n);
97  n += component.size();
98  }
99 }
SPOSet(const std::string &my_name)
constructor
Definition: SPOSet.cpp:29
std::vector< ValueVector > component_values
temporary storage for values
void copy(const Array< T1, 3 > &src, Array< T2, 3 > &dest)
Definition: Blitz.h:639
OrbitalSetTraits< ValueType >::ValueVector ValueVector
Definition: SPOSet.h:49
std::vector< std::unique_ptr< SPOSet > > components
component SPOSets

◆ 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 101 of file CompositeSPOSet.cpp.

References CompositeSPOSet::component_gradients, CompositeSPOSet::component_laplacians, CompositeSPOSet::component_values, CompositeSPOSet::components, copy(), SPOSet::evaluateVGL(), qmcplusplus::n, and SPOSet::size().

Referenced by DensityMatrices1B::update_basis_d012(), and OneBodyDensityMatrices::updateBasisD012().

102 {
103  int n = 0;
104  for (int c = 0; c < components.size(); ++c)
105  {
106  SPOSet& component = *components[c];
107  ValueVector& values = component_values[c];
108  GradVector& gradients = component_gradients[c];
109  ValueVector& laplacians = component_laplacians[c];
110  component.evaluateVGL(P, iat, values, gradients, laplacians);
111  std::copy(values.begin(), values.end(), psi.begin() + n);
112  std::copy(gradients.begin(), gradients.end(), dpsi.begin() + n);
113  std::copy(laplacians.begin(), laplacians.end(), d2psi.begin() + n);
114  n += component.size();
115  }
116 }
SPOSet(const std::string &my_name)
constructor
Definition: SPOSet.cpp:29
std::vector< ValueVector > component_values
temporary storage for values
void copy(const Array< T1, 3 > &src, Array< T2, 3 > &dest)
Definition: Blitz.h:639
OrbitalSetTraits< ValueType >::ValueVector ValueVector
Definition: SPOSet.h:49
std::vector< ValueVector > component_laplacians
temporary storage for laplacians
OrbitalSetTraits< ValueType >::GradVector GradVector
Definition: SPOSet.h:51
std::vector< std::unique_ptr< SPOSet > > components
component SPOSets
std::vector< GradVector > component_gradients
temporary storage for gradients

◆ evaluateVGL_spin()

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

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

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

Reimplemented from SPOSet.

Definition at line 118 of file CompositeSPOSet.cpp.

References CompositeSPOSet::component_gradients, CompositeSPOSet::component_laplacians, CompositeSPOSet::component_spin_gradients, CompositeSPOSet::component_values, CompositeSPOSet::components, copy(), SPOSet::evaluateVGL_spin(), qmcplusplus::n, and SPOSet::size().

Referenced by OneBodyDensityMatrices::updateBasisD012WithSpin().

124 {
125  int n = 0;
126  for (int c = 0; c < components.size(); ++c)
127  {
128  SPOSet& component = *components[c];
129  ValueVector& values = component_values[c];
130  GradVector& gradients = component_gradients[c];
131  ValueVector& laplacians = component_laplacians[c];
132  ValueVector& spin_gradients = component_spin_gradients[c];
133  component.evaluateVGL_spin(P, iat, values, gradients, laplacians, spin_gradients);
134  std::copy(values.begin(), values.end(), psi.begin() + n);
135  std::copy(gradients.begin(), gradients.end(), dpsi.begin() + n);
136  std::copy(laplacians.begin(), laplacians.end(), d2psi.begin() + n);
137  std::copy(spin_gradients.begin(), spin_gradients.end(), dspin_psi.begin() + n);
138  n += component.size();
139  }
140 }
SPOSet(const std::string &my_name)
constructor
Definition: SPOSet.cpp:29
std::vector< ValueVector > component_values
temporary storage for values
void copy(const Array< T1, 3 > &src, Array< T2, 3 > &dest)
Definition: Blitz.h:639
OrbitalSetTraits< ValueType >::ValueVector ValueVector
Definition: SPOSet.h:49
std::vector< ValueVector > component_laplacians
temporary storage for laplacians
OrbitalSetTraits< ValueType >::GradVector GradVector
Definition: SPOSet.h:51
std::vector< std::unique_ptr< SPOSet > > components
component SPOSets
std::vector< GradVector > component_gradients
temporary storage for gradients
std::vector< ValueVector > component_spin_gradients
temporary storage for spin gradients

◆ getClassName()

std::string getClassName ( ) const
inlineoverridevirtual

return class name

Implements SPOSet.

Definition at line 45 of file CompositeSPOSet.h.

45 { return "CompositeSPOSet"; }

◆ 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 86 of file CompositeSPOSet.cpp.

86 { return std::make_unique<CompositeSPOSet>(*this); }

◆ not_implemented()

void not_implemented ( const std::string &  method)
inline

unimplemented functions call this to abort

Definition at line 71 of file CompositeSPOSet.h.

References APP_ABORT.

Referenced by CompositeSPOSet::evaluate_notranspose().

72  {
73  APP_ABORT("CompositeSPOSet::" + method + " has not been implemented");
74  }
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ report()

void report ( )

print out component info

Definition at line 74 of file CompositeSPOSet.cpp.

References qmcplusplus::app_log(), and CompositeSPOSet::components.

75 {
76  app_log() << "CompositeSPOSet" << std::endl;
77  app_log() << " ncomponents = " << components.size() << std::endl;
78  app_log() << " components" << std::endl;
79  for (int i = 0; i < components.size(); ++i)
80  {
81  app_log() << " " << i << std::endl;
82  components[i]->basic_report(" ");
83  }
84 }
std::ostream & app_log()
Definition: OutputManager.h:65
std::vector< std::unique_ptr< SPOSet > > components
component SPOSets

◆ setOrbitalSetSize()

void setOrbitalSetSize ( int  norbs)
inlineoverridevirtual

size is determined by component sposets and nothing else

Implements SPOSet.

Definition at line 55 of file CompositeSPOSet.h.

55 {}

Member Data Documentation

◆ component_gradients

std::vector<GradVector> component_gradients

temporary storage for gradients

Definition at line 33 of file CompositeSPOSet.h.

Referenced by CompositeSPOSet::add(), CompositeSPOSet::evaluateVGL(), and CompositeSPOSet::evaluateVGL_spin().

◆ component_laplacians

std::vector<ValueVector> component_laplacians

temporary storage for laplacians

Definition at line 35 of file CompositeSPOSet.h.

Referenced by CompositeSPOSet::add(), CompositeSPOSet::evaluateVGL(), and CompositeSPOSet::evaluateVGL_spin().

◆ component_offsets

std::vector<int> component_offsets

store the precomputed offsets

Definition at line 39 of file CompositeSPOSet.h.

Referenced by CompositeSPOSet::add(), CompositeSPOSet::CompositeSPOSet(), and CompositeSPOSet::evaluate_notranspose().

◆ component_spin_gradients

std::vector<ValueVector> component_spin_gradients

temporary storage for spin gradients

Definition at line 37 of file CompositeSPOSet.h.

Referenced by CompositeSPOSet::add(), and CompositeSPOSet::evaluateVGL_spin().

◆ component_values

std::vector<ValueVector> component_values

◆ components


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