Bridge++  Ver. 2.0.2
hmc_Leapfrog.h
Go to the documentation of this file.
1 
14 #ifndef HMC_LEAPFROG_INCLUDED
15 #define HMC_LEAPFROG_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 
45 {
46  public:
47  static const std::string class_name;
48 
49  private:
50  int m_Nmdc;
51  int m_Nprec;
53  double m_Estep;
54 
57 
58  std::vector<Action *> m_action;
59  std::vector<Director *> m_director;
62 
63  public:
64 
66  HMC_Leapfrog(std::vector<Action *> action,
67  RandomNumbers *rand);
68 
70  HMC_Leapfrog(std::vector<Action *> action,
71  std::vector<Director *> director,
72  RandomNumbers *rand);
73 
75  HMC_Leapfrog(const ActionList& action_list,
76  RandomNumbers *rand);
77 
79  HMC_Leapfrog(const ActionList& action_list,
80  std::vector<Director *> director,
81  RandomNumbers *rand);
82 
83  //- constructor with paramsters
85  HMC_Leapfrog(std::vector<Action *> action,
86  RandomNumbers *rand,
87  const Parameters& params);
88 
90  HMC_Leapfrog(std::vector<Action *> action,
91  std::vector<Director *> director,
92  RandomNumbers *rand,
93  const Parameters& params);
94 
96  HMC_Leapfrog(const ActionList& action_list,
97  RandomNumbers *rand,
98  const Parameters& params);
99 
101  HMC_Leapfrog(const ActionList& action_list,
102  std::vector<Director *> director,
103  RandomNumbers *rand,
104  const Parameters& params);
105 
107  ~HMC_Leapfrog();
108 
109  private:
110  // non-copyable
111  HMC_Leapfrog(const HMC_Leapfrog&);
113 
114  public:
115  void set_parameters(const Parameters& params);
116  DEPRECATED
117  void set_parameters(const double Estep, const int Nmdc, const int Nprec, const int Metropolis_test); // backward compability
118  void set_parameters(const double Estep, const int Nmdc, const int Nprec, const bool Metropolis_test);
119 
121 
122  void get_parameters(Parameters& params) const;
123 
124  // Metropolis_test: enabled if true.
125  double update(Field_G&);
126 
127  double langevin(Field_G& iP, const Field_G& U);
128 
129  double calc_Hamiltonian(const Field_G& iP, const Field_G& U);
130  double calcH_P(const Field_G& iP);
131 
132  void integrate(Field_G& iP, Field_G& U);
133 
134  void update_U(const double estep, const Field_G& iP, Field_G& U);
135  void update_P(const double estep, Field_G& iP, const Field_G& U);
136 };
137 #endif
bridgeIO.h
HMC_Leapfrog::HMC_Leapfrog
HMC_Leapfrog(std::vector< Action * > action, RandomNumbers *rand)
constructor: with array of actions
Definition: hmc_Leapfrog.cpp:20
HMC_Leapfrog::m_vl
Bridge::VerboseLevel m_vl
Definition: hmc_Leapfrog.h:61
HMC_Leapfrog
HMC with single level leapfrog intetgrator.
Definition: hmc_Leapfrog.h:44
HMC_Leapfrog::class_name
static const std::string class_name
Definition: hmc_Leapfrog.h:47
Parameters
Class for parameters.
Definition: parameters.h:46
HMC_Leapfrog::m_rand
RandomNumbers * m_rand
Definition: hmc_Leapfrog.h:60
RandomNumbers
Base class of random number generators.
Definition: randomNumbers.h:43
action_list.h
HMC_Leapfrog::m_staple
Staple_lex * m_staple
Definition: hmc_Leapfrog.h:56
langevin_Momentum.h
HMC_Leapfrog::calc_Hamiltonian
double calc_Hamiltonian(const Field_G &iP, const Field_G &U)
Definition: hmc_Leapfrog.cpp:429
ActionList
lists of actions at respective integrator levels.
Definition: action_list.h:40
HMC_Leapfrog::integrate
void integrate(Field_G &iP, Field_G &U)
Definition: hmc_Leapfrog.cpp:471
HMC_Leapfrog::m_Langevin_P
Langevin_Momentum * m_Langevin_P
Definition: hmc_Leapfrog.h:55
HMC_Leapfrog::m_Nmdc
int m_Nmdc
Definition: hmc_Leapfrog.h:50
HMC_Leapfrog::set_parameter_verboselevel
void set_parameter_verboselevel(const Bridge::VerboseLevel vl)
Definition: hmc_Leapfrog.h:120
ParameterCheck::vl
Bridge::VerboseLevel vl
Definition: parameterCheck.cpp:18
HMC_Leapfrog::update_U
void update_U(const double estep, const Field_G &iP, Field_G &U)
Definition: hmc_Leapfrog.cpp:525
staple_lex.h
Langevin_Momentum
Langevin part of HMC for conjugate momentum to link variable.
Definition: langevin_Momentum.h:38
HMC_Leapfrog::operator=
HMC_Leapfrog & operator=(const HMC_Leapfrog &)
HMC_Leapfrog::get_parameters
void get_parameters(Parameters &params) const
Definition: hmc_Leapfrog.cpp:278
HMC_Leapfrog::m_action
std::vector< Action * > m_action
Definition: hmc_Leapfrog.h:58
HMC_Leapfrog::langevin
double langevin(Field_G &iP, const Field_G &U)
Definition: hmc_Leapfrog.cpp:394
Staple_lex
Staple construction.
Definition: staple_lex.h:39
integrator.h
HMC_Leapfrog::m_director
std::vector< Director * > m_director
Definition: hmc_Leapfrog.h:59
HMC_Leapfrog::calcH_P
double calcH_P(const Field_G &iP)
Definition: hmc_Leapfrog.cpp:460
HMC_Leapfrog::update
double update(Field_G &)
Definition: hmc_Leapfrog.cpp:323
HMC_Leapfrog::m_Estep
double m_Estep
Definition: hmc_Leapfrog.h:53
HMC_Leapfrog::update_P
void update_P(const double estep, Field_G &iP, const Field_G &U)
Definition: hmc_Leapfrog.cpp:501
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
HMC_Leapfrog::m_Nprec
int m_Nprec
Definition: hmc_Leapfrog.h:51
HMC_Leapfrog::m_Metropolis_test
bool m_Metropolis_test
Definition: hmc_Leapfrog.h:52
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
HMC_Leapfrog::~HMC_Leapfrog
~HMC_Leapfrog()
destructor
Definition: hmc_Leapfrog.cpp:220
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
HMC_Leapfrog::set_parameters
void set_parameters(const Parameters &params)
Definition: hmc_Leapfrog.cpp:228