42 const std::string
test_name =
"Spectrum.Overlap.CheckSignFunction";
46 const std::string filename_input =
"test_Spectrum_Overlap_CheckSignFunction.yaml";
52 #ifdef USE_TESTMANAGER_AUTOREGISTER
54 #if defined(USE_GROUP_SU2)
81 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
82 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
83 const string readfile = params_test.
get_string(
"config_filename_input");
84 const string str_rand_type = params_test.
get_string(
"random_number_type");
85 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
86 const string str_vlevel = params_test.
get_string(
"verbose_level");
88 const bool do_check = params_test.
is_set(
"expected_result");
89 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
91 const string str_gfix_type = params_gfix.
get_string(
"gauge_fixing_type");
92 const string str_gmset_type = params_wilson.
get_string(
"gamma_matrix_type");
93 const string str_source_type = params_source.
get_string(
"source_type");
98 vout.
general(
vl,
" gconf_status = %s\n", str_gconf_status.c_str());
99 vout.
general(
vl,
" gconf_read = %s\n", str_gconf_read.c_str());
101 vout.
general(
vl,
" rand_type = %s\n", str_rand_type.c_str());
104 vout.
general(
vl,
" gfix_type = %s\n", str_gfix_type.c_str());
105 vout.
general(
vl,
" gmset_type = %s\n", str_gmset_type.c_str());
106 vout.
general(
vl,
" source_type = %s\n", str_source_type.c_str());
117 if ((str_gfix_type ==
"Coulomb") || (str_gfix_type ==
"Landau")) {
131 if (str_gconf_status ==
"Continue") {
133 }
else if (str_gconf_status ==
"Cold_start") {
135 }
else if (str_gconf_status ==
"Hot_start") {
138 vout.
crucial(
vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
146 unique_ptr<GaugeFixing> gfix(GaugeFixing::New(str_gfix_type, params_gfix));
154 unique_ptr<Fopr> fopr_w(
new Fopr_Wilson(params_wilson));
155 fopr_w->set_config(&U);
158 std::vector<double> TDa;
159 std::vector<Field> vk;
165 unique_ptr<Fopr> fopr_sign(
new Fopr_Sign(fopr_w.get(), params_overlap));
166 fopr_sign->set_config(&U);
169 unique_ptr<Source> source(Source::New(str_source_type, params_source));
176 int Nin = fopr_w->field_nin();
177 int Nex = fopr_w->field_nex();
180 Field b(Nin, Nvol, Nex);
181 Field xq(Nin, Nvol, Nex);
182 Field xq2(Nin, Nvol, Nex);
188 for (
int ispin = 0; ispin < 1; ++ispin) {
189 for (
int icolor = 0; icolor < 1; ++icolor) {
193 int icd = icolor + Nc * ispin;
197 fopr_sign->mult(xq, b);
198 fopr_sign->mult(xq2, xq);
202 double xq_norm = xq2.
norm2();
205 if (ith == 0) result = xq_norm;