Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 {
22 
24 }
25 
26 
27 //====================================================================
29 {
30  int Nc = CommonParameters::Nc();
31  int Nvol = CommonParameters::Nvol();
32  int Ndim = CommonParameters::Ndim();
33  int NinG = 2 * Nc * Nc;
34 
35  vout.detailed(m_vl, "%s:\n", class_name.c_str());
36 }
37 
38 
39 //====================================================================
41 {
42  m_U = U;
43 
44  m_fopr->set_config(U);
46 }
47 
48 
49 //====================================================================
51 {
52  int Nvol = CommonParameters::Nvol();
53  int Ndim = CommonParameters::Ndim();
54 
55  int NinF = m_fopr->field_nin();
56  int NvolF = m_fopr->field_nvol();
57  int NexF = m_fopr->field_nex();
58  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
59 
60  assert(NvolF == Nvol);
61  m_psf.reset(NinF, NvolF, NexF);
62 
63  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
64 
65  Field xi(NinF, NvolF, NexF);
66  rand->gauss_lex_global(xi);
67 
69  m_fopr->set_mode("Ddag");
70 
71  m_fopr->mult(m_psf, xi);
72 
73  double xi2 = xi.norm();
74  double H_psf = xi2 * xi2;
75 
76  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
77  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
78 
79  return H_psf;
80 }
81 
82 
83 //====================================================================
85 {
86  int Nvol = CommonParameters::Nvol();
87  int Ndim = CommonParameters::Ndim();
88 
89  int NinF = m_fopr->field_nin();
90  int NvolF = m_fopr->field_nvol();
91  int NexF = m_fopr->field_nex();
92  int size_psf = NinF * NvolF * NexF * CommonParameters::NPE();
93 
94  Field v1(NinF, NvolF, NexF);
95 
96  vout.general(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
97 
98  int Nconv;
99  double diff;
100 
102  m_fprop_H->invert_DdagD(v1, m_psf, Nconv, diff);
103 
104  vout.general(m_vl, " Fprop_H: %6d %18.15e\n", Nconv, diff);
105 
106  double H_psf = dot(v1, m_psf);
107 
108  vout.general(m_vl, " H_Fstandard = %18.8f\n", H_psf);
109  vout.general(m_vl, " H_F/dof = %18.8f\n", H_psf / size_psf);
110 
111  return H_psf;
112 }
113 
114 
115 //====================================================================
117 {
118  int Nin = m_U->nin();
119  int Nvol = m_U->nvol();
120  int Nex = m_U->nex();
121  int Nc = CommonParameters::Nc();
122  int Ndim = CommonParameters::Ndim();
123 
124  assert(force.nin() == Nin);
125  assert(force.nvol() == Nvol);
126  assert(force.nex() == Nex);
127 
128  int NinF = m_fopr->field_nin();
129  int NvolF = m_fopr->field_nvol();
130  int NexF = m_fopr->field_nex();
131  Field eta(NinF, NvolF, NexF);
132 
133  vout.detailed(m_vl, " %s: %s\n", class_name.c_str(), m_label.c_str());
134 
135  int Nconv;
136  double diff;
137 
139  m_fprop_MD->invert_DdagD(eta, m_psf, Nconv, diff);
140 
141  vout.detailed(m_vl, " Fprop_MD: %6d %18.15e\n", Nconv, diff);
142 
144 
145  m_fopr_force->force_core(force, eta);
146 
147  double Fave, Fmax, Fdev;
148  force.stat(Fave, Fmax, Fdev);
149  vout.general(m_vl,
150  " Fstandard_ave = %12.6f Fstandard_max = %12.6f Fstandard_dev = %12.6f\n",
151  Fave, Fmax, Fdev);
152 }
153 
154 
155 //====================================================================
156 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:495
void set_config(Field *U)
setting pointer to the gauge configuration.
void detailed(const char *format,...)
Definition: bridgeIO.cpp:212
double dot(const Field &y, const Field &x)
Definition: field.cpp:46
virtual void set_config(Field *)=0
void general(const char *format,...)
Definition: bridgeIO.cpp:195
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:39
virtual void set_config(Field *)=0
double calcH()
calculate Hamiltonian of this action term.
double langevin(RandomNumbers *)
Langevis step.
int nvol() const
Definition: field.h:116
Class for parameters.
Definition: parameters.h:46
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.
void set_parameter_verboselevel(const Bridge::VerboseLevel vl)
Definition: action.h:53
int nin() const
Definition: field.h:115
virtual void invert_DdagD(Field &, const Field &, int &, double &)=0
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
Definition: field.h:84
double norm() const
Definition: field.h:211
virtual int field_nex()=0
returns the external d.o.f. for which the fermion operator is defined.
int nex() const
Definition: field.h:117
virtual void force_core(Field &, const Field &)
Definition: force_F.cpp:18
Bridge::VerboseLevel get_VerboseLevel() const
Definition: parameters.cpp:204
Bridge::VerboseLevel m_vl
Definition: action.h:75
Base class of random number generators.
Definition: randomNumbers.h:36
Bridge::VerboseLevel vl
Definition: checker.cpp:18
VerboseLevel
Definition: bridgeIO.h:42
virtual void mult(Field &, const Field &)=0
multiplies fermion operator to a given field (2nd argument)
virtual void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: fopr.h:96
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:516
void force(Field &)
returns force for molcular dynamical update of conjugate momenta.
virtual int field_nvol()=0
returns the volume for which the fermion operator is defined.
static const std::string class_name
static int NPE()