Bridge++  Ver. 2.0.2
fopr_WilsonGeneral_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_WILSON_GENERAL_IMPL_IMP_INCLUDED
15 #define FOPR_WILSON_GENERAL_IMPL_IMP_INCLUDED
16 
17 #include "Fopr/fopr.h"
18 
19 #include "Field/shiftField_lex.h"
20 #include "Tools/gammaMatrixSet.h"
21 
23 
24 #include "IO/bridgeIO.h"
25 using Bridge::vout;
26 
28 
37 namespace Imp {
38  class Fopr_WilsonGeneral : public Fopr
39  {
40  public:
41  static const std::string class_name;
42 
43  private:
44  // input parameters
46  double m_nu_s, m_r_s;
47  std::vector<int> m_boundary;
48  std::string m_repr;
50 
51  std::string m_mode;
52 
53  // internal data members
54  int m_Nc, m_Nd, m_Nvc, m_Ndf;
55  int m_Nx, m_Ny, m_Nz, m_Nt;
56  int m_Nvol, m_Ndim;
57 
58  const Field_G *m_U;
59 
60  std::vector<double> m_boundary_each_node;
61 
63  double *vcp1_xp, *vcp2_xp, *vcp1_xm, *vcp2_xm;
64  double *vcp1_yp, *vcp2_yp, *vcp1_ym, *vcp2_ym;
65  double *vcp1_zp, *vcp2_zp, *vcp1_zm, *vcp2_zm;
66  double *vcp1_tp, *vcp2_tp, *vcp1_tm, *vcp2_tm;
67 
69 
70  public:
72  Fopr_WilsonGeneral(const Parameters& params) { init(params); }
73 
75  Fopr_WilsonGeneral() { init("Dirac"); }
76 
78  Fopr_WilsonGeneral(const std::string repr) { init(repr); }
79 
81 
82  void set_parameters(const Parameters& params);
83 
84  void set_parameters(const double kappa_s, const double kappa_t,
85  const double nu_s, const double r_s,
86  const std::vector<int> bc);
87 
88  void get_parameters(Parameters& params) const;
89 
90  void set_config(Field *U);
91 
92  void set_mode(const std::string mode);
93 
94  std::string get_mode() const { return m_mode; }
95 
96  void mult(Field& v, const Field& w);
97 
98  void mult_dag(Field& v, const Field& w);
99 
100  void mult(Field& v, const Field& w, const std::string mod);
101 
102  void mult_dag(Field& v, const Field& w, const std::string mode);
103 
104  void mult_gm5(Field& v, const Field& w);
105 
106  void D(Field& v, const Field& w);
107 
108  void Ddag(Field& v, const Field& w);
109 
110  void DdagD(Field& v, const Field& w);
111 
112  void DDdag(Field& v, const Field& w);
113 
114  void H(Field& v, const Field& w);
115 
116  void mult_up(const int mu, Field&, const Field&);
117 
118  void mult_dn(const int mu, Field&, const Field&);
119 
120  int field_nvol() { return m_Nvol; }
121  int field_nin() { return m_Nvc * m_Nd; }
122  int field_nex() { return 1; }
123 
124  double flop_count();
125 
126  private:
127  // prohibit copy
130 
132  void init(const std::string repr);
133 
135  void init(const Parameters& params);
136 
138  void setup();
139 
141  void tidyup();
142 
143  void mult_gm5_chiral(Field&, const Field&);
144  void mult_gm5_dirac(Field&, const Field&);
145 
146  void D_chiral(Field&, const int ex1, const Field&, const int ex2);
147  void D_dirac(Field&, const int ex1, const Field&, const int ex2);
148 
149  void mult_xp(Field&, const Field&);
150  void mult_xm(Field&, const Field&);
151  void mult_yp(Field&, const Field&);
152  void mult_ym(Field&, const Field&);
153  void mult_zp(Field&, const Field&);
154  void mult_zm(Field&, const Field&);
155 
156  void mult_tp_dirac(Field&, const Field&);
157  void mult_tm_dirac(Field&, const Field&);
158  void mult_tp_chiral(Field&, const Field&);
159  void mult_tm_chiral(Field&, const Field&);
160 
161  void daxpy(Field&, const double, const Field&);
162  void clear(Field&);
163 
164 
165 #ifdef USE_FACTORY
166  private:
167  static Fopr *create_object() { return new Fopr_WilsonGeneral(); }
168 
169  static Fopr *create_object_with_repr(const std::string& repr)
170  { return new Fopr_WilsonGeneral(repr); }
171 
172  static Fopr *create_object_with_params(const Parameters& params)
173  { return new Fopr_WilsonGeneral(params); }
174 
175  public:
176  static bool register_factory()
177  {
178  bool init = true;
179  init &= Fopr::Factory_noarg::Register("WilsonGeneral/Imp", create_object);
180  init &= Fopr::Factory_string::Register("WilsonFeneral/Imp",
181  create_object_with_repr);
182  init &= Fopr::Factory_params::Register("WilsonGeneral/Imp",
183  create_object_with_params);
184  return init;
185  }
186 #endif
187  };
188 }
189 #endif /* FOPR_WILSON_GENERAL_IMPL_IMP_INCLUDED */
Imp::Fopr_WilsonGeneral::tidyup
void tidyup()
final clean-up.
Definition: fopr_WilsonGeneral_impl.cpp:150
Imp::Fopr_WilsonGeneral::vcp2_ym
double * vcp2_ym
Definition: fopr_WilsonGeneral_impl.h:64
Imp::Fopr_WilsonGeneral::m_Ndf
int m_Ndf
Definition: fopr_WilsonGeneral_impl.h:54
bridgeIO.h
Imp::Fopr_WilsonGeneral::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: fopr_WilsonGeneral_impl.h:122
Imp::Fopr_WilsonGeneral::m_boundary_each_node
std::vector< double > m_boundary_each_node
b.c. on each node.
Definition: fopr_WilsonGeneral_impl.h:60
AFopr
Definition: afopr.h:48
Imp::Fopr_WilsonGeneral::H
void H(Field &v, const Field &w)
Definition: fopr_WilsonGeneral_impl.cpp:465
Imp::Fopr_WilsonGeneral::mult_tp_chiral
void mult_tp_chiral(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:1697
Imp::Fopr_WilsonGeneral::m_kappa_s
double m_kappa_s
Definition: fopr_WilsonGeneral_impl.h:45
Imp::Fopr_WilsonGeneral::m_U
const Field_G * m_U
gauge configuration.
Definition: fopr_WilsonGeneral_impl.h:58
Imp::Fopr_WilsonGeneral::DDdag
void DDdag(Field &v, const Field &w)
Definition: fopr_WilsonGeneral_impl.cpp:455
Imp::Fopr_WilsonGeneral::m_Nz
int m_Nz
Definition: fopr_WilsonGeneral_impl.h:55
Parameters
Class for parameters.
Definition: parameters.h:46
Imp::Fopr_WilsonGeneral::m_Nvc
int m_Nvc
Definition: fopr_WilsonGeneral_impl.h:54
Imp::Fopr_WilsonGeneral::Fopr_WilsonGeneral
Fopr_WilsonGeneral(const Parameters &params)
standard constructor.
Definition: fopr_WilsonGeneral_impl.h:72
Imp::Fopr_WilsonGeneral::m_r_s
double m_r_s
Definition: fopr_WilsonGeneral_impl.h:46
shiftField_lex.h
Imp::Fopr_WilsonGeneral::m_Nvol
int m_Nvol
Definition: fopr_WilsonGeneral_impl.h:56
Imp::Fopr_WilsonGeneral::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_WilsonGeneral_impl.cpp:249
Imp::Fopr_WilsonGeneral::vcp2_xp
double * vcp2_xp
Definition: fopr_WilsonGeneral_impl.h:63
Imp::Fopr_WilsonGeneral::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: fopr_WilsonGeneral_impl.h:120
Imp::Fopr_WilsonGeneral::vcp1_xp
double * vcp1_xp
arrays for communication buffer.
Definition: fopr_WilsonGeneral_impl.h:63
Imp::Fopr_WilsonGeneral::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_WilsonGeneral_impl.cpp:175
Imp::Fopr_WilsonGeneral::~Fopr_WilsonGeneral
~Fopr_WilsonGeneral()
Definition: fopr_WilsonGeneral_impl.h:80
Imp::Fopr_WilsonGeneral::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: fopr_WilsonGeneral_impl.h:121
Imp::Fopr_WilsonGeneral::m_vl
Bridge::VerboseLevel m_vl
verbose level
Definition: fopr_WilsonGeneral_impl.h:49
Imp::Fopr_WilsonGeneral::mult_dag
void mult_dag(Field &v, const Field &w)
hermitian conjugate of mult.
Definition: fopr_WilsonGeneral_impl.cpp:303
Imp::Fopr_WilsonGeneral::mult_tm_dirac
void mult_tm_dirac(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:1601
Imp::Fopr_WilsonGeneral::m_nu_s
double m_nu_s
Definition: fopr_WilsonGeneral_impl.h:46
Imp::Fopr_WilsonGeneral::class_name
static const std::string class_name
Definition: fopr_WilsonGeneral_impl.h:41
Imp::Fopr_WilsonGeneral::get_mode
std::string get_mode() const
Definition: fopr_WilsonGeneral_impl.h:94
Imp::Fopr_WilsonGeneral::vcp2_zp
double * vcp2_zp
Definition: fopr_WilsonGeneral_impl.h:65
Imp::Fopr_WilsonGeneral::mult_dn
void mult_dn(const int mu, Field &, const Field &)
downward nearest neighbor hopping term.
Definition: fopr_WilsonGeneral_impl.cpp:391
Imp::Fopr_WilsonGeneral::D_dirac
void D_dirac(Field &, const int ex1, const Field &, const int ex2)
Definition: fopr_WilsonGeneral_impl.cpp:473
Imp::Fopr_WilsonGeneral::mult_xm
void mult_xm(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:747
Imp::Fopr_WilsonGeneral::setup
void setup()
initial setup main.
Definition: fopr_WilsonGeneral_impl.cpp:96
Imp::Fopr_WilsonGeneral::vcp2_xm
double * vcp2_xm
Definition: fopr_WilsonGeneral_impl.h:63
Imp::Fopr_WilsonGeneral::m_repr
std::string m_repr
gamma-matrix representation
Definition: fopr_WilsonGeneral_impl.h:48
Imp::Fopr_WilsonGeneral::m_w1
Field m_w1
Definition: fopr_WilsonGeneral_impl.h:68
Imp::Fopr_WilsonGeneral::Fopr_WilsonGeneral
DEPRECATED Fopr_WilsonGeneral()
Definition: fopr_WilsonGeneral_impl.h:75
Imp::Fopr_WilsonGeneral::vcp1_tp
double * vcp1_tp
Definition: fopr_WilsonGeneral_impl.h:66
Imp::Fopr_WilsonGeneral::mult_ym
void mult_ym(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:1048
Imp::Fopr_WilsonGeneral::Fopr_WilsonGeneral
Fopr_WilsonGeneral(const Fopr_WilsonGeneral &)
Definition: fopr_WilsonGeneral_impl.h:128
Imp::Fopr_WilsonGeneral::vcp1_zp
double * vcp1_zp
Definition: fopr_WilsonGeneral_impl.h:65
Imp::Fopr_WilsonGeneral::vcp1_tm
double * vcp1_tm
Definition: fopr_WilsonGeneral_impl.h:66
Imp::Fopr_WilsonGeneral::m_Nd
int m_Nd
Definition: fopr_WilsonGeneral_impl.h:54
Imp::Fopr_WilsonGeneral::Ddag
void Ddag(Field &v, const Field &w)
Definition: fopr_WilsonGeneral_impl.cpp:436
Imp::Fopr_WilsonGeneral::m_Nt
int m_Nt
Definition: fopr_WilsonGeneral_impl.h:55
Imp::Fopr_WilsonGeneral::D_chiral
void D_chiral(Field &, const int ex1, const Field &, const int ex2)
Definition: fopr_WilsonGeneral_impl.cpp:495
Imp::Fopr_WilsonGeneral
Definition: fopr_WilsonGeneral_impl.h:38
Imp::Fopr_WilsonGeneral::m_kappa_t
double m_kappa_t
Definition: fopr_WilsonGeneral_impl.h:45
Imp::Fopr_WilsonGeneral::m_Nx
int m_Nx
Definition: fopr_WilsonGeneral_impl.h:55
Imp::Fopr_WilsonGeneral::mult_zm
void mult_zm(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:1356
Imp::Fopr_WilsonGeneral::m_w2
Field m_w2
working fields
Definition: fopr_WilsonGeneral_impl.h:68
Imp::Fopr_WilsonGeneral::D
void D(Field &v, const Field &w)
Definition: fopr_WilsonGeneral_impl.cpp:425
Imp::Fopr_WilsonGeneral::mult_xp
void mult_xp(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:605
Imp::Fopr_WilsonGeneral::m_mode
std::string m_mode
mult mode
Definition: fopr_WilsonGeneral_impl.h:51
Imp::Fopr_WilsonGeneral::DdagD
void DdagD(Field &v, const Field &w)
Definition: fopr_WilsonGeneral_impl.cpp:445
Imp::Fopr_WilsonGeneral::m_Ndim
int m_Ndim
Definition: fopr_WilsonGeneral_impl.h:56
threadManager.h
Imp::Fopr_WilsonGeneral::vcp2_yp
double * vcp2_yp
Definition: fopr_WilsonGeneral_impl.h:64
Imp::Fopr_WilsonGeneral::vcp1_xm
double * vcp1_xm
Definition: fopr_WilsonGeneral_impl.h:63
Imp::Fopr_WilsonGeneral::Fopr_WilsonGeneral
DEPRECATED Fopr_WilsonGeneral(const std::string repr)
Definition: fopr_WilsonGeneral_impl.h:78
Imp::Fopr_WilsonGeneral::mult_yp
void mult_yp(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:899
Imp::Fopr_WilsonGeneral::m_Ny
int m_Ny
Definition: fopr_WilsonGeneral_impl.h:55
Imp::Fopr_WilsonGeneral::operator=
Fopr_WilsonGeneral & operator=(const Fopr_WilsonGeneral &)
Imp::Fopr_WilsonGeneral::mult_tm_chiral
void mult_tm_chiral(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:1785
Imp::Fopr_WilsonGeneral::vcp2_tp
double * vcp2_tp
Definition: fopr_WilsonGeneral_impl.h:66
Imp::Fopr_WilsonGeneral::mult_gm5_chiral
void mult_gm5_chiral(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:584
Imp::Fopr_WilsonGeneral::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_WilsonGeneral_impl.cpp:272
Imp::Fopr_WilsonGeneral::mult_gm5_dirac
void mult_gm5_dirac(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:563
fopr.h
Imp::Fopr_WilsonGeneral::mult_gm5
void mult_gm5(Field &v, const Field &w)
multiplies gamma_5 matrix.
Definition: fopr_WilsonGeneral_impl.cpp:414
Imp::Fopr_WilsonGeneral::vcp1_yp
double * vcp1_yp
Definition: fopr_WilsonGeneral_impl.h:64
Imp::Fopr_WilsonGeneral::vcp1_ym
double * vcp1_ym
Definition: fopr_WilsonGeneral_impl.h:64
Imp::Fopr_WilsonGeneral::vcp2_tm
double * vcp2_tm
Definition: fopr_WilsonGeneral_impl.h:66
Imp::Fopr_WilsonGeneral::daxpy
void daxpy(Field &, const double, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:539
Imp::Fopr_WilsonGeneral::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: fopr_WilsonGeneral_impl.cpp:263
Imp::Fopr_WilsonGeneral::flop_count
double flop_count()
returns the number of floating point operations.
Definition: fopr_WilsonGeneral_impl.cpp:1879
Imp::Fopr_WilsonGeneral::mult_zp
void mult_zp(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:1205
Imp
Clover term operator.
Definition: fopr_CloverTerm_eo_impl.cpp:32
Imp::Fopr_WilsonGeneral::mult_up
void mult_up(const int mu, Field &, const Field &)
upward nearest neighbor hopping term.
Definition: fopr_WilsonGeneral_impl.cpp:368
Imp::Fopr_WilsonGeneral::mult_tp_dirac
void mult_tp_dirac(Field &, const Field &)
Definition: fopr_WilsonGeneral_impl.cpp:1513
Field
Container of Field-type object.
Definition: field.h:46
Imp::Fopr_WilsonGeneral::clear
void clear(Field &)
Definition: fopr_WilsonGeneral_impl.cpp:517
Imp::Fopr_WilsonGeneral::vcp1_zm
double * vcp1_zm
Definition: fopr_WilsonGeneral_impl.h:65
Imp::Fopr_WilsonGeneral::mult
void mult(Field &v, const Field &w)
multiplies fermion operator to a given field.
Definition: fopr_WilsonGeneral_impl.cpp:282
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Imp::Fopr_WilsonGeneral::m_boundary
std::vector< int > m_boundary
boundary condition
Definition: fopr_WilsonGeneral_impl.h:47
Imp::Fopr_WilsonGeneral::init
void init(const std::string repr)
obsolete initial setup.
Definition: fopr_WilsonGeneral_impl.cpp:73
Imp::Fopr_WilsonGeneral::vcp2_zm
double * vcp2_zm
Definition: fopr_WilsonGeneral_impl.h:65
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
gammaMatrixSet.h
Imp::Fopr_WilsonGeneral::m_Nc
int m_Nc
Definition: fopr_WilsonGeneral_impl.h:54
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512