Bridge++  Ver. 1.3.x
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.h"
18 #include "action_list.h"
19 #include "director.h"
20 #include "integrator.h"
21 #include "randomNumbers.h"
22 #include "staples.h"
23 #include "langevin_Momentum.h"
24 
25 #ifdef USE_PARAMETERS_FACTORY
26 #include "parameters_factory.h"
27 #endif
28 
29 #include "bridgeIO.h"
30 using Bridge::vout;
31 
32 
34 
35 /*
36  This class defines Hybrid Monte Carlo update algorithm
37  with a given molecular dynamics integrator.
38  To be improved:
39  - at present setting conjugate momenta explicitly assumes
40  SU(3) gauge group. This should be generalized, and for
41  SU(3) case assert is necessary.
42  [25 Dec 2011 H.Matsufuru]
43  (Coding history will be recovered from trac.)
44  YAML is implemented. [14 Nov 2012 Y.Namekawa]
45  Langevin step was moved to separate file.
46  [07 May 2014 H.Matsufuru]
47  unique_ptr is introduced to avoid memory leaks
48  [21 Mar 2015 Y.Namekawa]
49  */
50 
51 //- parameters class
52 class Parameters_HMC_General : virtual public Parameters
53 {
54  public:
56 };
57 //- end
58 
60 {
61  public:
62  static const std::string class_name;
63 
64  private:
66  std::vector<Action *> m_action;
67  std::vector<Director *> m_director;
73 
75 
76  public:
78  HMC_General(const ActionList& action_list,
79  std::vector<Director *> director,
80  Integrator *integrator,
81  RandomNumbers *rand);
82 
83  HMC_General(const ActionList& action_list,
84  std::vector<Director *> director,
85  Integrator *integrator,
87 
89  HMC_General(const ActionList& action_list,
90  Integrator *integrator,
91  RandomNumbers *rand);
92 
93  HMC_General(const ActionList& action_list,
94  Integrator *integrator,
96 
98  ~HMC_General();
99 
100  private:
101  // non-copyable
102  HMC_General(const HMC_General&);
104 
105  public:
106  void set_parameters(const Parameters& params);
107  void set_parameters(double trajectory_length, int Metropolis_test);
108 
110 
111  double update(Field_G&);
112 
113  double langevin(Field_G& iP, Field_G& U);
114 
115  // double langevin_P(Field_G& iP); removed [07 May 2014]
116 
117  double calc_Hamiltonian(Field_G& iP, Field_G& U);
118  double calcH_P(Field_G& iP);
119 };
120 #endif
BridgeIO vout
Definition: bridgeIO.cpp:278
Staple construction.
Definition: staples.h:40
double calc_Hamiltonian(Field_G &iP, Field_G &U)
void set_parameters(const Parameters &params)
std::vector< Director * > m_director
directors
Definition: hmc_General.h:67
int m_Metropolis_test
Metropolis test: Metropolis_test=0: no test, !=0: test.
Definition: hmc_General.h:65
static const std::string class_name
Definition: hmc_General.h:62
Bridge::VerboseLevel m_vl
Definition: hmc_General.h:74
RandomNumbers * m_rand
random number generator
Definition: hmc_General.h:69
std::vector< Action * > m_action
actions
Definition: hmc_General.h:66
double calcH_P(Field_G &iP)
Class for parameters.
Definition: parameters.h:38
Base class of Integrator class family.
Definition: integrator.h:31
double langevin(Field_G &iP, Field_G &U)
SU(N) gauge field.
Definition: field_G.h:38
~HMC_General()
destructor
double m_trajectory_length
Definition: hmc_General.h:72
Langevin_Momentum * m_Langevin_P
Definition: hmc_General.h:71
lists of actions at respective integrator levels.
Definition: action_list.h:40
void set_parameter_verboselevel(const Bridge::VerboseLevel vl)
Definition: hmc_General.h:109
Base class of random number generators.
Definition: randomNumbers.h:39
Bridge::VerboseLevel vl
Definition: checker.cpp:18
Integrator * m_integrator
MD integrator.
Definition: hmc_General.h:68
VerboseLevel
Definition: bridgeIO.h:39
double update(Field_G &)
General HMC update class.
Definition: hmc_General.h:52
HMC_General & operator=(const HMC_General &)
Staples * m_staple
Definition: hmc_General.h:70
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:41
Langevin part of HMC for conjugate momentum to link variable.