Bridge++  Ver. 1.2.x
 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_INCLUDED
15 #define FOPR_WILSON_IMPL_INCLUDED
16 
17 #include "fopr_Wilson.h"
18 
19 #include "gammaMatrixSet.h"
20 #include "shiftField_lex.h"
21 
22 #include "bridgeIO.h"
23 using Bridge::vout;
24 
26 
42 {
43  public:
44  static const std::string class_name;
45 
46  private:
47  // lattice parameters
48  int m_Nc, m_Nd, m_Nvc, m_Ndf;
49  int m_Nx, m_Ny, m_Nz, m_Nt;
50  int m_Nvol, m_Ndim;
51 
52  // physical parameters
53  double m_kappa;
54  std::valarray<int> m_boundary;
55  std::valarray<double> m_boundary2;
56 
57  const Field_G *m_U;
58  std::valarray<GammaMatrix> m_GM;
59 
61 
62  std::string m_mode;
63  std::string m_repr;
64 
66 
68  double *vcp1_xp, *vcp2_xp, *vcp1_xm, *vcp2_xm;
69  double *vcp1_yp, *vcp2_yp, *vcp1_ym, *vcp2_ym;
70  double *vcp1_zp, *vcp2_zp, *vcp1_zm, *vcp2_zm;
71  double *vcp1_tp, *vcp2_tp, *vcp1_tm, *vcp2_tm;
72 
73  public:
74 
77 
78  void init(std::string repr);
79 
80  void tidyup();
81 
82  void set_parameters(const double kappa, const std::valarray<int> bc);
83 
84  void set_config(Field *U)
85  { m_U = (Field_G *)U; }
86 
87  void set_mode(std::string mode);
88 
89  std::string get_mode() const;
90 
91  inline void mult(Field& v, const Field& f)
92  { (this->*m_mult)(v, f); }
93 
94  inline void mult_dag(Field& v, const Field& f)
95  { (this->*m_mult_dag)(v, f); }
96 
97  inline void mult_gm5(Field& v, const Field& f)
98  { (this->*m_gm5)(v, f); }
99 
100  inline void D(Field& v, const Field& f)
101  { (this->*m_D)(v, f); }
102 
103  inline void Ddag(Field& w, const Field& f)
104  {
105  mult_gm5(w, f);
106  D(m_w1, w);
107  mult_gm5(w, m_w1);
108  }
109 
110  inline void DdagD(Field& w, const Field& f)
111  {
112  D(m_w1, f);
113 
114  // Ddag(w, m_w1);
115  mult_gm5(w, m_w1);
116  D(m_w1, w);
117  mult_gm5(w, m_w1);
118  }
119 
120  inline void DDdag(Field& w, const Field& f)
121  {
122  // Ddag(m_w1, f);
123  mult_gm5(m_w1, f);
124  D(w, m_w1);
125  mult_gm5(m_w1, w);
126 
127  D(w, m_w1);
128  }
129 
130  inline void H(Field& w, const Field& f)
131  {
132  D(m_w1, f);
133  mult_gm5(w, m_w1);
134  }
135 
136  inline void mult_undef(Field&, const Field& f)
137  {
138  vout.crucial(m_vl, "Fopr_Wilson: mode undefined.\n");
139  abort();
140  }
141 
142  inline void D_ex(Field& v, const int ex1,
143  const Field& f, const int ex2)
144  { (this->*m_D_ex)(v, ex1, f, ex2); }
145 
146  const Field_F mult_gm5p(int mu, const Field_F& w)
147  {
148  mult_gm5p(mu, m_w1, w);
149  return (Field_F)m_w1;
150  }
151 
152  void mult_gm5p(int mu, Field&, const Field&);
153 
154  // void gm5p(Field_F& v, const int mu, const Field_F& w);
155 
156  void proj_chiral(Field& w, const int ex1,
157  const Field& v, const int ex2, const int ipm);
158 
159  void mult_up(int mu, Field&, const Field&);
160  void mult_dn(int mu, Field&, const Field&);
161 
162  double flop_count();
163 
164  inline void fprop_normalize(Field& v)
165  { v *= (2.0 * m_kappa); }
166 
167  inline void fopr_normalize(Field& v)
168  { v *= 1.0 / (2.0 * m_kappa); }
169 
170  // const double get_fprop_normfactor(){ return 2.0 * m_kappa; }
171  // const double get_fopr_normfactor(){ return 1.0/(2.0 * m_kappa); }
172 
173  private:
174 
175  // prohibit copy
178 
186  const Field &, const int);
187 
188  void D_chiral(Field&, const Field&);
189  void D_dirac(Field&, const Field&);
190  void gm5_chiral(Field&, const Field&);
191  void gm5_dirac(Field&, const Field&);
192 
193  void D_ex_chiral(Field&, const int ex1, const Field&, const int ex2);
194  void D_ex_dirac(Field&, const int ex1, const Field&, const int ex2);
195 
196  void mult_p(int mu, Field_F&, const Field_F&);
197  void mult_m(int mu, Field_F&, const Field_F&);
198 
199  void mult_xp(Field&, const Field&);
200  void mult_xm(Field&, const Field&);
201  void mult_yp(Field&, const Field&);
202  void mult_ym(Field&, const Field&);
203  void mult_zp(Field&, const Field&);
204  void mult_zm(Field&, const Field&);
205 
206  void mult_tp_dirac(Field&, const Field&);
207  void mult_tm_dirac(Field&, const Field&);
208  void mult_tp_chiral(Field&, const Field&);
209  void mult_tm_chiral(Field&, const Field&);
210 
211  void daypx(Field&, double, const Field&);
212  void clear(Field&);
213 
214  // member data for threading
215  int m_Mz, m_Mt;
218 
219  struct mult_arg
220  {
221  int isite;
223  int kz0, kz1, kt0, kt1;
224  };
225  valarray<mult_arg> m_arg;
226 
227  // member functions for threading
228  void setup_thread();
229  void mult_xp1_thread(int, double *, double *);
230  void mult_xp2_thread(int, double *, double *);
231  void mult_xpb_thread(int, double *, double *);
232  void mult_xm1_thread(int, double *, double *);
233  void mult_xm2_thread(int, double *, double *);
234  void mult_xmb_thread(int, double *, double *);
235  void mult_yp1_thread(int, double *, double *);
236  void mult_yp2_thread(int, double *, double *);
237  void mult_ypb_thread(int, double *, double *);
238  void mult_ym1_thread(int, double *, double *);
239  void mult_ym2_thread(int, double *, double *);
240  void mult_ymb_thread(int, double *, double *);
241  void mult_zp1_thread(int, double *, double *);
242  void mult_zp2_thread(int, double *, double *);
243  void mult_zpb_thread(int, double *, double *);
244  void mult_zm1_thread(int, double *, double *);
245  void mult_zm2_thread(int, double *, double *);
246  void mult_zmb_thread(int, double *, double *);
247  void mult_tp1_dirac_thread(int, double *, double *);
248  void mult_tp2_dirac_thread(int, double *, double *);
249  void mult_tpb_dirac_thread(int, double *, double *);
250  void mult_tm1_dirac_thread(int, double *, double *);
251  void mult_tm2_dirac_thread(int, double *, double *);
252  void mult_tmb_dirac_thread(int, double *, double *);
253  void mult_tp1_chiral_thread(int, double *, double *);
254  void mult_tp2_chiral_thread(int, double *, double *);
255  void mult_tpb_chiral_thread(int, double *, double *);
256  void mult_tm1_chiral_thread(int, double *, double *);
257  void mult_tm2_chiral_thread(int, double *, double *);
258  void mult_tmb_chiral_thread(int, double *, double *);
259  void daypx_thread(int, double *, double, double *);
260  void clear_thread(int, double *);
261  void gm5_dirac_thread(int, double *, double *);
262  void gm5_chiral_thread(int, double *, double *);
263 
264  // for derivatives
265  void mult_xpu(Field&, const Field&);
266  void mult_ypu(Field&, const Field&);
267  void mult_zpu(Field&, const Field&);
268  void mult_tpu_dirac(Field&, const Field&);
269  void mult_tpu_chiral(Field&, const Field&);
270 };
271 #endif
void daypx(Field &, double, const Field &)
void mult_tpb_dirac_thread(int, double *, double *)
void mult_zp(Field &, const Field &)
void mult_tm1_chiral_thread(int, double *, double *)
BridgeIO vout
Definition: bridgeIO.cpp:207
void mult_tpu_dirac(Field &, const Field &)
void gm5_chiral(Field &, const Field &)
void set_parameters(const double kappa, const std::valarray< int > bc)
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
void mult_dag(Field &v, const Field &f)
double * vcp1_xp
arrays for data transfer.
void mult_m(int mu, Field_F &, const Field_F &)
void mult_tm_dirac(Field &, const Field &)
void mult_xp1_thread(int, double *, double *)
void daypx_thread(int, double *, double, double *)
Container of Field-type object.
Definition: field.h:37
void D_ex(Field &v, const int ex1, const Field &f, const int ex2)
void(Fopr_Wilson::Fopr_Wilson_impl::* m_D_ex)(Field &, const int, const Field &, const int)
void mult_xm2_thread(int, double *, double *)
void mult_zm2_thread(int, double *, double *)
void D(Field &v, const Field &f)
void mult_xp2_thread(int, double *, double *)
void(Fopr_Wilson::Fopr_Wilson_impl::* m_mult_dag)(Field &, const Field &)
void mult_tp_chiral(Field &, const Field &)
void mult_ymb_thread(int, double *, double *)
void H(Field &w, const Field &f)
void mult_tm2_chiral_thread(int, double *, double *)
void gm5_dirac_thread(int, double *, double *)
std::valarray< double > m_boundary2
b.c. for each node.
void mult_zmb_thread(int, double *, double *)
void D_chiral(Field &, const Field &)
void mult_tm2_dirac_thread(int, double *, double *)
void mult_zpu(Field &, const Field &)
void mult_xpu(Field &, const Field &)
void mult_zp1_thread(int, double *, double *)
void mult_xm(Field &, const Field &)
Wilson-type fermion field.
Definition: field_F.h:37
void mult_ym1_thread(int, double *, double *)
void DdagD(Field &w, const Field &f)
const Field_G * m_U
gauge configuration.
Field m_w2
temporary fields.
void mult_yp2_thread(int, double *, double *)
SU(N) gauge field.
Definition: field_G.h:36
Fopr_Wilson_impl & operator=(const Fopr_Wilson::Fopr_Wilson_impl &)
void mult_zp2_thread(int, double *, double *)
void(Fopr_Wilson::Fopr_Wilson_impl::* m_mult)(Field &, const Field &)
void mult_tm1_dirac_thread(int, double *, double *)
void DDdag(Field &w, const Field &f)
void mult_tpu_chiral(Field &, const Field &)
Fopr_Wilson_impl(const Fopr_Wilson::Fopr_Wilson_impl &)
void mult_tp1_chiral_thread(int, double *, double *)
void mult_xmb_thread(int, double *, double *)
std::valarray< GammaMatrix > m_GM
gamma matrices.
void mult_ym(Field &, const Field &)
void(Fopr_Wilson::Fopr_Wilson_impl::* m_D)(Field &, const Field &)
void mult_xm1_thread(int, double *, double *)
double m_kappa
hopping parameter.
void(Fopr_Wilson::Fopr_Wilson_impl::* m_gm5)(Field &, const Field &)
void mult_p(int mu, Field_F &, const Field_F &)
void D_ex_chiral(Field &, const int ex1, const Field &, const int ex2)
void D_ex_dirac(Field &, const int ex1, const Field &, const int ex2)
static const std::string class_name
void mult_tp1_dirac_thread(int, double *, double *)
const Field_F mult_gm5p(int mu, const Field_F &w)
void mult_zm1_thread(int, double *, double *)
void mult_xpb_thread(int, double *, double *)
void mult_tmb_dirac_thread(int, double *, double *)
void crucial(const char *format,...)
Definition: bridgeIO.cpp:26
void mult_tp2_chiral_thread(int, double *, double *)
void set_mode(std::string mode)
void mult_ypb_thread(int, double *, double *)
VerboseLevel
Definition: bridgeIO.h:25
void(Fopr_Wilson::Fopr_Wilson_impl::* m_mult_tm)(Field &, const Field &)
void mult_tp2_dirac_thread(int, double *, double *)
void gm5_chiral_thread(int, double *, double *)
Wilson fermion operator.
void mult_tp_dirac(Field &, const Field &)
std::valarray< int > m_boundary
boundary condition.
void mult_up(int mu, Field &, const Field &)
void mult_ypu(Field &, const Field &)
void mult(Field &v, const Field &f)
void mult_zpb_thread(int, double *, double *)
void mult_ym2_thread(int, double *, double *)
void D_dirac(Field &, const Field &)
void mult_gm5(Field &v, const Field &f)
void mult_zm(Field &, const Field &)
void mult_undef(Field &, const Field &f)
void mult_tpb_chiral_thread(int, double *, double *)
void mult_yp1_thread(int, double *, double *)
void mult_tmb_chiral_thread(int, double *, double *)
void mult_yp(Field &, const Field &)
void mult_xp(Field &, const Field &)
void mult_dn(int mu, Field &, const Field &)
void Ddag(Field &w, const Field &f)
void init(std::string repr)
void(Fopr_Wilson::Fopr_Wilson_impl::* m_mult_tp)(Field &, const Field &)
void mult_tm_chiral(Field &, const Field &)
void gm5_dirac(Field &, const Field &)