Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
force_F_Wilson_SF.cpp
Go to the documentation of this file.
1 
14 #include "force_F_Wilson_SF.h"
15 
16 const std::string Force_F_Wilson_SF::class_name = "Force_F_Wilson_SF";
17 
18 //====================================================================
20 {
21  const string str_vlevel = params.get_string("verbose_level");
22 
23  m_vl = vout.set_verbose_level(str_vlevel);
24 
25  //- fetch and check input parameters
26  double kappa;
27  std::vector<int> bc;
28 
29  int err = 0;
30  err += params.fetch_double("hopping_parameter", kappa);
31  err += params.fetch_int_vector("boundary_condition", bc);
32 
33  if (err) {
34  vout.crucial(m_vl, "Error at %s: input parameter not found.\n", class_name.c_str());
35  exit(EXIT_FAILURE);
36  }
37 
38 
39  set_parameters(kappa, bc);
40 }
41 
42 
43 //====================================================================
44 void Force_F_Wilson_SF::set_parameters(const double kappa, const std::vector<int> bc)
45 {
46  const int Ndim = CommonParameters::Ndim();
47 
48  //- print input parameters
49  vout.general(m_vl, "%s:\n", class_name.c_str());
50  vout.general(m_vl, " kappa = %12.8f\n", kappa);
51  for (int mu = 0; mu < Ndim; ++mu) {
52  vout.general(m_vl, " boundary[%d] = %2d\n", mu, bc[mu]);
53  }
54 
55  //- range check
56  // NB. kappa == 0 is allowed.
57  assert(bc.size() == Ndim);
58 
59  //- store values
60  m_kappa = kappa;
61 
62  m_boundary.resize(Ndim);
63  m_boundary = bc;
64 
65  //- propagate parameters
67 }
68 
69 
70 //====================================================================
71 void Force_F_Wilson_SF::force_udiv(Field& force_, const Field& eta_)
72 {
73  const int Nvol = CommonParameters::Nvol();
74  const int Ndim = CommonParameters::Ndim();
75 
76  Field_F zeta;
77  Field_F eta(eta_);
78 
79  m_fopr_w->set_mode("H");
80  m_fopr_w->mult(zeta, eta);
81 
82  Field_G force(Nvol, Ndim);
83  force_udiv1_impl(force, zeta, eta);
84 
85  Field_G force1(Nvol, Ndim);
86  force_udiv1_impl(force1, eta, zeta);
87  axpy(force, 1.0, force1); // force += force1;
88 
89  Field_G_SF set_wk;
90  set_wk.set_boundary_spatial_link_zero(force);
91 
92  copy(force_, force); // force_ = force;
93 }
94 
95 
96 //====================================================================
97 void Force_F_Wilson_SF::force_udiv1(Field& force_, const Field& zeta_, const Field& eta_)
98 {
99  const int Nvol = CommonParameters::Nvol();
100  const int Ndim = CommonParameters::Ndim();
101 
102  Field_G force(Nvol, Ndim);
103  Field_F zeta(zeta_);
104  Field_F eta(eta_);
105 
106  force_udiv1_impl(force, zeta, eta);
107 
108  copy(force_, force); // force_ = force;
109 }
110 
111 
112 //====================================================================
113 void Force_F_Wilson_SF::force_udiv1_impl(Field_G& force, const Field_F& zeta, const Field_F& eta)
114 {
115  const int Ndim = CommonParameters::Ndim();
116 
117  force.set(0.0);
118 
119  for (int mu = 0; mu < Ndim; ++mu) {
120  Field_F eta2;
121  m_fopr_w->mult_gm5p(mu, eta2, eta);
122 
123  Field_F eta3;
124  mult_Field_Gd(eta3, 0, *m_U, mu, eta2, 0);
125 
126  tensorProd_Field_F(force, mu, zeta, eta3);
127  }
128 
129  scal(force, -m_kappa); // force *= -m_kappa;
130 }
131 
132 
133 //====================================================================
134 //============================================================END=====
SU(N) gauge field class in which a few functions are added for the SF.
Definition: field_G_SF.h:33
void scal(Field &x, const double a)
scal(x, a): x = a * x
Definition: field.cpp:433
void mult_Field_Gd(Field_F &y, const int ex, const Field_G &u, int ex1, const Field_F &x, int ex2)
Definition: field_F_imp.cpp:79
BridgeIO vout
Definition: bridgeIO.cpp:503
void force_udiv1_impl(Field_G &force, const Field_F &zeta, const Field_F &eta)
void set(const int jin, const int site, const int jex, double v)
Definition: field.h:175
void general(const char *format,...)
Definition: bridgeIO.cpp:197
Bridge::VerboseLevel m_vl
Definition: force_F.h:69
Container of Field-type object.
Definition: field.h:45
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:327
Class for parameters.
Definition: parameters.h:46
void copy(Field &y, const Field &x)
copy(y, x): y = x
Definition: field.cpp:532
Wilson-type fermion field.
Definition: field_F.h:37
void set_boundary_spatial_link_zero()
Set the boundary spatial link to 0 for SF bc.
Definition: field_G_SF.cpp:102
SU(N) gauge field.
Definition: field_G.h:38
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
void mult_gm5p(const int mu, Field_F &v, const Field_F &w)
Fopr_Wilson_SF * m_fopr_w
static const std::string class_name
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Definition: field.cpp:319
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void tensorProd_Field_F(Field_G &u, const Field_F &v1, const Field_F &v2)
Definition: tensorProd.cpp:32
void set_parameters(const Parameters &params)
void force_udiv(Field &force, const Field &eta)
std::vector< int > m_boundary
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
void force_udiv1(Field &force, const Field &zeta, const Field &eta)
string get_string(const string &key) const
Definition: parameters.cpp:221
int fetch_int_vector(const string &key, vector< int > &value) const
Definition: parameters.cpp:429
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:131
void set_parameters(const Parameters &params)