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_IMP_BGQ_INCLUDED
15 #define FOPR_WILSON_IMP_BGQ_INCLUDED
16 
17 #include "Fopr/fopr.h"
18 
19 #include "Tools/gammaMatrixSet.h"
20 #include "Field/shiftField_lex.h"
21 
23 
24 #include "Tools/mat_SU_N.h"
25 #include "Tools/vec_SU_N.h"
26 
27 #include "IO/bridgeIO.h"
28 using Bridge::vout;
29 
31 
39 namespace Imp_BGQ {
40  class Fopr_WilsonGeneral : public Fopr
41  {
42  public:
43  static const std::string class_name;
44 
45  private:
46 
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_s;
54  double m_kappa_t;
55  double m_nu_s;
56  double m_r_s;
57  std::vector<int> m_boundary;
58  std::vector<double> m_boundary2;
59 
60  const Field_G *m_U;
61  std::vector<GammaMatrix> m_GM;
62 
64 
65  std::string m_mode;
66  std::string m_repr;
67 
69 
71  double *vcp1_xp, *vcp2_xp, *vcp1_xm, *vcp2_xm;
72  double *vcp1_yp, *vcp2_yp, *vcp1_ym, *vcp2_ym;
73  double *vcp1_zp, *vcp2_zp, *vcp1_zm, *vcp2_zm;
74  double *vcp1_tp, *vcp2_tp, *vcp1_tm, *vcp2_tm;
75 
76  // use async data transfer
77  std::vector<int> m_npe;
78  std::vector<Channel *> m_fw_send;
79  std::vector<Channel *> m_fw_recv;
80  std::vector<Channel *> m_bw_send;
81  std::vector<Channel *> m_bw_recv;
82 
83  public:
84  Fopr_WilsonGeneral() { init("Dirac"); }
85  Fopr_WilsonGeneral(std::string repr) { init(repr); }
87 
88  void init(std::string repr);
89 
90  void tidyup();
91 
92  void set_parameters(const Parameters& params);
93  void set_parameters(const double kappa_s, const double kappa_t,
94  const double nu_s, const double r_s,
95  const std::vector<int> bc);
96 
97  void set_config(Field *U)
98  { m_U = (Field_G *)U; }
99 
101  { return set_config(U.get()); }
102 
103  void set_mode(std::string mode);
104 
105  std::string get_mode() const;
106 
107  inline void mult(Field& v, const Field& f)
108  { (this->*m_mult)(v, f); }
109 
110  inline void mult_dag(Field& v, const Field& f)
111  { (this->*m_mult_dag)(v, f); }
112 
113  inline void mult_gm5(Field& v, const Field& f)
114  { (this->*m_gm5)(v, f); }
115 
116  inline void D(Field& v, const Field& f)
117  { (this->*m_D)(v, f); }
118 
119  inline void Ddag(Field& w, const Field& f)
120  {
121  mult_gm5(w, f);
122  D(m_w1, w);
123  mult_gm5(w, m_w1);
124  }
125 
126  inline void DdagD(Field& w, const Field& f)
127  {
128  D(m_w1, f);
129  mult_gm5(w, m_w1);
130  D(m_w1, w);
131  mult_gm5(w, m_w1);
132  }
133 
134  inline void DDdag(Field& w, const Field& f)
135  {
136  mult_gm5(m_w1, f);
137  D(w, m_w1);
138  mult_gm5(m_w1, w);
139  D(w, m_w1);
140  }
141 
142  inline void H(Field& w, const Field& f)
143  {
144  D(m_w1, f);
145  mult_gm5(w, m_w1);
146  }
147 
148  inline void mult_undef(Field&, const Field& f)
149  {
150  vout.crucial(m_vl, "Error at %s: mode undefined.\n", class_name.c_str());
151  exit(EXIT_FAILURE);
152  }
153 
154  inline void D_ex(Field& v, const int ex1,
155  const Field& f, const int ex2)
156  { (this->*m_D_ex)(v, ex1, f, ex2); }
157 
158  const Field_F mult_gm5p(int mu, const Field_F& w)
159  {
160  mult_gm5p(mu, m_w1, w);
161  return (Field_F)m_w1;
162  }
163 
164  void mult_gm5p(int mu, Field&, const Field&);
165 
166  void proj_chiral(Field& w, const int ex1,
167  const Field& v, const int ex2, const int ipm);
168 
169  void mult_up(int mu, Field&, const Field&);
170  void mult_dn(int mu, Field&, const Field&);
171 
173  { return CommonParameters::Nvol(); }
174  int field_nin()
175  { return 2 * CommonParameters::Nc() * CommonParameters::Nd(); }
176  int field_nex()
177  { return 1; }
178 
179  double flop_count();
180 
181  // void fprop_normalize(Field& v);
182  // void fopr_normalize(Field& v);
183  // const double get_fprop_normfactor() { return 2.0 * m_kappa; }
184  // const double get_fopr_normfactor() { return 1.0 / (2.0 * m_kappa); }
185 
186  private:
187  // prohibit copy
190 
191  void (Fopr_WilsonGeneral::*m_mult)(Field&, const Field&);
193  void (Fopr_WilsonGeneral::*m_D)(Field&, const Field&);
194  void (Fopr_WilsonGeneral::*m_gm5)(Field&, const Field&);
197  void (Fopr_WilsonGeneral::*m_D_ex)(Field&, const int,
198  const Field&, const int);
199 
200  void D_chiral(Field&, const Field&);
201  void D_dirac(Field&, const Field&);
202  void gm5_chiral(Field&, const Field&);
203  void gm5_dirac(Field&, const Field&);
204 
205  void D_ex_chiral(Field&, const int ex1, const Field&, const int ex2);
206  void D_ex_dirac(Field&, const int ex1, const Field&, const int ex2);
207 
208  void mult_p(int mu, Field_F&, const Field_F&);
209  void mult_m(int mu, Field_F&, const Field_F&);
210 
211  void mult_xp(Field&, const Field&);
212  void mult_xm(Field&, const Field&);
213  void mult_yp(Field&, const Field&);
214  void mult_ym(Field&, const Field&);
215  void mult_zp(Field&, const Field&);
216  void mult_zm(Field&, const Field&);
217 
218  void mult_tp_dirac(Field&, const Field&);
219  void mult_tm_dirac(Field&, const Field&);
220  void mult_tp_chiral(Field&, const Field&);
221  void mult_tm_chiral(Field&, const Field&);
222 
223  void daypx(Field&, double, const Field&);
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_xp1_thread(int, double *, const double *);
242  void mult_xp2_thread(int, double *, const double *);
243  void mult_xpb_thread(int, double *, const double *);
244  void mult_xm1_thread(int, double *, const double *);
245  void mult_xm2_thread(int, double *, const double *);
246  void mult_xmb_thread(int, double *, const double *);
247  void mult_yp1_thread(int, double *, const double *);
248  void mult_yp2_thread(int, double *, const double *);
249  void mult_ypb_thread(int, double *, const double *);
250  void mult_ym1_thread(int, double *, const double *);
251  void mult_ym2_thread(int, double *, const double *);
252  void mult_ymb_thread(int, double *, const double *);
253  void mult_zp1_thread(int, double *, const double *);
254  void mult_zp2_thread(int, double *, const double *);
255  void mult_zpb_thread(int, double *, const double *);
256  void mult_zm1_thread(int, double *, const double *);
257  void mult_zm2_thread(int, double *, const double *);
258  void mult_zmb_thread(int, double *, const double *);
259  void mult_tp1_dirac_thread(int, double *, const double *);
260  void mult_tp2_dirac_thread(int, double *, const double *);
261  void mult_tpb_dirac_thread(int, double *, const double *);
262  void mult_tm1_dirac_thread(int, double *, const double *);
263  void mult_tm2_dirac_thread(int, double *, const double *);
264  void mult_tmb_dirac_thread(int, double *, const double *);
265  void mult_tp1_chiral_thread(int, double *, const double *);
266  void mult_tp2_chiral_thread(int, double *, const double *);
267  void mult_tpb_chiral_thread(int, double *, const double *);
268  void mult_tm1_chiral_thread(int, double *, const double *);
269  void mult_tm2_chiral_thread(int, double *, const double *);
270  void mult_tmb_chiral_thread(int, double *, const double *);
271  void daypx_thread(int, double *, double, const double *);
272  void clear_thread(int, double *);
273  void gm5_dirac_thread(int, double *, const double *);
274  void gm5_chiral_thread(int, double *, const double *);
275  };
276 }
277 #endif
double * vcp1_xp
arrays for data transfer.
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
void mult_zpb_thread(int, double *, const double *)
void D_ex_chiral(Field &, const int ex1, const Field &, const int ex2)
BridgeIO vout
Definition: bridgeIO.cpp:495
void mult_tp1_chiral_thread(int, double *, const double *)
Fopr_WilsonGeneral & operator=(const Fopr_WilsonGeneral &)
void mult_tp_chiral(Field &, const Field &)
void(Fopr_WilsonGeneral::* m_mult_tp)(Field &, const Field &)
void mult_xp(Field &, const Field &)
void mult_yp(Field &, const Field &)
void mult_tm1_dirac_thread(int, double *, const double *)
const Field_G * m_U
gauge configuration.
void mult_yp1_thread(int, double *, const double *)
double m_nu_s
spatial anisotropy parameter.
void set_config(unique_ptr< Field_G > &U)
void mult_yp2_thread(int, double *, const double *)
void mult_zp2_thread(int, double *, const double *)
double m_kappa_s
spatial hopping parameter.
int field_nvol()
returns the volume for which the fermion operator is defined.
void mult_dn(int mu, Field &, const Field &)
Container of Field-type object.
Definition: field.h:39
void mult_ym2_thread(int, double *, const double *)
void Ddag(Field &w, const Field &f)
void mult_up(int mu, Field &, const Field &)
nearest neighbor hopping term: temporary entry [H.Matsufuru]
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
void mult_tpb_chiral_thread(int, double *, const double *)
void mult_xm(Field &, const Field &)
void mult_ym(Field &, const Field &)
Class for parameters.
Definition: parameters.h:46
void gm5_chiral_thread(int, double *, const double *)
void set_config(Field *U)
setting pointer to the gauge configuration.
std::vector< Channel * > m_bw_recv
void D_ex_dirac(Field &, const int ex1, const Field &, const int ex2)
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
Wilson-type fermion field.
Definition: field_F.h:37
void mult_tpb_dirac_thread(int, double *, const double *)
void H(Field &w, const Field &f)
void mult_tm_dirac(Field &, const Field &)
void mult_tp2_dirac_thread(int, double *, const double *)
void daypx(Field &, double, const Field &)
void mult_zm2_thread(int, double *, const double *)
void mult_xm2_thread(int, double *, const double *)
std::string get_mode() const
only for Fopr_Overlap
SU(N) gauge field.
Definition: field_G.h:38
void mult_tm1_chiral_thread(int, double *, const double *)
void mult_tmb_dirac_thread(int, double *, const double *)
void(Fopr_WilsonGeneral::* m_D_ex)(Field &, const int, const Field &, const int)
void mult_gm5(Field &v, const Field &f)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
void mult_tm2_dirac_thread(int, double *, const double *)
pointer get() const
void mult_tp1_dirac_thread(int, double *, const double *)
double flop_count()
returns the flops per site.
void D_ex(Field &v, const int ex1, const Field &f, const int ex2)
void mult_zp(Field &, const Field &)
std::vector< int > m_boundary
boundary condition.
void gm5_chiral(Field &, const Field &)
void D(Field &v, const Field &f)
void mult_zmb_thread(int, double *, const double *)
void DdagD(Field &w, const Field &f)
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void mult_xmb_thread(int, double *, const double *)
void gm5_dirac_thread(int, double *, const double *)
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
std::vector< double > m_boundary2
b.c. for each node.
void mult_tp_dirac(Field &, const Field &)
void D_chiral(Field &, const Field &)
void mult_p(int mu, Field_F &, const Field_F &)
void daypx_thread(int, double *, double, const double *)
void mult_tmb_chiral_thread(int, double *, const double *)
void mult_ypb_thread(int, double *, const double *)
void D_dirac(Field &, const Field &)
void(Fopr_WilsonGeneral::* m_mult_tm)(Field &, const Field &)
VerboseLevel
Definition: bridgeIO.h:42
double m_r_s
spatial Wilson parameter.
void mult_undef(Field &, const Field &f)
Fopr_WilsonGeneral(const Fopr_WilsonGeneral &)
void set_parameters(const Parameters &params)
void mult_ymb_thread(int, double *, const double *)
void mult_zm(Field &, const Field &)
void DDdag(Field &w, const Field &f)
void mult_xpb_thread(int, double *, const double *)
void(Fopr_WilsonGeneral::* m_mult_dag)(Field &, const Field &)
void mult_ym1_thread(int, double *, const double *)
void gm5_dirac(Field &, const Field &)
void mult_tm_chiral(Field &, const Field &)
Base class of fermion operator family.
Definition: fopr.h:47
std::vector< GammaMatrix > m_GM
gamma matrices.
void mult_m(int mu, Field_F &, const Field_F &)
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
void mult_xp1_thread(int, double *, const double *)
void mult_tm2_chiral_thread(int, double *, const double *)
static const std::string class_name
double m_kappa_t
temporal hopping parameter.
void mult_tp2_chiral_thread(int, double *, const double *)
void mult_zp1_thread(int, double *, const double *)
std::vector< Channel * > m_fw_send
void(Fopr_WilsonGeneral::* m_D)(Field &, const Field &)
void(Fopr_WilsonGeneral::* m_mult)(Field &, const Field &)
void mult_xm1_thread(int, double *, const double *)
void mult_xp2_thread(int, double *, const double *)
void mult_zm1_thread(int, double *, const double *)
std::vector< Channel * > m_fw_recv
void(Fopr_WilsonGeneral::* m_gm5)(Field &, const Field &)
std::vector< Channel * > m_bw_send
const Field_F mult_gm5p(int mu, const Field_F &w)