Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
action_F_Rational_SF.cpp
Go to the documentation of this file.
1 
14 #include "action_F_Rational_SF.h"
15 
16 const std::string Action_F_Rational_SF::class_name = "Action_F_Rational_SF";
17 
18 //====================================================================
20 {
21  const string str_vlevel = params.get_string("verbose_level");
22 
23  m_vl = vout.set_verbose_level(str_vlevel);
24 }
25 
26 
27 //====================================================================
29 {
30  const int NinF = m_fopr_langev->field_nin();
31  const int NvolF = m_fopr_langev->field_nvol();
32  const int NexF = m_fopr_langev->field_nex();
33  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
34 
35  m_psf.reset(NinF, NvolF, NexF);
36 
37  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
38 
39  Field xi(NinF, NvolF, NexF);
40  rand->gauss_lex_global(xi);
41 
43  m_fopr_langev->mult(m_psf, xi);
44 
45  Field_F_SF setzero;
46  setzero.set_boundary_zero(xi);
47 
48  const double xi2 = xi.norm();
49  const double H_psf = xi2 * xi2;
50 
51  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
52  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
53 
54  return H_psf;
55 }
56 
57 
58 //====================================================================
60 {
61  const int NinF = m_fopr_H->field_nin();
62  const int NvolF = m_fopr_H->field_nvol();
63  const int NexF = m_fopr_H->field_nex();
64  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
65 
66  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
67 
68  Field v1(NinF, NvolF, NexF);
70  m_fopr_H->mult(v1, m_psf);
71 
72  const double H_psf = dot(v1, m_psf);
73 
74  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
75  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
76 
77  return H_psf;
78 }
79 
80 
81 //====================================================================
83 {
84  const int Nvol = m_U->nvol();
85  const int Nex = m_U->nex();
86 
87  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
88 
89  Field_G force1(Nvol, Nex);
92 
93  Field_G_SF Fboundary(force1);
95 
96  force = (Field)Fboundary;
97 
98  double Fave, Fmax, Fdev;
99  force.stat(Fave, Fmax, Fdev);
100  vout.general(m_vl, " Frational_ave = %12.6f Frational_max = %12.6f Fratio\
101 nal_dev = %12.6f\n",
102  Fave, Fmax, Fdev);
103 }
104 
105 
106 //====================================================================
107 //============================================================END=====
SU(N) gauge field class in which a few functions are added for the SF.
Definition: field_G_SF.h:33
BridgeIO vout
Definition: bridgeIO.cpp:503
double dot(const Field &y, const Field &x)
Definition: field.cpp:46
void general(const char *format,...)
Definition: bridgeIO.cpp:197
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:45
virtual void set_config(Field *)=0
int nvol() const
Definition: field.h:127
void set_parameters(const Parameters &params)
setting parameters and creating class instances.
double langevin(RandomNumbers *)
Langevin step called at the beginning of HMC.
Class for parameters.
Definition: parameters.h:46
virtual void gauss_lex_global(Field &)
gaussian random number defined on global lattice.
static const std::string class_name
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:102
SU(N) gauge field.
Definition: field_G.h:38
double norm() const
Definition: field.h:222
virtual int field_nex()=0
returns the external d.o.f. for which the fermion operator is defined.
int nex() const
Definition: field.h:128
virtual void force_core(Field &, const Field &)
Definition: force_F.cpp:18
void force(Field &)
returns the force for updating conjugate momentum.
double calcH()
calculation of Hamiltonian.
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
Definition: field.h:95
Bridge::VerboseLevel m_vl
Definition: action.h:75
Base class of random number generators.
Definition: randomNumbers.h:43
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:53
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:667
string get_string(const string &key) const
Definition: parameters.cpp:221
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:131