Go to the documentation of this file.
34 const std::string filename_input =
"test_Rational_Approx.yaml";
40 #ifdef USE_TESTMANAGER_AUTOREGISTER
42 #if defined(USE_GROUP_SU2)
62 const string str_vlevel = params_test.
get_string(
"verbose_level");
64 const bool do_check = params_test.
is_set(
"expected_result");
65 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
67 const int n_exp = params_rational.
get_int(
"exponent_numerator");
68 const int d_exp = params_rational.
get_int(
"exponent_denominator");
69 const double x_min = params_rational.
get_double(
"lower_bound");
70 const double x_max = params_rational.
get_double(
"upper_bound");
71 const int Npoint = params_rational.
get_int(
"number_of_partitions");
95 const double dx = (x_max - x_min) / Npoint;
96 const double p_exp = ((double)n_exp) / ((double)d_exp);
100 for (
int j = 0; j < Npoint + 1; ++j) {
101 double y1 = rational.
func(x);
102 double y2 = pow(x, p_exp);
104 vout.
general(
vl,
"x,rational,x^(n/d) = %12.8f %12.8f %12.8f \n", x, y1, y2);
109 const double result = x;
int verify(const double result, const double expected, double eps)
int get_int(const string &key) const
void detailed(const char *format,...)
const std::string test_name
double func(const double x)
static void read(const std::string ¶ms_file, Parameters ¶ms)
double get_double(const string &key) const
static VerboseLevel set_verbose_level(const std::string &str)
bool is_set(const string &key) const
string get_string(const string &key) const
Test of rational approximation of fermion operators.
Determionation of coefficients of rational approximation.
void general(const char *format,...)
Parameters lookup(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
static bool RegisterTest(const std::string &key, const Test_function func)