Bridge++  Ver. 2.0.2
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  std::string vlevel;
22  if (!params.fetch_string("verbose_level", vlevel)) {
23  m_vl = vout.set_verbose_level(vlevel);
24  }
25 }
26 
27 
28 //====================================================================
30 {
31  params.set_string("verbose_level", vout.get_verbose_level(m_vl));
32 }
33 
34 
35 //====================================================================
37 {
38  const int NinF = m_fopr_langev->field_nin();
39  const int NvolF = m_fopr_langev->field_nvol();
40  const int NexF = m_fopr_langev->field_nex();
41  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
42 
43  m_psf.reset(NinF, NvolF, NexF);
44 
45  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
46 
47  Field xi(NinF, NvolF, NexF);
48  rand->gauss_lex_global(xi);
49 
51  m_fopr_langev->mult(m_psf, xi);
52 
54 
55  const double xi2 = xi.norm();
56  const double H_psf = xi2 * xi2;
57 
58  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
59  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
60 
61  return H_psf;
62 }
63 
64 
65 //====================================================================
67 {
68  const int NinF = m_fopr_H->field_nin();
69  const int NvolF = m_fopr_H->field_nvol();
70  const int NexF = m_fopr_H->field_nex();
71  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
72 
73  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
74 
75  Field v1(NinF, NvolF, NexF);
77  m_fopr_H->mult(v1, m_psf);
78 
79  const double H_psf = dot(v1, m_psf);
80 
81  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
82  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
83 
84  return H_psf;
85 }
86 
87 
88 //====================================================================
90 {
91  const int Nvol = m_U->nvol();
92  const int Nex = m_U->nex();
93 
94  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
95 
96  Field_G force1(Nvol, Nex);
99 
100  Field_G Fboundary(force1);
102 
103  force = (Field)Fboundary;
104 
105  double Fave, Fmax, Fdev;
106  force.stat(Fave, Fmax, Fdev);
107  vout.general(m_vl, " Frational_ave = %12.6f Frational_max = %12.6f Fratio\
108 nal_dev = %12.6f\n",
109  Fave, Fmax, Fdev);
110 }
111 
112 
113 //====================================================================
114 //============================================================END=====
Action_F_Rational_SF::m_vl
Bridge::VerboseLevel m_vl
Definition: action_F_Rational_SF.h:44
Parameters::set_string
void set_string(const string &key, const string &value)
Definition: parameters.cpp:39
AFopr::mult
virtual void mult(AFIELD &, const AFIELD &)
multiplies fermion operator to a given field.
Definition: afopr.h:95
Parameters
Class for parameters.
Definition: parameters.h:46
Action_F_Rational_SF::m_psf
Field m_psf
Definition: action_F_Rational_SF.h:54
AFopr::field_nex
virtual int field_nex()=0
returns the external degree of freedom of the fermion field.
Field::nex
int nex() const
Definition: field.h:128
Action_F_Rational_SF::set_parameters
void set_parameters(const Parameters &params)
setting parameters and creating class instances.
Definition: action_F_Rational_SF.cpp:19
RandomNumbers
Base class of random number generators.
Definition: randomNumbers.h:43
Action_F_Rational_SF::m_label
std::string m_label
Definition: action_F_Rational_SF.h:46
Force::set_config
virtual void set_config(Field *)=0
Action_F_Rational_SF::langevin
double langevin(RandomNumbers *)
Langevin step called at the beginning of HMC.
Definition: action_F_Rational_SF.cpp:36
dot
double dot(const Field &y, const Field &x)
Definition: field.cpp:576
Action_F_Rational_SF::m_fopr_langev
Fopr * m_fopr_langev
Definition: action_F_Rational_SF.h:48
Action_F_Rational_SF::class_name
static const std::string class_name
Definition: action_F_Rational_SF.h:41
AFopr::set_config
virtual void set_config(Field *)=0
sets the gauge configuration.
Field_SF::set_boundary_zero
void set_boundary_zero(Field_G &u)
Definition: field_SF.cpp:96
AFopr::field_nvol
virtual int field_nvol()=0
returns the volume of the fermion field.
Field::norm
double norm() const
Definition: field.h:226
Force::force_core
virtual void force_core(Field &, const Field &)
Definition: force_F.cpp:18
Field::nvol
int nvol() const
Definition: field.h:127
Action_F_Rational_SF::calcH
double calcH()
calculation of Hamiltonian.
Definition: action_F_Rational_SF.cpp:66
CommonParameters::NPE
static int NPE()
Definition: commonParameters.h:101
Action_F_Rational_SF::force
void force(Field &)
returns the force for updating conjugate momentum.
Definition: action_F_Rational_SF.cpp:89
Field::reset
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
Definition: field.h:95
Field_SF::set_boundary_spatial_link_zero
void set_boundary_spatial_link_zero(Field_G &u)
Definition: field_SF.cpp:151
Action_F_Rational_SF::get_parameters
void get_parameters(Parameters &params) const
getting parameters
Definition: action_F_Rational_SF.cpp:29
Action_F_Rational_SF::m_fopr_H
Fopr * m_fopr_H
Definition: action_F_Rational_SF.h:49
Bridge::BridgeIO::set_verbose_level
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:133
Action_F_Rational_SF::m_fopr_force_MD
Force * m_fopr_force_MD
Definition: action_F_Rational_SF.h:50
Parameters::fetch_string
int fetch_string(const string &key, string &value) const
Definition: parameters.cpp:378
Field
Container of Field-type object.
Definition: field.h:46
RandomNumbers::gauss_lex_global
virtual void gauss_lex_global(Field &)
gaussian random number defined on global lattice.
Definition: randomNumbers.cpp:95
AFopr::field_nin
virtual int field_nin()=0
returns the on-site degree of freedom of the fermion field.
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:200
Action_F_Rational_SF::m_U
Field * m_U
Definition: action_F_Rational_SF.h:52
action_F_Rational_SF.h
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Bridge::BridgeIO::get_verbose_level
static std::string get_verbose_level(const VerboseLevel vl)
Definition: bridgeIO.cpp:154