Bridge++  Ver. 1.3.x
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"
18 #include "staples_SF.h"
19 
20 #include "shiftField_lex.h"
21 #include "gammaMatrixSet.h"
22 
23 #include "bridgeIO.h"
24 using Bridge::vout;
25 
27 
42 //- parameters class
43 class Parameters_Fopr_Clover_SF : virtual public Parameters
44 {
45  public:
47 };
48 //- end
49 
50 class Fopr_Clover_SF : public Fopr
51 {
52  public:
53  static const std::string class_name;
54 
55  private:
57  double m_kappa, m_cSW;
58  std::vector<int> m_boundary;
59  std::string m_repr;
60  std::string m_mode;
61 
62  void (Fopr_Clover_SF::*m_csw)(Field_F&, const Field_F&);
63 
64  // Index_lex m_idx;
66  const Field_G *m_U;
68 
70  // Bx = -iF(1,2), By = -iF(2,1), -iBz = F(0,1)
71  // Ex = -iF(4,0), Ey = -iF(4,1), Ez = -iF(4,2)
72 
73  std::vector<GammaMatrix> m_GM, m_SG;
74 
76  double m_phi[3];
78  double m_phipr[3];
79 
82 
83  public:
85  {
86  init("Dirac");
87  }
88 
90  {
91  tidyup();
92  }
93 
94  void set_parameters(const Parameters& params);
95  void set_parameters(double kappa, double cSW, std::vector<int> bc,
96  double *phi, double *phipr);
97 
98  void set_config(Field *U)
99  {
100  m_U = (Field_G *)U;
101  m_fopr_w->set_config(U);
102 
103  set_csw();
104  }
105 
107  {
108  m_U = U.get();
109  m_fopr_w->set_config(U.get());
110 
111  set_csw();
112  }
113 
114  void set_mode(std::string mode)
115  {
116  m_mode = mode;
117  }
118 
119  std::string get_mode() const
120  {
121  return m_mode;
122  }
123 
124  void mult(Field& v, const Field& f)
125  {
126  if (m_mode == "D") {
127  D(v, f);
128  } else if (m_mode == "DdagD") {
129  DdagD(v, f);
130  } else if (m_mode == "Ddag") {
131  Ddag(v, f);
132  } else if (m_mode == "H") {
133  H(v, f);
134  } else {
135  vout.crucial(m_vl, "Fopr_Clover_SF: undefined mode = %s.\n", m_mode.c_str());
136  exit(EXIT_FAILURE);
137  }
138  }
139 
140  void mult_dag(Field& v, const Field& f)
141  {
142  if (m_mode == "D") {
143  Ddag(v, f);
144  } else if (m_mode == "DdagD") {
145  DdagD(v, f);
146  } else if (m_mode == "Ddag") {
147  D(v, f);
148  } else if (m_mode == "H") {
149  H(v, f);
150  } else {
151  vout.crucial(m_vl, "Fopr_Clover_SF: undefined mode = %s.\n", m_mode.c_str());
152  exit(EXIT_FAILURE);
153  }
154  }
155 
156  void DdagD(Field&, const Field&);
157  void D(Field&, const Field&);
158  void Ddag(Field&, const Field&);
159  void H(Field&, const Field&);
160 
161  void mult_gm5(Field& v, const Field& w)
162  {
163  m_fopr_w->mult_gm5(v, w);
164  }
165 
166  void mult_isigma(Field_F&, const Field_F&,
167  const int mu, const int nu);
168 
169  int field_nvol() { return m_Nvol; }
170  int field_nin() { return 2 * m_Nc * m_Nd; }
171  int field_nex() { return 1; }
172 
174  double flop_count();
175 
176  private:
177  void init(std::string repr);
178  void tidyup();
179 
180  void set_csw();
181  void mult_csw(Field_F&, const Field_F&);
182  void set_fieldstrength(Field_G&, const int, const int);
183 
184  void mult_csw_dirac(Field_F&, const Field_F&);
185  void mult_csw_chiral(Field_F&, const Field_F&);
186 
187  int sg_index(int mu, int nu) { return mu * m_Ndim + nu; }
188 };
189 #endif
std::vector< GammaMatrix > m_SG
BridgeIO vout
Definition: bridgeIO.cpp:278
Clover fermion operator.
void mult_csw_dirac(Field_F &, const Field_F &)
void(Fopr_Clover_SF::* m_csw)(Field_F &, const Field_F &)
double m_phi[3]
SF boundary condition at t=0.
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
ShiftField_lex m_shift
static const std::string class_name
Container of Field-type object.
Definition: field.h:39
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:38
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(int mu, 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:113
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)
Fopr_Wilson_SF * m_fopr_w
std::vector< GammaMatrix > m_GM
void crucial(const char *format,...)
Definition: bridgeIO.cpp:48
const Field_G * m_U
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 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:49
void mult_gm5(Field &v, const Field &w)
void set_config(unique_ptr< Field_G > &U)
void init(std::string repr)
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)