39 namespace Test_Rational {
40 const std::string
test_name =
"Rational.Smeared_Rational";
44 const std::string filename_input =
"test_Rational_Smeared.yaml";
50 #ifdef USE_TESTMANAGER_AUTOREGISTER
52 #if defined(USE_GROUP_SU2)
71 const int NinF = 2 * Nc * Nd;
83 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
84 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
85 const string readfile = params_test.
get_string(
"config_filename_input");
86 const string str_rand_type = params_test.
get_string(
"random_number_type");
87 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
88 const string str_vlevel = params_test.
get_string(
"verbose_level");
90 const bool do_check = params_test.
is_set(
"expected_result");
91 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
93 const string str_gmset_type = params_clover.
get_string(
"gamma_matrix_type");
94 const string str_proj_type = params_proj.
get_string(
"projection_type");
95 const string str_smear_type = params_smear.
get_string(
"smear_type");
96 const string str_source_type = params_source.
get_string(
"source_type");
101 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
102 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
103 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
104 vout.
general(vl,
" rand_type = %s\n", str_rand_type.c_str());
106 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
107 vout.
general(vl,
" gmset_type = %s\n", str_gmset_type.c_str());
108 vout.
general(vl,
" proj_type = %s\n", str_proj_type.c_str());
109 vout.
general(vl,
" smear_type = %s\n", str_smear_type.c_str());
110 vout.
general(vl,
" source_type = %s\n", str_source_type.c_str());
129 if (str_gconf_status ==
"Continue") {
131 }
else if (str_gconf_status ==
"Cold_start") {
133 }
else if (str_gconf_status ==
"Hot_start") {
136 vout.
crucial(vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
177 Field xq(NinF, Nvol, 1), b(NinF, Nvol, 1);
178 Field v(NinF, Nvol, 1), w(NinF, Nvol, 1);
181 vout.
general(vl,
"Consistency check of smeared-rational and rational-smeared.\n");
188 const int icolor = 0;
192 int idx = icolor + Nc * ispin;
193 source->
set(b2, idx);
197 fopr_smear_2.
mult(v, b);
200 fopr_smear_1.
mult(w, v);
202 fopr_smear_2.
mult(v, w);
205 double vv = v.norm2();
217 const int icolor = 0;
221 int idx = icolor + Nc * ispin;
222 source->
set(b2, idx);
226 fopr_r_smear_1.
mult(v, b);
229 fopr_smear_1.
mult(w, v);
231 fopr_r_smear_1.
mult(v, w);
240 const double result = vv;
250 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
Fermion operator for rational approximation.
const std::string test_name
void detailed(const char *format,...)
int smeared_rational(void)
virtual void set_parameters(const Parameters ¶m)=0
void general(const char *format,...)
Container of Field-type object.
virtual void set_parameters(const Parameters &)=0
void set_mode(const std::string mode)
set the mode of fermion operator
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
Wilson-type fermion field.
smeared fermion operator.
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
void set_config(Field *U)
setting pointer to the gauge configuration.
virtual void set_parameters(const Parameters &)=0
int non_NULL(const std::string v)
bool is_set(const string &key) const
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void crucial(const char *format,...)
virtual void set_parameters(const Parameters ¶ms)=0
static void read(const std::string ¶ms_file, Parameters ¶ms)
void mult(Field &v, const Field &f)
multiply smeared fermion operator
Manager of smeared configurations.
int verify(const double result, const double expected, double eps)
void set_parameters(const Parameters ¶ms)
GaugeConfig class for file I/O of gauge configuration.
Base class of fermion operator family.
string get_string(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
void set_config(Field *U)
set pointer to original thin link variable
virtual void set_parameters(const Parameters &)=0
static VerboseLevel set_verbose_level(const std::string &str)
virtual void set(Field &, const int)=0