Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_WilsonGeneral_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_WILSON_GENERAL_ORG_INCLUDED
15 #define FOPR_WILSON_GENERAL_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 
36 namespace Org {
37  class Fopr_WilsonGeneral : public Fopr
38  {
39  public:
40  static const std::string class_name;
41 
42  private:
43  // lattice parameters
44  int m_Nvol;
45  int m_Ndim;
46  int m_Nc;
47  int m_Nd;
48 
50  double m_nu_s, m_r_s;
51  std::vector<int> m_boundary;
52 
53  std::string m_mode;
54  std::string m_repr;
55 
56  void (Fopr_WilsonGeneral::*m_mult)(Field&, const Field&);
58 
59  const Field_G *m_U;
60 
61  std::vector<GammaMatrix> m_GM;
62 
65 
67 
68 
69  public:
70  Fopr_WilsonGeneral() { init("Dirac"); }
71  Fopr_WilsonGeneral(std::string repr) { init(repr); }
73 
74  void init(std::string repr);
75 
76  void set_parameters(const Parameters& params);
77  void set_parameters(const double kappa_s, const double kappa_t,
78  const double nu_s, const double r_s);
79  void set_parameters(const double kappa_s, const double kappa_t,
80  const double nu_s, const double r_s,
81  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(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(int mu, const Field_F& w);
151 
152  void mult_gm5p(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(int mu, Field& w, const Field& f);
167  void mult_dn(int mu, Field& w, const Field& f);
168 
169  // inline void fprop_normalize(Field& v)
170  // { v *= (2.0 * m_kappa); }
171  //
172  // inline void fopr_normalize(Field& v)
173  // { v *= 1.0 / (2.0 * m_kappa); }
174 
175 
176  private:
177  //- prohibit copy
180 
181 // void mult_p (int mu, Field_F&, const Field_F&);
182 // void mult_m (int mu, Field_F&, const Field_F&);
183  };
184 }
185 #endif
void(Fopr_WilsonGeneral::* m_mult_dag)(Field &, const Field &)
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
Fopr_WilsonGeneral(const Fopr_WilsonGeneral &)
BridgeIO vout
Definition: bridgeIO.cpp:495
void mult_up(int mu, Field &w, const Field &f)
nearest neighbor hopping term: temporary entry [H.Matsufuru]
void mult_undef(Field &, const Field &f)
Fopr_WilsonGeneral & operator=(const Fopr_WilsonGeneral &)
int field_nvol()
returns the volume for which the fermion operator is defined.
Container of Field-type object.
Definition: field.h:39
int nvol() const
Definition: field.h:116
void H(Field &w, const Field &f)
void set_config(unique_ptr< Field_G > &U)
Class for parameters.
Definition: parameters.h:46
std::string get_mode() const
only for Fopr_Overlap
void set_parameters(const Parameters &params)
Wilson-type fermion field.
Definition: field_F.h:37
int nin() const
Definition: field.h:115
SU(N) gauge field.
Definition: field_G.h:38
static const std::string class_name
std::vector< GammaMatrix > m_GM
void DDdag(Field &w, const Field &f)
double flop_count()
this returns the number of floating point operations.
pointer get() const
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
int nex() const
Definition: field.h:117
void DdagD(Field &w, const Field &f)
void mult_gm5(Field &v, const Field &f)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void(Fopr_WilsonGeneral::* m_mult)(Field &, const Field &)
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
void Ddag(Field &w, const Field &f)
void set_config(Field *U)
setting pointer to the gauge configuration.
VerboseLevel
Definition: bridgeIO.h:42
const Field_F mult_gm5p(int mu, const Field_F &w)
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
void mult_dn(int mu, Field &w, const Field &f)
Fopr_WilsonGeneral(std::string repr)
void D_ex(Field &v, const int ex1, const Field &f, const int ex2)
Methods to shift a field in the lexical site index.
void D(Field &v, const Field &f)
Base class of fermion operator family.
Definition: fopr.h:47
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...