Bridge++  Ver. 2.0.2
action_F_Standard_eo.cpp
Go to the documentation of this file.
1 
14 #include "action_F_Standard_eo.h"
15 
16 const std::string Action_F_Standard_eo::class_name = "Action_F_Standard_eo";
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  m_U = U;
39 
40  //- NB. only solver part is even-odd preconditioned.
41  m_fopr->set_config(U);
43 }
44 
45 
46 //====================================================================
48 {
49  const int Nvol = CommonParameters::Nvol();
50  const int Ndim = CommonParameters::Ndim();
51 
52  const int NinF = m_fopr->field_nin();
53  const int NvolF = m_fopr->field_nvol();
54  const int NexF = m_fopr->field_nex();
55  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
56 
57  assert(NvolF == Nvol);
58  m_psf.reset(NinF, NvolF, NexF);
59 
60  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
61 
62  Field xi(NinF, NvolF, NexF);
63  rand->gauss_lex_global(xi);
64 
66  m_fopr->set_mode("Ddag");
67 
68  m_fopr->mult(m_psf, xi);
69 
70  const double xi2 = xi.norm();
71  const double H_psf = xi2 * xi2;
72 
73  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
74  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
75 
76  return H_psf;
77 }
78 
79 
80 //====================================================================
82 {
83  const int Nvol = CommonParameters::Nvol();
84  const int Ndim = CommonParameters::Ndim();
85 
86  const int NinF = m_fopr->field_nin();
87  const int NvolF = m_fopr->field_nvol();
88  const int NexF = m_fopr->field_nex();
89  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
90 
91  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
92 
93  Field v1(NinF, NvolF, NexF);
94  int Nconv;
95  double diff;
97  m_fprop_H->invert_DdagD(v1, m_psf, Nconv, diff);
98 
99  const double H_psf = dot(v1, m_psf);
100 
101  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
102  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
103 
104  return H_psf;
105 }
106 
107 
108 //====================================================================
110 {
111  const int Nin = m_U->nin();
112  const int Nvol = m_U->nvol();
113  const int Nex = m_U->nex();
114  const int Nc = CommonParameters::Nc();
115  const int Ndim = CommonParameters::Ndim();
116 
117  assert(force.nin() == Nin);
118  assert(force.nvol() == Nvol);
119  assert(force.nex() == Nex);
120 
121  const int NinF = m_fopr->field_nin();
122  const int NvolF = m_fopr->field_nvol();
123  const int NexF = m_fopr->field_nex();
124 
125  vout.detailed(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
126 
127  Field eta(NinF, NvolF, NexF);
128  int Nconv;
129  double diff;
131  m_fprop_MD->invert_DdagD(eta, m_psf, Nconv, diff);
132 
133  // force of smeared fermion operator
136 
137  double Fave, Fmax, Fdev;
138  force.stat(Fave, Fmax, Fdev);
139  vout.general(m_vl,
140  " Fstandard_ave = %12.6f Fstandard_max = %12.6f Fstandard_dev = %12.6f\n",
141  Fave, Fmax, Fdev);
142 }
143 
144 
145 //====================================================================
146 //============================================================END=====
Action_F_Standard_eo::m_vl
Bridge::VerboseLevel m_vl
Definition: action_F_Standard_eo.h:43
Action_F_Standard_eo::class_name
static const std::string class_name
Definition: action_F_Standard_eo.h:40
Parameters::set_string
void set_string(const string &key, const string &value)
Definition: parameters.cpp:39
CommonParameters::Ndim
static int Ndim()
Definition: commonParameters.h:117
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.
Bridge::BridgeIO::detailed
void detailed(const char *format,...)
Definition: bridgeIO.cpp:219
Field::nex
int nex() const
Definition: field.h:128
RandomNumbers
Base class of random number generators.
Definition: randomNumbers.h:43
Force::set_config
virtual void set_config(Field *)=0
CommonParameters::Nvol
static int Nvol()
Definition: commonParameters.h:109
Fprop::set_config
virtual void set_config(Field *)=0
dot
double dot(const Field &y, const Field &x)
Definition: field.cpp:576
AFopr::set_mode
virtual void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: afopr.h:81
Field::nin
int nin() const
Definition: field.h:126
Action_F_Standard_eo::calcH
double calcH()
calculate Hamiltonian of this action term.
Definition: action_F_Standard_eo.cpp:81
Action_F_Standard_eo::m_label
std::string m_label
Definition: action_F_Standard_eo.h:48
Action_F_Standard_eo::set_parameters
void set_parameters(const Parameters &)
Definition: action_F_Standard_eo.cpp:19
AFopr::set_config
virtual void set_config(Field *)=0
sets the gauge configuration.
Action_F_Standard_eo::set_config
void set_config(Field *U)
setting pointer to the gauge configuration.
Definition: action_F_Standard_eo.cpp:36
Action_F_Standard_eo::m_psf
Field m_psf
Definition: action_F_Standard_eo.h:47
CommonParameters::Nc
static int Nc()
Definition: commonParameters.h:115
Action_F_Standard_eo::force
void force(Field &)
returns force for molcular dynamical update of conjugate momenta.
Definition: action_F_Standard_eo.cpp:109
Action_F_Standard_eo::m_fopr
Fopr * m_fopr
Definition: action_F_Standard_eo.h:45
Action_F_Standard_eo::get_parameters
void get_parameters(Parameters &) const
Definition: action_F_Standard_eo.cpp:29
AFopr::field_nvol
virtual int field_nvol()=0
returns the volume of the fermion field.
Action_F_Standard_eo::m_fprop_H
Fprop * m_fprop_H
Definition: action_F_Standard_eo.h:51
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
CommonParameters::NPE
static int NPE()
Definition: commonParameters.h:101
Action_F_Standard_eo::m_fprop_MD
Fprop * m_fprop_MD
Definition: action_F_Standard_eo.h:50
Field::reset
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
Definition: field.h:95
Fprop::invert_DdagD
virtual void invert_DdagD(Field &, const Field &, int &, double &)=0
Action_F_Standard_eo::m_U
Field * m_U
Definition: action_F_Standard_eo.h:53
Bridge::BridgeIO::set_verbose_level
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:133
Parameters::fetch_string
int fetch_string(const string &key, string &value) const
Definition: parameters.cpp:378
Action_F_Standard_eo::m_fopr_force
Force * m_fopr_force
Definition: action_F_Standard_eo.h:46
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.
action_F_Standard_eo.h
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:200
Action_F_Standard_eo::langevin
double langevin(RandomNumbers *)
Langevis step.
Definition: action_F_Standard_eo.cpp:47
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