49 const std::string
test_name =
"Spectrum.Domainwall.Hadron2ptFunction";
53 const std::string filename_input =
"test_Spectrum_Domainwall_Hadron2ptFunction.yaml";
59 #ifdef USE_TESTMANAGER_AUTOREGISTER
61 #if defined(USE_GROUP_SU2)
83 const Parameters params_test = params_all.
lookup(
"Test_Spectrum_Domainwall");
89 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
90 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
91 const string readfile = params_test.
get_string(
"config_filename_input");
92 const string str_rand_type = params_test.
get_string(
"random_number_type");
93 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
94 const string str_vlevel = params_test.
get_string(
"verbose_level");
96 const bool do_check = params_test.
is_set(
"expected_result");
97 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
99 const string str_gfix_type = params_gfix.
get_string(
"gauge_fixing_type");
100 const string str_gmset_type = params_dw.
get_string(
"gamma_matrix_type");
101 const string str_solver_type = params_solver.
get_string(
"solver_type");
102 const string str_source_type = params_source.
get_string(
"source_type");
107 vout.
general(
vl,
" gconf_status = %s\n", str_gconf_status.c_str());
108 vout.
general(
vl,
" gconf_read = %s\n", str_gconf_read.c_str());
110 vout.
general(
vl,
" rand_type = %s\n", str_rand_type.c_str());
113 vout.
general(
vl,
" gfix_type = %s\n", str_gfix_type.c_str());
114 vout.
general(
vl,
" gmset_type = %s\n", str_gmset_type.c_str());
115 vout.
general(
vl,
" solver_type = %s\n", str_solver_type.c_str());
116 vout.
general(
vl,
" source_type = %s\n", str_source_type.c_str());
127 if ((str_gfix_type ==
"Coulomb") || (str_gfix_type ==
"Landau")) {
141 if (str_gconf_status ==
"Continue") {
143 }
else if (str_gconf_status ==
"Cold_start") {
145 }
else if (str_gconf_status ==
"Hot_start") {
148 vout.
crucial(
vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
156 unique_ptr<GaugeFixing> gfix(GaugeFixing::New(str_gfix_type, params_gfix));
164 unique_ptr<GammaMatrixSet> gmset(GammaMatrixSet::New(str_gmset_type));
176 fopr_dw->set_mode(
"D");
177 fopr_dw->set_config(&U);
181 fopr_dw->get_parameters(params_dw_tmp);
182 const string kernel_type = params_dw_tmp.
get_string(
"kernel_type");
183 const double M0 = params_dw_tmp.
get_double(
"domain_wall_height");
184 const double coeff_c = params_dw_tmp.
get_double(
"coefficient_c");
185 const int Ns = params_dw_tmp.
get_int(
"extent_of_5th_dimension");
188 double kappa = 1.0 / (8.0 - 2.0 * M0);
189 double one_over_2kappa = 4.0 - M0;
190 params_kernel.
set_double(
"hopping_parameter", kappa);
192 unique_ptr<Fopr> foprw(Fopr::New(kernel_type, params_kernel));
193 foprw->set_mode(
"D");
194 foprw->set_config(&U);
196 unique_ptr<Solver>
solver(Solver::New(str_solver_type, fopr_dw.get(), params_solver));
201 unique_ptr<Source> source(Source::New(str_source_type, params_source));
211 std::vector<Field_F> sq(Nc * Nd);
212 for (
int i_cd = 0; i_cd < Nc * Nd; ++i_cd) {
227 for (
int ispin = 0; ispin < Nd; ++ispin) {
228 for (
int icolor = 0; icolor < Nc; ++icolor) {
229 int i_cd = icolor + Nc * ispin;
231 source->set(b, i_cd);
241 fopr_dw->mult_chproj_4d(vtmp_p, b, +1);
242 fopr_dw->mult_chproj_4d(vtmp_m, b, -1);
244 foprw->mult(vtmp, vtmp_p);
245 axpy(vtmp_p, -one_over_2kappa * coeff_c, vtmp);
247 foprw->mult(vtmp, vtmp_m);
248 axpy(vtmp_m, -one_over_2kappa * coeff_c, vtmp);
250 copy(b5, 0, vtmp_p, 0);
251 copy(b5, Ns - 1, vtmp_m, 0);
255 fprop_lex->invert_D(x5, b5, Nconv, diff);
258 fopr_dw->set_mode(
"D");
259 fopr_dw->mult(y5, x5);
261 double diff2 = y5.
norm();
264 icolor, ispin, Nconv, diff, diff2);
268 copy(vtmp, 0, x5, 0);
269 fopr_dw->mult_chproj_4d(vtmp_m, vtmp, -1);
270 copy(vtmp, 0, x5, Ns - 1);
271 fopr_dw->mult_chproj_4d(vtmp_p, vtmp, +1);
273 copy(sq[i_cd], vtmp_m);
274 axpy(sq[i_cd], 1.0, vtmp_p);
283 const double result = corr.
meson_all(sq, sq);