QMCPACK
SPOSetBuilder.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: Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign
8 // Miguel Morales, moralessilva2@llnl.gov, Lawrence Livermore National Laboratory
9 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
10 // Jaron T. Krogel, krogeljt@ornl.gov, Oak Ridge National Laboratory
11 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
12 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
13 //
14 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
15 //////////////////////////////////////////////////////////////////////////////////////
16 
17 
18 /** @file SPOSetBuilder.h
19  * @brief Declaration of a base class of SPOSet Builders
20  */
21 #ifndef QMCPLUSPLUS_SPOSET_BUILDER_H
22 #define QMCPLUSPLUS_SPOSET_BUILDER_H
23 
24 #include <memory>
25 #include <vector>
26 #include <string>
27 #include "Message/MPIObjectBase.h"
31 #include "hdf/hdf_archive.h"
32 
33 namespace qmcplusplus
34 {
35 /** base class for the real SPOSet builder
36  *
37  * \warning {
38  * We have not quite figured out how to use real/complex efficiently.
39  * There are three cases we have to deal with
40  * - real basis functions and real coefficients
41  * - real basis functions and complex coefficients
42  * - complex basis functions and complex coefficients
43  * For now, we decide to keep both real and complex basis sets and expect
44  * the user classes {\bf KNOW} what they need to use.
45  * }
46  */
47 class SPOSetBuilder : public QMCTraits, public MPIObjectBase
48 {
49 public:
50  using indices_t = std::vector<int>;
51  using energies_t = std::vector<RealType>;
52 
53  /// whether implementation conforms only to legacy standard
54  bool legacy;
55 
56  /// state info of all possible states available in the basis
57  std::vector<std::unique_ptr<SPOSetInfo>> states;
58 
59  SPOSetBuilder(const std::string& type_name, Communicate* comm);
60  virtual ~SPOSetBuilder() {}
61 
62  /// reserve space for states (usually only one set, multiple for e.g. spin dependent einspline)
63  void reserve_states(int nsets = 1);
64 
65  /// allow modification of state information
66  inline void modify_states(int index = 0) { states[index]->modify(); }
67 
68  /// clear state information
69  inline void clear_states(int index = 0) { states[index]->clear(); }
70 
71  /// create an sposet from xml and save the resulting SPOSet
72  std::unique_ptr<SPOSet> createSPOSet(xmlNodePtr cur);
73 
74  /// create orbital rotation transformation from xml and save the resulting SPOSet
75  std::unique_ptr<SPOSet> createRotatedSPOSet(xmlNodePtr cur);
76 
77  const std::string& getTypeName() const { return type_name_; }
78 
79 protected:
80  /// create an sposet from xml (legacy)
81  virtual std::unique_ptr<SPOSet> createSPOSetFromXML(xmlNodePtr cur) = 0;
82 
83  /// create an sposet from a general xml request
84  virtual std::unique_ptr<SPOSet> createSPOSet(xmlNodePtr cur, SPOSetInputInfo& input_info);
85 
86  /// type name of the SPO objects built by this builder.
87  const std::string type_name_;
88 };
89 
90 } // namespace qmcplusplus
91 #endif
std::vector< int > indices_t
Definition: SPOSetBuilder.h:50
Base class for any object which needs to know about a MPI communicator.
Definition: MPIObjectBase.h:26
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
class to read state range information from sposet input
std::unique_ptr< SPOSet > createSPOSet(xmlNodePtr cur)
create an sposet from xml and save the resulting SPOSet
std::vector< RealType > energies_t
Definition: SPOSetBuilder.h:51
void reserve_states(int nsets=1)
reserve space for states (usually only one set, multiple for e.g. spin dependent einspline) ...
void modify_states(int index=0)
allow modification of state information
Definition: SPOSetBuilder.h:66
std::vector< std::unique_ptr< SPOSetInfo > > states
state info of all possible states available in the basis
Definition: SPOSetBuilder.h:57
const std::string & getTypeName() const
Definition: SPOSetBuilder.h:77
declaration of MPIObjectBase
SPOSetBuilder(const std::string &type_name, Communicate *comm)
Wrapping information on parallelism.
Definition: Communicate.h:68
base class for the real SPOSet builder
Definition: SPOSetBuilder.h:47
void clear_states(int index=0)
clear state information
Definition: SPOSetBuilder.h:69
const std::string type_name_
type name of the SPO objects built by this builder.
Definition: SPOSetBuilder.h:87
virtual std::unique_ptr< SPOSet > createSPOSetFromXML(xmlNodePtr cur)=0
create an sposet from xml (legacy)
traits for QMC variables
Definition: Configuration.h:49
std::unique_ptr< SPOSet > createRotatedSPOSet(xmlNodePtr cur)
create orbital rotation transformation from xml and save the resulting SPOSet
bool legacy
whether implementation conforms only to legacy standard
Definition: SPOSetBuilder.h:54