QMCPACK
DMCDriverInput.cpp
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) 2020 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
8 //
9 // File created by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 #include "DMCDriverInput.h"
13 
14 namespace qmcplusplus
15 {
16 DMCDriverInput::DMCDriverInput(int walkers_per_rank) {}
17 
18 void DMCDriverInput::readXML(xmlNodePtr node)
19 {
20  ParameterSet parameter_set_;
21  std::string reconfig_str;
22  std::string refE_update_scheme_str;
23  parameter_set_.add(reconfig_str, "reconfiguration", {"no", "yes", "runwhileincorrect"});
24  parameter_set_.add(NonLocalMove, "nonlocalmove", {"no", "yes", "v0", "v1", "v3"});
25  parameter_set_.add(NonLocalMove, "nonlocalmoves", {"no", "yes", "v0", "v1", "v3"});
26  parameter_set_.add(max_age_, "MaxAge");
27  parameter_set_.add(feedback_, "feedback");
28  parameter_set_.add(refE_update_scheme_str, "refenergy_update_scheme", {"unlimited_history", "limited_history"});
29 
30  // from DMC.cpp put(xmlNodePtr)
31  parameter_set_.add(branch_interval_, "branchInterval");
32  parameter_set_.add(branch_interval_, "branchinterval");
33  parameter_set_.add(branch_interval_, "substeps");
34  parameter_set_.add(branch_interval_, "subStep");
35  parameter_set_.add(branch_interval_, "sub_stepd");
36 
37  //from NonLocalTOperator.cpp
38  parameter_set_.add(alpha_, "alpha");
39  parameter_set_.add(gamma_, "gamma");
40 
41  parameter_set_.add(reserve_, "reserve");
42 
43  parameter_set_.put(node);
44 
45  if (reconfig_str == "yes")
46  throw std::runtime_error("Reconfiguration is currently broken and gives incorrect results. Use dynamic "
47  "population control by setting reconfiguration=\"no\" or removing the reconfiguration "
48  "option from the DMC input section. If accessing the broken reconfiguration code path "
49  "is still desired, set reconfiguration to \"runwhileincorrect\" instead of \"yes\".");
50  reconfiguration_ = (reconfig_str == "yes");
51 
52  if (NonLocalMove == "yes" || NonLocalMove == "v0")
53  app_summary() << " Using Non-local T-moves v0, M. Casula, PRB 74, 161102(R) (2006)";
54  else if (NonLocalMove == "v1")
55  app_summary() << " Using Non-local T-moves v1, M. Casula et al., JCP 132, 154113 (2010)";
56  else if (NonLocalMove == "v3")
57  app_summary() << " Using Non-local T-moves v3, an approximation to v1";
58  else
59  app_summary() << " Using Locality Approximation";
60  app_summary() << std::endl;
61 
62  // TODO: similar check for alpha and gamma
63  if (max_age_ < 0)
64  throw std::runtime_error("Illegal input for MaxAge in DMC input section");
65  if (branch_interval_ < 0)
66  throw std::runtime_error("Illegal input for branchInterval or substeps in DMC input section");
67 
68  if (reserve_ < 1.0)
69  throw std::runtime_error("You can only reserve walkers above the target walker count");
70 
71  if (refE_update_scheme_str == "unlimited_history")
73  else
75 }
76 
77 std::ostream& operator<<(std::ostream& o_stream, const DMCDriverInput& dmci) { return o_stream; }
78 
79 } // namespace qmcplusplus
RealType reserve_
reserved walkers for population growth
double feedback_
feed back parameter for population control
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
if(!okay) throw std xmlNodePtr node
std::ostream & app_summary()
Definition: OutputManager.h:63
IndexType branch_interval_
Do not write out blocks of gets for variables like this there is are code_generation tools in QMCPA...
DMCRefEnergyScheme refenergy_update_scheme_
input std::string to determine reference energy update scheme
bool reconfiguration_
reconfiguration flag
IndexType max_age_
input to control maximum age allowed for walkers.
bool put(std::istream &is) override
read from std::istream
Definition: ParameterSet.h:42
Input representation for DMC driver class runtime parameters.
class to handle a set of parameters
Definition: ParameterSet.h:27
std::ostream & operator<<(std::ostream &out, const AntiSymTensor< T, D > &rhs)
std::string NonLocalMove
input std::string to determine to use nonlocal move
void add(PDT &aparam, const std::string &aname_in, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new parameter corresponding to an xmlNode <parameter>
void readXML(xmlNodePtr xml_input)