QMCPACK
HamiltonianFactory.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: John R. Gergely, University of Illinois at Urbana-Champaign
8 // Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign
9 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
10 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
11 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
12 //
13 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
14 //////////////////////////////////////////////////////////////////////////////////////
15 
16 
17 /**@file HamiltonianFactory.h
18  *@brief Declaration of a HamiltonianFactory
19  */
20 #ifndef QMCPLUSPLUS_HAMILTONIAN_FACTORY_H
21 #define QMCPLUSPLUS_HAMILTONIAN_FACTORY_H
22 
24 namespace qmcplusplus
25 {
26 /** Factory class to build a many-body wavefunction
27  */
29 {
30 public:
31  using PSetMap = std::map<std::string, const std::unique_ptr<ParticleSet>>;
32  using PsiPoolType = std::map<std::string, const std::unique_ptr<TrialWaveFunction>>;
33 
34  ///constructor
35  HamiltonianFactory(const std::string& hName,
36  ParticleSet& qp,
37  const PSetMap& pset,
38  const PsiPoolType& oset,
39  Communicate* c);
40 
41  ///read from xmlNode
42  bool put(xmlNodePtr cur);
43 
44  /** add a property whose name will be renamed by b
45  * @param a target property whose name should be replaced by b
46  * @param b new property name
47  */
48  void renameProperty(const std::string& a, const std::string& b);
49 
50  /** renamd a property
51  * @param a current name
52  *
53  * If a is found among the RenamedProperty, a is replaced,
54  */
55  void renameProperty(std::string& a);
56 
57  ///get targetH
58  QMCHamiltonian* getH() const { return targetH.get(); }
59 
60 private:
61  /** process xmlNode to populate targetPsi
62  */
63  bool build(xmlNodePtr cur);
64 
65  void addCoulombPotential(xmlNodePtr cur);
66  void addForceHam(xmlNodePtr cur);
67  void addPseudoPotential(xmlNodePtr cur);
68  void addMPCPotential(xmlNodePtr cur, bool physical = false);
69 
70  ///type of the lattice. 0=non-periodic, 1=periodic
71  int PBCType;
72  ///many-body wavefunction object
73  std::unique_ptr<QMCHamiltonian> targetH;
74  ///target ParticleSet
76  ///reference to the PSetMap
77  const PSetMap& ptclPool;
78  ///reference to the TrialWaveFunction Pool
80 
81  ///name of the TrialWaveFunction
82  std::string psiName;
83 
84  ///list of the old to new name
85  std::map<std::string, std::string> RenamedProperty;
86 };
87 } // namespace qmcplusplus
88 #endif
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
std::map< std::string, const std::unique_ptr< ParticleSet > > PSetMap
int PBCType
type of the lattice. 0=non-periodic, 1=periodic
QMCHamiltonian * getH() const
get targetH
Collection of Local Energy Operators.
bool build(xmlNodePtr cur)
process xmlNode to populate targetPsi
HamiltonianFactory(const std::string &hName, ParticleSet &qp, const PSetMap &pset, const PsiPoolType &oset, Communicate *c)
constructor
const PsiPoolType & psiPool
reference to the TrialWaveFunction Pool
std::map< std::string, std::string > RenamedProperty
list of the old to new name
Wrapping information on parallelism.
Definition: Communicate.h:68
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
Factory class to build a many-body wavefunction.
bool put(xmlNodePtr cur)
read from xmlNode
std::map< std::string, const std::unique_ptr< TrialWaveFunction > > PsiPoolType
std::unique_ptr< QMCHamiltonian > targetH
many-body wavefunction object
void renameProperty(const std::string &a, const std::string &b)
add a property whose name will be renamed by b
const PSetMap & ptclPool
reference to the PSetMap
std::string psiName
name of the TrialWaveFunction
ParticleSet & targetPtcl
target ParticleSet
void addMPCPotential(xmlNodePtr cur, bool physical=false)
Declaration of QMCHamiltonian.