Bridge++  Ver. 2.0.2
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  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 
53  const double xi2 = xi.norm();
54  const double H_psf = xi2 * xi2;
55 
56  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
57  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
58 
59  return H_psf;
60 }
61 
62 
63 //====================================================================
65 {
66  const int NinF = m_fopr_H->field_nin();
67  const int NvolF = m_fopr_H->field_nvol();
68  const int NexF = m_fopr_H->field_nex();
69  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
70 
71  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
72 
73  Field v1(NinF, NvolF, NexF);
75  m_fopr_H->mult(v1, m_psf);
76 
77  const double H_psf = dot(v1, m_psf);
78 
79  vout.general(m_vl, " H_Frational = %18.8f\n", H_psf);
80  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
81 
82  return H_psf;
83 }
84 
85 
86 //====================================================================
88 {
89  const int Nin = m_U->nin();
90  const int Nvol = m_U->nvol();
91  const int Nex = m_U->nex();
92 
93  assert(force.nin() == Nin);
94  assert(force.nvol() == Nvol);
95  assert(force.nex() == Nex);
96 
97  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
98 
101 
102  double Fave, Fmax, Fdev;
103  force.stat(Fave, Fmax, Fdev);
104  vout.general(m_vl, " Frational_ave = %12.6f Frational_max = %12.6f Frational_dev = %12.6f\n",
105  Fave, Fmax, Fdev);
106 }
107 
108 
109 //====================================================================
110 //============================================================END=====
action_F_Rational.h
Action_F_Rational::class_name
static const std::string class_name
Definition: action_F_Rational.h:40
Parameters::set_string
void set_string(const string &key, const string &value)
Definition: parameters.cpp:39
Action_F_Rational::m_psf
Field m_psf
Definition: action_F_Rational.h:53
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
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::force
void force(Field &)
returns the force for updating conjugate momentum.
Definition: action_F_Rational.cpp:87
RandomNumbers
Base class of random number generators.
Definition: randomNumbers.h:43
Action_F_Rational::get_parameters
void get_parameters(Parameters &params) const
Definition: action_F_Rational.cpp:29
Force::set_config
virtual void set_config(Field *)=0
dot
double dot(const Field &y, const Field &x)
Definition: field.cpp:576
Action_F_Rational::m_U
Field * m_U
Definition: action_F_Rational.h:51
Action_F_Rational::m_fopr_langev
Fopr * m_fopr_langev
Definition: action_F_Rational.h:47
Field::nin
int nin() const
Definition: field.h:126
AFopr::set_config
virtual void set_config(Field *)=0
sets the gauge configuration.
Action_F_Rational::m_label
std::string m_label
Definition: action_F_Rational.h:45
Action_F_Rational::m_fopr_H
Fopr * m_fopr_H
Definition: action_F_Rational.h:48
AFopr::field_nvol
virtual int field_nvol()=0
returns the volume of the fermion field.
Field::norm
double norm() const
Definition: field.h:226
Action_F_Rational::set_parameters
void set_parameters(const Parameters &params)
Definition: action_F_Rational.cpp:19
Force::force_core
virtual void force_core(Field &, const Field &)
Definition: force_F.cpp:18
Field::nvol
int nvol() const
Definition: field.h:127
CommonParameters::NPE
static int NPE()
Definition: commonParameters.h:101
Field::reset
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
Definition: field.h:95
Action_F_Rational::m_fopr_force_MD
Force * m_fopr_force_MD
Definition: action_F_Rational.h:49
Action_F_Rational::m_vl
Bridge::VerboseLevel m_vl
Definition: action_F_Rational.h:43
Bridge::BridgeIO::set_verbose_level
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:133
Action_F_Rational::langevin
double langevin(RandomNumbers *)
Langevin step called at the beginning of HMC.
Definition: action_F_Rational.cpp:36
Parameters::fetch_string
int fetch_string(const string &key, string &value) const
Definition: parameters.cpp:378
Action_F_Rational::calcH
double calcH()
calculation of Hamiltonian.
Definition: action_F_Rational.cpp:64
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.
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:200
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