Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_CloverTerm_eo_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_CLOVERTERM_EO_IMPL_ORG_INCLUDED
15 #define FOPR_CLOVERTERM_EO_IMPL_ORG_INCLUDED
16 
17 #include "Fopr/fopr.h"
18 
19 #include "Field/shiftField_eo.h"
20 
21 #include "Tools/gammaMatrixSet.h"
22 
23 #include "IO/bridgeIO.h"
24 using Bridge::vout;
25 
27 
59 namespace Org {
60  class Fopr_CloverTerm_eo : public Fopr
61  {
62  public:
63  static const std::string class_name;
64 
65 // This class returns D_ee = 1-f_ee or D_oo = 1-f_oo
66  private:
67  double m_kappa;
68  double m_cSW;
69  std::vector<int> m_boundary;
70  std::string m_repr;
71  std::string m_mode;
72 
74  int m_Ndim;
75  int m_Nc, m_Nd, m_Ndm2;
76  int m_NinF;
77 
79  std::vector<GammaMatrix> m_GM, m_SG;
80 
81  void (Fopr_CloverTerm_eo::*m_mult)(Field&, const Field&);
82 
83  const Field_G *m_Ueo;
84 
87 
92 
95 
97  std::vector<Field_G> m_T2;
98 
99  public:
100  Fopr_CloverTerm_eo(std::string repr)
101  : m_Nvol(CommonParameters::Nvol()),
102  m_Nvol2(m_Nvol / 2),
103  m_Ndim(CommonParameters::Ndim()),
104  m_Nc(CommonParameters::Nc()),
105  m_Nd(CommonParameters::Nd()),
106  m_Ndm2(m_Nd * m_Nd / 2),
107  m_T(m_Nvol, m_Ndm2)
108  {
109  init(repr);
110  }
111 
113  {
114  delete m_fee_inv;
115  delete m_foo_inv;
116  }
117 
118  void set_parameters(const Parameters& params);
119  void set_parameters(const double kappa, const double cSW,
120  const std::vector<int> bc);
121 
122  void set_config(Field *Ueo);
123 
125  {
126  set_config(Ueo.get());
127  }
128 
129  void set_mode(const std::string mode)
130  {
131  m_mode = mode;
132  }
133 
134  std::string get_mode() const
135  {
136  return m_mode;
137  }
138 
140  const Field mult(const Field& f)
141  {
142  Field v(f.nin(), f.nvol(), f.nex());
143 
144  mult(v, f);
145  return v;
146  }
147 
148  const Field mult_dag(const Field& f)
149  {
150  Field v(f.nin(), f.nvol(), f.nex());
151 
152  mult_dag(v, f);
153  return v;
154  }
155 
157  void mult(Field& v, const Field& f)
158  {
159  // multiplies 1-csw kappa sigma_{mu nu} F_{mu nu}
160  if (m_mode == "even") {
161  D(v, f, 0);
162  } else if (m_mode == "odd") {
163  D(v, f, 1);
164  } else {
165  vout.crucial("Error at %s: undefined mode = %s\n", class_name.c_str(), m_mode.c_str());
166  exit(EXIT_FAILURE);
167  }
168  }
169 
170  void mult_dag(Field& v, const Field& f)
171  {
172  mult(v, f);
173  }
174 
175  void mult_isigma(Field_F&, const Field_F&,
176  const int mu, const int nu);
177 
179  void D(Field& v, const Field& f, const int ieo);
180 
182  void D_dirac(Field& v, const Field& f, const int ieo);
183 
185  void D_chiral(Field& v, const Field& f, const int ieo);
186 
187  //const Field_F mult_csw_inv(const Field_F&, const int ieo);
188  //const Field_G trSigmaInv(const int mu, const int nu);
189  void trSigmaInv(Field_G&, const int mu, const int nu);
190 
192  void mult_csw_inv(Field&, const Field&, const int ieo);
193 
195  void mult_csw_inv_dirac(Field&, const Field&, const int ieo);
196 
198  void mult_csw_inv_chiral(Field&, const Field&, const int ieo);
199 
200  std::vector<double> csmatrix(const int&);
201 
202  int field_nvol() { return m_Nvol2; }
203  int field_nin() { return 2 * m_Nc * m_Nd; }
204  int field_nex() { return 1; }
205 
207  double flop_count();
208 
209  private:
210  void init(const std::string repr);
211  void tidyup();
212 
213  void solve_csw_inv();
214 
215  void set_csw();
216 
218  void set_csw_dirac();
219 
221  void set_csw_chiral();
222 
223  void mult_csw(Field_F&, const Field_F&, const int ieo);
224  void set_fieldstrength(Field_G&, const int, const int);
225 
226  int sg_index(const int mu, const int nu) { return mu * m_Ndim + nu; }
227  };
228 }
229 #endif /* FOPR_CLOVERTERM_EO_IMPL_ORG_INCLUDED */
const Field mult_dag(const Field &f)
BridgeIO vout
Definition: bridgeIO.cpp:503
void set_csw_chiral()
explicit implementation for Chiral representation (for Imp-version).
void init(const std::string repr)
Field_G m_T
m_T = 1 - kappa c_SW sigma F / 2
void D_dirac(Field &v, const Field &f, const int ieo)
explicit implementation for Dirac representation (for Imp-version).
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
void D_chiral(Field &v, const Field &f, const int ieo)
explicit implementation for Chiral representation (for Imp-version).
Container of Field-type object.
Definition: field.h:45
int nvol() const
Definition: field.h:127
void set_csw_dirac()
explicit implementation for Dirac representation (for Imp-version).
void mult_isigma(Field_F &, const Field_F &, const int mu, const int nu)
std::vector< double > csmatrix(const int &)
Class for parameters.
Definition: parameters.h:46
Even-odd site index.
Definition: index_eo.h:40
void mult_csw_inv_chiral(Field &, const Field &, const int ieo)
multiplies [1 - csw kappa sigma_{mu nu} F_{mu nu} ]^{-1}
void set_fieldstrength(Field_G &, const int, const int)
Wilson-type fermion field.
Definition: field_F.h:37
int nin() const
Definition: field.h:126
SU(N) gauge field.
Definition: field_G.h:38
void mult(Field &v, const Field &f)
return D = D^dag = 1-f_ee or 1-f_oo
int sg_index(const int mu, const int nu)
void trSigmaInv(Field_G &, const int mu, const int nu)
std::string get_mode() const
only for Fopr_Overlap
std::vector< Field_G > m_T2
m_T2 is used in Org-version.
pointer get() const
int nex() const
Definition: field.h:128
Common parameter class: provides parameters as singleton.
void mult_csw(Field_F &, const Field_F &, const int ieo)
void(Fopr_CloverTerm_eo::* m_mult)(Field &, const Field &)
int field_nvol()
returns the volume for which the fermion operator is defined.
double flop_count()
returns number of floating point operations.
Methods to shift the even-odd field.
Definition: shiftField_eo.h:45
static const std::string class_name
void set_parameters(const Parameters &params)
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
void D(Field &v, const Field &f, const int ieo)
multiplies 1 - csw kappa sigma_{mu nu} F_{mu nu}
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
Fopr_CloverTerm_eo(std::string repr)
void set_config(unique_ptr< Field_G > &Ueo)
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
void set_config(Field *Ueo)
setting pointer to the gauge configuration.
Base class of fermion operator family.
Definition: fopr.h:46
void mult_csw_inv(Field &, const Field &, const int ieo)
multiplies [1 - csw kappa sigma_{mu nu} F_{mu nu} ]^{-1}
std::vector< GammaMatrix > m_GM
Gamma Matrix and Sigma_{mu,nu} = -i [Gamma_mu, Gamma_nu] /2.
std::vector< GammaMatrix > m_SG
const Field mult(const Field &f)
return D = D^dag = 1-f_ee or 1-f_oo
void mult_csw_inv_dirac(Field &, const Field &, const int ieo)
multiplies [1 - csw kappa sigma_{mu nu} F_{mu nu} ]^{-1}