Bridge++  Ver. 1.3.x
action_F_Rational_Frame.cpp
Go to the documentation of this file.
1 
15 
16 #ifdef USE_PARAMETERS_FACTORY
17 #include "parameters_factory.h"
18 #endif
19 
20 //- parameter entries
21 namespace {
22  void append_entry(Parameters& param)
23  {
24  param.Register_string("verbose_level", "NULL");
25  }
26 
27 
28 #ifdef USE_PARAMETERS_FACTORY
29  bool init_param = ParametersFactory::Register("Action.F_Rational_Frame", append_entry);
30 #endif
31 }
32 //- end
33 
34 //- parameters class
36 //- end
37 
38 const std::string Action_F_Rational_frame::class_name = "Action_F_Rational_frame";
39 
40 //====================================================================
42 {
43  const string str_vlevel = params.get_string("verbose_level");
44 
45  m_vl = vout.set_verbose_level(str_vlevel);
46 }
47 
48 
49 //====================================================================
51 {
52  int Nc = CommonParameters::Nc();
53  int Nvol = CommonParameters::Nvol();
54  int Ndim = CommonParameters::Ndim();
55  int NinG = 2 * Nc * Nc;
56 }
57 
58 
59 //====================================================================
61 {
62  int NinF = m_fopr_langev->field_nin();
63  int NvolF = m_fopr_langev->field_nvol();
64  int NexF = m_fopr_langev->field_nex();
65  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
66 
67  m_psf.reset(NinF, NvolF, NexF);
68 
69  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
70 
71  Field xi(NinF, NvolF, NexF);
72  rand->gauss_lex_global(xi);
73 
75  m_fopr_langev->mult(m_psf, xi);
76 
77  double xi2 = xi.norm();
78  double H_psf = xi2 * xi2;
79 
80  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
81  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
82 
83  return H_psf;
84 }
85 
86 
87 //====================================================================
89 {
90  int NinF = m_fopr_H->field_nin();
91  int NvolF = m_fopr_H->field_nvol();
92  int NexF = m_fopr_H->field_nex();
93  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
94 
95  Field v1(NinF, NvolF, NexF);
96 
97  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
98 
100  m_fopr_H->mult(v1, m_psf);
101 
102  double H_psf = dot(v1, m_psf);
103 
104  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
105  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
106 
107  return H_psf;
108 }
109 
110 
111 //====================================================================
113 {
114  int Nin = m_U->nin();
115  int Nvol = m_U->nvol();
116  int Nex = m_U->nex();
117 
118  assert(force.nin() == Nin);
119  assert(force.nvol() == Nvol);
120  assert(force.nex() == Nex);
121 
122  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
123 
126 
127  double Fave, Fmax, Fdev;
128  force.stat(Fave, Fmax, Fdev);
129  vout.general(m_vl, " Frational_frame_ave = %12.6f Frational_frame_max = %12.6f Frational_frame_dev = %12.6f\n",
130  Fave, Fmax, Fdev);
131 }
132 
133 
134 //====================================================================
135 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:278
void set_parameters(const Parameters &params)
void Register_string(const string &, const string &)
Definition: parameters.cpp:351
double dot(const Field &y, const Field &x)
Definition: field.cpp:46
void general(const char *format,...)
Definition: bridgeIO.cpp:65
double langevin(RandomNumbers *)
Langevin step called at the beginning of HMC.
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:39
virtual void set_config(Field *)=0
int nvol() const
Definition: field.h:116
Class for parameters.
Definition: parameters.h:38
virtual void gauss_lex_global(Field &)
gaussian random number defined on global lattice.
virtual int field_nin()=0
returns the on-site d.o.f. for which the fermion operator is defined.
int nin() const
Definition: field.h:115
double calcH()
calculation of Hamiltonian.
static const std::string class_name
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
Definition: field.h:84
double norm() const
Definition: field.h:240
virtual int field_nex()=0
returns the external d.o.f. for which the fermion operator is defined.
int nex() const
Definition: field.h:117
virtual void force_core(Field &, const Field &)
Definition: force.cpp:19
void force(Field &)
returns the force for updating conjugate momentum.
static bool Register(const std::string &realm, const creator_callback &cb)
Bridge::VerboseLevel m_vl
Definition: action.h:81
Base class of random number generators.
Definition: randomNumbers.h:39
virtual void mult(Field &, const Field &)=0
multiplies fermion operator to a given field (2nd argument)
void stat(double &Fave, double &Fmax, double &Fdev) const
determines the statistics of the field. average, maximum value, and deviation is determined over glob...
Definition: field.cpp:516
string get_string(const string &key) const
Definition: parameters.cpp:87
void setup()
creating instances. called from set_parameters().
virtual int field_nvol()=0
returns the volume for which the fermion operator is defined.
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:28
static int NPE()