Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Wilson_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_WILSON_IMPL_ORG_INCLUDED
15 #define FOPR_WILSON_IMPL_ORG_INCLUDED
16 
17 #include "Fopr/fopr.h"
18 
19 #include "Field/shiftField_lex.h"
20 #include "Tools/gammaMatrixSet.h"
21 
22 #include "IO/bridgeIO.h"
23 using Bridge::vout;
24 
26 
41 namespace Org {
42  class Fopr_Wilson : public Fopr
43  {
44  public:
45  static const std::string class_name;
46 
47  private:
49 
50  // lattice parameters
51  int m_Nvol;
52  int m_Ndim;
53  int m_Nc;
54  int m_Nd;
55 
56  double m_kappa;
57  std::vector<int> m_boundary;
58 
59  std::string m_mode;
60  std::string m_repr;
61 
62  void (Fopr_Wilson::*m_mult)(Field&, const Field&);
63  void (Fopr_Wilson::*m_mult_dag)(Field&, const Field&);
64 
65  const Field_G *m_U;
66 
67  std::vector<GammaMatrix> m_GM;
68 
71 
72  public:
73  Fopr_Wilson() { init("Dirac"); }
74  Fopr_Wilson(const std::string repr) { init(repr); }
76 
77  void init(std::string repr);
78 
79  void set_parameters(const Parameters& params);
80  void set_parameters(const double kappa);
81  void set_parameters(const double kappa, const std::vector<int> bc);
82 
83  void set_config(Field *U)
84  { m_U = (Field_G *)U; }
85 
87  { return set_config(U.get()); }
88 
89  void set_mode(const std::string mode);
90 
91  std::string get_mode() const;
92 
93  inline void mult(Field& v, const Field& f)
94  { (this->*m_mult)(v, f); }
95 
96  inline void mult_dag(Field& v, const Field& f)
97  { (this->*m_mult_dag)(v, f); }
98 
99  void mult_gm5(Field& v, const Field& f);
100 
101  void proj_chiral(Field& w, const int ex1, const Field& v, const int ex2, const int ipm);
102 
103  void D(Field& v, const Field& f);
104 
105  void D_ex(Field& v, const int ex1, const Field& f, const int ex2);
106 
107  inline void Ddag(Field& w, const Field& f)
108  {
109  Field w2(f.nin(), f.nvol(), f.nex());
110 
111  mult_gm5(w, f);
112  D(w2, w);
113  mult_gm5(w, w2);
114  }
115 
116  inline void DdagD(Field& w, const Field& f)
117  {
118  Field w2(f.nin(), f.nvol(), f.nex());
119 
120  D(w2, f);
121  mult_gm5(w, w2);
122  D(w2, w);
123  mult_gm5(w, w2);
124  }
125 
126  inline void DDdag(Field& w, const Field& f)
127  {
128  Field w2(f.nin(), f.nvol(), f.nex());
129 
130  mult_gm5(w2, f);
131  D(w, w2);
132  mult_gm5(w2, w);
133  D(w, w2);
134  }
135 
136  inline void H(Field& w, const Field& f)
137  {
138  Field w2(f.nin(), f.nvol(), f.nex());
139 
140  D(w2, f);
141  mult_gm5(w, w2);
142  }
143 
144  inline void mult_undef(Field&, const Field& f)
145  {
146  vout.crucial(m_vl, "Error at %s: mode undefined.\n", class_name.c_str());
147  exit(EXIT_FAILURE);
148  }
149 
150  const Field_F mult_gm5p(const int mu, const Field_F& w);
151 
152  void mult_gm5p(const int mu, Field_F& v, const Field_F& w);
153 
154  // void gm5p(Field_F& v, const int mu, const Field_F& w);
155 
157  double flop_count();
158 
160  { return CommonParameters::Nvol(); }
161  int field_nin()
162  { return 2 * CommonParameters::Nc() * CommonParameters::Nd(); }
163  int field_nex()
164  { return 1; }
165 
166  void mult_up(const int mu, Field& w, const Field& f);
167  void mult_dn(const int mu, Field& w, const Field& f);
168 
169  private:
170  //- prohibit copy
173 
174  // void mult_p (int mu, Field_F&, const Field_F&);
175  // void mult_m (int mu, Field_F&, const Field_F&);
176 
177 #ifdef USE_FACTORY
178  private:
179  static Fopr *create_object()
180  {
181  return new Fopr_Wilson();
182  }
183 
184  static Fopr *create_object_with_repr(const std::string& repr)
185  {
186  return new Fopr_Wilson(repr);
187  }
188 
189  public:
190  static bool register_factory()
191  {
192  bool init1 = Fopr::Factory_noarg::Register("Wilson/Org", create_object);
193  bool init2 = Fopr::Factory_string::Register("Wilson/Org", create_object_with_repr);
194 
195  return init1 && init2;
196  }
197 #endif
198  };
199 }
200 #endif /* FOPR_WILSON_IMPL_ORG_INCLUDED */
BridgeIO vout
Definition: bridgeIO.cpp:503
void set_config(Field *U)
setting pointer to the gauge configuration.
static const std::string class_name
Bridge::VerboseLevel m_vl
int field_nvol()
returns the volume for which the fermion operator is defined.
Container of Field-type object.
Definition: field.h:45
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
int nvol() const
Definition: field.h:127
void mult_gm5(Field &v, const Field &f)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
Class for parameters.
Definition: parameters.h:46
void H(Field &w, const Field &f)
Wilson-type fermion field.
Definition: field_F.h:37
ShiftField_lex m_shift
void mult_dn(const int mu, Field &w, const Field &f)
int nin() const
Definition: field.h:126
void set_parameters(const Parameters &params)
std::vector< int > m_boundary
SU(N) gauge field.
Definition: field_G.h:38
void(Fopr_Wilson::* m_mult)(Field &, const Field &)
void D(Field &v, const Field &f)
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
Fopr_Wilson(const std::string repr)
const Field_F mult_gm5p(const int mu, const Field_F &w)
std::string m_repr
pointer get() const
void init(std::string repr)
int nex() const
Definition: field.h:128
void DdagD(Field &w, const Field &f)
void mult_up(const int mu, Field &w, const Field &f)
nearest neighbor hopping term: temporary entry [H.Matsufuru]
std::vector< GammaMatrix > m_GM
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
Fopr_Wilson & operator=(const Fopr_Wilson &)
std::string m_mode
VerboseLevel
Definition: bridgeIO.h:42
void DDdag(Field &w, const Field &f)
void(Fopr_Wilson::* m_mult_dag)(Field &, const Field &)
Methods to shift a field in the lexical site index.
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
Base class of fermion operator family.
Definition: fopr.h:46
const Field_G * m_U
Fopr_Wilson(const Fopr_Wilson &)
double flop_count()
this returns the number of floating point operations.
void D_ex(Field &v, const int ex1, const Field &f, const int ex2)
void Ddag(Field &w, const Field &f)
std::string get_mode() const
only for Fopr_Overlap
void set_config(unique_ptr< Field_G > &U)
void mult_undef(Field &, const Field &f)
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...