Bridge++  Ver. 2.0.2
action_F_Standard_lex.cpp
Go to the documentation of this file.
1 
14 #include "action_F_Standard_lex.h"
15 
16 const std::string Action_F_Standard_lex::class_name = "Action_F_Standard_lex";
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  m_fopr->set_config(U);
42 }
43 
44 
45 //====================================================================
47 {
48  const int Nvol = CommonParameters::Nvol();
49  const int Ndim = CommonParameters::Ndim();
50 
51  const int NinF = m_fopr->field_nin();
52  const int NvolF = m_fopr->field_nvol();
53  const int NexF = m_fopr->field_nex();
54  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
55 
56  assert(NvolF == Nvol);
57  m_psf.reset(NinF, NvolF, NexF);
58 
59  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
60 
61  Field xi(NinF, NvolF, NexF);
62  rand->gauss_lex_global(xi);
63 
65  m_fopr->set_mode("Ddag");
66 
67  m_fopr->mult(m_psf, xi);
68 
69  const double xi2 = xi.norm();
70  const double H_psf = xi2 * xi2;
71 
72  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
73  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
74 
75  return H_psf;
76 }
77 
78 
79 //====================================================================
81 {
82  const int Nvol = CommonParameters::Nvol();
83  const int Ndim = CommonParameters::Ndim();
84 
85  const int NinF = m_fopr->field_nin();
86  const int NvolF = m_fopr->field_nvol();
87  const int NexF = m_fopr->field_nex();
88  const int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
89 
90  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
91 
92  Field v1(NinF, NvolF, NexF);
93  int Nconv;
94  double diff;
96  m_fprop_H->invert_DdagD(v1, m_psf, Nconv, diff);
97 
98  vout.general(m_vl, " Fprop_H: %6d %18.15e\n", Nconv, diff);
99 
100  const double H_psf = dot(v1, m_psf);
101 
102  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
103  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
104 
105  return H_psf;
106 }
107 
108 
109 //====================================================================
111 {
112  const int Nin = m_U->nin();
113  const int Nvol = m_U->nvol();
114  const int Nex = m_U->nex();
115  const int Nc = CommonParameters::Nc();
116  const int Ndim = CommonParameters::Ndim();
117 
118  assert(force.nin() == Nin);
119  assert(force.nvol() == Nvol);
120  assert(force.nex() == Nex);
121 
122  const int NinF = m_fopr->field_nin();
123  const int NvolF = m_fopr->field_nvol();
124  const int NexF = m_fopr->field_nex();
125 
126 
127  vout.detailed(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
128 
129  Field eta(NinF, NvolF, NexF);
130  int Nconv;
131  double diff;
133  m_fprop_MD->invert_DdagD(eta, m_psf, Nconv, diff);
134 
135  vout.detailed(m_vl, " Fprop_MD: %6d %18.15e\n", Nconv, diff);
136 
138 
140 
141  double Fave, Fmax, Fdev;
142  force.stat(Fave, Fmax, Fdev);
143  vout.general(m_vl,
144  " Fstandard_ave = %12.6f Fstandard_max = %12.6f Fstandard_dev = %12.6f\n",
145  Fave, Fmax, Fdev);
146 }
147 
148 
149 //====================================================================
150 //============================================================END=====
Action_F_Standard_lex::m_fopr
Fopr * m_fopr
Definition: action_F_Standard_lex.h:45
Parameters::set_string
void set_string(const string &key, const string &value)
Definition: parameters.cpp:39
Action_F_Standard_lex::get_parameters
void get_parameters(Parameters &) const
Definition: action_F_Standard_lex.cpp:29
Action_F_Standard_lex::class_name
static const std::string class_name
Definition: action_F_Standard_lex.h:40
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.
Action_F_Standard_lex::set_config
void set_config(Field *U)
setting pointer to the gauge configuration.
Definition: action_F_Standard_lex.cpp:36
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
action_F_Standard_lex.h
Action_F_Standard_lex::m_fprop_H
Fprop * m_fprop_H
Definition: action_F_Standard_lex.h:51
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_lex::m_label
std::string m_label
Definition: action_F_Standard_lex.h:48
AFopr::set_config
virtual void set_config(Field *)=0
sets the gauge configuration.
Action_F_Standard_lex::set_parameters
void set_parameters(const Parameters &)
Definition: action_F_Standard_lex.cpp:19
CommonParameters::Nc
static int Nc()
Definition: commonParameters.h:115
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_Standard_lex::calcH
double calcH()
calculate Hamiltonian of this action term.
Definition: action_F_Standard_lex.cpp:80
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
Fprop::invert_DdagD
virtual void invert_DdagD(Field &, const Field &, int &, double &)=0
Action_F_Standard_lex::force
void force(Field &)
returns force for molcular dynamical update of conjugate momenta.
Definition: action_F_Standard_lex.cpp:110
Action_F_Standard_lex::m_fprop_MD
Fprop * m_fprop_MD
Definition: action_F_Standard_lex.h:50
Bridge::BridgeIO::set_verbose_level
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:133
Action_F_Standard_lex::m_vl
Bridge::VerboseLevel m_vl
Definition: action_F_Standard_lex.h:43
Action_F_Standard_lex::m_U
Field * m_U
Definition: action_F_Standard_lex.h:53
Action_F_Standard_lex::langevin
double langevin(RandomNumbers *)
Langevis step.
Definition: action_F_Standard_lex.cpp:46
Parameters::fetch_string
int fetch_string(const string &key, string &value) const
Definition: parameters.cpp:378
Action_F_Standard_lex::m_fopr_force
Force * m_fopr_force
Definition: action_F_Standard_lex.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_lex::m_psf
Field m_psf
Definition: action_F_Standard_lex.h:47
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