Bridge++  Ver. 2.0.2
hmc_General.h
Go to the documentation of this file.
1 
14 #ifndef HMC_GENERAL_INCLUDED
15 #define HMC_GENERAL_INCLUDED
16 
17 #include "action_list.h"
18 #include "integrator.h"
19 #include "langevin_Momentum.h"
20 
22 
23 #include "IO/bridgeIO.h"
24 using Bridge::vout;
25 
27 
28 /*
29  This class defines Hybrid Monte Carlo update algorithm
30  with a given molecular dynamics integrator.
31  To be improved:
32  - at present setting conjugate momenta explicitly assumes
33  SU(3) gauge group. This should be generalized, and for
34  SU(3) case assert is necessary.
35  [25 Dec 2011 H.Matsufuru]
36  (Coding history will be recovered from trac.)
37  YAML is implemented. [14 Nov 2012 Y.Namekawa]
38  Langevin step was moved to separate file.
39  [07 May 2014 H.Matsufuru]
40  unique_ptr is introduced to avoid memory leaks
41  [21 Mar 2015 Y.Namekawa]
42  */
43 
44 
46 {
47  public:
48  static const std::string class_name;
49 
50  private:
51  //int m_Metropolis_test; //!< Metropolis test: Metropolis_test=0: no test, !=0: test
53  std::vector<Action *> m_action;
54  std::vector<Director *> m_director;
60 
62 
63  public:
65  HMC_General(const ActionList& action_list,
66  std::vector<Director *> director,
67  Integrator *integrator,
68  RandomNumbers *rand);
69 
70  HMC_General(const ActionList& action_list,
71  std::vector<Director *> director,
72  Integrator *integrator,
73  RandomNumbers *rand,
74  const Parameters& params);
75 
77  HMC_General(const ActionList& action_list,
78  Integrator *integrator,
79  RandomNumbers *rand);
80 
81  HMC_General(const ActionList& action_list,
82  Integrator *integrator,
83  RandomNumbers *rand,
84  const Parameters& params);
85 
87  ~HMC_General();
88 
89  private:
90  // non-copyable
91  HMC_General(const HMC_General&);
93 
94  public:
95  void set_parameters(const Parameters& params);
96  void set_parameters(const double trajectory_length, const bool Metropolis_test);
98  void set_parameters(const double trajectory_length, const int Metropolis_test); // backward compatibility
99 
101 
102  void get_parameters(Parameters& params) const;
103 
104  double update(Field_G&);
105 
106  double langevin(Field_G& iP, const Field_G& U);
107 
108  // double langevin_P(Field_G& iP); removed [07 May 2014]
109 
110  double calc_Hamiltonian(const Field_G& iP, const Field_G& U);
111  double calcH_P(const Field_G& iP);
112 };
113 #endif
HMC_General::m_trajectory_length
double m_trajectory_length
Definition: hmc_General.h:59
HMC_General::HMC_General
HMC_General(const ActionList &action_list, std::vector< Director * > director, Integrator *integrator, RandomNumbers *rand)
constructor with action_list, directors, and random number generator
Definition: hmc_General.cpp:20
bridgeIO.h
HMC_General::m_integrator
Integrator * m_integrator
MD integrator.
Definition: hmc_General.h:55
HMC_General::update
double update(Field_G &)
Definition: hmc_General.cpp:196
Parameters
Class for parameters.
Definition: parameters.h:46
RandomNumbers
Base class of random number generators.
Definition: randomNumbers.h:43
HMC_General::m_Langevin_P
Langevin_Momentum * m_Langevin_P
Definition: hmc_General.h:58
HMC_General::m_rand
RandomNumbers * m_rand
random number generator
Definition: hmc_General.h:56
HMC_General::m_action
std::vector< Action * > m_action
actions
Definition: hmc_General.h:53
action_list.h
langevin_Momentum.h
ActionList
lists of actions at respective integrator levels.
Definition: action_list.h:40
HMC_General::get_parameters
void get_parameters(Parameters &params) const
Definition: hmc_General.cpp:159
HMC_General::langevin
double langevin(Field_G &iP, const Field_G &U)
Definition: hmc_General.cpp:266
ParameterCheck::vl
Bridge::VerboseLevel vl
Definition: parameterCheck.cpp:18
HMC_General::set_parameters
void set_parameters(const Parameters &params)
Definition: hmc_General.cpp:134
HMC_General::m_director
std::vector< Director * > m_director
directors
Definition: hmc_General.h:54
staple_lex.h
HMC_General::~HMC_General
~HMC_General()
destructor
Definition: hmc_General.cpp:126
HMC_General::class_name
static const std::string class_name
Definition: hmc_General.h:48
HMC_General::m_vl
Bridge::VerboseLevel m_vl
Definition: hmc_General.h:61
HMC_General::calcH_P
double calcH_P(const Field_G &iP)
Definition: hmc_General.cpp:333
Langevin_Momentum
Langevin part of HMC for conjugate momentum to link variable.
Definition: langevin_Momentum.h:38
HMC_General::calc_Hamiltonian
double calc_Hamiltonian(const Field_G &iP, const Field_G &U)
Definition: hmc_General.cpp:302
HMC_General
General HMC update class.
Definition: hmc_General.h:45
Staple_lex
Staple construction.
Definition: staple_lex.h:39
HMC_General::set_parameter_verboselevel
void set_parameter_verboselevel(const Bridge::VerboseLevel vl)
Definition: hmc_General.h:100
HMC_General::m_staple
Staple_lex * m_staple
Definition: hmc_General.h:57
integrator.h
HMC_General::operator=
HMC_General & operator=(const HMC_General &)
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Integrator
Base class of Integrator class family.
Definition: integrator.h:29
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
HMC_General::m_Metropolis_test
bool m_Metropolis_test
Metropolis test: enabled if true.
Definition: hmc_General.h:52
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512