60 const std::string
test_name =
"HMC.Clover.RHMC_Nf2p1_eo";
64 const std::string filename_input =
"test_HMC_Clover_RHMC_Nf2p1.yaml";
70 #ifdef USE_TESTMANAGER_AUTOREGISTER
72 #if defined(USE_GROUP_SU2)
101 const Parameters params_rational_MD = params_all.
lookup(
"Fopr_Rational_MD");
105 const Parameters params_solver_Nf2_MD_prec = params_all.
lookup(
"Solver_Nf2_MD_prec");
106 const Parameters params_solver_Nf2_H_prec = params_all.
lookup(
"Solver_Nf2_H_prec");
107 const Parameters params_integrator = params_all.
lookup(
"Builder_Integrator");
110 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
111 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
112 const string readfile = params_test.
get_string(
"config_filename_input");
113 const string str_gconf_write = params_test.
get_string(
"gauge_config_type_output");
114 const string writefile = params_test.
get_string(
"config_filename_output");
115 const string str_rand_type = params_test.
get_string(
"random_number_type");
116 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
117 int i_conf = params_test.
get_int(
"trajectory_number");
118 const int Ntraj = params_test.
get_int(
"trajectory_number_step");
119 const int i_save_conf = params_test.
get_int(
"save_config_interval");
120 const string str_vlevel = params_test.
get_string(
"verbose_level");
122 const bool do_check = params_test.
is_set(
"expected_result");
123 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
125 const string str_action_G_type = params_action_G.
get_string(
"action_type");
126 const string str_fopr_Nf2_type = params_fopr_Nf2.
get_string(
"fermion_type");
127 const string str_fopr_Nf2_prec_type = params_fopr_Nf2_prec.
get_string(
"fermion_type");
128 const string str_fopr_Nf1_type = params_fopr_Nf1.
get_string(
"fermion_type");
129 const string str_gmset_type = params_fopr_Nf2.
get_string(
"gamma_matrix_type");
130 const string str_proj_type = params_proj.
get_string(
"projection_type");
131 const string str_smear_type = params_smear.
get_string(
"smear_type");
133 const string str_solver_Nf2_MD_type = params_solver_Nf2_MD.
get_string(
"solver_type");
134 const string str_solver_Nf2_H_type = params_solver_Nf2_H.
get_string(
"solver_type");
135 const string str_solver_Nf2_MD_prec_type = params_solver_Nf2_MD_prec.
get_string(
"solver_type");
136 const string str_solver_Nf2_H_prec_type = params_solver_Nf2_H_prec.
get_string(
"solver_type");
137 const int Nlevels = params_integrator.
get_int(
"number_of_levels");
138 const std::vector<int> level_action = params_integrator.
get_int_vector(
"level_of_actions");
143 vout.
general(
vl,
" gconf_status = %s\n", str_gconf_status.c_str());
144 vout.
general(
vl,
" gconf_read = %s\n", str_gconf_read.c_str());
146 vout.
general(
vl,
" gconf_write = %s\n", str_gconf_write.c_str());
149 vout.
general(
vl,
" rand_type = %s\n", str_rand_type.c_str());
154 vout.
general(
vl,
" gmset_type = %s\n", str_gmset_type.c_str());
155 vout.
general(
vl,
" proj_type = %s\n", str_proj_type.c_str());
156 vout.
general(
vl,
" smear_type = %s\n", str_smear_type.c_str());
157 vout.
general(
vl,
" solver_Nf2_MD_type = %s\n", str_solver_Nf2_MD_type.c_str());
158 vout.
general(
vl,
" solver_Nf2_H_type = %s\n", str_solver_Nf2_H_type.c_str());
159 vout.
general(
vl,
" solver_Nf2_MD_prec_type = %s\n", str_solver_Nf2_MD_prec_type.c_str());
160 vout.
general(
vl,
" solver_Nf2_H_prec_type = %s\n", str_solver_Nf2_H_prec_type.c_str());
175 if ((str_solver_Nf2_MD_type ==
"CG") || (str_solver_Nf2_H_type ==
"CG") ||
176 (str_solver_Nf2_MD_prec_type ==
"CG") || (str_solver_Nf2_H_prec_type ==
"CG")) {
182 if (str_proj_type ==
"Stout_SU3") {
196 if (str_gconf_status ==
"Continue") {
198 }
else if (str_gconf_status ==
"Cold_start") {
200 }
else if (str_gconf_status ==
"Hot_start") {
203 vout.
crucial(
vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
210 unique_ptr<Action> action_G(Action::New(str_action_G_type, params_action_G));
214 unique_ptr<Projection> proj(Projection::New(str_proj_type, params_proj));
215 unique_ptr<Smear> smear(Smear::New(str_smear_type, proj.get(), params_smear));
217 unique_ptr<ForceSmear> force_smear(ForceSmear::New(str_smear_type, proj.get(), params_smear));
219 unique_ptr<Director_Smear> dr_smear(
new Director_Smear(smear.get(), params_dr_smear));
223 unique_ptr<Fopr> fopr_Nf2(Fopr::New(str_fopr_Nf2_type, params_fopr_Nf2));
227 unique_ptr<Fopr> fopr_smear_Nf2(Fopr::New(
"Smeared", fopr_Nf2.get(), dr_smear.get()));
228 unique_ptr<Force> force_fopr_smear_Nf2(
new Force_F_Smeared(force_fopr_Nf2.get(), force_smear.get(), dr_smear.get()));
232 unique_ptr<Fopr> fopr_Nf2_eo(Fopr::New(str_fopr_Nf2_type +
"_eo", params_fopr_Nf2));
234 unique_ptr<Fopr> fopr_smear_Nf2_eo(Fopr::New(
"Smeared_eo", fopr_Nf2_eo.get(), dr_smear.get()));
236 unique_ptr<Solver> solver_Nf2_eo_MD(Solver::New(str_solver_Nf2_MD_type, fopr_smear_Nf2_eo.get(), params_solver_Nf2_MD));
237 unique_ptr<Fprop> fprop_Nf2_eo_MD(
new Fprop_Standard_eo(solver_Nf2_eo_MD.get()));
239 unique_ptr<Solver> solver_Nf2_eo_H(Solver::New(str_solver_Nf2_H_type, fopr_smear_Nf2_eo.get(), params_solver_Nf2_H));
243 unique_ptr<Fopr> fopr_Nf2_prec(Fopr::New(str_fopr_Nf2_prec_type, params_fopr_Nf2_prec));
247 unique_ptr<Fopr> fopr_smear_Nf2_prec(Fopr::New(
"Smeared", fopr_Nf2_prec.get(), dr_smear.get()));
248 unique_ptr<Force> force_fopr_smear_Nf2_prec(
new Force_F_Smeared(force_fopr_Nf2_prec.get(), force_smear.get(), dr_smear.get()));
252 unique_ptr<Fopr> fopr_Nf2_eo_prec(Fopr::New(str_fopr_Nf2_prec_type +
"_eo", params_fopr_Nf2_prec));
254 unique_ptr<Fopr> fopr_smear_Nf2_eo_prec(Fopr::New(
"Smeared_eo", fopr_Nf2_eo_prec.get(), dr_smear.get()));
256 unique_ptr<Solver> solver_Nf2_eo_MD_prec(Solver::New(str_solver_Nf2_MD_type, fopr_smear_Nf2_eo_prec.get(), params_solver_Nf2_MD));
257 unique_ptr<Fprop> fprop_Nf2_eo_MD_prec(
new Fprop_Standard_eo(solver_Nf2_eo_MD_prec.get()));
259 unique_ptr<Solver> solver_Nf2_eo_H_prec(Solver::New(str_solver_Nf2_H_type, fopr_smear_Nf2_eo_prec.get(), params_solver_Nf2_H));
260 unique_ptr<Fprop> fprop_Nf2_eo_H_prec(
new Fprop_Standard_eo(solver_Nf2_eo_H_prec.get()));
265 unique_ptr<Action> action_F_Nf2_prec(
267 force_fopr_smear_Nf2_prec.get(),
268 fprop_Nf2_eo_MD_prec.get(),
269 fprop_Nf2_eo_H_prec.get() ));
273 unique_ptr<Action> action_F_Nf2_d(
275 force_fopr_smear_Nf2_prec.get(),
276 fopr_smear_Nf2.get(),
277 force_fopr_smear_Nf2.get(),
278 fprop_Nf2_eo_H_prec.get(),
279 fprop_Nf2_eo_MD.get(),
280 fprop_Nf2_eo_H.get() ));
283 unique_ptr<Fopr> fopr_Nf1(Fopr::New(str_fopr_Nf1_type, params_fopr_Nf1));
289 unique_ptr<Fopr> fopr_r1(Fopr::New(
"Rational", fopr_Nf1.get(), params_rational_H));
290 unique_ptr<Fopr> fopr_smear_Nf1_langev(Fopr::New(
"Smeared", fopr_r1.get(), dr_smear.get()));
293 unique_ptr<Fopr> fopr_r2(Fopr::New(
"Rational", fopr_Nf1.get(), params_rational_MD));
294 unique_ptr<Fopr> fopr_smear_Nf1_H(Fopr::New(
"Smeared", fopr_r2.get(), dr_smear.get()));
296 unique_ptr<Force> force_fopr_Nf1_MD(
new Force_F_Rational(fopr_Nf1.get(), force_fopr_Nf1.get(), params_rational_MD));
297 unique_ptr<Force> force_fopr_smear_Nf1_MD(
new Force_F_Smeared(force_fopr_Nf1_MD.get(), force_smear.get(), dr_smear.get()));
300 unique_ptr<Action> action_F_Nf1(
new Action_F_Rational(fopr_smear_Nf1_langev.get(), fopr_smear_Nf1_H.get(), force_fopr_smear_Nf1_MD.get()));
304 actions.
append(level_action[0], action_F_Nf2_d.get());
305 actions.
append(level_action[1], action_F_Nf2_prec.get());
306 actions.
append(level_action[2], action_F_Nf1.get());
307 actions.
append(level_action[3], action_G.get());
309 std::vector<Director *> directors(1);
310 directors[0] =
static_cast<Director *
>(dr_smear.get());
312 unique_ptr<Builder_Integrator> builder(
new Builder_Integrator(actions, directors, params_integrator));
320 HMC_General hmc(actions, directors, integrator, rand.get(), params_hmc);
331 for (
int traj = 0; traj < Ntraj; ++traj) {
333 vout.
general(
vl,
"---------------------------------------------------\n");
338 if ((i_conf + traj + 1) % i_save_conf == 0) {