Bridge++  Ver. 1.3.x
action_F_Rational_Frame_SF.cpp
Go to the documentation of this file.
1 
15 
16 #ifdef USE_PARAMETERS_FACTORY
17 #include "parameters_factory.h"
18 #endif
19 
20 using Bridge::vout;
21 
22 //- parameter entries
23 namespace {
24  void append_entry(Parameters& param)
25  {
26  param.Register_string("verbose_level", "NULL");
27  }
28 
29 
30 #ifdef USE_PARAMETERS_FACTORY
31  bool init_param = ParametersFactory::Register("Action.F_Rational_Frame_SF", append_entry);
32 #endif
33 }
34 //- end
35 
36 //- parameters class
38 //- end
39 
40 const std::string Action_F_Rational_frame_SF::class_name = "Action_F_Rational_frame_SF";
41 
42 //====================================================================
44 {
45  const string str_vlevel = params.get_string("verbose_level");
46 
47  m_vl = vout.set_verbose_level(str_vlevel);
48 }
49 
50 
51 //====================================================================
53 {
54  int Nc = CommonParameters::Nc();
55  int Nvol = CommonParameters::Nvol();
56  int Ndim = CommonParameters::Ndim();
57  int NinG = 2 * Nc * Nc;
58 }
59 
60 
61 //====================================================================
63 {
64  int NinF = m_fopr_langev->field_nin();
65  int NvolF = m_fopr_langev->field_nvol();
66  int NexF = m_fopr_langev->field_nex();
67  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
68 
69  m_psf.reset(NinF, NvolF, NexF);
70 
71  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
72 
73  Field xi(NinF, NvolF, NexF);
74  rand->gauss_lex_global(xi);
75 
77  m_fopr_langev->mult(m_psf, xi);
78 
79  Field_F_SF setzero;
80  setzero.set_boundary_zero(xi);
81 
82  double xi2 = xi.norm();
83  double H_psf = xi2 * xi2;
84 
85  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
86  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
87 
88  return H_psf;
89 }
90 
91 
92 //====================================================================
94 {
95  int NinF = m_fopr_H->field_nin();
96  int NvolF = m_fopr_H->field_nvol();
97  int NexF = m_fopr_H->field_nex();
98  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
99 
100  Field v1(NinF, NvolF, NexF);
101 
102  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
103 
105  m_fopr_H->mult(v1, m_psf);
106 
107  double H_psf = dot(v1, m_psf);
108 
109  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
110  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
111 
112  return H_psf;
113 }
114 
115 
116 //====================================================================
118 {
119  int Nvol = m_U->nvol();
120  int Nex = m_U->nex();
121 
122  Field_G force1(Nvol, Nex);
123 
124  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
125 
127  m_fopr_force_MD->force_core(force1, m_psf);
128 
129  Field_G_SF Fboundary(force1);
130  Fboundary.set_boundary_spatial_link_zero();
131 
132  force = (Field)Fboundary;
133 
134  double Fave, Fmax, Fdev;
135  force.stat(Fave, Fmax, Fdev);
136  vout.general(m_vl, " Frational_frame_ave = %12.6f Frational_frame_max = %12.6f Fratio\
137 nal_frame_dev = %12.6f\n",
138  Fave, Fmax, Fdev);
139 }
140 
141 
142 //====================================================================
143 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:278
void Register_string(const string &, const string &)
Definition: parameters.cpp:351
double dot(const Field &y, const Field &x)
Definition: field.cpp:46
double calcH()
calculation of Hamiltonian.
void general(const char *format,...)
Definition: bridgeIO.cpp:65
void force(Field &)
returns the force for updating conjugate momentum.
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.
void set_boundary_spatial_link_zero()
Set the boundary spatial link to 0 for SF bc.
Definition: field_G_SF.cpp:125
SU(N) gauge field.
Definition: field_G.h:38
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
static const std::string class_name
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
void set_parameters(const Parameters &params)
setting parameters and creating class instances.
virtual void mult(Field &, const Field &)=0
multiplies fermion operator to a given field (2nd argument)
void set_boundary_zero(Field &f)
Definition: field_F_SF.h:56
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
double langevin(RandomNumbers *)
Langevin step called at the beginning of HMC.
void setup()
creating instances. called from set_parameters().
string get_string(const string &key) const
Definition: parameters.cpp:87
virtual int field_nvol()=0
returns the volume for which the fermion operator is defined.
A class generated to add a function for the SF.
Definition: field_F_SF.h:33
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:28
static int NPE()