QMCPACK
CompositeSPOSet.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Jaron T. Krogel, krogeljt@ornl.gov, Oak Ridge National Laboratory
8 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
9 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
10 //
11 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
12 //////////////////////////////////////////////////////////////////////////////////////
13 
14 
15 #ifndef QMCPLUSPLUS_COMPOSITE_SPOSET_H
16 #define QMCPLUSPLUS_COMPOSITE_SPOSET_H
17 
22 
23 namespace qmcplusplus
24 {
25 class CompositeSPOSet : public SPOSet
26 {
27 public:
28  ///component SPOSets
29  std::vector<std::unique_ptr<SPOSet>> components;
30  ///temporary storage for values
31  std::vector<ValueVector> component_values;
32  ///temporary storage for gradients
33  std::vector<GradVector> component_gradients;
34  ///temporary storage for laplacians
35  std::vector<ValueVector> component_laplacians;
36  ///temporary storage for spin gradients
37  std::vector<ValueVector> component_spin_gradients;
38  ///store the precomputed offsets
39  std::vector<int> component_offsets;
40 
41  CompositeSPOSet(const std::string& my_name);
42  CompositeSPOSet(const CompositeSPOSet& other);
43  ~CompositeSPOSet() override;
44 
45  std::string getClassName() const override { return "CompositeSPOSet"; }
46 
47  ///add a sposet component to this composite sposet
48  void add(std::unique_ptr<SPOSet> component);
49 
50  ///print out component info
51  void report();
52 
53  //SPOSet interface methods
54  ///size is determined by component sposets and nothing else
55  inline void setOrbitalSetSize(int norbs) override {}
56 
57  std::unique_ptr<SPOSet> makeClone() const override;
58 
59  void evaluateValue(const ParticleSet& P, int iat, ValueVector& psi) override;
60 
61  void evaluateVGL(const ParticleSet& P, int iat, ValueVector& psi, GradVector& dpsi, ValueVector& d2psi) override;
62 
63  void evaluateVGL_spin(const ParticleSet& P,
64  int iat,
65  ValueVector& psi,
66  GradVector& dpsi,
67  ValueVector& d2psi,
68  ValueVector& dspin_psi) override;
69 
70  ///unimplemented functions call this to abort
71  inline void not_implemented(const std::string& method)
72  {
73  APP_ABORT("CompositeSPOSet::" + method + " has not been implemented");
74  }
75 
76  //methods to be implemented in the future (possibly)
77  void evaluate_notranspose(const ParticleSet& P,
78  int first,
79  int last,
80  ValueMatrix& logdet,
81  GradMatrix& dlogdet,
82  ValueMatrix& d2logdet) override;
83  void evaluate_notranspose(const ParticleSet& P,
84  int first,
85  int last,
86  ValueMatrix& logdet,
87  GradMatrix& dlogdet,
88  HessMatrix& ddlogdet) override;
89  void evaluate_notranspose(const ParticleSet& P,
90  int first,
91  int last,
92  ValueMatrix& logdet,
93  GradMatrix& dlogdet,
94  HessMatrix& ddlogdet,
95  GGGMatrix& dddlogdet) override;
96 };
97 
99 {
101  : SPOSetBuilder("Composite", comm), sposet_builder_factory_(factory)
102  {}
103 
104  //SPOSetBuilder interface
105  std::unique_ptr<SPOSet> createSPOSetFromXML(xmlNodePtr cur) override;
106 
107  std::unique_ptr<SPOSet> createSPOSet(xmlNodePtr cur, SPOSetInputInfo& input) override;
108 
109  /// reference to the sposet_builder_factory
111 };
112 } // namespace qmcplusplus
113 
114 #endif
base class for Single-particle orbital sets
Definition: SPOSet.h:46
CompositeSPOSetBuilder(Communicate *comm, const SPOSetBuilderFactory &factory)
std::string getClassName() const override
return class name
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
class to read state range information from sposet input
const SPOSetBuilderFactory & sposet_builder_factory_
reference to the sposet_builder_factory
std::vector< int > component_offsets
store the precomputed offsets
OrbitalSetTraits< ValueType >::ValueMatrix ValueMatrix
Definition: SPOSet.h:50
OrbitalSetTraits< ValueType >::ValueVector ValueVector
std::vector< ValueVector > component_values
temporary storage for values
OrbitalSetTraits< ValueType >::GradMatrix GradMatrix
Definition: SPOSet.h:52
Wrapping information on parallelism.
Definition: Communicate.h:68
CompositeSPOSet(const std::string &my_name)
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
base class for the real SPOSet builder
Definition: SPOSetBuilder.h:47
Declaration of a base class of SPOSet Builders.
std::unique_ptr< SPOSet > makeClone() const override
make a clone of itself every derived class must implement this to have threading working correctly...
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 ...
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27
void add(std::unique_ptr< SPOSet > component)
add a sposet component to this composite sposet
void evaluateValue(const ParticleSet &P, int iat, ValueVector &psi) override
evaluate the values of this single-particle orbital set
void report()
print out component info
std::vector< ValueVector > component_laplacians
temporary storage for laplacians
void setOrbitalSetSize(int norbs) override
size is determined by component sposets and nothing else
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 ...
OrbitalSetTraits< ValueType >::GradVector GradVector
Definition: SPOSet.h:51
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...
std::vector< std::unique_ptr< SPOSet > > components
component SPOSets
OrbitalSetTraits< ValueType >::GradHessMatrix GGGMatrix
Definition: SPOSet.h:56
std::vector< GradVector > component_gradients
temporary storage for gradients
std::unique_ptr< SPOSet > createSPOSetFromXML(xmlNodePtr cur) override
create an sposet from xml (legacy)
std::vector< ValueVector > component_spin_gradients
temporary storage for spin gradients
void not_implemented(const std::string &method)
unimplemented functions call this to abort
OrbitalSetTraits< ValueType >::HessMatrix HessMatrix
Definition: SPOSet.h:54
Declaration of a base class of BasisSet.
std::unique_ptr< SPOSet > createSPOSet(xmlNodePtr cur, SPOSetInputInfo &input) override
create an sposet from a general xml request