Bridge++  Ver. 2.0.2
fopr_CloverTerm_eo_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_CLOVERTERM_EO_IMPL_IMP_INCLUDED
15 #define FOPR_CLOVERTERM_EO_IMPL_IMP_INCLUDED
16 
17 #include "Fopr/fopr.h"
18 
19 #include "Field/index_eo.h"
20 #include "Field/field_F.h"
21 #include "Tools/gammaMatrix.h"
22 
23 #include "IO/bridgeIO.h"
24 using Bridge::vout;
25 
26 class Staple_eo;
27 class ShiftField_eo;
28 class Solver_CG;
29 
31 
63 namespace Imp {
64  class Fopr_CloverTerm_eo : public Fopr
65  {
66  // This class returns D_ee = 1-f_ee or D_oo = 1-f_oo
67 
68  public:
69  static const std::string class_name;
70 
71  private:
72  // input parameters
73  double m_kappa;
74  double m_cSW;
75  std::vector<int> m_boundary;
76  std::string m_repr;
78 
79  // internal data members
80  std::string m_mode;
81 
83  int m_Nc, m_Nd, m_Ndm2;
84  int m_NinF;
85 
87  std::vector<GammaMatrix> m_GM, m_SG;
88 
93 
96 
102  // try to reduce number of working vector in set_fieldstrength !
103 
104  public:
105 
106  DEPRECATED
107  Fopr_CloverTerm_eo(std::string repr) { init(repr); }
108 
110  Fopr_CloverTerm_eo(const Parameters& params) { init(params); }
111 
113 
114  void set_parameters(const Parameters& params);
115  void set_parameters(const double kappa, const double cSW,
116  const std::vector<int> bc);
117 
118  void get_parameters(Parameters& params) const;
119 
120  void set_config(Field *U);
121 
122  void set_mode(const std::string mode);
123 
124  std::string get_mode() const { return m_mode; }
125 
127  void mult(Field& v, const Field& f);
128 
129  void mult_dag(Field& v, const Field& f);
130 
131  void mult_isigma(Field_F&, const Field_F&,
132  const int mu, const int nu);
133 
135  void D(Field& v, const Field& f, const int ieo);
136 
138  void D_dirac(Field& v, const Field& f, const int ieo);
139 
141  void D_chiral(Field& v, const Field& f, const int ieo);
142 
144  void mult_csw_inv(Field&, const Field&, const int ieo);
145 
146  void mult_csw_inv_dirac(Field&, const Field&, const int ieo);
147 
148  void mult_csw_inv_chiral(Field&, const Field&, const int ieo);
149 
150  // std::vector<double> csmatrix(const int&);
151 
152  int field_nvol() { return m_Nvol2; }
153 
154  int field_nin() { return 2 * m_Nc * m_Nd; }
155 
156  int field_nex() { return 1; }
157 
159  double flop_count();
160 
161  private:
162  void init(const std::string repr);
163 
164  void init(const Parameters& params);
165 
166  void tidyup();
167 
168  void setup();
169 
170  void setup_gamma_matrices();
171 
172  void set_config_omp(Field *U);
173 
174  void set_config_impl(Field *U);
175 
176  void solve_csw_inv();
177 
178  void set_csw();
179 
181  void set_csw_dirac();
182 
184  void set_csw_chiral();
185 
186  void mult_csw(Field_F&, const Field_F&, const int ieo);
187 
188  void set_fieldstrength(Field_G&, const int, const int);
189 
190  int sg_index(const int mu, const int nu) { return mu * m_Ndim + nu; }
191  };
192 }
193 #endif /* FOPR_CLOVERTERM_EO_IMPL_IMP_INCLUDED */
Imp::Fopr_CloverTerm_eo::m_Umu
Field_G m_Umu
working vectors
Definition: fopr_CloverTerm_eo_impl.h:100
Imp::Fopr_CloverTerm_eo::Fopr_CloverTerm_eo
Fopr_CloverTerm_eo(const Parameters &params)
standard constructor.
Definition: fopr_CloverTerm_eo_impl.h:110
Imp::Fopr_CloverTerm_eo::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_CloverTerm_eo_impl.cpp:207
Imp::Fopr_CloverTerm_eo::m_staple
Staple_eo * m_staple
Definition: fopr_CloverTerm_eo_impl.h:90
bridgeIO.h
Imp::Fopr_CloverTerm_eo::m_Ndm2
int m_Ndm2
Definition: fopr_CloverTerm_eo_impl.h:83
Imp::Fopr_CloverTerm_eo::m_GM
std::vector< GammaMatrix > m_GM
Gamma Matrix and Sigma_{mu,nu} = -i [Gamma_mu, Gamma_nu] /2.
Definition: fopr_CloverTerm_eo_impl.h:87
Imp::Fopr_CloverTerm_eo::set_csw_chiral
void set_csw_chiral()
explicit implementation for Chiral representation (for Imp-version).
Definition: fopr_CloverTerm_eo_impl.cpp:746
ShiftField_eo
Methods to shift the even-odd field.
Definition: shiftField_eo.h:49
Imp::Fopr_CloverTerm_eo::m_ut3
Field_G m_ut3
working vectors
Definition: fopr_CloverTerm_eo_impl.h:101
field_F.h
AFopr
Definition: afopr.h:48
Imp::Fopr_CloverTerm_eo::m_NinF
int m_NinF
Definition: fopr_CloverTerm_eo_impl.h:84
Imp::Fopr_CloverTerm_eo::m_Foo_inv
Field_F m_Foo_inv
inverse of site-diagonal part
Definition: fopr_CloverTerm_eo_impl.h:97
Imp::Fopr_CloverTerm_eo::m_idx
Index_eo m_idx
Definition: fopr_CloverTerm_eo_impl.h:89
Imp::Fopr_CloverTerm_eo::mult_csw_inv
void mult_csw_inv(Field &, const Field &, const int ieo)
multiplies [ 1-csw kappa sigma_{mu nu} F_{mu nu} ]^{-1}
Definition: fopr_CloverTerm_eo_impl.cpp:394
Imp::Fopr_CloverTerm_eo::set_csw_dirac
void set_csw_dirac()
explicit implementation for Dirac representation (for Imp-version).
Definition: fopr_CloverTerm_eo_impl.cpp:672
gammaMatrix.h
Parameters
Class for parameters.
Definition: parameters.h:46
Imp::Fopr_CloverTerm_eo::m_mode
std::string m_mode
Definition: fopr_CloverTerm_eo_impl.h:80
Imp::Fopr_CloverTerm_eo::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: fopr_CloverTerm_eo_impl.h:154
Imp::Fopr_CloverTerm_eo::set_config_impl
void set_config_impl(Field *U)
Definition: fopr_CloverTerm_eo_impl.cpp:283
Imp::Fopr_CloverTerm_eo::flop_count
double flop_count()
returns number of floating point operations.
Definition: fopr_CloverTerm_eo_impl.cpp:897
Imp::Fopr_CloverTerm_eo::get_mode
std::string get_mode() const
Definition: fopr_CloverTerm_eo_impl.h:124
Imp::Fopr_CloverTerm_eo::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: fopr_CloverTerm_eo_impl.cpp:254
Imp::Fopr_CloverTerm_eo::set_config_omp
void set_config_omp(Field *U)
Definition: fopr_CloverTerm_eo_impl.cpp:271
Imp::Fopr_CloverTerm_eo::m_cSW
double m_cSW
Definition: fopr_CloverTerm_eo_impl.h:74
Index_eo
Even-odd site index.
Definition: index_eo.h:44
Imp::Fopr_CloverTerm_eo::m_Nvol
int m_Nvol
Definition: fopr_CloverTerm_eo_impl.h:82
Imp::Fopr_CloverTerm_eo::m_kappa
double m_kappa
Definition: fopr_CloverTerm_eo_impl.h:73
Imp::Fopr_CloverTerm_eo::m_Fee_inv
Field_F m_Fee_inv
Definition: fopr_CloverTerm_eo_impl.h:97
Imp::Fopr_CloverTerm_eo::D_chiral
void D_chiral(Field &v, const Field &f, const int ieo)
explicit implementation for Chiral representation (for Imp-version).
Definition: fopr_CloverTerm_eo_impl.cpp:591
Imp::Fopr_CloverTerm_eo
Definition: fopr_CloverTerm_eo_impl.h:64
Imp::Fopr_CloverTerm_eo::m_Cup
Field_G m_Cup
Definition: fopr_CloverTerm_eo_impl.h:100
Imp::Fopr_CloverTerm_eo::m_Ueo
Field_G m_Ueo
even-odd gauge configuration
Definition: fopr_CloverTerm_eo_impl.h:94
Imp::Fopr_CloverTerm_eo::D
void D(Field &v, const Field &f, const int ieo)
multiplies 1-csw kappa sigma_{mu nu} F_{mu nu}
Definition: fopr_CloverTerm_eo_impl.cpp:521
Imp::Fopr_CloverTerm_eo::m_Nd
int m_Nd
Definition: fopr_CloverTerm_eo_impl.h:83
Imp::Fopr_CloverTerm_eo::mult_csw
void mult_csw(Field_F &, const Field_F &, const int ieo)
Imp::Fopr_CloverTerm_eo::m_solver
Solver_CG * m_solver
Definition: fopr_CloverTerm_eo_impl.h:92
Imp::Fopr_CloverTerm_eo::m_w1
Field_F m_w1
Definition: fopr_CloverTerm_eo_impl.h:98
Imp::Fopr_CloverTerm_eo::m_boundary
std::vector< int > m_boundary
Definition: fopr_CloverTerm_eo_impl.h:75
Imp::Fopr_CloverTerm_eo::init
void init(const std::string repr)
Definition: fopr_CloverTerm_eo_impl.cpp:73
Imp::Fopr_CloverTerm_eo::m_repr
std::string m_repr
Definition: fopr_CloverTerm_eo_impl.h:76
Imp::Fopr_CloverTerm_eo::set_csw
void set_csw()
Definition: fopr_CloverTerm_eo_impl.cpp:657
Imp::Fopr_CloverTerm_eo::mult
void mult(Field &v, const Field &f)
return D = D^dag = 1-f_ee or 1-f_oo
Definition: fopr_CloverTerm_eo_impl.cpp:305
Imp::Fopr_CloverTerm_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_CloverTerm_eo_impl.cpp:293
Imp::Fopr_CloverTerm_eo::mult_csw_inv_chiral
void mult_csw_inv_chiral(Field &, const Field &, const int ieo)
Definition: fopr_CloverTerm_eo_impl.cpp:463
Imp::Fopr_CloverTerm_eo::mult_csw_inv_dirac
void mult_csw_inv_dirac(Field &, const Field &, const int ieo)
Definition: fopr_CloverTerm_eo_impl.cpp:407
Imp::Fopr_CloverTerm_eo::mult_dag
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult.
Definition: fopr_CloverTerm_eo_impl.cpp:321
Imp::Fopr_CloverTerm_eo::setup
void setup()
Definition: fopr_CloverTerm_eo_impl.cpp:98
Imp::Fopr_CloverTerm_eo::m_SG
std::vector< GammaMatrix > m_SG
Definition: fopr_CloverTerm_eo_impl.h:87
Imp::Fopr_CloverTerm_eo::m_w2
Field_F m_w2
working vectors
Definition: fopr_CloverTerm_eo_impl.h:98
Imp::Fopr_CloverTerm_eo::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: fopr_CloverTerm_eo_impl.h:156
Imp::Fopr_CloverTerm_eo::Fopr_CloverTerm_eo
DEPRECATED Fopr_CloverTerm_eo(std::string repr)
Definition: fopr_CloverTerm_eo_impl.h:107
Imp::Fopr_CloverTerm_eo::m_shift_eo
ShiftField_eo * m_shift_eo
Definition: fopr_CloverTerm_eo_impl.h:91
Imp::Fopr_CloverTerm_eo::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: fopr_CloverTerm_eo_impl.h:152
Imp::Fopr_CloverTerm_eo::m_ut1
Field_G m_ut1
Definition: fopr_CloverTerm_eo_impl.h:101
Imp::Fopr_CloverTerm_eo::m_vl
Bridge::VerboseLevel m_vl
Definition: fopr_CloverTerm_eo_impl.h:77
Imp::Fopr_CloverTerm_eo::m_Nc
int m_Nc
Definition: fopr_CloverTerm_eo_impl.h:83
Imp::Fopr_CloverTerm_eo::tidyup
void tidyup()
Definition: fopr_CloverTerm_eo_impl.cpp:144
fopr.h
Imp::Fopr_CloverTerm_eo::m_Nvol2
int m_Nvol2
Definition: fopr_CloverTerm_eo_impl.h:82
Imp::Fopr_CloverTerm_eo::m_T
Field_G m_T
m_T = 1 - kappa c_SW sigma F / 2
Definition: fopr_CloverTerm_eo_impl.h:95
Imp::Fopr_CloverTerm_eo::class_name
static const std::string class_name
Definition: fopr_CloverTerm_eo_impl.h:69
Staple_eo
Staple construction.
Definition: staple_eo.h:33
Imp::Fopr_CloverTerm_eo::m_Cdn
Field_G m_Cdn
Definition: fopr_CloverTerm_eo_impl.h:100
Imp::Fopr_CloverTerm_eo::setup_gamma_matrices
void setup_gamma_matrices()
Definition: fopr_CloverTerm_eo_impl.cpp:219
Imp::Fopr_CloverTerm_eo::~Fopr_CloverTerm_eo
~Fopr_CloverTerm_eo()
Definition: fopr_CloverTerm_eo_impl.h:112
Imp::Fopr_CloverTerm_eo::m_Ndim
int m_Ndim
Definition: fopr_CloverTerm_eo_impl.h:82
Imp::Fopr_CloverTerm_eo::m_ut2
Field_G m_ut2
Definition: fopr_CloverTerm_eo_impl.h:101
Field_F
Wilson-type fermion field.
Definition: field_F.h:37
Imp::Fopr_CloverTerm_eo::m_Ft
Field_G m_Ft
working vectors
Definition: fopr_CloverTerm_eo_impl.h:99
index_eo.h
Imp
Clover term operator.
Definition: fopr_CloverTerm_eo_impl.cpp:32
Solver_CG
Standard Conjugate Gradient solver algorithm.
Definition: solver_CG.h:38
Field
Container of Field-type object.
Definition: field.h:46
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Imp::Fopr_CloverTerm_eo::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_CloverTerm_eo_impl.cpp:153
Imp::Fopr_CloverTerm_eo::mult_isigma
void mult_isigma(Field_F &, const Field_F &, const int mu, const int nu)
Definition: fopr_CloverTerm_eo_impl.cpp:644
Imp::Fopr_CloverTerm_eo::sg_index
int sg_index(const int mu, const int nu)
Definition: fopr_CloverTerm_eo_impl.h:190
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Imp::Fopr_CloverTerm_eo::solve_csw_inv
void solve_csw_inv()
Definition: fopr_CloverTerm_eo_impl.cpp:329
Imp::Fopr_CloverTerm_eo::set_fieldstrength
void set_fieldstrength(Field_G &, const int, const int)
Definition: fopr_CloverTerm_eo_impl.cpp:839
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
Imp::Fopr_CloverTerm_eo::D_dirac
void D_dirac(Field &v, const Field &f, const int ieo)
explicit implementation for Dirac representation (for Imp-version).
Definition: fopr_CloverTerm_eo_impl.cpp:537
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512