Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_CloverTerm.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_CLOVERTERM_IMP_INCLUDED
15 #define FOPR_CLOVERTERM_IMP_INCLUDED
16 
17 #include "Fopr/fopr_Wilson.h"
18 
20 
21 #include "IO/bridgeIO.h"
22 using Bridge::vout;
23 
25 
44 namespace Imp {
45  class Fopr_CloverTerm : public Fopr
46  {
47  public:
48  static const std::string class_name;
49 
50  private:
51  double m_kappa;
52  double m_cSW;
53  std::vector<int> m_boundary;
54  std::string m_repr;
55  std::string m_mode;
56  void (Fopr_CloverTerm::*m_csw)(Field&, const Field&);
57  void (Fopr_CloverTerm::*m_gm5)(Field&, const Field&);
58 
60  int m_Nvol;
61 
62  const Field_G *m_U;
63 
68  // Bx = -iF(1,2), By = -iF(2,0), Bz = -iF(0,1)
69  // Ex = -iF(3,0), Ey = -iF(3,1), Ez = -iF(3,2)
70 
71  std::vector<GammaMatrix> m_SG;
73 
74  public:
76  : Fopr()
77  {
78  init("Dirac");
79  }
80 
81  Fopr_CloverTerm(std::string repr)
82  : Fopr()
83  {
84  init(repr);
85  }
86 
88  {
89  tidyup();
90  }
91 
92  void set_parameters(const Parameters& params);
93  void set_parameters(double kappa, double cSW, std::vector<int> bc);
94 
95  void set_config(Field *U);
96 
98  {
99  set_config(U.get());
100  }
101 
102  void set_mode(std::string mode)
103  {
104  m_mode = mode;
105  }
106 
107  std::string get_mode() const
108  {
109  return m_mode;
110  }
111 
112  void mult(Field& v, const Field& f)
113  {
114  if (m_mode == "D") {
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 
145  void init(std::string repr);
146  void tidyup();
147 
148  void set_csw();
149  void set_fieldstrength(Field_G&, const int, const int);
150 
151  void gm5_dirac(Field&, const Field&);
152  void gm5_chiral(Field&, const Field&);
153 
154  void mult_csw(Field&, const Field&);
155  void mult_csw_dirac(Field&, const Field&);
156  void mult_csw_chiral(Field&, const Field&);
157 
158  void mult_csw_dirac(Field_F&, const Field_F&);
159  void mult_csw_chiral(Field_F&, const Field_F&);
160 
161  int sg_index(int mu, int nu) { return mu * m_Ndim + nu; }
162  };
163 }
164 #endif
BridgeIO vout
Definition: bridgeIO.cpp:495
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 set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Container of Field-type object.
Definition: field.h:39
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.
int sg_index(int mu, int nu)
void init(std::string repr)
Wilson-type fermion field.
Definition: field_F.h:37
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 &)
Fopr_CloverTerm(std::string repr)
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
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:47
void mult_sigmaF(Field &, const Field &)
ShiftField_lex m_shift
void set_parameters(const Parameters &params)
void mult_csw(Field &, const Field &)
void mult_csw_chiral(Field &, const Field &)