Bridge++  Ver. 1.3.x
fopr_Wilson_General.cpp
Go to the documentation of this file.
1 
14 #include "fopr_Wilson_General.h"
15 #include "fopr_Wilson_General_impl.h"
16 
17 #ifdef USE_FACTORY
18 namespace {
19  Fopr *create_object()
20  {
21  return new Fopr_Wilson_General();
22  }
23 
24 
25  Fopr *create_object_with_repr(const std::string& repr)
26  {
27  return new Fopr_Wilson_General(repr);
28  }
29 
30 
31  bool init1 = Fopr::Factory_noarg::Register("Wilson_General", create_object);
32  bool init2 = Fopr::Factory_string::Register("Wilson_General", create_object_with_repr);
33 }
34 #endif
35 
36 //- parameter entries
37 namespace {
38  void append_entry(Parameters& param)
39  {
40  param.Register_string("gamma_matrix_type", "NULL");
41  param.Register_double("hopping_parameter_spatial", 0.0);
42  param.Register_double("hopping_parameter_temporal", 0.0);
43  param.Register_double("dispersion_parameter_spatial", 0.0);
44  param.Register_double("Wilson_parameter_spatial", 0.0);
45  param.Register_int_vector("boundary_condition", std::vector<int>());
46 
47  param.Register_string("verbose_level", "NULL");
48  }
49 
50 
51 #ifdef USE_PARAMETERS_FACTORY
52  bool init_param = ParametersFactory::Register("Fopr.Wilson_General", append_entry);
53 #endif
54 }
55 //- end
56 
57 //- parameters class
59 //- end
60 
61 const std::string Fopr_Wilson_General::class_name = "Fopr_Wilson_General";
62 
63 //====================================================================
65 {
66  const string str_vlevel = params.get_string("verbose_level");
67 
68  m_vl = vout.set_verbose_level(str_vlevel);
69 
70  //- fetch and check input parameters
71  double kappa_s, kappa_t;
72  double nu_s, r_s;
73  std::vector<int> bc;
74 
75  int err = 0;
76  err += params.fetch_double("hopping_parameter_spatial", kappa_s);
77  err += params.fetch_double("hopping_parameter_temporal", kappa_t);
78  err += params.fetch_double("dispersion_parameter_spatial", nu_s);
79  err += params.fetch_double("Wilson_parameter_spatial", r_s);
80  err += params.fetch_int_vector("boundary_condition", bc);
81 
82  if (err) {
83  vout.crucial(m_vl, "%s: fetch error, input parameter not found.\n", class_name.c_str());
84  exit(EXIT_FAILURE);
85  }
86 
87  set_parameters(kappa_s, kappa_t, nu_s, r_s, bc);
88 }
89 
90 
91 //====================================================================
92 void Fopr_Wilson_General::set_parameters(const double kappa_s, const double kappa_t,
93  const double nu_s, const double r_s,
94  const std::vector<int> bc)
95 { m_impl->set_parameters(kappa_s, kappa_t, nu_s, r_s, bc); }
96 
97 //====================================================================
99 { m_impl->init("Dirac"); }
100 
101 //====================================================================
103 { m_impl->init(repr); }
104 
105 //====================================================================
107 
108 
109 //====================================================================
111 { m_impl->set_config(U); }
112 
113 //====================================================================
114 void Fopr_Wilson_General::set_mode(std::string mode)
115 { m_impl->set_mode(mode); }
116 
117 //====================================================================
118 std::string Fopr_Wilson_General::get_mode() const
119 { return m_impl->get_mode(); }
120 
121 
122 //====================================================================
124 { m_impl->mult(v, f); }
125 
126 //====================================================================
128 { m_impl->mult_dag(v, f); }
129 
130 //====================================================================
132  const Field& v, const int ex2, const int ipm)
133 { m_impl->proj_chiral(w, ex1, v, ex2, ipm); }
134 
135 //====================================================================
137 { m_impl->mult_gm5(w, v); }
138 
139 
140 //====================================================================
142 { m_impl->D(w, v); }
143 
144 //====================================================================
146 { m_impl->Ddag(w, v); }
147 
148 //====================================================================
150 { m_impl->DdagD(w, v); }
151 
152 //====================================================================
154 { m_impl->DDdag(w, v); }
155 
156 //====================================================================
158 { m_impl->H(w, v); }
159 
160 //====================================================================
162 { m_impl->mult_gm5p(mu, v, w); }
163 
164 //====================================================================
165 void Fopr_Wilson_General::D_ex(Field& w, const int ex1,
166  const Field& v, const int ex2)
167 { m_impl->D_ex(w, ex1, v, ex2); }
168 
169 //====================================================================
171 void Fopr_Wilson_General::mult_up(int mu, Field& w, const Field& v)
172 { m_impl->mult_up(mu, w, v); }
173 
174 //====================================================================
175 void Fopr_Wilson_General::mult_dn(int mu, Field& w, const Field& v)
176 { m_impl->mult_dn(mu, w, v); }
177 
178 //====================================================================
180 { return m_impl->flop_count(); }
181 
182 //====================================================================
183 //============================================================END=====
void Register_int_vector(const string &, const std::vector< int > &)
Definition: parameters.cpp:344
BridgeIO vout
Definition: bridgeIO.cpp:278
void Register_string(const string &, const string &)
Definition: parameters.cpp:351
void set_config(Field *U)
setting pointer to the gauge configuration.
Container of Field-type object.
Definition: field.h:39
void DdagD(Field &w, const Field &v)
std::string get_mode() const
only for Fopr_Overlap
void set_parameters(const Parameters &params)
Class for parameters.
Definition: parameters.h:38
void DDdag(Field &w, const Field &v)
void set_parameters(const double kappa_s, const double kappa_t, const double nu_s, const double r_s, const std::vector< int > bc)
void H(Field &w, const Field &v)
Wilson-type fermion field.
Definition: field_F.h:37
void D(Field &w, const Field &v)
const Field_F mult_gm5p(int mu, const Field_F &w)
void mult_dn(int mu, Field &w, const Field &v)
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
Bridge::VerboseLevel m_vl
Definition: fopr.h:113
void D_ex(Field &w, const int ex1, const Field &v, const int ex2)
this function is assumed to be exclusively used from domain-wall fermions.
void mult_up(int mu, Field &w, const Field &v)
adding the hopping to nearest neighbor site in mu-th direction.
Fopr_Wilson_General_impl * m_impl
void mult_gm5(Field &w, const Field &v)
void crucial(const char *format,...)
Definition: bridgeIO.cpp:48
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
void D_ex(Field &v, const int ex1, const Field &f, const int ex2)
double flop_count()
this returns the number of floating point number operations.
void Ddag(Field &w, const Field &v)
static bool Register(const std::string &realm, const creator_callback &cb)
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
static const std::string class_name
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
void Register_double(const string &, const double)
Definition: parameters.cpp:323
void mult_gm5p(int mu, Field_F &v, const Field_F &w)
this function is used for derivatives in force calculation.
Base class of fermion operator family.
Definition: fopr.h:49
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
int fetch_double(const string &key, double &val) const
Definition: parameters.cpp:124
string get_string(const string &key) const
Definition: parameters.cpp:87
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:28
int fetch_int_vector(const string &key, std::vector< int > &val) const
Definition: parameters.cpp:176