Bridge++  Version 1.4.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 "Tools/gammaMatrixSet.h"
20 #include "Field/shiftField_lex.h"
21 
22 #include "Tools/mat_SU_N.h"
23 
24 #include "IO/bridgeIO.h"
25 using Bridge::vout;
26 
28 
43 namespace Org {
44  class Fopr_Wilson : public Fopr
45  {
46  public:
47  static const std::string class_name;
48 
49  public:
50 
51  Fopr_Wilson() { init("Dirac"); }
52  Fopr_Wilson(std::string repr) { init(repr); }
54 
55  void init(std::string repr);
56 
57  void set_parameters(const Parameters& params);
58  void set_parameters(const double kappa);
59  void set_parameters(const double kappa, const std::vector<int> bc);
60 
61  void set_config(Field *U)
62  { m_U = (Field_G *)U; }
63 
65  { return set_config(U.get()); }
66 
67  void set_mode(std::string mode);
68 
69  std::string get_mode() const;
70 
71  inline void mult(Field& v, const Field& f)
72  { (this->*m_mult)(v, f); }
73 
74  inline void mult_dag(Field& v, const Field& f)
75  { (this->*m_mult_dag)(v, f); }
76 
77  void mult_gm5(Field& v, const Field& f);
78 
79  void proj_chiral(Field& w, const int ex1, const Field& v, const int ex2, const int ipm);
80 
81  void D(Field& v, const Field& f);
82 
83  void D_ex(Field& v, const int ex1, const Field& f, const int ex2);
84 
85  inline void Ddag(Field& w, const Field& f)
86  {
87  Field w2(f.nin(), f.nvol(), f.nex());
88 
89  mult_gm5(w, f);
90  D(w2, w);
91  mult_gm5(w, w2);
92  }
93 
94  inline void DdagD(Field& w, const Field& f)
95  {
96  Field w2(f.nin(), f.nvol(), f.nex());
97 
98  D(w2, f);
99  mult_gm5(w, w2);
100  D(w2, w);
101  mult_gm5(w, w2);
102  }
103 
104  inline void DDdag(Field& w, const Field& f)
105  {
106  Field w2(f.nin(), f.nvol(), f.nex());
107 
108  mult_gm5(w2, f);
109  D(w, w2);
110  mult_gm5(w2, w);
111  D(w, w2);
112  }
113 
114  inline void H(Field& w, const Field& f)
115  {
116  Field w2(f.nin(), f.nvol(), f.nex());
117 
118  D(w2, f);
119  mult_gm5(w, w2);
120  }
121 
122  inline void mult_undef(Field&, const Field& f)
123  {
124  vout.crucial(m_vl, "Error at %s: mode undefined.\n", class_name.c_str());
125  exit(EXIT_FAILURE);
126  }
127 
128  const Field_F mult_gm5p(int mu, const Field_F& w);
129 
130  void mult_gm5p(int mu, Field_F& v, const Field_F& w);
131 
132 // void gm5p(Field_F& v, const int mu, const Field_F& w);
133 
135  double flop_count();
136 
138  { return CommonParameters::Nvol(); }
139  int field_nin()
140  { return 2 * CommonParameters::Nc() * CommonParameters::Nd(); }
141  int field_nex()
142  { return 1; }
143 
144 
145  void mult_up(int mu, Field& w, const Field& f);
146  void mult_dn(int mu, Field& w, const Field& f);
147 
148  inline void fprop_normalize(Field& v)
149  { scal(v, (2.0 * m_kappa)); }
150 
151  inline void fopr_normalize(Field& v)
152  { scal(v, 1.0 / (2.0 * m_kappa)); }
153 
154 
155  private:
156  //- prohibit copy
159 
160 
162 
163  // lattice parameters
164  int m_Nvol;
165  int m_Ndim;
166  int m_Nc;
167  int m_Nd;
168 
169  double m_kappa;
170  std::vector<int> m_boundary;
171 
172  std::string m_mode;
173  std::string m_repr;
174 
175  void (Fopr_Wilson::*m_mult)(Field&, const Field&);
176  void (Fopr_Wilson::*m_mult_dag)(Field&, const Field&);
177 
178  const Field_G *m_U;
179 
180  std::vector<GammaMatrix> m_GM;
181 
184 
185 // void mult_p (int mu, Field_F&, const Field_F&);
186 // void mult_m (int mu, Field_F&, const Field_F&);
187  };
188 }
189 #endif
void scal(Field &x, const double a)
scal(x, a): x = a * x
Definition: field.cpp:282
BridgeIO vout
Definition: bridgeIO.cpp:495
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.
const Field_F mult_gm5p(int mu, const Field_F &w)
Fopr_Wilson(std::string repr)
Container of Field-type object.
Definition: field.h:39
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:116
void mult_gm5(Field &v, const Field &f)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
Class for parameters.
Definition: parameters.h:46
ShiftField_lex shift
void H(Field &w, const Field &f)
std::string get_mode() const
only for Fopr_Overlap
Wilson-type fermion field.
Definition: field_F.h:37
int nin() const
Definition: field.h:115
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 set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
void D(Field &v, const Field &f)
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
void mult_up(int mu, Field &w, const Field &f)
nearest neighbor hopping term: temporary entry [H.Matsufuru]
pointer get() const
void init(std::string repr)
int nex() const
Definition: field.h:117
void DdagD(Field &w, const Field &f)
std::vector< GammaMatrix > m_GM
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
Fopr_Wilson & operator=(const Fopr_Wilson &)
VerboseLevel
Definition: bridgeIO.h:42
void DDdag(Field &w, const Field &f)
void(Fopr_Wilson::* m_mult_dag)(Field &, const Field &)
void fprop_normalize(Field &v)
Methods to shift a field in the lexical site index.
void mult_dn(int mu, Field &w, const Field &f)
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:47
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)
void set_config(unique_ptr< Field_G > &U)
void fopr_normalize(Field &v)
void mult_undef(Field &, const Field &f)
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).