Bridge++  Ver. 2.0.2
fopr_WilsonGeneral_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_WILSON_GENERAL_IMPL_ORG_INCLUDED
15 #define FOPR_WILSON_GENERAL_IMPL_ORG_INCLUDED
16 
17 #include "Fopr/fopr.h"
18 
19 #include "Field/field_F.h"
20 #include "Field/shiftField_lex.h"
21 #include "Tools/gammaMatrixSet.h"
22 
23 #include "IO/bridgeIO.h"
24 using Bridge::vout;
25 
27 
35 namespace Org {
36  class Fopr_WilsonGeneral : public Fopr
37  {
38  public:
39  static const std::string class_name;
40 
41  private:
43 
44  // lattice parameters
45  int m_Nvol;
46  int m_Ndim;
47  int m_Nc;
48  int m_Nd;
49 
51  double m_nu_s, m_r_s;
52  std::vector<int> m_boundary;
53 
54  std::string m_mode;
55  std::string m_repr;
56 
57  void (Fopr_WilsonGeneral::*m_mult)(Field&, const Field&);
59 
60  const Field_G *m_U;
61 
62  std::vector<GammaMatrix> m_GM;
63 
66 
67  public:
70  : m_vl(CommonParameters::Vlevel()) { init("Dirac"); }
72  Fopr_WilsonGeneral(std::string repr)
73  : m_vl(CommonParameters::Vlevel()) { init(repr); }
74 
76  : m_vl(CommonParameters::Vlevel())
77  {
78  std::string repr = params.get_string("gamma_matrix_type");
79  init(repr);
80  set_parameters(params);
81  }
82 
84 
85  void init(const std::string repr);
86 
87  void set_parameters(const Parameters& params);
88  void set_parameters(const double kappa_s, const double kappa_t,
89  const double nu_s, const double r_s);
90  void set_parameters(const double kappa_s, const double kappa_t,
91  const double nu_s, const double r_s,
92  const std::vector<int> bc);
93 
94  void get_parameters(Parameters& params) const;
95 
96  void set_config(Field *U)
97  { m_U = (Field_G *)U; }
98 
99  void set_mode(const std::string mode);
100 
101  std::string get_mode() const;
102 
103  inline void mult(Field& v, const Field& f)
104  { (this->*m_mult)(v, f); }
105 
106  inline void mult_dag(Field& v, const Field& f)
107  { (this->*m_mult_dag)(v, f); }
108 
109  void mult_gm5(Field& v, const Field& f);
110 
111  void proj_chiral(Field& w, const int ex1, const Field& v, const int ex2, const int ipm);
112 
113  void D(Field& v, const Field& f);
114 
115  void D_ex(Field& v, const int ex1, const Field& f, const int ex2);
116 
117  inline void Ddag(Field& w, const Field& f)
118  {
119  Field w2(f.nin(), f.nvol(), f.nex());
120 
121  mult_gm5(w, f);
122  D(w2, w);
123  mult_gm5(w, w2);
124  }
125 
126  inline void DdagD(Field& w, const Field& f)
127  {
128  Field w2(f.nin(), f.nvol(), f.nex());
129 
130  D(w2, f);
131  mult_gm5(w, w2);
132  D(w2, w);
133  mult_gm5(w, w2);
134  }
135 
136  inline void DDdag(Field& w, const Field& f)
137  {
138  Field w2(f.nin(), f.nvol(), f.nex());
139 
140  mult_gm5(w2, f);
141  D(w, w2);
142  mult_gm5(w2, w);
143  D(w, w2);
144  }
145 
146  inline void H(Field& w, const Field& f)
147  {
148  Field w2(f.nin(), f.nvol(), f.nex());
149 
150  D(w2, f);
151  mult_gm5(w, w2);
152  }
153 
154  inline void mult_undef(Field&, const Field& f)
155  {
156  vout.crucial(m_vl, "Error at %s: mode undefined.\n", class_name.c_str());
157  exit(EXIT_FAILURE);
158  }
159 
160  const Field_F mult_gm5p(const int mu, const Field_F& w);
161 
162  void mult_gm5p(const int mu, Field_F& v, const Field_F& w);
163 
164  // void gm5p(Field_F& v, const int mu, const Field_F& w);
165 
167  double flop_count();
168 
170  { return CommonParameters::Nvol(); }
171  int field_nin()
172  { return 2 * CommonParameters::Nc() * CommonParameters::Nd(); }
173  int field_nex()
174  { return 1; }
175 
176  void mult_up(const int mu, Field& w, const Field& f);
177  void mult_dn(const int mu, Field& w, const Field& f);
178 
179  private:
180  //- prohibit copy
183 
184  // void mult_p (int mu, Field_F&, const Field_F&);
185  // void mult_m (int mu, Field_F&, const Field_F&);
186 
187 #ifdef USE_FACTORY
188  private:
189  static Fopr *create_object()
190  {
191  return new Fopr_WilsonGeneral();
192  }
193 
194  static Fopr *create_object_with_arg(const std::string& repr)
195  {
196  return new Fopr_WilsonGeneral(repr);
197  }
198 
199  static Fopr *create_object_with_params(const Parameters& params)
200  {
201  return new Fopr_WilsonGeneral(params);
202  }
203 
204  public:
205  static bool register_factory()
206  {
207  bool init = true;
208  init &= Fopr::Factory_noarg::Register("WilsonGeneral/Org", create_object);
209  init &= Fopr::Factory_string::Register("WilsonGeneral/Org", create_object_with_arg);
210  init &= Fopr::Factory_params::Register("WilsonGeneral/Org", create_object_with_params);
211  return init;
212  }
213 #endif
214  };
215 }
216 #endif /* FOPR_WILSON_GENERAL_IMPL_ORG_INCLUDED */
Org::Fopr_WilsonGeneral::get_mode
std::string get_mode() const
Definition: fopr_WilsonGeneral_impl.cpp:86
Org::Fopr_WilsonGeneral::init
void init(const std::string repr)
Definition: fopr_WilsonGeneral_impl.cpp:26
Org::Fopr_WilsonGeneral::m_kappa_s
double m_kappa_s
Definition: fopr_WilsonGeneral_impl.h:50
Org::Fopr_WilsonGeneral::m_kappa_t
double m_kappa_t
Definition: fopr_WilsonGeneral_impl.h:50
bridgeIO.h
Org::Fopr_WilsonGeneral::Ddag
void Ddag(Field &w, const Field &f)
Definition: fopr_WilsonGeneral_impl.h:117
Org::Fopr_WilsonGeneral::m_repr
std::string m_repr
Definition: fopr_WilsonGeneral_impl.h:55
Org::Fopr_WilsonGeneral::m_r_s
double m_r_s
Definition: fopr_WilsonGeneral_impl.h:51
Org::Fopr_WilsonGeneral::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: fopr_WilsonGeneral_impl.h:96
Org::Fopr_WilsonGeneral::m_nu_s
double m_nu_s
Definition: fopr_WilsonGeneral_impl.h:51
field_F.h
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
AFopr< Field >
Org::Fopr_WilsonGeneral::m_trf2
Field_F m_trf2
Definition: fopr_WilsonGeneral_impl.h:65
Org::Fopr_WilsonGeneral::operator=
Fopr_WilsonGeneral & operator=(const Fopr_WilsonGeneral &)
Org::Fopr_WilsonGeneral::Fopr_WilsonGeneral
DEPRECATED Fopr_WilsonGeneral()
Definition: fopr_WilsonGeneral_impl.h:69
Parameters
Class for parameters.
Definition: parameters.h:46
Org::Fopr_WilsonGeneral::D_ex
void D_ex(Field &v, const int ex1, const Field &f, const int ex2)
Definition: fopr_WilsonGeneral_impl.cpp:186
Org::Fopr_WilsonGeneral::DdagD
void DdagD(Field &w, const Field &f)
Definition: fopr_WilsonGeneral_impl.h:126
Org::Fopr_WilsonGeneral::~Fopr_WilsonGeneral
~Fopr_WilsonGeneral()
Definition: fopr_WilsonGeneral_impl.h:83
Org::Fopr_WilsonGeneral::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: fopr_WilsonGeneral_impl.h:169
shiftField_lex.h
Field::nex
int nex() const
Definition: field.h:128
Org::Fopr_WilsonGeneral::Fopr_WilsonGeneral
Fopr_WilsonGeneral(const Fopr_WilsonGeneral &)
Definition: fopr_WilsonGeneral_impl.h:181
Org::Fopr_WilsonGeneral::mult_undef
void mult_undef(Field &, const Field &f)
Definition: fopr_WilsonGeneral_impl.h:154
CommonParameters::Nvol
static int Nvol()
Definition: commonParameters.h:109
Org::Fopr_WilsonGeneral::m_boundary
std::vector< int > m_boundary
Definition: fopr_WilsonGeneral_impl.h:52
Org::Fopr_WilsonGeneral::mult_up
void mult_up(const int mu, Field &w, const Field &f)
upward nearest neighbor hopping term.
Definition: fopr_WilsonGeneral_impl.cpp:272
Org::Fopr_WilsonGeneral::Fopr_WilsonGeneral
DEPRECATED Fopr_WilsonGeneral(std::string repr)
Definition: fopr_WilsonGeneral_impl.h:72
Org::Fopr_WilsonGeneral::mult_dag
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult.
Definition: fopr_WilsonGeneral_impl.h:106
Field::nin
int nin() const
Definition: field.h:126
Org::Fopr_WilsonGeneral::m_mult
void(Fopr_WilsonGeneral::* m_mult)(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.h:57
Org::Fopr_WilsonGeneral::mult_dn
void mult_dn(const int mu, Field &w, const Field &f)
downward nearest neighbor hopping term.
Definition: fopr_WilsonGeneral_impl.cpp:305
Org::Fopr_WilsonGeneral::m_vl
Bridge::VerboseLevel m_vl
Definition: fopr_WilsonGeneral_impl.h:42
Org::Fopr_WilsonGeneral::m_shift
ShiftField_lex m_shift
Definition: fopr_WilsonGeneral_impl.h:64
Org::Fopr_WilsonGeneral::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: fopr_WilsonGeneral_impl.h:171
Org::Fopr_WilsonGeneral::D
void D(Field &v, const Field &f)
Definition: fopr_WilsonGeneral_impl.cpp:167
Org::Fopr_WilsonGeneral::H
void H(Field &w, const Field &f)
Definition: fopr_WilsonGeneral_impl.h:146
Org::Fopr_WilsonGeneral::Fopr_WilsonGeneral
Fopr_WilsonGeneral(const Parameters &params)
Definition: fopr_WilsonGeneral_impl.h:75
CommonParameters::Nc
static int Nc()
Definition: commonParameters.h:115
Org::Fopr_WilsonGeneral::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: fopr_WilsonGeneral_impl.h:173
Org::Fopr_WilsonGeneral::DDdag
void DDdag(Field &w, const Field &f)
Definition: fopr_WilsonGeneral_impl.h:136
Org::Fopr_WilsonGeneral::flop_count
double flop_count()
this returns the number of floating point operations.
Definition: fopr_WilsonGeneral_impl.cpp:336
Org::Fopr_WilsonGeneral::mult_gm5p
const Field_F mult_gm5p(const int mu, const Field_F &w)
Org::Fopr_WilsonGeneral::class_name
static const std::string class_name
Definition: fopr_WilsonGeneral_impl.h:39
Org::Fopr_WilsonGeneral::m_mult_dag
void(Fopr_WilsonGeneral::* m_mult_dag)(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.h:58
Field::nvol
int nvol() const
Definition: field.h:127
Org
Clover term operator.
Definition: fopr_CloverTerm_eo_impl.cpp:23
Org::Fopr_WilsonGeneral
Definition: fopr_WilsonGeneral_impl.h:36
Org::Fopr_WilsonGeneral::mult
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field.
Definition: fopr_WilsonGeneral_impl.h:103
Org::Fopr_WilsonGeneral::m_GM
std::vector< GammaMatrix > m_GM
Definition: fopr_WilsonGeneral_impl.h:62
ShiftField_lex
Methods to shift a field in the lexical site index.
Definition: shiftField_lex.h:39
Org::Fopr_WilsonGeneral::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_WilsonGeneral_impl.cpp:122
fopr.h
Org::Fopr_WilsonGeneral::m_mode
std::string m_mode
Definition: fopr_WilsonGeneral_impl.h:54
CommonParameters::Nd
static int Nd()
Definition: commonParameters.h:116
Org::Fopr_WilsonGeneral::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_WilsonGeneral_impl.cpp:93
Org::Fopr_WilsonGeneral::proj_chiral
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
Definition: fopr_WilsonGeneral_impl.cpp:218
Field_F
Wilson-type fermion field.
Definition: field_F.h:37
Org::Fopr_WilsonGeneral::m_trf
Field_F m_trf
Definition: fopr_WilsonGeneral_impl.h:65
Parameters::get_string
string get_string(const string &key) const
Definition: parameters.cpp:221
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:180
Field
Container of Field-type object.
Definition: field.h:46
Org::Fopr_WilsonGeneral::m_U
const Field_G * m_U
Definition: fopr_WilsonGeneral_impl.h:60
Org::Fopr_WilsonGeneral::m_Ndim
int m_Ndim
Definition: fopr_WilsonGeneral_impl.h:46
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Org::Fopr_WilsonGeneral::m_Nd
int m_Nd
Definition: fopr_WilsonGeneral_impl.h:48
Org::Fopr_WilsonGeneral::set_mode
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: fopr_WilsonGeneral_impl.cpp:59
Org::Fopr_WilsonGeneral::m_Nc
int m_Nc
Definition: fopr_WilsonGeneral_impl.h:47
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
gammaMatrixSet.h
Org::Fopr_WilsonGeneral::m_Nvol
int m_Nvol
Definition: fopr_WilsonGeneral_impl.h:45
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Org::Fopr_WilsonGeneral::mult_gm5
void mult_gm5(Field &v, const Field &f)
multiplies gamma_5 matrix.
Definition: fopr_WilsonGeneral_impl.cpp:204