Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_CloverTerm_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_CLOVERTERM_IMPL_IMP_INCLUDED
15 #define FOPR_CLOVERTERM_IMPL_IMP_INCLUDED
16 
17 #include "Fopr/fopr_Wilson.h"
18 
20 
21 #include "IO/bridgeIO.h"
22 using Bridge::vout;
23 
25 
52 namespace Imp {
53  class Fopr_CloverTerm : public Fopr
54  {
55  public:
56  static const std::string class_name;
57 
58  private:
59  double m_kappa;
60  double m_cSW;
61  std::vector<int> m_boundary;
62  std::string m_repr;
63  std::string m_mode;
64  void (Fopr_CloverTerm::*m_csw)(Field&, const Field&);
65  void (Fopr_CloverTerm::*m_gm5)(Field&, const Field&);
66 
68  int m_Nvol;
69 
70  const Field_G *m_U;
71 
76  // Bx = -iF(1,2), By = -iF(2,0), Bz = -iF(0,1)
77  // Ex = -iF(3,0), Ey = -iF(3,1), Ez = -iF(3,2)
78 
79  std::vector<GammaMatrix> m_SG;
81 
82  public:
84  : Fopr()
85  {
86  init("Dirac");
87  }
88 
89  Fopr_CloverTerm(const std::string repr)
90  : Fopr()
91  {
92  init(repr);
93  }
94 
96  {
97  tidyup();
98  }
99 
100  void set_parameters(const Parameters& params);
101  void set_parameters(const double kappa, const double cSW, const std::vector<int> bc);
102 
103  void set_config(Field *U);
104 
106  {
107  set_config(U.get());
108  }
109 
110  void set_mode(const std::string mode)
111  {
112  m_mode = mode;
113  }
114 
115  std::string get_mode() const
116  {
117  return m_mode;
118  }
119 
120  void mult(Field& v, const Field& f)
121  {
122  // csw kappa sigma_{mu nu} F_{mu nu}
123  if ((m_mode == "D") || (m_mode == "F")) {
124  mult_sigmaF(v, f);
125 // } else if(m_mode=="H"){
126 // H(v,f);
127  } else {
128  vout.crucial("Error at %s: undefined mode = %s\n", class_name.c_str(), m_mode.c_str());
129  exit(EXIT_FAILURE);
130  }
131  }
132 
133  void mult_dag(Field& v, const Field& f)
134  {
135  mult(v, f);
136  }
137 
138  void mult_sigmaF(Field&, const Field&);
139 
140  void mult_gm5(Field& v, const Field& w);
141 
142  void mult_isigma(Field_F&, const Field_F&,
143  const int mu, const int nu);
144 
145  int field_nvol() { return m_Nvol; }
146  int field_nin() { return 2 * m_Nc * m_Nd; }
147  int field_nex() { return 1; }
148 
150  double flop_count();
151 
152  private:
153  void init(const std::string repr);
154  void tidyup();
155 
156  void set_csw();
157  void set_fieldstrength(Field_G&, const int, const int);
158 
159  void gm5_dirac(Field&, const Field&);
160  void gm5_chiral(Field&, const Field&);
161 
162  // multiplies csw kappa sigma_{mu nu} F_{mu nu}
163  // NOTE: this is NOT 1 - csw kappa sigma_{mu nu} F_{mu nu}
164  void mult_csw(Field&, const Field&);
165  void mult_csw_dirac(Field&, const Field&);
166  void mult_csw_chiral(Field&, const Field&);
167 
168  void mult_csw_dirac(Field_F&, const Field_F&);
169  void mult_csw_chiral(Field_F&, const Field_F&);
170 
171  int sg_index(const int mu, const int nu) { return mu * m_Ndim + nu; }
172  };
173 }
174 #endif /* FOPR_CLOVERTERM_IMPL_IMP_INCLUDED */
BridgeIO vout
Definition: bridgeIO.cpp:503
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
Container of Field-type object.
Definition: field.h:45
void(Fopr_CloverTerm::* m_csw)(Field &, const Field &)
void mult_csw_dirac(Field &, const Field &)
double flop_count()
this returns the number of floating point operations.
Class for parameters.
Definition: parameters.h:46
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
const Field_G * m_U
pointer to gauge configuration.
Field_G m_v2
for calculation of field strength.
Wilson-type fermion field.
Definition: field_F.h:37
Fopr_CloverTerm(const std::string repr)
void set_config(Field *U)
setting pointer to the gauge configuration.
Gamma Matrix class.
Definition: gammaMatrix.h:44
static const std::string class_name
Staple construction.
Definition: staple_lex.h:39
SU(N) gauge field.
Definition: field_G.h:38
void gm5_chiral(Field &, const Field &)
std::vector< int > m_boundary
void mult_gm5(Field &v, const Field &w)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
pointer get() const
void gm5_dirac(Field &, const Field &)
void set_config(unique_ptr< Field_G > &U)
void(Fopr_CloverTerm::* m_gm5)(Field &, const Field &)
void mult_isigma(Field_F &, const Field_F &, const int mu, const int nu)
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
Field_G m_Ez
field strength.
void set_fieldstrength(Field_G &, const int, const int)
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
int sg_index(const int mu, const int nu)
std::string get_mode() const
only for Fopr_Overlap
int field_nvol()
returns the volume for which the fermion operator is defined.
std::vector< GammaMatrix > m_SG
Methods to shift a field in the lexical site index.
Base class of fermion operator family.
Definition: fopr.h:46
void mult_sigmaF(Field &, const Field &)
void init(const std::string repr)
void set_parameters(const Parameters &params)
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
void mult_csw(Field &, const Field &)
void mult_csw_chiral(Field &, const Field &)