Go to the documentation of this file.
21 std::vector<Director *> director,
29 for (
int i = 0; i < action_set.size(); ++i) {
33 for (
int i = 0; i < director.size(); ++i) {
49 std::vector<Director *> director,
58 for (
int i = 0; i < action_set.size(); ++i) {
62 for (
int i = 0; i < director.size(); ++i) {
86 for (
int i = 0; i < action_set.size(); ++i) {
110 for (
int i = 0; i < action_set.size(); ++i) {
143 bool Metropolis_test;
146 err += params.
fetch_double(
"trajectory_length", traj_length);
147 err += params.
fetch_bool(
"Metropolis_test", Metropolis_test);
171 vout.
crucial(
m_vl,
"%s: warning: integer variable for Metroplis_test is obsolete. use boolean parameter.\n",
class_name.c_str());
173 return set_parameters(trajectory_length, (Metropolis_test == 0) ?
false :
true);
184 vout.
general(
m_vl,
" Metropolis_test = %s\n", Metropolis_test ?
"true" :
"false");
202 for (
int i = 0; i <
m_action.size(); ++i) {
206 const int Nin = U.
nin();
207 const int Nvol = U.
nvol();
208 const int Nex = U.
nex();
216 const double H_total0 =
langevin(iP, U);
239 const double diff_H = H_total1 - H_total0;
240 const double exp_minus_diff_H = exp(-diff_H);
250 if (rand <= exp_minus_diff_H) {
270 const int NcA = Nc * Nc - 1;
288 vout.
general(
m_vl,
" H_kin/dof = %18.8f\n", H_iP / NcA / Nvol / NPE / Ndim);
291 double H_actions = 0.0;
292 for (
int i = 0; i <
m_action.size(); ++i) {
296 double H_total = H_iP + H_actions;
304 const int Nin = U.
nin();
305 const int Nvol = U.
nvol();
306 const int Nex = U.
nex();
310 const int NcA = Nc * Nc - 1;
320 vout.
general(
m_vl,
" H_kin/dof = %18.8f\n", H_iP / NcA / Nvol / NPE / Nex);
322 double H_actions = 0.0;
323 for (
int i = 0; i <
m_action.size(); ++i) {
327 double H_total = H_iP + H_actions;
335 const double hn = iP.
norm();
336 const double H_iP = 0.5 * hn * hn;
void set_bool(const string &key, const bool value)
double m_trajectory_length
HMC_General(const ActionList &action_list, std::vector< Director * > director, Integrator *integrator, RandomNumbers *rand)
constructor with action_list, directors, and random number generator
double set_iP(Field_G &iP)
Setting conjugate momenta and returns kinetic part of Hamiltonian.
virtual void invalidate_cache()=0
void set_string(const string &key, const string &value)
Common parameter class: provides parameters as singleton.
Integrator * m_integrator
MD integrator.
double plaquette(const Field_G &)
calculates plaquette value.
void set_double(const string &key, const double value)
Base class of random number generators.
Langevin_Momentum * m_Langevin_P
RandomNumbers * m_rand
random number generator
std::vector< Action * > m_action
actions
int fetch_bool(const string &key, bool &value) const
std::vector< Action * > ActionSet
lists of actions at respective integrator levels.
void get_parameters(Parameters ¶ms) const
double langevin(Field_G &iP, const Field_G &U)
void set_parameters(const Parameters ¶ms)
std::vector< Director * > m_director
directors
static const std::string class_name
Bridge::VerboseLevel m_vl
double calcH_P(const Field_G &iP)
Langevin part of HMC for conjugate momentum to link variable.
double calc_Hamiltonian(const Field_G &iP, const Field_G &U)
static VerboseLevel set_verbose_level(const std::string &str)
ActionSet get_actions() const
int fetch_string(const string &key, string &value) const
int fetch_double(const string &key, double &value) const
void crucial(const char *format,...)
Base class of Integrator class family.
virtual void evolve(const double step_size, Field_G &iP, Field_G &U)=0
void general(const char *format,...)
bool m_Metropolis_test
Metropolis test: enabled if true.
static std::string get_verbose_level(const VerboseLevel vl)