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