46 const std::string
test_name =
"Spectrum.Hadron2ptFunction_eo";
69 #ifdef USE_TESTMANAGER_AUTOREGISTER
71 #if defined(USE_GROUP_SU2)
75 "Spectrum.Clover.Hadron2ptFunction_eo",
101 const int N_quark = params_test.
get_int(
"number_of_valence_quarks");
103 const std::string str_gconf_status = params_test.
get_string(
"gauge_config_status");
104 const std::string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
105 const vector<int> Nshift_origin = params_test.
get_int_vector(
"shift_origin");
106 const std::string readfile = params_test.
get_string(
"config_filename_input");
107 const std::string str_rand_type = params_test.
get_string(
"random_number_type");
108 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
109 const std::string str_vlevel = params_test.
get_string(
"verbose_level");
111 const bool do_check = params_test.
is_set(
"expected_result");
112 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
114 const std::string str_gfix_type = params_all.
lookup(
"GaugeFixing").
get_string(
"gauge_fixing_type");
115 const std::string str_proj_type = params_all.
lookup(
"Projection").
get_string(
"projection_type");
116 const std::string str_smear_type = params_all.
lookup(
"Smear").
get_string(
"smear_type");
117 const int Nsmear = params_all.
lookup(
"Director_Smear").
get_int(
"number_of_smearing");
122 vout.
general(
vl,
" gconf_status = %s\n", str_gconf_status.c_str());
123 vout.
general(
vl,
" gconf_read = %s\n", str_gconf_read.c_str());
125 for (
int mu = 0; mu < Ndim; ++mu) {
126 vout.
general(
vl,
" shift_origin[%d] = %d\n", mu, Nshift_origin[mu]);
128 vout.
general(
vl,
" rand_type = %s\n", str_rand_type.c_str());
131 vout.
general(
vl,
" gfix_type = %s\n", str_gfix_type.c_str());
132 vout.
general(
vl,
" proj_type = %s\n", str_proj_type.c_str());
133 vout.
general(
vl,
" smear_type = %s\n", str_smear_type.c_str());
135 vector<Parameters> params_quark;
136 for (
int iq = 0; iq < N_quark; ++iq) {
138 params_quark.push_back(params_all.
lookup(qlabel));
142 const std::string str_gmset_type = params_quark[0].lookup(
"Fopr").get_string(
"gamma_matrix_type");
143 vout.
general(
vl,
" gmset_type = %s\n", str_gmset_type.c_str());
145 for (
int iq = 0; iq < N_quark; ++iq) {
148 params_quark[iq].lookup(
"Solver").get_string(
"solver_type").c_str());
150 params_quark[iq].lookup(
"Source").get_string(
"source_type").c_str());
152 std::string str_solver_type = params_quark[iq].lookup(
"Solver").get_string(
"solver_type");
153 vout.
general(
vl,
" solver_type = %s\n", str_solver_type.c_str());
155 vector<int> source_position = params_quark[iq].lookup(
"Source").get_int_vector(
"source_position");
156 for (
int mu = 0; mu < Ndim; ++mu) {
157 vout.
general(
vl,
" source_position[%d] = %d\n", mu, source_position[mu]);
171 for (
int iq = 0; iq < N_quark; ++iq) {
172 std::string str_solver_type = params_quark[iq].lookup(
"Solver").get_string(
"solver_type");
174 if (str_solver_type ==
"CG") {
180 if ((Nsmear > 0) && (str_proj_type ==
"Stout_SU3")) {
187 if ((str_gfix_type ==
"Coulomb") || (str_gfix_type ==
"Landau")) {
201 if (str_gconf_status ==
"Continue") {
203 }
else if (str_gconf_status ==
"Cold_start") {
205 }
else if (str_gconf_status ==
"Hot_start") {
208 vout.
crucial(
vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
214 for (
int i_dir = 0; i_dir < Ndim; ++i_dir) {
215 for (
int i_shift = 0; i_shift < Nshift_origin[i_dir]; ++i_shift) {
217 shift.backward(Ushift, U, i_dir);
224 unique_ptr<Projection> proj(Projection::New(str_proj_type, params_all.
lookup(
"Projection")));
225 unique_ptr<Smear> smear(Smear::New(str_smear_type, proj.get(), params_all.
lookup(
"Smear")));
226 unique_ptr<Director_Smear> dr_smear(
new Director_Smear(smear.get(), params_all.
lookup(
"Director_Smear")));
227 dr_smear->set_config(&U);
229 const Field_G *Usmear = (
Field_G *)dr_smear->getptr_smearedConfig(Nsmear);
236 unique_ptr<GaugeFixing> gfix(GaugeFixing::New(str_gfix_type, params_all.
lookup(
"GaugeFixing")));
244 unique_ptr<GammaMatrixSet> gmset(GammaMatrixSet::New(str_gmset_type));
248 unique_ptr<Fopr> fopr;
249 unique_ptr<Fopr> fopr_eo;
250 unique_ptr<Solver>
solver;
251 unique_ptr<Fprop> fprop_eo;
252 unique_ptr<Source> source;
256 std::vector<QuarkType> quark(N_quark);
258 for (
int iq = 0; iq < N_quark; ++iq) {
263 quark[iq].fopr.reset(Fopr::New(params_fopr.
get_string(
"fermion_type"),
265 quark[iq].fopr->set_config(&U);
267 quark[iq].fopr_eo.reset(Fopr::New(params_fopr.
get_string(
"fermion_type") +
"_eo",
269 quark[iq].fopr_eo->set_config(&U);
271 quark[iq].solver.reset(Solver::New(params_solver.
get_string(
"solver_type"),
272 quark[iq].fopr_eo.get(),
277 quark[iq].source.reset(Source::New(params_source.
get_string(
"source_type"),
289 typedef std::vector<Field_F> PropagatorSet;
290 std::vector<PropagatorSet> sq(N_quark);
291 for (
int iq = 0; iq < N_quark; ++iq) {
292 sq[iq].resize(Nc * Nd);
294 for (
int i_cd = 0; i_cd < Nc * Nd; ++i_cd) {
295 sq[iq][i_cd].set(0.0);
299 for (
int iq = 0; iq < N_quark; ++iq) {
300 vout.
general(
vl,
"Solving quark propagator, flavor = %d:\n", iq + 1);
303 for (
int ispin = 0; ispin < Nd; ++ispin) {
304 for (
int icolor = 0; icolor < Nc; ++icolor) {
305 int i_cd = icolor + Nc * ispin;
308 quark[iq].source->
set(b, i_cd);
312 quark[iq].fprop_eo->invert_D(sq[iq][i_cd], b, Nconv, diff);
315 quark[iq].fopr->set_mode(
"D");
316 quark[iq].fopr->mult(y, sq[iq][i_cd]);
321 icolor, ispin, Nconv, diff, diff2);
330 std::vector<double> result(N_quark);
335 for (
int iq = 0; iq < N_quark; ++iq) {
336 vout.
general(
vl,
"Flavor combination = %d, %d\n", iq + 1, iq + 1);
337 result[iq] = corr.
meson_all(sq[iq], sq[iq]);
343 for (
int iq = 0; iq < N_quark; ++iq) {
344 for (
int jq = iq + 1; jq < N_quark; ++jq) {
345 vout.
general(
vl,
"Flavor combination = %d, %d\n", iq + 1, jq + 1);
346 double result_2 = corr.
meson_all(sq[iq], sq[jq]);