65 const std::string
test_name =
"HMC.Clover_Isochemical.RHMC_Nf2p1";
69 const std::string filename_input =
"test_HMC_Clover_Isochemical_RHMC_Nf2p1.yaml";
70 const std::string filename_output =
"stdout";
72 class Parameters_Test_HMC_Clover_Isochemical :
public Parameters {
74 Parameters_Test_HMC_Clover_Isochemical()
76 Register_string(
"gauge_config_status",
"NULL");
78 Register_string(
"gauge_config_type_input",
"NULL");
79 Register_string(
"config_filename_input",
"NULL");
81 Register_string(
"gauge_config_type_output",
"NULL");
82 Register_string(
"config_filename_output",
"NULL");
84 Register_int(
"trajectory_number", 0);
85 Register_int(
"trajectory_number_step", 0);
86 Register_int(
"save_config_interval", 0);
88 Register_int(
"seed_for_noise", 0);
89 Register_int(
"number_of_noises", 0);
91 Register_string(
"verbose_level",
"NULL");
93 Register_double(
"expected_result", 0.0);
101 #ifdef USE_TESTMANAGER_AUTOREGISTER
103 #if defined(USE_GROUP_SU2)
155 const string str_gconf_status = params_test->
get_string(
"gauge_config_status");
156 const string str_gconf_read = params_test->
get_string(
"gauge_config_type_input");
157 const string readfile = params_test->
get_string(
"config_filename_input");
158 const string str_gconf_write = params_test->
get_string(
"gauge_config_type_output");
159 const string writefile = params_test->
get_string(
"config_filename_output");
160 int i_conf = params_test->
get_int(
"trajectory_number");
161 const int Ntraj = params_test->
get_int(
"trajectory_number_step");
162 const int i_save_conf = params_test->
get_int(
"save_config_interval");
163 int i_seed_noise = params_test->
get_int(
"seed_for_noise");
164 const string str_vlevel = params_test->
get_string(
"verbose_level");
166 const bool do_check = params_test->
is_set(
"expected_result");
167 const double expected_result = do_check ? params_test->
get_double(
"expected_result") : 0.0;
169 const string str_action_G_type = params_action_G->
get_string(
"action_type");
170 const string str_fopr_Nf2_type = params_fopr_Nf2->
get_string(
"fermion_type");
171 const string str_fopr_Nf2_prec_type = params_fopr_Nf2_prec->
get_string(
"fermion_type");
172 const string str_fopr_Nf1_type = params_fopr_Nf1->
get_string(
"fermion_type");
173 const string str_gmset_type = params_fopr_Nf2->
get_string(
"gamma_matrix_type");
174 const string str_proj_type = params_proj->
get_string(
"projection_type");
175 const string str_smear_type = params_smear->
get_string(
"smear_type");
176 const string str_solver_MD_type = params_solver_MD->
get_string(
"solver_type");
177 const string str_solver_H_type = params_solver_H->
get_string(
"solver_type");
178 const int Nlevels = params_integrator->
get_int(
"number_of_levels");
179 const std::vector<int> level_action = params_integrator->
get_int_vector(
"level_of_actions");
184 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
185 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
186 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
187 vout.
general(vl,
" gconf_write = %s\n", str_gconf_write.c_str());
188 vout.
general(vl,
" writefile = %s\n", writefile.c_str());
191 vout.
general(vl,
" i_save_conf = %d\n", i_save_conf);
192 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
193 vout.
general(vl,
" gmset_type = %s\n", str_gmset_type.c_str());
194 vout.
general(vl,
" proj_type = %s\n", str_proj_type.c_str());
195 vout.
general(vl,
" smear_type = %s\n", str_smear_type.c_str());
196 vout.
general(vl,
" solver_MD_type = %s\n", str_solver_MD_type.c_str());
197 vout.
general(vl,
" solver_H_type = %s\n", str_solver_H_type.c_str());
207 vout.
crucial(vl,
"%s: Input parameters have not been set.\n", test_name.c_str());
217 if (str_gconf_status ==
"Continue") {
219 }
else if (str_gconf_status ==
"Cold_start") {
221 }
else if (str_gconf_status ==
"Hot_start") {
222 int i_seed_noise = 1234567;
226 vout.
crucial(vl,
"%s: unsupported gconf status \"%s\".\n", test_name.c_str(), str_gconf_status.c_str());
240 unique_ptr<Fopr> fopr_Nf2_prec(Fopr::New(str_fopr_Nf2_prec_type, str_gmset_type));
261 unique_ptr<Fopr> fopr_smear_prec(Fopr::New(
"Smeared", fopr_Nf2_prec, dr_smear));
285 fprop_MD_prec, fprop_H_prec));
289 fopr_smear, force_fopr_smear,
320 actions.
append(level_action[0], action_F_Nf2_d);
321 actions.
append(level_action[1], action_F_Nf2_prec);
322 actions.
append(level_action[2], action_F_Nf1);
323 actions.
append(level_action[3], action_G);
325 std::vector<Director *> directors(1);
335 HMC_General hmc(actions, directors, integrator, rand);
353 vout.
general(vl,
"HMC start: Ntraj = %d\n", Ntraj);
356 vout.
general(vl,
"Polyakov loop = %e %e\n", real(ploop0), imag(ploop0));
359 double result_quark_suscept0 = quark_suscept->
measure();
362 for (
int traj = 0; traj < Ntraj; ++traj) {
364 vout.
general(vl,
"---------------------------------------------------\n");
369 if ((i_conf + traj + 1) % i_save_conf == 0) {
375 vout.
general(vl,
"Polyakov loop = %e %e\n", real(ploop1), imag(ploop1));
378 double result_quark_suscept1 = quark_suscept->
measure();
389 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_config(Field *)=0
setting pointer to the gauge configuration.
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
Base class of Integrator class family.
virtual void set_parameters(const Parameters ¶ms)=0
std::vector< int > get_int_vector(const string &key) const
static bool RegisterTest(const std::string &key, const Test_function func)
void set_parameters(const Parameters ¶ms)
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,...)
Quark number susceptibility for the Wilson-type fermion.
void write_file(Field *U, const string &filename)
virtual void set_parameters(const Parameters &)=0
double measure()
measure tr1 = Tr[D1*Sq], tr2 = Tr[D2*Sq], tr3 = Tr[D1*Sq*D1*Sq].
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)
lists of actions at respective integrator levels.
Manager of smeared configurations.
int verify(const double result, const double expected, double eps)
Test of HMC update for clover fermions with isochemical potential.
void set_parameters(const Parameters ¶ms)
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
dcomplex measure_ploop(Field_G &U)
Polyakov loop measurement.
HMC action for Hasenbusch preconditioned fermions.
GaugeConfig class for file I/O of gauge configuration.
Z2 Noise vector for trance calculation.
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)
const std::string test_name