Bridge++  Ver. 2.0.2
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 
51  double m_cSW_s, m_cSW_t;
52  std::vector<int> m_boundary;
53  std::string m_repr;
54  std::string m_mode;
57 
59  int m_Nvol;
60 
61  const Field_G *m_U;
62 
67  // Bx = -iF(1,2), By = -iF(2,0), Bz = -iF(0,1)
68  // Ex = -iF(3,0), Ey = -iF(3,1), Ez = -iF(3,2)
69 
70  std::vector<GammaMatrix> m_SG;
72 
73  public:
76  : m_vl(CommonParameters::Vlevel())
77  {
78  init("Dirac");
79  }
80 
82  Fopr_CloverTerm_General(const std::string repr)
83  : m_vl(CommonParameters::Vlevel())
84  {
85  init(repr);
86  }
87 
89  : m_vl(CommonParameters::Vlevel())
90  {
91  std::string repr = params.get_string("gamma_matrix_type");
92  init(repr);
93  set_parameters(params);
94  }
95 
97  {
98  tidyup();
99  }
100 
101  void set_parameters(const Parameters& params);
102  void set_parameters(const double kappa_s, const double kappa_t,
103  const double cSW_s, const double cSW_t,
104  const std::vector<int> bc);
105 
106  void get_parameters(Parameters& params) const;
107 
108  void set_config(Field *U);
109 
110  void set_mode(const 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  // csw kappa sigma_{mu nu} F_{mu nu}
123  if ((m_mode == "D") || (m_mode == "F")) {
124  mult_sigmaF(v, f);
125 // } else if(m_mode=="H"){
126 // H(v,f);
127  } else {
128  vout.crucial("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  mult(v, f);
136  }
137 
138  void mult_sigmaF(Field&, const Field&);
139 
140  void mult_gm5(Field& v, const Field& w);
141 
142  void mult_isigma(Field_F&, const Field_F&,
143  const int mu, const int nu);
144 
145  int field_nvol() { return m_Nvol; }
146  int field_nin() { return 2 * m_Nc * m_Nd; }
147  int field_nex() { return 1; }
148 
150  double flop_count();
151 
152  private:
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  // multiplies csw kappa sigma_{mu nu} F_{mu nu}
163  // NOTE: this is NOT 1 - csw kappa sigma_{mu nu} F_{mu nu}
164  void mult_csw(Field&, const Field&);
165  void mult_csw_dirac(Field&, const Field&);
166  void mult_csw_chiral(Field&, const Field&);
167 
168  void mult_csw_dirac(Field_F&, const Field_F&);
169  void mult_csw_chiral(Field_F&, const Field_F&);
170 
171  int sg_index(const int mu, const int nu) { return mu * m_Ndim + nu; }
172  };
173 }
174 #endif /* FOPR_CLOVERTERM_GENERAL_IMPL_IMP_INCLUDED */
Imp::Fopr_CloverTerm_General::gm5_dirac
void gm5_dirac(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:181
Imp::Fopr_CloverTerm_General::~Fopr_CloverTerm_General
~Fopr_CloverTerm_General()
Definition: fopr_CloverTerm_General_impl.h:96
bridgeIO.h
Imp::Fopr_CloverTerm_General::m_shift
ShiftField_lex m_shift
Definition: fopr_CloverTerm_General_impl.h:63
Imp::Fopr_CloverTerm_General::m_Nc
int m_Nc
Definition: fopr_CloverTerm_General_impl.h:58
Imp::Fopr_CloverTerm_General::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: fopr_CloverTerm_General_impl.h:146
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
AFopr< Field >
Imp::Fopr_CloverTerm_General::tidyup
void tidyup()
Definition: fopr_CloverTerm_General_impl.cpp:167
Imp::Fopr_CloverTerm_General::m_NinF
int m_NinF
Definition: fopr_CloverTerm_General_impl.h:58
Imp::Fopr_CloverTerm_General::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: fopr_CloverTerm_General_impl.h:145
Imp::Fopr_CloverTerm_General::set_mode
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: fopr_CloverTerm_General_impl.h:110
Parameters
Class for parameters.
Definition: parameters.h:46
GammaMatrix
Gamma Matrix class.
Definition: gammaMatrix.h:44
Imp::Fopr_CloverTerm_General::m_Nvol
int m_Nvol
Definition: fopr_CloverTerm_General_impl.h:59
Imp::Fopr_CloverTerm_General::init
void init(std::string repr)
Definition: fopr_CloverTerm_General_impl.cpp:112
Imp::Fopr_CloverTerm_General::mult_isigma
void mult_isigma(Field_F &, const Field_F &, const int mu, const int nu)
Definition: fopr_CloverTerm_General_impl.cpp:251
Imp::Fopr_CloverTerm_General::m_By
Field_G m_By
Definition: fopr_CloverTerm_General_impl.h:66
Imp::Fopr_CloverTerm_General::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: fopr_CloverTerm_General_impl.cpp:104
Imp::Fopr_CloverTerm_General::mult_dag
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult.
Definition: fopr_CloverTerm_General_impl.h:133
Imp::Fopr_CloverTerm_General::m_vl
Bridge::VerboseLevel m_vl
Definition: fopr_CloverTerm_General_impl.h:48
Imp::Fopr_CloverTerm_General::m_U
const Field_G * m_U
pointer to gauge configuration.
Definition: fopr_CloverTerm_General_impl.h:61
Imp::Fopr_CloverTerm_General::mult
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field.
Definition: fopr_CloverTerm_General_impl.h:120
Imp::Fopr_CloverTerm_General::m_Cdn
Field_G m_Cdn
Definition: fopr_CloverTerm_General_impl.h:65
Imp::Fopr_CloverTerm_General::m_csw
void(Fopr_CloverTerm_General::* m_csw)(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.h:55
Imp::Fopr_CloverTerm_General::get_mode
std::string get_mode() const
Definition: fopr_CloverTerm_General_impl.h:115
Imp::Fopr_CloverTerm_General::gm5_chiral
void gm5_chiral(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:216
Imp::Fopr_CloverTerm_General::m_v2
Field_G m_v2
for calculation of field strength.
Definition: fopr_CloverTerm_General_impl.h:65
Imp::Fopr_CloverTerm_General::mult_csw
void mult_csw(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:267
fopr_Wilson.h
Imp::Fopr_CloverTerm_General::m_boundary
std::vector< int > m_boundary
Definition: fopr_CloverTerm_General_impl.h:52
Imp::Fopr_CloverTerm_General::m_kappa_t
double m_kappa_t
Definition: fopr_CloverTerm_General_impl.h:50
Imp::Fopr_CloverTerm_General::m_Ex
Field_G m_Ex
Definition: fopr_CloverTerm_General_impl.h:66
Imp::Fopr_CloverTerm_General::m_cSW_s
double m_cSW_s
Definition: fopr_CloverTerm_General_impl.h:51
Imp::Fopr_CloverTerm_General::set_fieldstrength
void set_fieldstrength(Field_G &, const int, const int)
Definition: fopr_CloverTerm_General_impl.cpp:544
Imp::Fopr_CloverTerm_General::mult_csw_chiral
void mult_csw_chiral(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:276
staple_lex.h
Imp::Fopr_CloverTerm_General::m_Ndim
int m_Ndim
Definition: fopr_CloverTerm_General_impl.h:58
Imp::Fopr_CloverTerm_General::sg_index
int sg_index(const int mu, const int nu)
Definition: fopr_CloverTerm_General_impl.h:171
Imp::Fopr_CloverTerm_General::m_mode
std::string m_mode
Definition: fopr_CloverTerm_General_impl.h:54
Imp::Fopr_CloverTerm_General::m_staple
Staple_lex m_staple
Definition: fopr_CloverTerm_General_impl.h:64
Imp::Fopr_CloverTerm_General::m_Bz
Field_G m_Bz
Definition: fopr_CloverTerm_General_impl.h:66
Imp::Fopr_CloverTerm_General::m_Nd
int m_Nd
Definition: fopr_CloverTerm_General_impl.h:58
Imp::Fopr_CloverTerm_General::flop_count
double flop_count()
this returns the number of floating point operations.
Definition: fopr_CloverTerm_General_impl.cpp:576
Imp::Fopr_CloverTerm_General::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: fopr_CloverTerm_General_impl.h:147
Imp::Fopr_CloverTerm_General::Fopr_CloverTerm_General
DEPRECATED Fopr_CloverTerm_General()
Definition: fopr_CloverTerm_General_impl.h:75
ShiftField_lex
Methods to shift a field in the lexical site index.
Definition: shiftField_lex.h:39
Imp::Fopr_CloverTerm_General::m_SG
std::vector< GammaMatrix > m_SG
Definition: fopr_CloverTerm_General_impl.h:70
Imp::Fopr_CloverTerm_General::m_Ey
Field_G m_Ey
Definition: fopr_CloverTerm_General_impl.h:66
Imp::Fopr_CloverTerm_General::mult_csw_dirac
void mult_csw_dirac(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:404
Imp::Fopr_CloverTerm_General::m_repr
std::string m_repr
Definition: fopr_CloverTerm_General_impl.h:53
Imp::Fopr_CloverTerm_General::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_CloverTerm_General_impl.cpp:32
Staple_lex
Staple construction.
Definition: staple_lex.h:39
Imp::Fopr_CloverTerm_General::m_cSW_t
double m_cSW_t
Definition: fopr_CloverTerm_General_impl.h:51
Imp::Fopr_CloverTerm_General::mult_sigmaF
void mult_sigmaF(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.cpp:260
Imp::Fopr_CloverTerm_General::Fopr_CloverTerm_General
DEPRECATED Fopr_CloverTerm_General(const std::string repr)
Definition: fopr_CloverTerm_General_impl.h:82
Imp::Fopr_CloverTerm_General::m_GM5
GammaMatrix m_GM5
Definition: fopr_CloverTerm_General_impl.h:71
Field_F
Wilson-type fermion field.
Definition: field_F.h:37
Imp::Fopr_CloverTerm_General::m_gm5
void(Fopr_CloverTerm_General::* m_gm5)(Field &, const Field &)
Definition: fopr_CloverTerm_General_impl.h:56
Imp::Fopr_CloverTerm_General::mult_gm5
void mult_gm5(Field &v, const Field &w)
multiplies gamma_5 matrix.
Definition: fopr_CloverTerm_General_impl.cpp:174
Imp::Fopr_CloverTerm_General::m_Bx
Field_G m_Bx
Definition: fopr_CloverTerm_General_impl.h:66
Parameters::get_string
string get_string(const string &key) const
Definition: parameters.cpp:221
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:180
Imp
Clover term operator.
Definition: fopr_CloverTerm_eo_impl.cpp:32
Field
Container of Field-type object.
Definition: field.h:46
Imp::Fopr_CloverTerm_General::m_Cup
Field_G m_Cup
Definition: fopr_CloverTerm_General_impl.h:65
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Imp::Fopr_CloverTerm_General::set_csw
void set_csw()
Definition: fopr_CloverTerm_General_impl.cpp:532
Imp::Fopr_CloverTerm_General::class_name
static const std::string class_name
Definition: fopr_CloverTerm_General_impl.h:45
Imp::Fopr_CloverTerm_General::m_kappa_s
double m_kappa_s
Definition: fopr_CloverTerm_General_impl.h:50
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
Imp::Fopr_CloverTerm_General::m_v1
Field_G m_v1
Definition: fopr_CloverTerm_General_impl.h:65
Imp::Fopr_CloverTerm_General
Definition: fopr_CloverTerm_General_impl.h:42
Imp::Fopr_CloverTerm_General::Fopr_CloverTerm_General
Fopr_CloverTerm_General(const Parameters &params)
Definition: fopr_CloverTerm_General_impl.h:88
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Imp::Fopr_CloverTerm_General::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_CloverTerm_General_impl.cpp:61
Imp::Fopr_CloverTerm_General::m_Ez
Field_G m_Ez
field strength.
Definition: fopr_CloverTerm_General_impl.h:66