Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Clover_SF.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_CLOVER_SF_INCLUDED
15 #define FOPR_CLOVER_SF_INCLUDED
16 
17 #include "fopr_Wilson_SF.h"
19 
20 #include "Field/shiftField_lex.h"
21 #include "Tools/gammaMatrixSet.h"
22 
23 #include "IO/bridgeIO.h"
24 using Bridge::vout;
25 
27 
43 class Fopr_Clover_SF : public Fopr
44 {
45  public:
46  static const std::string class_name;
47 
48  private:
50  double m_kappa, m_cSW;
51  std::vector<int> m_boundary;
52  std::string m_repr;
53  std::string m_mode;
54 
55  void (Fopr_Clover_SF::*m_csw)(Field_F&, const Field_F&);
56 
57  // Index_lex m_idx;
59  const Field_G *m_U;
61 
63  // Bx = -iF(1,2), By = -iF(2,1), -iBz = F(0,1)
64  // Ex = -iF(4,0), Ey = -iF(4,1), Ez = -iF(4,2)
65 
66  std::vector<GammaMatrix> m_GM, m_SG;
67 
69  double m_phi[3];
71  double m_phipr[3];
72 
75 
76  public:
78  {
79  init("Dirac");
80  }
81 
83  {
84  tidyup();
85  }
86 
87  void set_parameters(const Parameters& params);
88  void set_parameters(const double kappa, const double cSW, const std::vector<int> bc,
89  double *phi, double *phipr);
90 
91  void set_config(Field *U)
92  {
93  m_U = (Field_G *)U;
94  m_fopr_w->set_config(U);
95 
96  set_csw();
97  }
98 
100  {
101  m_U = U.get();
102  m_fopr_w->set_config(U.get());
103 
104  set_csw();
105  }
106 
107  void set_mode(const std::string mode)
108  {
109  m_mode = mode;
110  }
111 
112  std::string get_mode() const
113  {
114  return m_mode;
115  }
116 
117  void mult(Field& v, const Field& f)
118  {
119  if (m_mode == "D") {
120  D(v, f);
121  } else if (m_mode == "DdagD") {
122  DdagD(v, f);
123  } else if (m_mode == "Ddag") {
124  Ddag(v, f);
125  } else if (m_mode == "H") {
126  H(v, f);
127  } else {
128  vout.crucial(m_vl, "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  if (m_mode == "D") {
136  Ddag(v, f);
137  } else if (m_mode == "DdagD") {
138  DdagD(v, f);
139  } else if (m_mode == "Ddag") {
140  D(v, f);
141  } else if (m_mode == "H") {
142  H(v, f);
143  } else {
144  vout.crucial(m_vl, "Error at %s: undefined mode = %s.\n", class_name.c_str(), m_mode.c_str());
145  exit(EXIT_FAILURE);
146  }
147  }
148 
149  void DdagD(Field&, const Field&);
150  void D(Field&, const Field&);
151  void Ddag(Field&, const Field&);
152  void H(Field&, const Field&);
153 
154  void mult_gm5(Field& v, const Field& w)
155  {
156  m_fopr_w->mult_gm5(v, w);
157  }
158 
159  void mult_isigma(Field_F&, const Field_F&,
160  const int mu, const int nu);
161 
162  int field_nvol() { return m_Nvol; }
163  int field_nin() { return 2 * m_Nc * m_Nd; }
164  int field_nex() { return 1; }
165 
167  double flop_count();
168 
169  private:
170  void init(const std::string repr);
171  void tidyup();
172 
173  void set_csw();
174  void mult_csw(Field_F&, const Field_F&);
175  void set_fieldstrength(Field_G&, const int, const int);
176 
177  void mult_csw_dirac(Field_F&, const Field_F&);
178  void mult_csw_chiral(Field_F&, const Field_F&);
179 
180  int sg_index(const int mu, const int nu) { return mu * m_Ndim + nu; }
181 
182 #ifdef USE_FACTORY
183  private:
184  static Fopr *create_object()
185  {
186  return new Fopr_Clover_SF();
187  }
188 
189  public:
190  static bool register_factory()
191  {
192  return Fopr::Factory_noarg::Register("Clover_SF", create_object);
193  }
194 #endif
195 };
196 #endif
std::vector< GammaMatrix > m_SG
BridgeIO vout
Definition: bridgeIO.cpp:503
void init(const std::string repr)
void mult_csw_dirac(Field_F &, const Field_F &)
double m_phi[3]
SF boundary condition at t=0.
ShiftField_lex m_shift
static const std::string class_name
Container of Field-type object.
Definition: field.h:45
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
void H(Field &, const Field &)
void set_config(Field *U)
setting pointer to the gauge configuration.
std::string m_repr
Class for parameters.
Definition: parameters.h:46
std::string m_mode
Wilson fermion operator with SF BC.
double m_phipr[3]
SF boundary condition at t=Nt.
void mult_isigma(Field_F &, const Field_F &, const int mu, const int nu)
Wilson-type fermion field.
Definition: field_F.h:37
void set_config(Field *U)
setting pointer to the gauge configuration.
int sg_index(const int mu, const int nu)
void DdagD(Field &, const Field &)
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
SU(N) gauge field.
Definition: field_G.h:38
Bridge::VerboseLevel m_vl
Definition: fopr.h:127
std::string get_mode() const
only for Fopr_Overlap
void set_fieldstrength(Field_G &, const int, const int)
pointer get() const
void mult_csw(Field_F &, const Field_F &)
std::vector< int > m_boundary
void mult_gm5(Field &v, const Field &w)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
Fopr_Wilson_SF * m_fopr_w
std::vector< GammaMatrix > m_GM
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
const Field_G * m_U
void(Fopr_Clover_SF::* m_csw)(Field_F &, const Field_F &)
void Ddag(Field &, const Field &)
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
void mult_csw_chiral(Field_F &, const Field_F &)
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
void D(Field &, const Field &)
Field_F_SF setzero
In order to set the boundary field to zero.
Methods to shift a field in the lexical site index.
int field_nvol()
returns the volume for which the fermion operator is defined.
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
Base class of fermion operator family.
Definition: fopr.h:46
void mult_gm5(Field &v, const Field &w)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
void set_config(unique_ptr< Field_G > &U)
double flop_count()
this returns the number of floating point number operations.
A class generated to add a function for the SF.
Definition: field_F_SF.h:33
void set_parameters(const Parameters &params)
Clover fermion operator.