46 const std::string
test_name =
"Eigensolver.Clover_SF";
50 const std::string filename_input =
"test_Eigensolver_Clover_SF.yaml";
51 const std::string filename_output =
"stdout";
53 class Parameters_Test_Eigensolver :
public Parameters {
55 Parameters_Test_Eigensolver()
57 Register_string(
"gauge_config_status",
"NULL");
58 Register_string(
"gauge_config_type_input",
"NULL");
59 Register_string(
"config_filename_input",
"NULL");
61 Register_string(
"verbose_level",
"NULL");
63 Register_double(
"expected_result", 0.0);
71 #ifdef USE_TESTMANAGER_AUTOREGISTER
73 #if defined(USE_GROUP_SU2)
109 const string str_gconf_status = params_test->
get_string(
"gauge_config_status");
110 const string str_gconf_read = params_test->
get_string(
"gauge_config_type_input");
111 const string readfile = params_test->
get_string(
"config_filename_input");
112 const string str_vlevel = params_test->
get_string(
"verbose_level");
114 const bool do_check = params_test->
is_set(
"expected_result");
115 const double expected_result = do_check ? params_test->
get_double(
"expected_result") : 0.0;
117 const string str_gmset_type = params_fopr->
get_string(
"gamma_matrix_type");
118 const string str_proj_type = params_proj->
get_string(
"projection_type");
119 const string str_smear_type = params_smear->
get_string(
"smear_type");
120 const string str_sortfield_type = params_irlanczos->
get_string(
"eigensolver_mode");
121 const int Nk = params_irlanczos->
get_int(
"number_of_wanted_eigenvectors");
122 const int Np = params_irlanczos->
get_int(
"number_of_working_eigenvectors");
127 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
128 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
129 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
130 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
131 vout.
general(vl,
" gmset_type = %s\n", str_gmset_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());
134 vout.
general(vl,
" sortfield_type = %s\n", str_sortfield_type.c_str());
142 vout.
crucial(vl,
"%s: input parameters have not been set.\n", test_name.c_str());
151 if (str_gconf_status ==
"Continue") {
153 }
else if (str_gconf_status ==
"Cold_start") {
155 }
else if (str_gconf_status ==
"Hot_start") {
156 int i_seed_noise = 1234567;
160 vout.
crucial(vl,
"%s: unsupported gconf status \"%s\".\n", test_name.c_str(), str_gconf_status.c_str());
192 std::vector<double> TDa(Nm);
193 std::vector<Field> vk(Nm);
197 int NFvol = b2.
nvol();
199 for (
int k = 0; k < Nm; ++k) {
200 vk[k].reset(NFin, NFvol, NFex);
205 eigen->
solve(TDa, vk, Nsbt, Nconv, (
Field)b2);
208 v.
reset(NFin, NFvol, NFex);
211 for (
int i = 0; i < Nsbt + 1; ++i) {
212 fopr_smear->
mult(v, vk[i]);
213 axpy(v, -TDa[i], vk[i]);
216 vout.
general(vl,
"Eigenvalues: %4d %20.14f %20.15e \n", i, TDa[i], vv);
219 double result = TDa[0];
227 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
Random number generator base on M-series.
Eigenvalue solver with Implicitly Restarted Lanczos algorithm.
void detailed(const char *format,...)
Test of eigenvalue solver.
const std::string test_name
void general(const char *format,...)
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
virtual void set_parameters(const Parameters &)=0
int get_int(const string &key) const
static Parameters * New(const std::string &realm)
void read_file(Field *U, const string &filename)
void set_random(RandomNumbers *rand)
Wilson-type fermion field.
static bool RegisterTest(const std::string &key, const Test_function func)
virtual void solve(std::vector< double > &TDa, std::vector< Field > &vk, int &Nsbt, int &Nconv, const Field &b)=0
bool is_set(const string &) const
double get_double(const string &key) const
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
virtual void set_parameters(const Parameters &)=0
int non_NULL(const std::string v)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void crucial(const char *format,...)
virtual void set_parameters(const Parameters ¶ms)=0
void Register_Parameters(const string &, Parameters *const)
Manager of smeared configurations.
int verify(const double result, const double expected, double eps)
virtual void mult(Field &, const Field &)=0
multiplies fermion operator to a given field (2nd argument)
virtual void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
static void read(const std::string ¶ms_file, Parameters *params)
GaugeConfig class for file I/O of gauge configuration.
string get_string(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
virtual void set_parameters(const Parameters &)=0
static VerboseLevel set_verbose_level(const std::string &str)