Bridge++  Ver. 1.3.x
fopr_Rational.h
Go to the documentation of this file.
1 
15 #ifndef FOPR_RATIONAL_INCLUDED
16 #define FOPR_RATIONAL_INCLUDED
17 
18 #include "fopr.h"
19 #include "field_G.h"
20 #include "shiftsolver_CG.h"
21 #include "math_Rational.h"
22 
23 #include "bridgeIO.h"
24 using Bridge::vout;
25 
26 //- parameters class
27 class Parameters_Fopr_Rational : virtual public Parameters
28 {
29  public:
31 };
32 //- end
33 
35 
48 class Fopr_Rational : public Fopr
49 {
50  public:
51  static const std::string class_name;
52 
53  private:
54  int m_Np; // number of poles in rational approx.
55  int m_n_exp, m_d_exp; // numerator and denominator of the exponent
56  double m_x_min, m_x_max; // valid range of approximate sign function
57  int m_Niter; // max iteration of shiftsolver
58  double m_Stop_cond; // stopping condition of shift solver
59 
62 
63  double m_a0;
64  std::vector<double> m_cl;
65  std::vector<double> m_bl;
66  std::vector<Field> m_xq;
67 
68  public:
70  : Fopr(), m_fopr(fopr) {}
71 
73  : Fopr(), m_fopr(fopr.get()) {}
74 
76  {
77  delete m_solver;
78  }
79 
80  void set_parameters(const Parameters& params);
81  void set_parameters(int Np, int n_exp, int d_exp, double x_min, double x_max,
82  int Niter, double Stop_cond);
83 
84  void set_config(Field *U)
85  {
86  m_fopr->set_config(U);
87  }
88 
90  {
91  m_fopr->set_config(U.get());
92  }
93 
94  void mult(Field& v, const Field& f);
95 
96 
97  void mult_dag(Field& v, const Field& f)
98  {
99  mult(v, f);
100  }
101 
102  double func(double x);
103 
104  int field_nvol() { return m_fopr->field_nvol(); }
105  int field_nin() { return m_fopr->field_nin(); }
106  int field_nex() { return m_fopr->field_nex(); }
107 
108  private:
109  void init_parameters();
110 };
111 #endif
Fermion operator for rational approximation.
Definition: fopr_Rational.h:48
BridgeIO vout
Definition: bridgeIO.cpp:278
void set_config(unique_ptr< Field_G > &U)
Definition: fopr_Rational.h:89
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
std::vector< Field > m_xq
Definition: fopr_Rational.h:66
Container of Field-type object.
Definition: field.h:39
Multishift Conjugate Gradient solver.
int field_nvol()
returns the volume for which the fermion operator is defined.
void init_parameters()
Class for parameters.
Definition: parameters.h:38
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
std::vector< double > m_cl
Definition: fopr_Rational.h:64
virtual int field_nin()=0
returns the on-site d.o.f. for which the fermion operator is defined.
double m_Stop_cond
Definition: fopr_Rational.h:58
Shiftsolver_CG * m_solver
Definition: fopr_Rational.h:61
void set_config(Field *U)
setting pointer to the gauge configuration.
Definition: fopr_Rational.h:84
pointer get() const
virtual int field_nex()=0
returns the external d.o.f. for which the fermion operator is defined.
Fopr_Rational(unique_ptr< Fopr > &fopr)
Definition: fopr_Rational.h:72
Fopr_Rational(Fopr *fopr)
Definition: fopr_Rational.h:69
double func(double x)
static const std::string class_name
Definition: fopr_Rational.h:51
void set_parameters(const Parameters &params)
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
Definition: fopr_Rational.h:97
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
std::vector< double > m_bl
Definition: fopr_Rational.h:65
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
Base class of fermion operator family.
Definition: fopr.h:49
virtual int field_nvol()=0
returns the volume for which the fermion operator is defined.