Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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,
74 
76  HMC_General(const ActionList& action_list,
77  Integrator *integrator,
78  RandomNumbers *rand);
79 
80  HMC_General(const ActionList& action_list,
81  Integrator *integrator,
83 
85  ~HMC_General();
86 
87  private:
88  // non-copyable
89  HMC_General(const HMC_General&);
91 
92  public:
93  void set_parameters(const Parameters& params);
94  void set_parameters(const double trajectory_length, const bool Metropolis_test);
95  void set_parameters(const double trajectory_length, const int Metropolis_test); // backward compatibility
96 
98 
99  double update(Field_G&);
100 
101  double langevin(Field_G& iP, const Field_G& U);
102 
103  // double langevin_P(Field_G& iP); removed [07 May 2014]
104 
105  double calc_Hamiltonian(const Field_G& iP, const Field_G& U);
106  double calcH_P(const Field_G& iP);
107 };
108 #endif
BridgeIO vout
Definition: bridgeIO.cpp:503
void set_parameters(const Parameters &params)
std::vector< Director * > m_director
directors
Definition: hmc_General.h:54
static const std::string class_name
Definition: hmc_General.h:48
General HMC update class.
Definition: hmc_General.h:45
Bridge::VerboseLevel m_vl
Definition: hmc_General.h:61
RandomNumbers * m_rand
random number generator
Definition: hmc_General.h:56
double calc_Hamiltonian(const Field_G &iP, const Field_G &U)
std::vector< Action * > m_action
actions
Definition: hmc_General.h:53
Class for parameters.
Definition: parameters.h:46
Staple_lex * m_staple
Definition: hmc_General.h:57
Base class of Integrator class family.
Definition: integrator.h:29
Staple construction.
Definition: staple_lex.h:39
SU(N) gauge field.
Definition: field_G.h:38
double langevin(Field_G &iP, const Field_G &U)
~HMC_General()
destructor
double calcH_P(const Field_G &iP)
bool m_Metropolis_test
Metropolis test: enabled if true.
Definition: hmc_General.h:52
double m_trajectory_length
Definition: hmc_General.h:59
Langevin_Momentum * m_Langevin_P
Definition: hmc_General.h:58
lists of actions at respective integrator levels.
Definition: action_list.h:40
void set_parameter_verboselevel(const Bridge::VerboseLevel vl)
Definition: hmc_General.h:97
Base class of random number generators.
Definition: randomNumbers.h:43
Bridge::VerboseLevel vl
Integrator * m_integrator
MD integrator.
Definition: hmc_General.h:55
VerboseLevel
Definition: bridgeIO.h:42
double update(Field_G &)
HMC_General & operator=(const 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
Langevin part of HMC for conjugate momentum to link variable.