Bridge++  Ver. 1.3.x
action_F_Rational.h
Go to the documentation of this file.
1 
14 #ifndef ACTION_F_RATIONAL_INCLUDED
15 #define ACTION_F_RATIONAL_INCLUDED
16 
17 #include "action.h"
18 #include "fopr_Rational.h"
19 #include "force_F_Rational.h"
20 
21 #include "bridgeIO.h"
22 using Bridge::vout;
23 
25 
41 //- parameters class
43 {
44  public:
46 };
47 //- end
48 
49 class Action_F_Rational : public Action {
50  public:
51  static const std::string class_name;
52 
53  private:
54  // rational approximation parameters:
55  int m_Np; // number of poles in rational approx.
56  int m_n_exp, m_d_exp; // numerator and denominator of the exponent
57  double m_x_min, m_x_max; // valid range of approximate sign function
58  int m_Niter; // max iteration of shiftsolver
59  double m_Stop_cond; // stopping condition of shift solver
60  std::string m_label; // label of action
61 
67 
69 
71 
72  public:
74  Action_F_Rational(Fopr *fopr, Force *fopr_force) :
75  Action()
76  {
77  m_fopr = fopr;
78  m_fopr_force = fopr_force;
79  }
80 
82  Action()
83  {
84  m_fopr = fopr.get();
85  m_fopr_force = fopr_force.get();
86  }
87 
90  {
91  tidyup();
92  }
93 
95  void set_parameters(const Parameters& params);
96  void set_parameters(int Np, int n_exp, int d_exp,
97  double x_min, double x_max,
98  int Niter, double Stop_cond);
99 
101  void set_label(std::string label)
102  {
103  m_label = label;
104  vout.detailed(m_vl, " label: %s\n", m_label.c_str());
105  }
106 
108  std::string get_label()
109  {
110  return m_label;
111  }
112 
114  void set_config(Field *U)
115  {
116  m_U = U;
117  m_fopr->set_config(U);
118  }
119 
121  double langevin(RandomNumbers *);
122 
124  double calcH();
125 
127  const Field force();
128 
129  private:
130 
132  void setup();
133 
135  void tidyup();
136 };
137 #endif
Fermion operator for rational approximation.
Definition: fopr_Rational.h:48
BridgeIO vout
Definition: bridgeIO.cpp:278
action class for rational HMC.
void detailed(const char *format,...)
Definition: bridgeIO.cpp:82
static const std::string class_name
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:39
Base class of fermion force calculation.
Definition: force.h:31
std::string get_label()
returns the label of action.
Class for parameters.
Definition: parameters.h:38
const Field force()
returns the force for updating conjugate momentum.
double calcH()
calculation of Hamiltonian.
Base class of HMC action class family.
Definition: action.h:42
void set_config(Field *U)
setting gauge configuration.
Fopr_Rational * m_fopr_H
pointer get() const
void tidyup()
destruct class instances constructed in setup()
double langevin(RandomNumbers *)
Langevin step called at the beginning of HMC.
void set_parameters(const Parameters &params)
setting parameters and creating class instances.
Bridge::VerboseLevel m_vl
Definition: action.h:81
Base class of random number generators.
Definition: randomNumbers.h:39
void setup()
creating instances. called from set_parameters().
~Action_F_Rational()
destructor. constructed instances are deconstructed in tydyup().
Fopr_Rational * m_fopr_langev
Action_F_Rational(Fopr *fopr, Force *fopr_force)
constructor requires pointers to Fopr and Force instances.
Action_F_Rational(unique_ptr< Fopr > &fopr, unique_ptr< Force > &fopr_force)
void set_label(std::string label)
set the label of action.
Base class of fermion operator family.
Definition: fopr.h:49
Force_F_Rational * m_force_rational