54 const std::string
test_name =
"HMC.Wilson.Leapfrog_Nf2";
58 const std::string filename_input =
"test_HMC_Wilson_Leapfrog_Nf2.yaml";
59 const std::string filename_output =
"stdout";
61 class Parameters_Test_HMC_Wilson :
public Parameters {
63 Parameters_Test_HMC_Wilson()
65 Register_string(
"gauge_config_status",
"NULL");
67 Register_string(
"gauge_config_type_input",
"NULL");
68 Register_string(
"config_filename_input",
"NULL");
70 Register_string(
"gauge_config_type_output",
"NULL");
71 Register_string(
"config_filename_output",
"NULL");
73 Register_int(
"trajectory_number", 0);
74 Register_int(
"trajectory_number_step", 0);
75 Register_int(
"save_config_interval", 0);
77 Register_string(
"verbose_level",
"NULL");
79 Register_double(
"expected_result", 0.0);
87 #ifdef USE_TESTMANAGER_AUTOREGISTER
89 #if defined(USE_GROUP_SU2)
131 const string str_gconf_status = params_test->
get_string(
"gauge_config_status");
132 const string str_gconf_read = params_test->
get_string(
"gauge_config_type_input");
133 const string readfile = params_test->
get_string(
"config_filename_input");
134 const string str_gconf_write = params_test->
get_string(
"gauge_config_type_output");
135 const string writefile = params_test->
get_string(
"config_filename_output");
136 int i_conf = params_test->
get_int(
"trajectory_number");
137 const int Ntraj = params_test->
get_int(
"trajectory_number_step");
138 const int i_save_conf = params_test->
get_int(
"save_config_interval");
139 const string str_vlevel = params_test->
get_string(
"verbose_level");
141 const bool do_check = params_test->
is_set(
"expected_result");
142 const double expected_result = do_check ? params_test->
get_double(
"expected_result") : 0.0;
144 const string str_action_G_type = params_action_G->
get_string(
"action_type");
145 const string str_fopr_type = params_fopr->
get_string(
"fermion_type");
146 const string str_gmset_type = params_fopr->
get_string(
"gamma_matrix_type");
147 const string str_proj_type = params_proj->
get_string(
"projection_type");
148 const string str_smear_type = params_smear->
get_string(
"smear_type");
149 const string str_solver_MD_type = params_solver_MD->
get_string(
"solver_type");
150 const string str_solver_H_type = params_solver_H->
get_string(
"solver_type");
155 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
156 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
157 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
158 vout.
general(vl,
" gconf_write = %s\n", str_gconf_write.c_str());
159 vout.
general(vl,
" writefile = %s\n", writefile.c_str());
162 vout.
general(vl,
" i_save_conf = %d\n", i_save_conf);
163 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
164 vout.
general(vl,
" gmset_type = %s\n", str_gmset_type.c_str());
165 vout.
general(vl,
" proj_type = %s\n", str_proj_type.c_str());
166 vout.
general(vl,
" smear_type = %s\n", str_smear_type.c_str());
167 vout.
general(vl,
" solver_MD_type = %s\n", str_solver_MD_type.c_str());
168 vout.
general(vl,
" solver_H_type = %s\n", str_solver_H_type.c_str());
179 vout.
crucial(vl,
"%s: Input parameters have not been set.\n", test_name.c_str());
189 if (str_gconf_status ==
"Continue") {
191 }
else if (str_gconf_status ==
"Cold_start") {
193 }
else if (str_gconf_status ==
"Hot_start") {
194 int i_seed_noise = 1234567;
198 vout.
crucial(vl,
"%s: unsupported gconf status \"%s\".\n", test_name.c_str(), str_gconf_status.c_str());
246 actions.
append(0, action_F);
247 actions.
append(0, action_G);
249 std::vector<Director *> directors(1);
267 for (
int traj = 0; traj < Ntraj; ++traj) {
273 if ((i_conf + traj + 1) % i_save_conf == 0) {
287 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
Random number generator base on M-series.
void detailed(const char *format,...)
void set_parameters(const Parameters ¶ms)
void general(const char *format,...)
virtual void set_parameters(const Parameters &)=0
int get_int(const string &key) const
static Parameters * New(const std::string &realm)
void read_file(Field *U, const string &filename)
void set_random(RandomNumbers *rand)
bool append(const int level, Action *action)
virtual void set_parameters(const Parameters ¶m)=0
virtual void set_parameters(const Parameters ¶ms)=0
static bool RegisterTest(const std::string &key, const Test_function func)
Test of HMC update for Wilson fermions.
Manager of commonly used data object in HMC.
bool is_set(const string &) const
double get_double(const string &key) const
std::string generate_filename(const char *fmt,...)
void write_file(Field *U, const string &filename)
virtual void set_parameters(const Parameters &)=0
int non_NULL(const std::string v)
Get quark propagator for Fopr with lexical site index.
void crucial(const char *format,...)
virtual void set_parameters(const Parameters ¶ms)=0
void Register_Parameters(const string &, Parameters *const)
const std::string test_name
lists of actions at respective integrator levels.
Manager of smeared configurations.
int verify(const double result, const double expected, double eps)
Force calculation for smeared fermion operators.
int non_negative(const int v)
static void read(const std::string ¶ms_file, Parameters *params)
virtual void set_parameters(const Parameters &)=0
GaugeConfig class for file I/O of gauge configuration.
string get_string(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
virtual void set_parameters(const Parameters &)=0
Standard fermion action for HMC.
static VerboseLevel set_verbose_level(const std::string &str)