44 const std::string filename_input =
"test_Eigensolver.yaml";
50 #ifdef USE_TESTMANAGER_AUTOREGISTER
52 #if defined(USE_GROUP_SU2)
80 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
81 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
82 const string readfile = params_test.
get_string(
"config_filename_input");
83 const string str_rand_type = params_test.
get_string(
"random_number_type");
84 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
85 const string str_vlevel = params_test.
get_string(
"verbose_level");
87 const bool do_check = params_test.
is_set(
"expected_result");
88 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
90 const string str_fopr_type = params_fopr.
get_string(
"fermion_type");
91 const string str_gmset_type = params_fopr.
get_string(
"gamma_matrix_type");
92 const string str_proj_type = params_proj.
get_string(
"projection_type");
93 const string str_smear_type = params_smear.
get_string(
"smear_type");
94 const int Nsmear = params_dr_smear.
get_int(
"number_of_smearing");
95 const string str_sortfield_type = params_irlanczos.
get_string(
"eigensolver_mode");
96 const int Nk = params_irlanczos.
get_int(
"number_of_wanted_eigenvectors");
97 const int Np = params_irlanczos.
get_int(
"number_of_working_eigenvectors");
102 vout.
general(
vl,
" gconf_status = %s\n", str_gconf_status.c_str());
103 vout.
general(
vl,
" gconf_read = %s\n", str_gconf_read.c_str());
105 vout.
general(
vl,
" rand_type = %s\n", str_rand_type.c_str());
108 vout.
general(
vl,
" gmset_type = %s\n", str_gmset_type.c_str());
109 vout.
general(
vl,
" proj_type = %s\n", str_proj_type.c_str());
110 vout.
general(
vl,
" smear_type = %s\n", str_smear_type.c_str());
111 vout.
general(
vl,
" sortfield_type = %s\n", str_sortfield_type.c_str());
123 if ((Nsmear > 0) && (str_proj_type ==
"Stout_SU3")) {
137 if (str_gconf_status ==
"Continue") {
139 }
else if (str_gconf_status ==
"Cold_start") {
141 }
else if (str_gconf_status ==
"Hot_start") {
144 vout.
crucial(
vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
149 unique_ptr<Projection> proj(Projection::New(str_proj_type, params_all.
lookup(
"Projection")));
150 unique_ptr<Smear> smear(Smear::New(str_smear_type, proj.get(), params_all.
lookup(
"Smear")));
151 unique_ptr<Director_Smear> dr_smear(
new Director_Smear(smear.get(), params_all.
lookup(
"Director_Smear")));
152 dr_smear->set_config(&U);
154 const Field_G *Usmear = (
Field_G *)dr_smear->getptr_smearedConfig(Nsmear);
160 unique_ptr<Fopr> fopr(Fopr::New(str_fopr_type, params_fopr));
161 fopr->set_config(&U);
173 const int NFin = b2.
nin();
174 const int NFvol = b2.
nvol();
175 const int NFex = b2.
nex();
177 const int Nm = Nk + Np;
178 std::vector<double> TDa(Nm);
180 std::vector<Field> vk(Nm);
181 for (
int k = 0; k < Nm; ++k) {
182 vk[k].reset(NFin, NFvol, NFex);
187 eigen->solve(TDa, vk, Nsbt, Nconv, (
Field)b2);
189 for (
int i = 0; i < Nsbt + 1; ++i) {
190 Field v(NFin, NFvol, NFex);
192 fopr->mult(v, vk[i]);
193 axpy(v, -TDa[i], vk[i]);
194 double vv = v.
norm2();
196 vout.
general(
vl,
"Eigenvalues: %4d %20.14f %20.15e \n", i, TDa[i], vv);
199 const double result = TDa[0];