51 const std::string
test_name =
"Spectrum.Overlap.Hadron2ptFunction";
55 const std::string filename_input =
"test_Spectrum_Overlap_Hadron2ptFunction.yaml";
61 #ifdef USE_TESTMANAGER_AUTOREGISTER
63 #if defined(USE_GROUP_SU2)
93 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
94 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
95 const string readfile = params_test.
get_string(
"config_filename_input");
96 const string str_rand_type = params_test.
get_string(
"random_number_type");
97 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
98 const string str_vlevel = params_test.
get_string(
"verbose_level");
100 const bool do_check = params_test.
is_set(
"expected_result");
101 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
103 const string str_gfix_type = params_gfix.
get_string(
"gauge_fixing_type");
105 const string str_gmset_type = params_overlap.
get_string(
"gamma_matrix_type");
106 const string str_solver_type = params_solver.
get_string(
"solver_type");
107 const string str_source_type = params_source.
get_string(
"source_type");
112 vout.
general(
vl,
" gconf_status = %s\n", str_gconf_status.c_str());
113 vout.
general(
vl,
" gconf_read = %s\n", str_gconf_read.c_str());
115 vout.
general(
vl,
" rand_type = %s\n", str_rand_type.c_str());
118 vout.
general(
vl,
" gfix_type = %s\n", str_gfix_type.c_str());
119 vout.
general(
vl,
" gmset_type = %s\n", str_gmset_type.c_str());
120 vout.
general(
vl,
" solver_type = %s\n", str_solver_type.c_str());
121 vout.
general(
vl,
" source_type = %s\n", str_source_type.c_str());
132 if (str_solver_type ==
"CG") {
137 if ((str_gfix_type ==
"Coulomb") || (str_gfix_type ==
"Landau")) {
151 if (str_gconf_status ==
"Continue") {
153 }
else if (str_gconf_status ==
"Cold_start") {
155 }
else if (str_gconf_status ==
"Hot_start") {
158 vout.
crucial(
vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
166 unique_ptr<GaugeFixing> gfix(GaugeFixing::New(str_gfix_type, params_gfix));
174 unique_ptr<GammaMatrixSet> gmset(GammaMatrixSet::New(str_gmset_type));
186 unique_ptr<Fopr> fopr_overlap(Fopr::New(
"Overlap", params_overlap));
187 fopr_overlap->set_config(&U);
190 unique_ptr<Solver>
solver(Solver::New(str_solver_type, fopr_overlap.get(), params_solver));
192 unique_ptr<Source> source(Source::New(str_source_type, params_source));
202 std::vector<Field_F> sq(Nc * Nd);
203 for (
int i_cd = 0; i_cd < Nc * Nd; ++i_cd) {
211 int Nin = fopr_overlap->field_nin();
212 int Nex = fopr_overlap->field_nex();
214 Field b(Nin, Nvol, Nex);
215 Field y(Nin, Nvol, Nex);
219 for (
int ispin = 0; ispin < Nd; ++ispin) {
220 for (
int icolor = 0; icolor < Nc; ++icolor) {
221 int icd = icolor + Nc * ispin;
227 fopr_overlap->set_mode(
"D");
228 solver->solve(sq[icd], b, Nconv, diff);
230 fopr_overlap->set_mode(
"D");
231 fopr_overlap->mult(y, sq[icd]);
236 icolor, ispin, Nconv, diff, diff2);
245 const double result = corr.
meson_all(sq, sq);