35 namespace Test_TopologicalCharge {
40 const std::string filename_input =
"test_TopologicalCharge.yaml";
46 #ifdef USE_TESTMANAGER_AUTOREGISTER
48 #if defined(USE_GROUP_SU2)
73 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
74 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
75 const string readfile = params_test.
get_string(
"config_filename_input");
76 const string str_rand_type = params_test.
get_string(
"random_number_type");
77 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
78 const int Nsmear = params_test.
get_int(
"number_of_max_smearing");
79 const int Nmeas = params_test.
get_int(
"number_of_measurement_step");
80 const string str_vlevel = params_test.
get_string(
"verbose_level");
82 const bool do_check = params_test.
is_set(
"expected_result");
83 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
85 const string str_proj_type = params_proj.
get_string(
"projection_type");
86 const string str_smear_type = params_smear.
get_string(
"smear_type");
91 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
92 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
93 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
94 vout.
general(vl,
" rand_type = %s\n", str_rand_type.c_str());
98 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
99 vout.
general(vl,
" proj_type = %s\n", str_proj_type.c_str());
100 vout.
general(vl,
" smear_type = %s\n", str_smear_type.c_str());
119 if (str_gconf_status ==
"Continue") {
121 }
else if (str_gconf_status ==
"Cold_start") {
123 }
else if (str_gconf_status ==
"Hot_start") {
126 vout.
crucial(vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
151 for (
int i_smear = 0; i_smear <= Nsmear; ++i_smear) {
153 if (i_smear == 0)
copy(Usmear, Uorg);
154 if (i_smear > 0) smear->
smear(Usmear, Uorg);
156 if ((i_smear % Nmeas) == 0) {
157 result = topological_charge->
measure(Usmear);
159 vout.
general(vl,
"i_smear,Q = %d %20.16e\n", i_smear, result);
174 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
void detailed(const char *format,...)
virtual void set_parameters(const Parameters ¶m)=0
void general(const char *format,...)
virtual void set_parameters(const Parameters &)=0
double measure(const Field_G &U)
main function to measure Topological Charge. The field strength is constructed inside the function...
int get_int(const string &key) const
void copy(Field &y, const Field &x)
copy(y, x): y = x
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 read(Field_G *U, const string &filename=string())
unsigned long get_unsigned_long(const string &key) const
double get_double(const string &key) const
virtual void smear(Field_G &, const Field_G &)=0
int non_NULL(const std::string v)
bool is_set(const string &key) const
void crucial(const char *format,...)
static void read(const std::string ¶ms_file, Parameters ¶ms)
int verify(const double result, const double expected, double eps)
virtual void set_parameters(const Parameters ¶ms)
setting parameters.
int topological_charge(void)
GaugeConfig class for file I/O of gauge configuration.
string get_string(const string &key) const
const std::string test_name
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
static VerboseLevel set_verbose_level(const std::string &str)
Topological Charge measurement.