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_IMP_INCLUDED
15 #define FOPR_WILSON_GENERAL_IMP_INCLUDED
16 
17 #include "Fopr/fopr.h"
18 
19 #include "Tools/gammaMatrixSet.h"
20 #include "Field/shiftField_lex.h"
21 
23 
24 #include "IO/bridgeIO.h"
25 using Bridge::vout;
26 
28 
36 namespace Imp {
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_Nc, m_Nd, m_Nvc, m_Ndf;
45  int m_Nx, m_Ny, m_Nz, m_Nt;
46  int m_Nvol, m_Ndim;
47 
48  // physical parameters
50  double m_nu_s, m_r_s;
51  std::vector<int> m_boundary;
52  std::vector<double> m_boundary2;
53 
54  const Field_G *m_U;
55  std::vector<GammaMatrix> m_GM;
56 
58 
59  std::string m_mode;
60  std::string m_repr;
61 
63 
69 
70  public:
71  Fopr_WilsonGeneral() { init("Dirac"); }
72  Fopr_WilsonGeneral(std::string repr) { init(repr); }
74 
75  void init(std::string repr);
76 
77  void tidyup();
78 
79  void set_parameters(const Parameters& params);
80  void set_parameters(const double kappa_s, const double kappa_t,
81  const double nu_s, const double r_s,
82  const std::vector<int> bc);
83 
84  void set_config(Field *U)
85  { m_U = (Field_G *)U; }
86 
88  { return set_config(U.get()); }
89 
90  void set_mode(std::string mode);
91 
92  std::string get_mode() const;
93 
94  inline void mult(Field& v, const Field& f)
95  { (this->*m_mult)(v, f); }
96 
97  inline void mult_dag(Field& v, const Field& f)
98  { (this->*m_mult_dag)(v, f); }
99 
100  inline void mult_gm5(Field& v, const Field& f)
101  { (this->*m_gm5)(v, f); }
102 
103  inline void D(Field& v, const Field& f)
104  { (this->*m_D)(v, f); }
105 
106  inline void Ddag(Field& w, const Field& f)
107  {
108  mult_gm5(w, f);
109  D(m_w1, w);
110  mult_gm5(w, m_w1);
111  }
112 
113  inline void DdagD(Field& w, const Field& f)
114  {
115  D(m_w1, f);
116 
117  // Ddag(w, m_w1);
118  mult_gm5(w, m_w1);
119  D(m_w1, w);
120  mult_gm5(w, m_w1);
121  }
122 
123  inline void DDdag(Field& w, const Field& f)
124  {
125  // Ddag(m_w1, f);
126  mult_gm5(m_w1, f);
127  D(w, m_w1);
128  mult_gm5(m_w1, w);
129 
130  D(w, m_w1);
131  }
132 
133  inline void H(Field& w, const Field& f)
134  {
135  D(m_w1, f);
136  mult_gm5(w, m_w1);
137  }
138 
139  inline void mult_undef(Field&, const Field& f)
140  {
141  vout.crucial(m_vl, "Error at %s: mode undefined.\n", class_name.c_str());
142  exit(EXIT_FAILURE);
143  }
144 
145  inline void D_ex(Field& v, const int ex1,
146  const Field& f, const int ex2)
147  { (this->*m_D_ex)(v, ex1, f, ex2); }
148 
149  const Field_F mult_gm5p(int mu, const Field_F& w)
150  {
151  mult_gm5p(mu, m_w1, w);
152  return (Field_F)m_w1;
153  }
154 
155  void mult_gm5p(int mu, Field&, const Field&);
156 
157  // void gm5p(Field_F& v, const int mu, const Field_F& w);
158 
159  void proj_chiral(Field& w, const int ex1,
160  const Field& v, const int ex2, const int ipm);
161 
162  void mult_up(int mu, Field&, const Field&);
163  void mult_dn(int mu, Field&, const Field&);
164 
165 
167  { return CommonParameters::Nvol(); }
168  int field_nin()
169  { return 2 * CommonParameters::Nc() * CommonParameters::Nd(); }
170  int field_nex()
171  { return 1; }
172 
173  double flop_count();
174 
175  // inline void fprop_normalize(Field& v)
176  // { v *= (2.0 * m_kappa); }
177  //
178  // inline void fopr_normalize(Field& v)
179  // { v *= 1.0 / (2.0 * m_kappa); }
180 
181  // const double get_fprop_normfactor(){ return 2.0 * m_kappa; }
182  // const double get_fopr_normfactor(){ return 1.0/(2.0 * m_kappa); }
183 
184  private:
185  // prohibit copy
188 
189  void (Fopr_WilsonGeneral::*m_mult)(Field&, const Field&);
191  void (Fopr_WilsonGeneral::*m_D)(Field&, const Field&);
192  void (Fopr_WilsonGeneral::*m_gm5)(Field&, const Field&);
195  void (Fopr_WilsonGeneral::*m_D_ex)(Field&, const int,
196  const Field&, const int);
197 
198  void D_chiral(Field&, const Field&);
199  void D_dirac(Field&, const Field&);
200  void gm5_chiral(Field&, const Field&);
201  void gm5_dirac(Field&, const Field&);
202 
203  void D_ex_chiral(Field&, const int ex1, const Field&, const int ex2);
204  void D_ex_dirac(Field&, const int ex1, const Field&, const int ex2);
205 
206  void mult_p(int mu, Field_F&, const Field_F&);
207  void mult_m(int mu, Field_F&, const Field_F&);
208 
209  void mult_x_plus(Field&, const Field&);
210  void mult_x_minus(Field&, const Field&);
211  void mult_y_plus(Field&, const Field&);
212  void mult_y_minus(Field&, const Field&);
213  void mult_z_plus(Field&, const Field&);
214  void mult_z_minus(Field&, const Field&);
215 
216  void mult_t_plus_dirac(Field&, const Field&);
217  void mult_t_minus_dirac(Field&, const Field&);
218  void mult_t_plus_chiral(Field&, const Field&);
219  void mult_t_minus_chiral(Field&, const Field&);
220 
221  void daxpy(Field&, double, const Field&);
222  void daypx(Field&, double, const Field&);
223  void scal(Field&, double);
224  void clear(Field&);
225 
226  // member data for threading
227  int m_Mz, m_Mt;
230 
231  struct mult_arg
232  {
233  int isite;
235  int kz0, kz1, kt0, kt1;
236  };
237  std::vector<mult_arg> m_arg;
238 
239  // member functions for threading
240  void setup_thread();
241  void mult_x_plus1_thread(int, double *, const double *);
242  void mult_x_plus2_thread(int, double *, const double *);
243  void mult_x_plus_bulk_thread(int, double *, const double *);
244  void mult_x_minus1_thread(int, double *, const double *);
245  void mult_x_minus2_thread(int, double *, const double *);
246  void mult_x_minus_bulk_thread(int, double *, const double *);
247  void mult_y_plus1_thread(int, double *, const double *);
248  void mult_y_plus2_thread(int, double *, const double *);
249  void mult_y_plus_bulk_thread(int, double *, const double *);
250  void mult_y_minus1_thread(int, double *, const double *);
251  void mult_y_minus2_thread(int, double *, const double *);
252  void mult_y_minus_bulk_thread(int, double *, const double *);
253  void mult_z_plus1_thread(int, double *, const double *);
254  void mult_z_plus2_thread(int, double *, const double *);
255  void mult_z_plus_bulk_thread(int, double *, const double *);
256  void mult_z_minus1_thread(int, double *, const double *);
257  void mult_z_minus2_thread(int, double *, const double *);
258  void mult_z_minus_bulk_thread(int, double *, const double *);
259  void mult_t_plus1_dirac_thread(int, double *, const double *);
260  void mult_t_plus2_dirac_thread(int, double *, const double *);
261  void mult_t_plus_bulk_dirac_thread(int, double *, const double *);
262  void mult_t_minus1_dirac_thread(int, double *, const double *);
263  void mult_t_minus2_dirac_thread(int, double *, const double *);
264  void mult_t_minus_bulk_dirac_thread(int, double *, const double *);
265  void mult_t_plus1_chiral_thread(int, double *, const double *);
266  void mult_t_plus2_chiral_thread(int, double *, const double *);
267  void mult_t_plus_bulk_chiral_thread(int, double *, const double *);
268  void mult_t_minus1_chiral_thread(int, double *, const double *);
269  void mult_t_minus2_chiral_thread(int, double *, const double *);
270  void mult_t_minus_bulk_chiral_thread(int, double *, const double *);
271 
272  void daxpy_thread(int, double *, double, const double *);
273  void daypx_thread(int, double *, double, const double *);
274  void scal_thread(int, double *, double);
275  void clear_thread(int, double *);
276 
277  void gm5_dirac_thread(int, double *, const double *);
278  void gm5_chiral_thread(int, double *, const double *);
279 
280  //- for derivatives
281  // void mult_xpu(Field&, const Field&);
282  // void mult_ypu(Field&, const Field&);
283  // void mult_zpu(Field&, const Field&);
284  // void mult_tpu_dirac(Field&, const Field&);
285  // void mult_tpu_chiral(Field&, const Field&);
286  };
287 }
288 #endif
const Field_F mult_gm5p(int mu, const Field_F &w)
void mult_t_plus1_chiral_thread(int, double *, const double *)
BridgeIO vout
Definition: bridgeIO.cpp:495
void(Fopr_WilsonGeneral::* m_mult_t_plus)(Field &, const Field &)
void DDdag(Field &w, const Field &f)
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
void mult_y_plus2_thread(int, double *, const double *)
double * vcp1_x_plus
arrays for data transfer.
void D_dirac(Field &, const Field &)
void mult_t_plus2_dirac_thread(int, double *, const double *)
void D_ex_chiral(Field &, const int ex1, const Field &, const int ex2)
int field_nvol()
returns the volume for which the fermion operator is defined.
void mult_x_minus_bulk_thread(int, double *, const double *)
void mult_x_plus2_thread(int, double *, const double *)
void(Fopr_WilsonGeneral::* m_mult)(Field &, const Field &)
Fopr_WilsonGeneral(std::string repr)
Container of Field-type object.
Definition: field.h:39
void H(Field &w, const Field &f)
void mult_t_plus_dirac(Field &, const Field &)
void mult_t_plus_bulk_dirac_thread(int, double *, const double *)
void mult_t_minus2_chiral_thread(int, double *, const double *)
std::string get_mode() const
only for Fopr_Overlap
void gm5_dirac_thread(int, double *, const double *)
void mult_x_plus(Field &, const Field &)
void set_config(Field *U)
setting pointer to the gauge configuration.
void daxpy_thread(int, double *, double, const double *)
void gm5_chiral_thread(int, double *, const double *)
Class for parameters.
Definition: parameters.h:46
double flop_count()
returns the flops per site.
void daxpy(Field &, double, const Field &)
Fopr_WilsonGeneral(const Fopr_WilsonGeneral &)
void D_ex(Field &v, const int ex1, const Field &f, const int ex2)
void mult_x_minus1_thread(int, double *, const double *)
void mult_y_plus_bulk_thread(int, double *, const double *)
void mult_m(int mu, Field_F &, const Field_F &)
void mult_x_minus2_thread(int, double *, const double *)
Wilson-type fermion field.
Definition: field_F.h:37
std::vector< GammaMatrix > m_GM
gamma matrices.
void mult_t_minus_dirac(Field &, const Field &)
void mult_z_plus_bulk_thread(int, double *, const double *)
void set_config(unique_ptr< Field_G > &U)
void DdagD(Field &w, const Field &f)
void mult_y_minus(Field &, const Field &)
void mult_y_minus_bulk_thread(int, double *, const double *)
void mult_z_minus1_thread(int, double *, const double *)
void mult_t_minus1_dirac_thread(int, double *, const double *)
void mult_undef(Field &, const Field &f)
SU(N) gauge field.
Definition: field_G.h:38
void mult_t_minus_bulk_chiral_thread(int, double *, const double *)
void mult_gm5(Field &v, const Field &f)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
void mult_x_plus1_thread(int, double *, const double *)
const Field_G * m_U
gauge configuration.
Field m_w2
temporary fields.
void daypx_thread(int, double *, double, const double *)
std::vector< double > m_boundary2
b.c. for each node.
void mult_t_plus2_chiral_thread(int, double *, const double *)
pointer get() const
void mult_x_minus(Field &, const Field &)
void mult_dn(int mu, Field &, const Field &)
void mult_t_plus_chiral(Field &, const Field &)
void mult_t_minus_chiral(Field &, const Field &)
void mult_x_plus_bulk_thread(int, double *, const double *)
void mult_t_minus2_dirac_thread(int, double *, const double *)
void(Fopr_WilsonGeneral::* m_mult_dag)(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 mult_y_plus(Field &, const Field &)
void mult_y_minus1_thread(int, double *, const double *)
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void mult_y_minus2_thread(int, double *, const double *)
void mult_z_plus2_thread(int, double *, const double *)
void(Fopr_WilsonGeneral::* m_mult_t_minus)(Field &, const Field &)
void(Fopr_WilsonGeneral::* m_D_ex)(Field &, const int, const Field &, const int)
void scal_thread(int, double *, double)
static const std::string class_name
void mult_t_plus_bulk_chiral_thread(int, double *, const double *)
void gm5_chiral(Field &, const Field &)
void set_parameters(const Parameters &params)
VerboseLevel
Definition: bridgeIO.h:42
void mult_z_minus_bulk_thread(int, double *, const double *)
void mult_z_plus1_thread(int, double *, const double *)
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
void Ddag(Field &w, const Field &f)
void mult_p(int mu, Field_F &, const Field_F &)
std::vector< mult_arg > m_arg
void mult_up(int mu, Field &, const Field &)
nearest neighbor hopping term: temporary entry [H.Matsufuru]
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
void(Fopr_WilsonGeneral::* m_gm5)(Field &, const Field &)
void D_ex_dirac(Field &, const int ex1, const Field &, const int ex2)
void daypx(Field &, double, const Field &)
void D(Field &v, const Field &f)
void mult_z_minus(Field &, const Field &)
Base class of fermion operator family.
Definition: fopr.h:47
void mult_y_plus1_thread(int, double *, const double *)
void mult_t_minus1_chiral_thread(int, double *, const double *)
Fopr_WilsonGeneral & operator=(const Fopr_WilsonGeneral &)
void mult_t_plus1_dirac_thread(int, double *, const double *)
std::vector< int > m_boundary
boundary condition.
void mult_z_plus(Field &, const Field &)
void gm5_dirac(Field &, const Field &)
void(Fopr_WilsonGeneral::* m_D)(Field &, const Field &)
void mult_t_minus_bulk_dirac_thread(int, double *, const double *)
void mult_z_minus2_thread(int, double *, const double *)
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
void D_chiral(Field &, const Field &)