Bridge++  Ver. 2.0.2
afopr_Wilson_TwistedMass.h
Go to the documentation of this file.
1 
14 #ifndef AFOPR_WILSON_TWISTEDMASS_INCLUDED
15 #define AFOPR_WILSON_TWISTEDMASS_INCLUDED
16 
17 //#include "fopr_Wilson.h"
18 #include "Fopr/afopr.h"
19 
20 #include "IO/bridgeIO.h"
21 using Bridge::vout;
22 
24 
37 template<typename AFIELD>
38 class AFopr_Wilson_TwistedMass : public AFopr<AFIELD>
39 {
40  public:
41  typedef typename AFIELD::real_t real_t;
42 
43  static const std::string class_name;
44 
45  private:
48  std::vector<int> m_boundary;
49 
50  std::string m_kernel_type;
51  std::string m_repr;
52 
54 
56 
57  std::string m_mode;
58 
59  // internal data members
60  int m_Nc, m_Nd, m_NinF;
61  int m_Nvol, m_Ndim;
62 
63  const Field_G *m_U;
64 
66 
68 
69  public:
70 
73  : m_vl(CommonParameters::Vlevel()) { init("Dirac"); }
74 
76  AFopr_Wilson_TwistedMass(const std::string repr) { init(repr); }
77 
78  AFopr_Wilson_TwistedMass(const Parameters& params) { init(params); }
79 
81 
82  private:
83  void init(const std::string& repr);
84 
85  void init(const Parameters& params);
86 
87  void tidyup();
88 
89  public:
90  void set_parameters(const Parameters& params);
91  void set_parameters(const double kappa, const double tw_mass,
92  const std::vector<int> bc);
93 
94  void get_parameters(Parameters& params) const;
95 
96  void set_config(Field *U);
97 
98  void mult(AFIELD& v, const AFIELD& w);
99  void mult_dag(AFIELD& v, const AFIELD& w);
100 
101  void set_mode(std::string mode);
102 
103  std::string get_mode() const { return m_mode; }
104 
105  void mult_gm5(AFIELD& v, const AFIELD& w);
106 
107  void mult_gm5p(const int mu, AFIELD& v, const AFIELD& w);
108 
109  void D(AFIELD&, const AFIELD&);
110  void DdagD(AFIELD&, const AFIELD&);
111  void Ddag(AFIELD&, const AFIELD&);
112  void H(AFIELD&, const AFIELD&);
113  void Hdag(AFIELD&, const AFIELD&);
114 
116  virtual bool needs_convert()
117  { return m_fopr_w->needs_convert(); }
118 
120  virtual void convert(AFIELD& v, const Field& w)
121  { m_fopr_w->convert(v, w); }
122 
124  virtual void reverse(Field& v, const AFIELD& w)
125  { m_fopr_w->reverse(v, w); }
126 
127  int field_nin() { return m_fopr_w->field_nin(); }
128  int field_nvol() { return m_fopr_w->field_nvol(); }
129  int field_nex() { return m_fopr_w->field_nex(); }
130 
132  double flop_count();
133 
134 #ifdef USE_FACTORY
135  private:
136  static AFopr<AFIELD> *create_object()
137  { return new AFopr_Wilson_TwistedMass<AFIELD>(); }
138 
139  static AFopr<AFIELD> *create_object_with_repr(const std::string& repr)
140  { return new AFopr_Wilson_TwistedMass<AFIELD>(repr); }
141 
142  static AFopr<AFIELD> *create_object_with_params(const Parameters& params)
143  { return new AFopr_Wilson_TwistedMass<AFIELD>(params); }
144 
145  public:
146  static bool register_factory()
147  {
148  bool init = true;
149  init &= AFopr<AFIELD>::Factory_noarg::Register("Wilson_TwistedMass",
150  create_object);
151  init &= AFopr<AFIELD>::Factory_string::Register("Wilson_TwistedMass",
152  create_object_with_repr);
153  init &= AFopr<AFIELD>::Factory_params::Register("Wilson_TwistedMass",
154  create_object_with_params);
155  return init;
156  }
157 #endif
158 };
159 #endif
AFopr_Wilson_TwistedMass::m_U
const Field_G * m_U
gauge configuration (pointer)
Definition: afopr_Wilson_TwistedMass.h:63
AFopr_Wilson_TwistedMass::Ddag
void Ddag(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_TwistedMass-tmpl.h:323
bridgeIO.h
AFopr_Wilson_TwistedMass::m_NinF
int m_NinF
Definition: afopr_Wilson_TwistedMass.h:60
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
AFopr
Definition: afopr.h:48
AFopr_Wilson_TwistedMass::needs_convert
virtual bool needs_convert()
returns true if additional field conversion is needed.
Definition: afopr_Wilson_TwistedMass.h:116
AFopr_Wilson_TwistedMass::flop_count
double flop_count()
this returns the number of floating point operations.
Definition: afopr_Wilson_TwistedMass-tmpl.h:395
Parameters
Class for parameters.
Definition: parameters.h:46
AFopr_Wilson_TwistedMass::class_name
static const std::string class_name
Definition: afopr_Wilson_TwistedMass.h:43
AFopr_Wilson_TwistedMass::m_repr
std::string m_repr
gamma matrix representation
Definition: afopr_Wilson_TwistedMass.h:51
AFopr_Wilson_TwistedMass::m_kernel_type
std::string m_kernel_type
kernel type
Definition: afopr_Wilson_TwistedMass.h:50
AFopr_Wilson_TwistedMass::get_mode
std::string get_mode() const
returns the current mult mode.
Definition: afopr_Wilson_TwistedMass.h:103
AFopr_Wilson_TwistedMass::mult_dag
void mult_dag(AFIELD &v, const AFIELD &w)
hermitian conjugate of mult.
Definition: afopr_Wilson_TwistedMass-tmpl.h:246
AFopr_Wilson_TwistedMass::m_boundary
std::vector< int > m_boundary
boundary condition
Definition: afopr_Wilson_TwistedMass.h:48
AFopr_Wilson_TwistedMass::tidyup
void tidyup()
Definition: afopr_Wilson_TwistedMass-tmpl.h:123
Field::real_t
double real_t
Definition: field.h:51
AFopr_Wilson_TwistedMass::convert
virtual void convert(AFIELD &v, const Field &w)
converts a Field object into other format if necessary.
Definition: afopr_Wilson_TwistedMass.h:120
AFopr_Wilson_TwistedMass
Twisted-mass Wilson fermion operator.
Definition: afopr_Wilson_TwistedMass.h:38
AFopr_Wilson_TwistedMass::mult_gm5p
void mult_gm5p(const int mu, AFIELD &v, const AFIELD &w)
Definition: afopr_Wilson_TwistedMass-tmpl.h:288
AFopr_Wilson_TwistedMass::reverse
virtual void reverse(Field &v, const AFIELD &w)
reverses to a Field object from other format if necessary.
Definition: afopr_Wilson_TwistedMass.h:124
AFopr_Wilson_TwistedMass::~AFopr_Wilson_TwistedMass
~AFopr_Wilson_TwistedMass()
Definition: afopr_Wilson_TwistedMass.h:80
AFopr_Wilson_TwistedMass::m_tw_mass
real_t m_tw_mass
twisted mass
Definition: afopr_Wilson_TwistedMass.h:47
AFopr_Wilson_TwistedMass::m_mode
std::string m_mode
mode of multiplication
Definition: afopr_Wilson_TwistedMass.h:57
AFopr_Wilson_TwistedMass::m_kappa
real_t m_kappa
hopping parameter
Definition: afopr_Wilson_TwistedMass.h:46
AFopr_Wilson_TwistedMass::H
void H(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_TwistedMass-tmpl.h:342
AFopr_Wilson_TwistedMass::AFopr_Wilson_TwistedMass
DEPRECATED AFopr_Wilson_TwistedMass(const std::string repr)
Definition: afopr_Wilson_TwistedMass.h:76
AFopr_Wilson_TwistedMass::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Wilson_TwistedMass-tmpl.h:131
AFopr_Wilson_TwistedMass::m_Nc
int m_Nc
Definition: afopr_Wilson_TwistedMass.h:60
AFopr_Wilson_TwistedMass::real_t
AFIELD::real_t real_t
Definition: afopr_Wilson_TwistedMass.h:41
AFopr_Wilson_TwistedMass::m_Nvol
int m_Nvol
Definition: afopr_Wilson_TwistedMass.h:61
AFopr_Wilson_TwistedMass::DdagD
void DdagD(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_TwistedMass-tmpl.h:380
AFopr_Wilson_TwistedMass::mult
void mult(AFIELD &v, const AFIELD &w)
multiplies fermion operator to a given field.
Definition: afopr_Wilson_TwistedMass-tmpl.h:226
AFopr_Wilson_TwistedMass::m_Nd
int m_Nd
Definition: afopr_Wilson_TwistedMass.h:60
AFopr_Wilson_TwistedMass::m_Ndim
int m_Ndim
Definition: afopr_Wilson_TwistedMass.h:61
AFopr_Wilson_TwistedMass::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: afopr_Wilson_TwistedMass.h:127
AFopr_Wilson_TwistedMass::D
void D(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_TwistedMass-tmpl.h:304
AFopr_Wilson_TwistedMass::init
void init(const std::string &repr)
Definition: afopr_Wilson_TwistedMass-tmpl.h:86
AFopr_Wilson_TwistedMass::AFopr_Wilson_TwistedMass
DEPRECATED AFopr_Wilson_TwistedMass()
Definition: afopr_Wilson_TwistedMass.h:72
AFopr_Wilson_TwistedMass::m_is_initial_step
bool m_is_initial_step
to avoid redundant setup
Definition: afopr_Wilson_TwistedMass.h:67
AFopr_Wilson_TwistedMass::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: afopr_Wilson_TwistedMass.h:129
AFopr_Wilson_TwistedMass::m_v2
AFIELD m_v2
working field
Definition: afopr_Wilson_TwistedMass.h:65
AFopr_Wilson_TwistedMass::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: afopr_Wilson_TwistedMass.h:128
Field
Container of Field-type object.
Definition: field.h:46
afopr.h
AFopr_Wilson_TwistedMass::m_fopr_w
AFopr< AFIELD > * m_fopr_w
kernel fermion operator
Definition: afopr_Wilson_TwistedMass.h:55
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
AFopr_Wilson_TwistedMass::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: afopr_Wilson_TwistedMass-tmpl.h:212
AFopr_Wilson_TwistedMass::AFopr_Wilson_TwistedMass
AFopr_Wilson_TwistedMass(const Parameters &params)
Definition: afopr_Wilson_TwistedMass.h:78
AFopr_Wilson_TwistedMass::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Wilson_TwistedMass-tmpl.h:197
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
AFopr_Wilson_TwistedMass::Hdag
void Hdag(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_TwistedMass-tmpl.h:361
AFopr_Wilson_TwistedMass::mult_gm5
void mult_gm5(AFIELD &v, const AFIELD &w)
multiplies gamma_5 matrix.
Definition: afopr_Wilson_TwistedMass-tmpl.h:266
AFopr_Wilson_TwistedMass::m_vl
Bridge::VerboseLevel m_vl
verbose level
Definition: afopr_Wilson_TwistedMass.h:53
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
AFopr_Wilson_TwistedMass::set_mode
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: afopr_Wilson_TwistedMass-tmpl.h:274