21 std::vector<Director *> director,
29 for (
int i = 0; i < action_set.size(); ++i) {
33 for (
int i = 0; i < director.size(); ++i) {
47 std::vector<Director *> director,
55 for (
int i = 0; i < action_set.size(); ++i) {
59 for (
int i = 0; i < director.size(); ++i) {
81 for (
int i = 0; i < action_set.size(); ++i) {
102 for (
int i = 0; i < action_set.size(); ++i) {
126 const string str_vlevel = params.
get_string(
"verbose_level");
132 bool Metropolis_test;
135 err += params.
fetch_double(
"trajectory_length", traj_length);
136 err += params.
fetch_bool(
"Metropolis_test", Metropolis_test);
150 vout.
crucial(
m_vl,
"%s: warning: integer variable for Metroplis_test is obsolete. use boolean parameter.\n",
class_name.c_str());
152 return set_parameters(trajectory_length, (Metropolis_test == 0) ?
false :
true);
163 vout.
general(
m_vl,
" Metropolis_test = %s\n", Metropolis_test ?
"true" :
"false");
181 for (
int i = 0; i <
m_action.size(); ++i) {
185 const int Nin = U.
nin();
186 const int Nvol = U.
nvol();
187 const int Nex = U.
nex();
195 const double H_total0 =
langevin(iP, U);
218 const double diff_H = H_total1 - H_total0;
219 const double exp_minus_diff_H = exp(-diff_H);
229 if (rand <= exp_minus_diff_H) {
249 const int NcA = Nc * Nc - 1;
267 vout.
general(
m_vl,
" H_kin/dof = %18.8f\n", H_iP / NcA / Nvol / NPE / Ndim);
270 double H_actions = 0.0;
271 for (
int i = 0; i <
m_action.size(); ++i) {
275 double H_total = H_iP + H_actions;
283 const int Nin = U.
nin();
284 const int Nvol = U.
nvol();
285 const int Nex = U.
nex();
289 const int NcA = Nc * Nc - 1;
299 vout.
general(
m_vl,
" H_kin/dof = %18.8f\n", H_iP / NcA / Nvol / NPE / Nex);
301 double H_actions = 0.0;
302 for (
int i = 0; i <
m_action.size(); ++i) {
306 double H_total = H_iP + H_actions;
314 const double hn = iP.
norm();
315 const double H_iP = 0.5 * hn * hn;
int fetch_bool(const string &key, bool &value) const
void set_parameters(const Parameters ¶ms)
std::vector< Director * > m_director
directors
void general(const char *format,...)
static const std::string class_name
int fetch_double(const string &key, double &value) const
double plaquette(const Field_G &)
calculates plaquette value.
double set_iP(Field_G &iP)
Setting conjugate momenta and returns kinetic part of Hamiltonian.
Bridge::VerboseLevel m_vl
RandomNumbers * m_rand
random number generator
double calc_Hamiltonian(const Field_G &iP, const Field_G &U)
std::vector< Action * > m_action
actions
virtual void invalidate_cache()=0
Base class of Integrator class family.
ActionSet get_actions() const
double langevin(Field_G &iP, const Field_G &U)
Common parameter class: provides parameters as singleton.
virtual void evolve(const double step_size, Field_G &iP, Field_G &U)=0
double calcH_P(const Field_G &iP)
bool m_Metropolis_test
Metropolis test: enabled if true.
double m_trajectory_length
void crucial(const char *format,...)
Langevin_Momentum * m_Langevin_P
lists of actions at respective integrator levels.
Base class of random number generators.
Integrator * m_integrator
MD integrator.
string get_string(const string &key) const
std::vector< Action * > ActionSet
static VerboseLevel set_verbose_level(const std::string &str)
HMC_General(const ActionList &action_list, std::vector< Director * > director, Integrator *integrator, RandomNumbers *rand)
constructor with action_list, directors, and random number generator
Langevin part of HMC for conjugate momentum to link variable.