Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
action_F_Rational.cpp
Go to the documentation of this file.
1 
14 #include "action_F_Rational.h"
15 
16 const std::string Action_F_Rational::class_name = "Action_F_Rational";
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  const double xi2 = xi.norm();
46  const double H_psf = xi2 * xi2;
47 
48  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
49  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
50 
51  return H_psf;
52 }
53 
54 
55 //====================================================================
57 {
58  const int NinF = m_fopr_H->field_nin();
59  const int NvolF = m_fopr_H->field_nvol();
60  const int NexF = m_fopr_H->field_nex();
61  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
62 
63  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
64 
65  Field v1(NinF, NvolF, NexF);
67  m_fopr_H->mult(v1, m_psf);
68 
69  const double H_psf = dot(v1, m_psf);
70 
71  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
72  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
73 
74  return H_psf;
75 }
76 
77 
78 //====================================================================
80 {
81  const int Nin = m_U->nin();
82  const int Nvol = m_U->nvol();
83  const int Nex = m_U->nex();
84 
85  assert(force.nin() == Nin);
86  assert(force.nvol() == Nvol);
87  assert(force.nex() == Nex);
88 
89  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
90 
93 
94  double Fave, Fmax, Fdev;
95  force.stat(Fave, Fmax, Fdev);
96  vout.general(m_vl, " Frational_ave = %12.6f Frational_max = %12.6f Frational_dev = %12.6f\n",
97  Fave, Fmax, Fdev);
98 }
99 
100 
101 //====================================================================
102 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:503
void force(Field &)
returns the force for updating conjugate momentum.
static const std::string class_name
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
Class for parameters.
Definition: parameters.h:46
double calcH()
calculation of Hamiltonian.
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:126
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 reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
Definition: field.h:95
double langevin(RandomNumbers *)
Langevin step called at the beginning of HMC.
void set_parameters(const Parameters &params)
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 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.
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:131