Bridge++  Ver. 2.0.2
fopr_Wilson_eo_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_WILSON_EO_IMPL_IMP_INCLUDED
15 #define FOPR_WILSON_EO_IMPL_IMP_INCLUDED
16 
17 #include "Fopr/fopr_eo.h"
18 #include "Field/index_eo.h"
19 
20 #include "IO/bridgeIO.h"
21 using Bridge::vout;
22 
24 
37 namespace Imp {
38  class Fopr_Wilson_eo : public Fopr_eo
39  {
40  public:
41  static const std::string class_name;
42 
43  private:
44  // input parameters
45  double m_kappa;
46  std::vector<int> m_boundary;
47  std::string m_repr;
49 
50  std::string m_mode;
51 
52  // internal data members
53  int m_Nc, m_Nd, m_Nvc, m_Ndf;
55  int m_Nx, m_Ny, m_Nz, m_Nt, m_Nx2;
56 
57  std::vector<double> m_boundary_each_node;
58 
61 
62  std::vector<int> m_yzt_eo;
65 
67  double *vcp1_xp, *vcp2_xp, *vcp1_xm, *vcp2_xm;
68  double *vcp1_yp, *vcp2_yp, *vcp1_ym, *vcp2_ym;
69  double *vcp1_zp, *vcp2_zp, *vcp1_zm, *vcp2_zm;
70  double *vcp1_tp, *vcp2_tp, *vcp1_tm, *vcp2_tm;
71 
72  public:
74  Fopr_Wilson_eo() { init("Dirac"); }
75 
77  Fopr_Wilson_eo(const std::string repr) { init(repr); }
78 
79  Fopr_Wilson_eo(const Parameters& params) { init(params); }
80 
82 
83  void set_parameters(const Parameters& params);
84 
85  void set_parameters(const double kappa, const std::vector<int> bc);
86 
87  void get_parameters(Parameters& params) const;
88 
89  void set_config(Field *U);
90  void set_config_omp(Field *U);
91  void set_config_impl(Field *U);
92 
93  void set_mode(const std::string mode);
94 
95  std::string get_mode() const { return m_mode; }
96 
97  // method for even odd fermion operator
98  void preProp(Field& Be, Field& bo, const Field& b);
99 
100  void postProp(Field& x, const Field& xe, const Field& bo);
101 
102  void mult(Field& v, const Field& w);
103 
104  void mult_dag(Field& v, const Field& w);
105 
106  void mult(Field& v, const Field& w, const std::string mode);
107 
108  void mult_dag(Field& v, const Field& w, const std::string mode);
109 
110  void D(Field& v, const Field& w);
111  void Ddag(Field& v, const Field& w);
112  void DdagD(Field& v, const Field& w);
113  void DDdag(Field& v, const Field& w);
114  void H(Field& v, const Field& w);
115 
116  // Meo: ieo = 0: even <- odd, 1: odd <- even
117  void Meo(Field&, const Field&, const int ieo);
118 
119  void Mdageo(Field&, const Field&, const int ieo);
120 
121  // void MeoMoe(Field&, const Field&);
122  void Meo_gm5(Field&, const Field&, const int ieo);
123 
124  void mult_gm5(Field&, const Field&);
125  void mult_gm5(Field&);
126  void gm5_dirac(Field&, const Field&);
127  void gm5_chiral(Field&, const Field&);
128 
130  void gm5p(const int mu, Field&, const Field& v);
131 
132  int field_nvol() { return m_Nvol2; }
133  int field_nin() { return m_Nvc * m_Nd; }
134  int field_nex() { return 1; }
135 
137  double flop_count();
138 
139  private:
140  void init(const std::string);
141 
142  void init(const Parameters&);
143 
144  void setup();
145 
146  void tidyup();
147 
148  void Meo_dirac(Field&, const Field&, const int ieo);
149  void Meo_chiral(Field&, const Field&, const int ieo);
150 
151  void mult_xp(Field&, const Field&, const int ieo);
152  void mult_xm(Field&, const Field&, const int ieo);
153  void mult_yp(Field&, const Field&, const int ieo);
154  void mult_ym(Field&, const Field&, const int ieo);
155  void mult_zp(Field&, const Field&, const int ieo);
156  void mult_zm(Field&, const Field&, const int ieo);
157  void mult_tp_dirac(Field&, const Field&, const int ieo);
158  void mult_tm_dirac(Field&, const Field&, const int ieo);
159  void mult_tp_chiral(Field&, const Field&, const int ieo);
160  void mult_tm_chiral(Field&, const Field&, const int ieo);
161 
162 
163 #ifdef USE_FACTORY
164  private:
165  static Fopr *create_object()
166  {
167  return new Fopr_Wilson_eo();
168  }
169 
170  static Fopr *create_object_with_repr(const std::string& repr)
171  {
172  return new Fopr_Wilson_eo(repr);
173  }
174 
175  static Fopr *create_object_with_params(const Parameters& params)
176  {
177  return new Fopr_Wilson_eo(params);
178  }
179 
180  public:
181  static bool register_factory()
182  {
183  bool init = true;
184  init &= Fopr::Factory_noarg::Register("Wilson_eo/Imp",
185  create_object);
186  init &= Fopr::Factory_string::Register("Wilson_eo/Imp",
187  create_object_with_repr);
188  init &= Fopr::Factory_params::Register("Wilson_eo/Imp",
189  create_object_with_params);
190  return init;
191  }
192 #endif
193  };
194 }
195 #endif /* FOPR_WILSON_EO_IMPL_IMP_INCLUDED */
Imp::Fopr_Wilson_eo::mult_ym
void mult_ym(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:884
Imp::Fopr_Wilson_eo::m_mode
std::string m_mode
mult mode.
Definition: fopr_Wilson_eo_impl.h:50
Imp::Fopr_Wilson_eo::mult_yp
void mult_yp(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:797
bridgeIO.h
Imp::Fopr_Wilson_eo::gm5p
void gm5p(const int mu, Field &, const Field &v)
gamma_5 (1 - gamma_mu) v(x + mu) used in force calculation.
Definition: fopr_Wilson_eo_impl.cpp:608
Imp::Fopr_Wilson_eo::vcp1_xm
double * vcp1_xm
Definition: fopr_Wilson_eo_impl.h:67
Imp::Fopr_Wilson_eo::postProp
void postProp(Field &x, const Field &xe, const Field &bo)
Definition: fopr_Wilson_eo_impl.cpp:417
AFopr< Field >
Imp::Fopr_Wilson_eo::mult
void mult(Field &v, const Field &w)
multiplies fermion operator to a given field (2nd argument)
Definition: fopr_Wilson_eo_impl.cpp:329
Imp::Fopr_Wilson_eo::Meo_dirac
void Meo_dirac(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:488
Imp::Fopr_Wilson_eo::~Fopr_Wilson_eo
~Fopr_Wilson_eo()
Definition: fopr_Wilson_eo_impl.h:81
Imp::Fopr_Wilson_eo::DDdag
void DDdag(Field &v, const Field &w)
Definition: fopr_Wilson_eo_impl.cpp:445
Imp::Fopr_Wilson_eo::m_Nd
int m_Nd
Definition: fopr_Wilson_eo_impl.h:53
Imp::Fopr_Wilson_eo::vcp1_ym
double * vcp1_ym
Definition: fopr_Wilson_eo_impl.h:68
Parameters
Class for parameters.
Definition: parameters.h:46
Imp::Fopr_Wilson_eo::m_Nvc
int m_Nvc
Definition: fopr_Wilson_eo_impl.h:53
Imp::Fopr_Wilson_eo::mult_zm
void mult_zm(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:1066
AFopr_eo< Field >
Imp::Fopr_Wilson_eo::get_mode
std::string get_mode() const
Definition: fopr_Wilson_eo_impl.h:95
Imp::Fopr_Wilson_eo::m_yzt_eo
std::vector< int > m_yzt_eo
yzt parity
Definition: fopr_Wilson_eo_impl.h:62
Imp::Fopr_Wilson_eo::mult_xm
void mult_xm(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:705
Imp::Fopr_Wilson_eo::Meo_chiral
void Meo_chiral(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:513
Imp::Fopr_Wilson_eo::field_nex
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
Definition: fopr_Wilson_eo_impl.h:134
Imp::Fopr_Wilson_eo::m_Ueo
Field_G m_Ueo
Definition: fopr_Wilson_eo_impl.h:60
Imp::Fopr_Wilson_eo::vcp2_zp
double * vcp2_zp
Definition: fopr_Wilson_eo_impl.h:69
Imp::Fopr_Wilson_eo::mult_xp
void mult_xp(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:619
Imp::Fopr_Wilson_eo::vcp1_yp
double * vcp1_yp
Definition: fopr_Wilson_eo_impl.h:68
Imp::Fopr_Wilson_eo::vcp2_xp
double * vcp2_xp
Definition: fopr_Wilson_eo_impl.h:67
Imp::Fopr_Wilson_eo::m_Ndf
int m_Ndf
Definition: fopr_Wilson_eo_impl.h:53
Index_eo
Even-odd site index.
Definition: index_eo.h:44
Imp::Fopr_Wilson_eo::gm5_dirac
void gm5_dirac(Field &, const Field &)
Definition: fopr_Wilson_eo_impl.cpp:566
Imp::Fopr_Wilson_eo::vcp2_zm
double * vcp2_zm
Definition: fopr_Wilson_eo_impl.h:69
Imp::Fopr_Wilson_eo::vcp1_tp
double * vcp1_tp
Definition: fopr_Wilson_eo_impl.h:70
Imp::Fopr_Wilson_eo::m_boundary_each_node
std::vector< double > m_boundary_each_node
b.c. for each node.
Definition: fopr_Wilson_eo_impl.h:57
Imp::Fopr_Wilson_eo::vcp2_tm
double * vcp2_tm
Definition: fopr_Wilson_eo_impl.h:70
Imp::Fopr_Wilson_eo::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_Wilson_eo_impl.cpp:271
Imp::Fopr_Wilson_eo::Meo
void Meo(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:477
Imp::Fopr_Wilson_eo::tidyup
void tidyup()
Definition: fopr_Wilson_eo_impl.cpp:184
Imp::Fopr_Wilson_eo::m_Nvol
int m_Nvol
Definition: fopr_Wilson_eo_impl.h:54
Imp::Fopr_Wilson_eo::flop_count
double flop_count()
this returns the number of floating point operations of Meo.
Definition: fopr_Wilson_eo_impl.cpp:1511
Imp::Fopr_Wilson_eo::set_config
void set_config(Field *U)
setting pointer to the gauge configuration.
Definition: fopr_Wilson_eo_impl.cpp:282
Imp::Fopr_Wilson_eo::vcp2_ym
double * vcp2_ym
Definition: fopr_Wilson_eo_impl.h:68
Imp::Fopr_Wilson_eo::field_nin
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
Definition: fopr_Wilson_eo_impl.h:133
Imp::Fopr_Wilson_eo::preProp
void preProp(Field &Be, Field &bo, const Field &b)
Definition: fopr_Wilson_eo_impl.cpp:399
Imp::Fopr_Wilson_eo::m_v1
Field m_v1
Definition: fopr_Wilson_eo_impl.h:63
Imp::Fopr_Wilson_eo::Mdageo
void Mdageo(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:538
Imp::Fopr_Wilson_eo::mult_tp_dirac
void mult_tp_dirac(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:1161
fopr_eo.h
Imp::Fopr_Wilson_eo::set_config_omp
void set_config_omp(Field *U)
Definition: fopr_Wilson_eo_impl.cpp:300
Imp::Fopr_Wilson_eo::mult_tm_chiral
void mult_tm_chiral(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:1421
Imp::Fopr_Wilson_eo::field_nvol
int field_nvol()
returns the volume for which the fermion operator is defined.
Definition: fopr_Wilson_eo_impl.h:132
Imp::Fopr_Wilson_eo::set_config_impl
void set_config_impl(Field *U)
Definition: fopr_Wilson_eo_impl.cpp:312
Imp::Fopr_Wilson_eo::m_w1
Field m_w1
Definition: fopr_Wilson_eo_impl.h:64
Imp::Fopr_Wilson_eo::vcp2_tp
double * vcp2_tp
Definition: fopr_Wilson_eo_impl.h:70
Imp::Fopr_Wilson_eo::vcp1_zp
double * vcp1_zp
Definition: fopr_Wilson_eo_impl.h:69
Imp::Fopr_Wilson_eo::m_w2
Field m_w2
working field
Definition: fopr_Wilson_eo_impl.h:64
Imp::Fopr_Wilson_eo::Fopr_Wilson_eo
DEPRECATED Fopr_Wilson_eo()
Definition: fopr_Wilson_eo_impl.h:74
Imp::Fopr_Wilson_eo::m_repr
std::string m_repr
Dirac matrix representation.
Definition: fopr_Wilson_eo_impl.h:47
Imp::Fopr_Wilson_eo::vcp1_tm
double * vcp1_tm
Definition: fopr_Wilson_eo_impl.h:70
Imp::Fopr_Wilson_eo::setup
void setup()
Definition: fopr_Wilson_eo_impl.cpp:100
Imp::Fopr_Wilson_eo::m_Nt
int m_Nt
Definition: fopr_Wilson_eo_impl.h:55
Imp::Fopr_Wilson_eo::init
void init(const std::string)
Definition: fopr_Wilson_eo_impl.cpp:73
Imp::Fopr_Wilson_eo::DdagD
void DdagD(Field &v, const Field &w)
Definition: fopr_Wilson_eo_impl.cpp:437
Imp::Fopr_Wilson_eo::vcp2_yp
double * vcp2_yp
Definition: fopr_Wilson_eo_impl.h:68
Imp::Fopr_Wilson_eo::m_Ny
int m_Ny
Definition: fopr_Wilson_eo_impl.h:55
Imp::Fopr_Wilson_eo::m_Nz
int m_Nz
Definition: fopr_Wilson_eo_impl.h:55
Imp::Fopr_Wilson_eo::Fopr_Wilson_eo
Fopr_Wilson_eo(const Parameters &params)
Definition: fopr_Wilson_eo_impl.h:79
Imp::Fopr_Wilson_eo::vcp1_xp
double * vcp1_xp
communication buffers
Definition: fopr_Wilson_eo_impl.h:67
Imp::Fopr_Wilson_eo::gm5_chiral
void gm5_chiral(Field &, const Field &)
Definition: fopr_Wilson_eo_impl.cpp:587
Imp::Fopr_Wilson_eo::m_Nx2
int m_Nx2
Definition: fopr_Wilson_eo_impl.h:55
Imp::Fopr_Wilson_eo::mult_zp
void mult_zp(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:977
Imp::Fopr_Wilson_eo::Meo_gm5
void Meo_gm5(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:547
Imp::Fopr_Wilson_eo::H
void H(Field &v, const Field &w)
Imp::Fopr_Wilson_eo::mult_tp_chiral
void mult_tp_chiral(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:1337
Imp::Fopr_Wilson_eo::m_boundary
std::vector< int > m_boundary
boundary condition
Definition: fopr_Wilson_eo_impl.h:46
Imp::Fopr_Wilson_eo::class_name
static const std::string class_name
Definition: fopr_Wilson_eo_impl.h:41
Imp::Fopr_Wilson_eo::m_vl
Bridge::VerboseLevel m_vl
verbose level
Definition: fopr_Wilson_eo_impl.h:48
Imp::Fopr_Wilson_eo::mult_gm5
void mult_gm5(Field &, const Field &)
multiplies gamma_5 matrix.
Definition: fopr_Wilson_eo_impl.cpp:555
Imp::Fopr_Wilson_eo::mult_dag
void mult_dag(Field &v, const Field &w)
hermitian conjugate of mult(Field&, const Field&).
Definition: fopr_Wilson_eo_impl.cpp:348
index_eo.h
Imp::Fopr_Wilson_eo::m_Nx
int m_Nx
Definition: fopr_Wilson_eo_impl.h:55
Imp::Fopr_Wilson_eo::m_Nvol2
int m_Nvol2
Definition: fopr_Wilson_eo_impl.h:54
Imp::Fopr_Wilson_eo::Ddag
void Ddag(Field &v, const Field &w)
Definition: fopr_Wilson_eo_impl.cpp:466
Imp
Clover term operator.
Definition: fopr_CloverTerm_eo_impl.cpp:32
Imp::Fopr_Wilson_eo::m_kappa
double m_kappa
hopping parameter
Definition: fopr_Wilson_eo_impl.h:45
Imp::Fopr_Wilson_eo::mult_tm_dirac
void mult_tm_dirac(Field &, const Field &, const int ieo)
Definition: fopr_Wilson_eo_impl.cpp:1245
Imp::Fopr_Wilson_eo::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_Wilson_eo_impl.cpp:211
Field
Container of Field-type object.
Definition: field.h:46
Imp::Fopr_Wilson_eo::set_mode
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: fopr_Wilson_eo_impl.cpp:319
Imp::Fopr_Wilson_eo
Definition: fopr_Wilson_eo_impl.h:38
Imp::Fopr_Wilson_eo::m_index
Index_eo m_index
Definition: fopr_Wilson_eo_impl.h:59
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Imp::Fopr_Wilson_eo::vcp1_zm
double * vcp1_zm
Definition: fopr_Wilson_eo_impl.h:69
Imp::Fopr_Wilson_eo::Fopr_Wilson_eo
DEPRECATED Fopr_Wilson_eo(const std::string repr)
Definition: fopr_Wilson_eo_impl.h:77
Imp::Fopr_Wilson_eo::vcp2_xm
double * vcp2_xm
Definition: fopr_Wilson_eo_impl.h:67
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
Imp::Fopr_Wilson_eo::D
void D(Field &v, const Field &w)
Definition: fopr_Wilson_eo_impl.cpp:453
Imp::Fopr_Wilson_eo::m_Ndim
int m_Ndim
Definition: fopr_Wilson_eo_impl.h:54
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Imp::Fopr_Wilson_eo::m_Nc
int m_Nc
Definition: fopr_Wilson_eo_impl.h:53
Imp::Fopr_Wilson_eo::m_v2
Field m_v2
working field
Definition: fopr_Wilson_eo_impl.h:63