Bridge++  Ver. 1.3.x
fopr_CloverTerm.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_CLOVERTERM_INCLUDED
15 #define FOPR_CLOVERTERM_INCLUDED
16 
17 #include "fopr_Wilson.h"
18 #include "shiftField_lex.h"
19 #include "gammaMatrixSet.h"
20 #include "staples.h"
21 
22 #include "bridgeIO.h"
23 using Bridge::vout;
24 
26 
45 //- parameters class
46 class Parameters_Fopr_CloverTerm : virtual public Parameters
47 {
48  public:
50 };
51 //- end
52 
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(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(double kappa, double cSW, std::vector<int> bc);
102 
103  void set_config(Field *U);
104 
106  {
107  set_config(U.get());
108  }
109 
110  void set_mode(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  if (m_mode == "D") {
123  mult_sigmaF(v, f);
124 // } else if(m_mode=="H"){
125 // H(v,f);
126  } else {
127  vout.crucial("%s: undefined mode = %s\n", class_name.c_str(), m_mode.c_str());
128  exit(EXIT_FAILURE);
129  }
130  }
131 
132  void mult_dag(Field& v, const Field& f)
133  {
134  mult(v, f);
135  }
136 
137  void mult_sigmaF(Field&, const Field&);
138 
139  void mult_gm5(Field& v, const Field& w);
140 
141  void mult_isigma(Field_F&, const Field_F&,
142  const int mu, const int nu);
143 
144  int field_nvol() { return m_Nvol; }
145  int field_nin() { return 2 * m_Nc * m_Nd; }
146  int field_nex() { return 1; }
147 
149  double flop_count();
150 
151  private:
152 
153  void init(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  void mult_csw(Field&, const Field&);
163  void mult_csw_dirac(Field&, const Field&);
164  void mult_csw_chiral(Field&, const Field&);
165 
166  void mult_csw_dirac(Field_F&, const Field_F&);
167  void mult_csw_chiral(Field_F&, const Field_F&);
168 
169  int sg_index(int mu, int nu) { return mu * m_Ndim + nu; }
170 };
171 #endif
void set_config(unique_ptr< Field_G > &U)
void set_config(Field *U)
setting pointer to the gauge configuration.
BridgeIO vout
Definition: bridgeIO.cpp:278
Staple construction.
Definition: staples.h:40
void mult_sigmaF(Field &, const Field &)
Field_G m_Ez
field strength.
GammaMatrix m_GM5
void mult_csw_chiral(Field &, const Field &)
void gm5_chiral(Field &, const Field &)
std::string m_mode
Container of Field-type object.
Definition: field.h:39
void set_parameters(const Parameters &params)
void set_fieldstrength(Field_G &, const int, const int)
Class for parameters.
Definition: parameters.h:38
Wilson-type fermion field.
Definition: field_F.h:37
Gamma Matrix class.
Definition: gammaMatrix.h:44
Field_G m_v2
for calculation of field strength.
SU(N) gauge field.
Definition: field_G.h:38
void mult_gm5(Field &v, const Field &w)
void gm5_dirac(Field &, const Field &)
void(Fopr_CloverTerm::* m_gm5)(Field &, const Field &)
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)
void mult_isigma(Field_F &, const Field_F &, const int mu, const int nu)
Fopr_CloverTerm(std::string repr)
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
pointer get() const
Clover term operator.
void init(std::string repr)
std::string m_repr
void crucial(const char *format,...)
Definition: bridgeIO.cpp:48
double flop_count()
this returns the number of floating point operations.
ShiftField_lex m_shift
void mult_csw(Field &, const Field &)
const Field_G * m_U
pointer to gauge configuration.
static const std::string class_name
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
int sg_index(int mu, int nu)
Methods to shift a field in the lexical site index.
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
std::vector< int > m_boundary
std::string get_mode() const
only for Fopr_Overlap
void mult_csw_dirac(Field &, const Field &)
Base class of fermion operator family.
Definition: fopr.h:49
int field_nvol()
returns the volume for which the fermion operator is defined.
void(Fopr_CloverTerm::* m_csw)(Field &, const Field &)
std::vector< GammaMatrix > m_SG