57 namespace Test_HMC_Clover_Isochemical {
58 const std::string
test_name =
"HMC.Clover_Isochemical.RHMC_Nf2p1";
62 const std::string filename_input =
"test_HMC_Clover_Isochemical_RHMC_Nf2p1.yaml";
68 #ifdef USE_TESTMANAGER_AUTOREGISTER
70 #if defined(USE_GROUP_SU2)
91 const Parameters params_test = params_all.
lookup(
"Test_HMC_Clover_Isochemical");
103 const Parameters params_solver_Nf2_MD_prec = params_all.
lookup(
"Solver_Nf2_MD_prec");
104 const Parameters params_solver_Nf2_H_prec = params_all.
lookup(
"Solver_Nf2_H_prec");
105 const Parameters params_integrator = params_all.
lookup(
"Builder_Integrator");
108 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
109 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
110 const string readfile = params_test.
get_string(
"config_filename_input");
111 const string str_gconf_write = params_test.
get_string(
"gauge_config_type_output");
112 const string writefile = params_test.
get_string(
"config_filename_output");
113 const string str_rand_type = params_test.
get_string(
"random_number_type");
114 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
115 int i_conf = params_test.
get_int(
"trajectory_number");
116 const int Ntraj = params_test.
get_int(
"trajectory_number_step");
117 const int i_save_conf = params_test.
get_int(
"save_config_interval");
118 const int i_seed_noise = params_test.
get_int(
"int_seed_for_noise");
119 const string str_vlevel = params_test.
get_string(
"verbose_level");
121 const bool do_check = params_test.
is_set(
"expected_result");
122 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
124 const string str_action_G_type = params_action_G.
get_string(
"action_type");
125 const string str_fopr_Nf2_type = params_fopr_Nf2.
get_string(
"fermion_type");
126 const string str_fopr_Nf2_prec_type = params_fopr_Nf2_prec.
get_string(
"fermion_type");
127 const string str_fopr_Nf1_type = params_fopr_Nf1.
get_string(
"fermion_type");
128 const string str_gmset_type = params_fopr_Nf2.
get_string(
"gamma_matrix_type");
129 const string str_proj_type = params_proj.
get_string(
"projection_type");
130 const string str_smear_type = params_smear.
get_string(
"smear_type");
131 const string str_solver_Nf2_MD_type = params_solver_Nf2_MD.
get_string(
"solver_type");
132 const string str_solver_Nf2_H_type = params_solver_Nf2_H.
get_string(
"solver_type");
133 const string str_solver_Nf2_MD_prec_type = params_solver_Nf2_MD_prec.
get_string(
"solver_type");
134 const string str_solver_Nf2_H_prec_type = params_solver_Nf2_H_prec.
get_string(
"solver_type");
135 const int Nlevels = params_integrator.
get_int(
"number_of_levels");
136 const std::vector<int> level_action = params_integrator.
get_int_vector(
"level_of_actions");
141 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
142 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
143 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
144 vout.
general(vl,
" gconf_write = %s\n", str_gconf_write.c_str());
145 vout.
general(vl,
" writefile = %s\n", writefile.c_str());
146 vout.
general(vl,
" rand_type = %s\n", str_rand_type.c_str());
150 vout.
general(vl,
" i_save_conf = %d\n", i_save_conf);
151 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
152 vout.
general(vl,
" gmset_type = %s\n", str_gmset_type.c_str());
153 vout.
general(vl,
" proj_type = %s\n", str_proj_type.c_str());
154 vout.
general(vl,
" smear_type = %s\n", str_smear_type.c_str());
155 vout.
general(vl,
" solver_Nf2_MD_type = %s\n", str_solver_Nf2_MD_type.c_str());
156 vout.
general(vl,
" solver_Nf2_H_type = %s\n", str_solver_Nf2_H_type.c_str());
157 vout.
general(vl,
" solver_Nf2_MD_prec_type = %s\n", str_solver_Nf2_MD_prec_type.c_str());
158 vout.
general(vl,
" solver_Nf2_H_prec_type = %s\n", str_solver_Nf2_H_prec_type.c_str());
179 if (str_gconf_status ==
"Continue") {
181 }
else if (str_gconf_status ==
"Cold_start") {
183 }
else if (str_gconf_status ==
"Hot_start") {
186 vout.
crucial(vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
221 unique_ptr<Solver> solver_Nf2_MD(Solver::New(str_solver_Nf2_MD_type, fopr_smear_Nf2));
231 unique_ptr<Fopr> fopr_Nf2_prec(Fopr::New(str_fopr_Nf2_prec_type, str_gmset_type));
237 unique_ptr<Fopr> fopr_smear_Nf2_prec(Fopr::New(
"Smeared", fopr_Nf2_prec, dr_smear));
240 unique_ptr<Solver> solver_Nf2_MD_prec(Solver::New(str_solver_Nf2_MD_prec_type, fopr_smear_Nf2_prec));
244 unique_ptr<Solver> solver_Nf2_H_prec(Solver::New(str_solver_Nf2_H_prec_type, fopr_smear_Nf2_prec));
251 fprop_Nf2_MD_prec, fprop_Nf2_H_prec));
255 fopr_smear_Nf2, force_fopr_smear_Nf2,
257 fprop_Nf2_MD, fprop_Nf2_H));
271 unique_ptr<Fopr> fopr_smear_Nf1_langev(Fopr::New(
"Smeared", fopr_r1, dr_smear));
284 new Action_F_Rational(fopr_smear_Nf1_langev, fopr_smear_Nf1_H, force_fopr_smear_Nf1_MD));
288 actions.
append(level_action[0], action_F_Nf2_d);
289 actions.
append(level_action[1], action_F_Nf2_prec);
290 actions.
append(level_action[2], action_F_Nf1);
291 actions.
append(level_action[3], action_G);
293 std::vector<Director *> directors(1);
303 HMC_General hmc(actions, directors, integrator, rand);
321 vout.
general(vl,
"HMC start: Ntraj = %d\n", Ntraj);
324 vout.
general(vl,
"Polyakov loop = %e %e\n", real(ploop0), imag(ploop0));
327 const double result_quark_suscept0 = quark_suscept->
measure();
330 for (
int traj = 0; traj < Ntraj; ++traj) {
332 vout.
general(vl,
"---------------------------------------------------\n");
337 if ((i_conf + traj + 1) % i_save_conf == 0) {
343 vout.
general(vl,
"Polyakov loop = %e %e\n", real(ploop1), imag(ploop1));
346 double result_quark_suscept1 = quark_suscept->
measure();
359 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
Random number generator base on M-series.
void detailed(const char *format,...)
virtual void set_parameters(const Parameters ¶m)=0
void set_parameters(const Parameters ¶ms)
void general(const char *format,...)
Force calculation for clover quark action.
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
General HMC update class.
virtual void set_parameters(const Parameters &)=0
int get_int(const string &key) const
bool append(const int level, Action *action)
virtual void set_parameters(const Parameters ¶m)=0
Base class of Integrator class family.
virtual void set_parameters(const Parameters ¶ms)=0
Parameters lookup(const string &key) const
static bool RegisterTest(const std::string &key, const Test_function func)
static bool initialize(const std::string &rng_type, unsigned long seed)
void set_parameters(const Parameters ¶ms)
Manager of commonly used data object in HMC.
void read(Field_G *U, const string &filename=string())
unsigned long get_unsigned_long(const string &key) const
double get_double(const string &key) const
std::string generate_filename(const char *fmt,...)
Polyakov loop measurement.
Quark number susceptibility for the Wilson-type fermion.
virtual void set_parameters(const Parameters &)=0
action class for RHMC, with externally constructed Fopr_Rational.
double measure()
measure tr1 = Tr[D1*Sq], tr2 = Tr[D2*Sq], tr3 = Tr[D1*Sq*D1*Sq].
int non_NULL(const std::string v)
bool is_set(const string &key) const
Get quark propagator for Fopr with lexical site index.
void crucial(const char *format,...)
virtual void set_parameters(const Parameters ¶ms)=0
static void read(const std::string ¶ms_file, Parameters ¶ms)
lists of actions at respective integrator levels.
Manager of smeared configurations.
int verify(const double result, const double expected, double eps)
void set_parameters(const Parameters ¶ms)
void write_file(Field_G *U, const string &filename)
Force calculation for smeared fermion operators.
int non_negative(const int v)
virtual void set_parameters(const Parameters &)=0
HMC action for Hasenbusch preconditioned fermions.
GaugeConfig class for file I/O of gauge configuration.
Z2 Noise vector for a trace calculation.
string get_string(const string &key) const
vector< int > get_int_vector(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
virtual void set_parameters(const Parameters &)=0
Builder of MD integrator for HMC.
Standard fermion action for HMC.
static VerboseLevel set_verbose_level(const std::string &str)
Force calculation for smeared fermion operators.
const std::string test_name
dcomplex measure_ploop(const Field_G &U)
Polyakov loop measurement.