Bridge++  Ver. 2.0.2
fopr_Wilson_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_WILSON_IMPL_IMP_INCLUDED
15 #define FOPR_WILSON_IMPL_IMP_INCLUDED
16 
17 //#include "Fopr/fopr_Wilson.h"
18 #include "Fopr/fopr.h"
19 
20 #include "Field/shiftField_lex.h"
21 #include "Tools/gammaMatrixSet.h"
22 
23 #include "IO/bridgeIO.h"
24 using Bridge::vout;
25 
27 
42 namespace Imp {
43  class Fopr_Wilson : public Fopr
44  {
45  public:
46  static const std::string class_name;
47 
48  private:
49  // input parameters
50  double m_kappa;
51  std::vector<int> m_boundary;
52  std::string m_repr;
54 
55  std::string m_mode;
56 
57  // internal data members
58  int m_Nc, m_Nd, m_Nvc, m_Ndf;
59  int m_Nx, m_Ny, m_Nz, m_Nt;
60  int m_Nvol, m_Ndim;
61 
62  const Field_G *m_U;
63 
64  std::vector<double> m_boundary_each_node;
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 
73 
74  public:
76  Fopr_Wilson(const Parameters& params) { init(params); }
77 
79  Fopr_Wilson() { init("Dirac"); }
80 
82  Fopr_Wilson(const std::string repr) { init(repr); }
83 
85 
86  void set_parameters(const Parameters& params);
87 
88  void set_parameters(const double kappa, const std::vector<int> bc);
89 
90  void get_parameters(Parameters& params) const;
91 
92  void set_config(Field *U);
93 
94  void set_mode(const std::string mode);
95 
96  std::string get_mode() const { return m_mode; }
97 
98  void mult(Field& v, const Field& w);
99 
100  void mult_dag(Field& v, const Field& w);
101 
102  void mult(Field& v, const Field& w, const std::string mod);
103 
104  void mult_dag(Field& v, const Field& w, const std::string mode);
105 
106  void mult_gm5(Field& v, const Field& w);
107 
108  void D(Field& v, const Field& w);
109 
110  void Ddag(Field& v, const Field& w);
111 
112  void DdagD(Field& v, const Field& w);
113 
114  void DDdag(Field& v, const Field& w);
115 
116  void H(Field& v, const Field& w);
117 
118  void D_ex(Field& v, const int ex1,
119  const Field& f, const int ex2);
120 
121  void mult_gm5p(const int mu, Field&, const Field&);
122 
123  void proj_chiral(Field& w, const int ex1,
124  const Field& v, const int ex2, const int ipm);
125 
126  void mult_up(const int mu, Field&, const Field&);
127  void mult_dn(const int mu, Field&, const Field&);
128 
129  int field_nvol() { return m_Nvol; }
130  int field_nin() { return m_Nvc * m_Nd; }
131  int field_nex() { return 1; }
132 
133  double flop_count();
134 
135  private:
136  // prohibit copy
139 
141  void init(const std::string repr);
142 
144  void init();
145 
147  void init(const Parameters& params);
148 
150  void setup();
151 
153  void tidyup();
154 
155  void mult_gm5_chiral(Field&, const Field&);
156  void mult_gm5_dirac(Field&, const Field&);
157 
158  void D_ex_chiral(Field&, const int ex1, const Field&, const int ex2);
159  void D_ex_dirac(Field&, const int ex1, const Field&, const int ex2);
160 
161  void D_ex_chiral_alt(Field&, const int ex1, const Field&, const int ex2);
162  void D_ex_dirac_alt(Field&, const int ex1, const Field&, const int ex2);
163 
164  void mult_xp(Field&, const Field&);
165  void mult_xm(Field&, const Field&);
166  void mult_yp(Field&, const Field&);
167  void mult_ym(Field&, const Field&);
168  void mult_zp(Field&, const Field&);
169  void mult_zm(Field&, const Field&);
170 
171  void mult_tp_dirac(Field&, const Field&);
172  void mult_tm_dirac(Field&, const Field&);
173  void mult_tp_chiral(Field&, const Field&);
174  void mult_tm_chiral(Field&, const Field&);
175 
176  void daypx(Field&, const double, const Field&);
177  void clear(Field&);
178 
179 
180 #ifdef USE_FACTORY
181  private:
182  static Fopr *create_object() { return new Fopr_Wilson(); }
183 
184  static Fopr *create_object_with_repr(const std::string& repr)
185  { return new Fopr_Wilson(repr); }
186 
187  static Fopr *create_object_with_params(const Parameters& params)
188  { return new Fopr_Wilson(params); }
189 
190  public:
191  static bool register_factory()
192  {
193  bool init = true;
194  init &= Fopr::Factory_noarg::Register("Wilson/Imp", create_object);
195  init &= Fopr::Factory_string::Register("Wilson/Imp",
196  create_object_with_repr);
197  init &= Fopr::Factory_params::Register("Wilson/Imp",
198  create_object_with_params);
199  return init;
200  }
201 #endif
202  };
203 }
204 #endif /* FOPR_WILSON_IMPL_IMP_INCLUDED */
Imp::Fopr_Wilson::mult_ym
void mult_ym(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:1728
Imp::Fopr_Wilson::mult_tp_dirac
void mult_tp_dirac(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:2005
Imp::Fopr_Wilson::class_name
static const std::string class_name
Definition: fopr_Wilson_impl.h:46
Imp::Fopr_Wilson::m_w2
Field m_w2
working fields
Definition: fopr_Wilson_impl.h:72
Imp::Fopr_Wilson::Ddag
void Ddag(Field &v, const Field &w)
Definition: fopr_Wilson_impl.cpp:432
bridgeIO.h
Imp::Fopr_Wilson::flop_count
double flop_count()
returns the number of floating point operations.
Definition: fopr_Wilson_impl.cpp:2351
Imp::Fopr_Wilson::vcp1_zp
double * vcp1_zp
Definition: fopr_Wilson_impl.h:69
Imp::Fopr_Wilson::vcp1_xm
double * vcp1_xm
Definition: fopr_Wilson_impl.h:67
Imp::Fopr_Wilson::mult_gm5
void mult_gm5(Field &v, const Field &w)
multiplies gamma_5 matrix.
Definition: fopr_Wilson_impl.cpp:396
Imp::Fopr_Wilson::D_ex_dirac
void D_ex_dirac(Field &, const int ex1, const Field &, const int ex2)
Definition: fopr_Wilson_impl.cpp:469
Imp::Fopr_Wilson::mult
void mult(Field &v, const Field &w)
multiplies fermion operator to a given field.
Definition: fopr_Wilson_impl.cpp:264
Imp::Fopr_Wilson::m_Ny
int m_Ny
Definition: fopr_Wilson_impl.h:59
AFopr< Field >
Imp::Fopr_Wilson::m_mode
std::string m_mode
mult mode
Definition: fopr_Wilson_impl.h:55
Parameters
Class for parameters.
Definition: parameters.h:46
Imp::Fopr_Wilson::mult_zm
void mult_zm(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:1910
Imp::Fopr_Wilson::vcp2_tp
double * vcp2_tp
Definition: fopr_Wilson_impl.h:70
Imp::Fopr_Wilson::proj_chiral
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
Definition: fopr_Wilson_impl.cpp:1360
Imp::Fopr_Wilson::m_Nd
int m_Nd
Definition: fopr_Wilson_impl.h:58
Imp::Fopr_Wilson::mult_tm_dirac
void mult_tm_dirac(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:2088
Imp::Fopr_Wilson::mult_xp
void mult_xp(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:1473
Imp::Fopr_Wilson::DdagD
void DdagD(Field &v, const Field &w)
Definition: fopr_Wilson_impl.cpp:441
shiftField_lex.h
Imp::Fopr_Wilson::DDdag
void DDdag(Field &v, const Field &w)
Definition: fopr_Wilson_impl.cpp:451
Imp::Fopr_Wilson::vcp2_xm
double * vcp2_xm
Definition: fopr_Wilson_impl.h:67
Imp::Fopr_Wilson::mult_dn
void mult_dn(const int mu, Field &, const Field &)
downward nearest neighbor hopping term.
Definition: fopr_Wilson_impl.cpp:373
Imp::Fopr_Wilson::mult_xm
void mult_xm(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:1554
Imp::Fopr_Wilson::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: fopr_Wilson_impl.h:129
Imp::Fopr_Wilson::vcp2_tm
double * vcp2_tm
Definition: fopr_Wilson_impl.h:70
Imp::Fopr_Wilson::m_Ndf
int m_Ndf
Definition: fopr_Wilson_impl.h:58
Imp::Fopr_Wilson::vcp2_zp
double * vcp2_zp
Definition: fopr_Wilson_impl.h:69
Imp::Fopr_Wilson::mult_zp
void mult_zp(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:1821
Imp::Fopr_Wilson::m_w1
Field m_w1
Definition: fopr_Wilson_impl.h:72
Imp::Fopr_Wilson::m_kappa
double m_kappa
hopping parameter
Definition: fopr_Wilson_impl.h:50
Imp::Fopr_Wilson::mult_gm5p
void mult_gm5p(const int mu, Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:1351
Imp::Fopr_Wilson::m_Nz
int m_Nz
Definition: fopr_Wilson_impl.h:59
Imp::Fopr_Wilson::mult_yp
void mult_yp(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:1641
Imp::Fopr_Wilson::Fopr_Wilson
Fopr_Wilson(const Fopr_Wilson &)
Definition: fopr_Wilson_impl.h:137
Imp::Fopr_Wilson::D
void D(Field &v, const Field &w)
Definition: fopr_Wilson_impl.cpp:407
Imp::Fopr_Wilson::setup
void setup()
initial setup main.
Definition: fopr_Wilson_impl.cpp:95
Imp::Fopr_Wilson::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: fopr_Wilson_impl.h:130
Imp::Fopr_Wilson::m_boundary_each_node
std::vector< double > m_boundary_each_node
b.c. on each node.
Definition: fopr_Wilson_impl.h:64
Imp::Fopr_Wilson::mult_up
void mult_up(const int mu, Field &, const Field &)
upward nearest neighbor hopping term.
Definition: fopr_Wilson_impl.cpp:350
Imp::Fopr_Wilson::D_ex
void D_ex(Field &v, const int ex1, const Field &f, const int ex2)
Definition: fopr_Wilson_impl.cpp:420
Imp::Fopr_Wilson::tidyup
void tidyup()
final clean-up.
Definition: fopr_Wilson_impl.cpp:149
Imp::Fopr_Wilson::mult_gm5_chiral
void mult_gm5_chiral(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:1452
Imp::Fopr_Wilson::mult_gm5_dirac
void mult_gm5_dirac(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:1431
Imp::Fopr_Wilson::D_ex_dirac_alt
void D_ex_dirac_alt(Field &, const int ex1, const Field &, const int ex2)
Definition: fopr_Wilson_impl.cpp:1317
Imp::Fopr_Wilson::D_ex_chiral_alt
void D_ex_chiral_alt(Field &, const int ex1, const Field &, const int ex2)
Definition: fopr_Wilson_impl.cpp:1334
Imp::Fopr_Wilson::vcp2_yp
double * vcp2_yp
Definition: fopr_Wilson_impl.h:68
Imp::Fopr_Wilson::vcp2_ym
double * vcp2_ym
Definition: fopr_Wilson_impl.h:68
Imp::Fopr_Wilson::vcp1_xp
double * vcp1_xp
arrays for communication buffer.
Definition: fopr_Wilson_impl.h:67
Imp::Fopr_Wilson
Definition: fopr_Wilson_impl.h:43
Imp::Fopr_Wilson::m_U
const Field_G * m_U
gauge configuration.
Definition: fopr_Wilson_impl.h:62
Imp::Fopr_Wilson::vcp2_zm
double * vcp2_zm
Definition: fopr_Wilson_impl.h:69
Imp::Fopr_Wilson::vcp2_xp
double * vcp2_xp
Definition: fopr_Wilson_impl.h:67
Imp::Fopr_Wilson::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: fopr_Wilson_impl.cpp:245
Imp::Fopr_Wilson::vcp1_zm
double * vcp1_zm
Definition: fopr_Wilson_impl.h:69
Imp::Fopr_Wilson::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_Wilson_impl.cpp:174
Imp::Fopr_Wilson::vcp1_ym
double * vcp1_ym
Definition: fopr_Wilson_impl.h:68
Imp::Fopr_Wilson::D_ex_chiral
void D_ex_chiral(Field &, const int ex1, const Field &, const int ex2)
Definition: fopr_Wilson_impl.cpp:893
Imp::Fopr_Wilson::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_Wilson_impl.cpp:234
Imp::Fopr_Wilson::daypx
void daypx(Field &, const double, const Field &)
Definition: fopr_Wilson_impl.cpp:1406
Imp::Fopr_Wilson::m_Nx
int m_Nx
Definition: fopr_Wilson_impl.h:59
Imp::Fopr_Wilson::m_boundary
std::vector< int > m_boundary
boundary condition
Definition: fopr_Wilson_impl.h:51
fopr.h
Imp::Fopr_Wilson::vcp1_tm
double * vcp1_tm
Definition: fopr_Wilson_impl.h:70
Imp::Fopr_Wilson::H
void H(Field &v, const Field &w)
Definition: fopr_Wilson_impl.cpp:461
Imp::Fopr_Wilson::m_vl
Bridge::VerboseLevel m_vl
verbose level
Definition: fopr_Wilson_impl.h:53
Imp::Fopr_Wilson::m_repr
std::string m_repr
gamma-matrix representation
Definition: fopr_Wilson_impl.h:52
Imp::Fopr_Wilson::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_impl.cpp:254
Imp::Fopr_Wilson::vcp1_tp
double * vcp1_tp
Definition: fopr_Wilson_impl.h:70
Imp::Fopr_Wilson::vcp1_yp
double * vcp1_yp
Definition: fopr_Wilson_impl.h:68
Imp::Fopr_Wilson::~Fopr_Wilson
~Fopr_Wilson()
Definition: fopr_Wilson_impl.h:84
Imp::Fopr_Wilson::Fopr_Wilson
Fopr_Wilson(const Parameters &params)
standard constructor.
Definition: fopr_Wilson_impl.h:76
Imp::Fopr_Wilson::m_Nc
int m_Nc
Definition: fopr_Wilson_impl.h:58
Imp
Clover term operator.
Definition: fopr_CloverTerm_eo_impl.cpp:32
Imp::Fopr_Wilson::m_Nvc
int m_Nvc
Definition: fopr_Wilson_impl.h:58
Imp::Fopr_Wilson::get_mode
std::string get_mode() const
Definition: fopr_Wilson_impl.h:96
Imp::Fopr_Wilson::Fopr_Wilson
DEPRECATED Fopr_Wilson(const std::string repr)
Definition: fopr_Wilson_impl.h:82
Imp::Fopr_Wilson::mult_dag
void mult_dag(Field &v, const Field &w)
hermitian conjugate of mult.
Definition: fopr_Wilson_impl.cpp:285
Field
Container of Field-type object.
Definition: field.h:46
Imp::Fopr_Wilson::m_Nvol
int m_Nvol
Definition: fopr_Wilson_impl.h:60
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Imp::Fopr_Wilson::clear
void clear(Field &)
Definition: fopr_Wilson_impl.cpp:1384
Imp::Fopr_Wilson::mult_tp_chiral
void mult_tp_chiral(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:2179
Imp::Fopr_Wilson::Fopr_Wilson
DEPRECATED Fopr_Wilson()
Definition: fopr_Wilson_impl.h:79
Imp::Fopr_Wilson::m_Nt
int m_Nt
Definition: fopr_Wilson_impl.h:59
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
gammaMatrixSet.h
Imp::Fopr_Wilson::mult_tm_chiral
void mult_tm_chiral(Field &, const Field &)
Definition: fopr_Wilson_impl.cpp:2262
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Imp::Fopr_Wilson::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: fopr_Wilson_impl.h:131
Imp::Fopr_Wilson::init
void init()
to be discarded.
Imp::Fopr_Wilson::operator=
Fopr_Wilson & operator=(const Fopr_Wilson &)
Imp::Fopr_Wilson::m_Ndim
int m_Ndim
Definition: fopr_Wilson_impl.h:60