Bridge++  Version 1.4.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 
17 using Bridge::vout;
18 
19 
20 
21 const std::string Action_F_Rational_SF::class_name = "Action_F_Rational_SF";
22 
23 //====================================================================
25 {
26  const string str_vlevel = params.get_string("verbose_level");
27 
28  m_vl = vout.set_verbose_level(str_vlevel);
29 }
30 
31 
32 //====================================================================
34 {
35  int Nc = CommonParameters::Nc();
36  int Nvol = CommonParameters::Nvol();
37  int Ndim = CommonParameters::Ndim();
38  int NinG = 2 * Nc * Nc;
39 }
40 
41 
42 //====================================================================
44 {
45  int NinF = m_fopr_langev->field_nin();
46  int NvolF = m_fopr_langev->field_nvol();
47  int NexF = m_fopr_langev->field_nex();
48  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
49 
50  m_psf.reset(NinF, NvolF, NexF);
51 
52  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
53 
54  Field xi(NinF, NvolF, NexF);
55  rand->gauss_lex_global(xi);
56 
58  m_fopr_langev->mult(m_psf, xi);
59 
60  Field_F_SF setzero;
61  setzero.set_boundary_zero(xi);
62 
63  double xi2 = xi.norm();
64  double H_psf = xi2 * xi2;
65 
66  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
67  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
68 
69  return H_psf;
70 }
71 
72 
73 //====================================================================
75 {
76  int NinF = m_fopr_H->field_nin();
77  int NvolF = m_fopr_H->field_nvol();
78  int NexF = m_fopr_H->field_nex();
79  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
80 
81  Field v1(NinF, NvolF, NexF);
82 
83  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
84 
86  m_fopr_H->mult(v1, m_psf);
87 
88  double H_psf = dot(v1, m_psf);
89 
90  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
91  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
92 
93  return H_psf;
94 }
95 
96 
97 //====================================================================
99 {
100  int Nvol = m_U->nvol();
101  int Nex = m_U->nex();
102 
103  Field_G force1(Nvol, Nex);
104 
105  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
106 
108  m_fopr_force_MD->force_core(force1, m_psf);
109 
110  Field_G_SF Fboundary(force1);
111  Fboundary.set_boundary_spatial_link_zero();
112 
113  force = (Field)Fboundary;
114 
115  double Fave, Fmax, Fdev;
116  force.stat(Fave, Fmax, Fdev);
117  vout.general(m_vl, " Frational_ave = %12.6f Frational_max = %12.6f Fratio\
118 nal_dev = %12.6f\n",
119  Fave, Fmax, Fdev);
120 }
121 
122 
123 //====================================================================
124 //============================================================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:495
double dot(const Field &y, const Field &x)
Definition: field.cpp:46
void general(const char *format,...)
Definition: bridgeIO.cpp:195
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
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:104
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:211
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_F.cpp:18
void force(Field &)
returns the force for updating conjugate momentum.
double calcH()
calculation of Hamiltonian.
Bridge::VerboseLevel m_vl
Definition: action.h:75
Base class of random number generators.
Definition: randomNumbers.h:36
virtual void mult(Field &, const Field &)=0
multiplies fermion operator to a given field (2nd argument)
void setup()
creating instances. called from set_parameters().
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
string get_string(const string &key) const
Definition: parameters.cpp:116
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
static int NPE()