Bridge++  Ver. 2.0.2
afopr_Clover_Chemical.h
Go to the documentation of this file.
1 
14 #ifndef AFOPR_CLOVER_CHEMICAL_INCLUDED
15 #define AFOPR_CLOVER_CHEMICAL_INCLUDED
16 
17 #include "lib/Fopr/afopr.h"
18 
19 #include "lib/IO/bridgeIO.h"
20 using Bridge::vout;
21 
23 
34 template<typename AFIELD>
35 class AFopr_Clover_Chemical : public AFopr<AFIELD>
36 {
37  public:
38  static const std::string class_name;
39  typedef typename AFIELD::real_t real_t;
40 
41  private:
45  std::vector<int> m_boundary;
47  std::string m_repr;
48 
49  std::string m_kernel_type;
50 
51  std::string m_mode;
52 
53  // internal data members
54  int m_Nvol, m_Ndim;
55  int m_Nc, m_Nd, m_NinF;
57 
60 
61  const Field_G *m_U;
62 
64 
66 
67  public:
68 
70  AFopr_Clover_Chemical() { init("Dirac"); }
71 
73  AFopr_Clover_Chemical(const std::string repr) { init(repr); }
74 
75  AFopr_Clover_Chemical(const Parameters& params) { init(params); }
76 
78 
79  void set_parameters(const Parameters& params);
80 
81  void get_parameters(Parameters& params) const;
82 
83  void set_config(Field *U);
84 
85  void set_mode(const std::string mode);
86 
87  void mult(AFIELD& v, const AFIELD& w);
88 
89  void mult_dag(AFIELD& v, const AFIELD& w);
90 
91  std::string get_mode() const { return m_mode; }
92 
93  void mult_gm5p(const int mu, AFIELD& v, const AFIELD& w);
94 
95  void mult_gm5(AFIELD&, const AFIELD&);
96  void D(AFIELD&, const AFIELD&);
97  void Dminmu(AFIELD&, const AFIELD&);
98 
99  void DdagD(AFIELD&, const AFIELD&);
100  void Ddag(AFIELD&, const AFIELD&);
101  void H(AFIELD&, const AFIELD&);
102  void Hdag(AFIELD&, const AFIELD&);
103 
104  void mult_up(const int mu, AFIELD& v, const AFIELD& w)
105  { m_fopr_w->mult_up(mu, v, w); }
106 
107  void mult_dn(const int mu, AFIELD& v, const AFIELD& w)
108  { m_fopr_w->mult_dn(mu, v, w); }
109 
111  virtual bool needs_convert()
112  { return m_fopr_w->needs_convert(); }
113 
115  virtual void convert(AFIELD& v, const Field& w)
116  { m_fopr_w->convert(v, w); }
117 
119  virtual void reverse(Field& v, const AFIELD& w)
120  { m_fopr_w->reverse(v, w); }
121 
122  int field_nin() { return m_NinF; }
123  int field_nvol() { return m_Nvol; }
124  int field_nex() { return 1; }
125 
127  double flop_count();
128 
129  private:
130  void init(const std::string repr);
131 
132  void init(const Parameters& params);
133 
134  void tidyup();
135 
137  void set_parameters_impl(const real_t kappa,
138  const real_t cSW,
139  const real_t mu,
140  const std::vector<int> bc);
141 
142 #ifdef USE_FACTORY
143  private:
144  static AFopr<AFIELD> *create_object()
145  { return new AFopr_Clover_Chemical<AFIELD>(); }
146 
147  static AFopr<AFIELD> *create_object_with_repr(const std::string& repr)
148  { return new AFopr_Clover_Chemical<AFIELD>(repr); }
149 
150  static AFopr<AFIELD> *create_object_with_params(const Parameters& params)
151  { return new AFopr_Clover_Chemical<AFIELD>(params); }
152 
153  public:
154  static bool register_factory()
155  {
156  bool init = true;
157  init &= AFopr<AFIELD>::Factory_noarg::Register("Clover_Chemical",
158  create_object);
159  init &= AFopr<AFIELD>::Factory_string::Register("Clover_Chemical",
160  create_object_with_repr);
161  init &= AFopr<AFIELD>::Factory_params::Register("Clover_Chemical",
162  create_object_with_params);
163  return init;
164  }
165 #endif
166 };
167 #endif
AFopr_Clover_Chemical::init
void init(const std::string repr)
Definition: afopr_Clover_Chemical-tmpl.h:89
AFopr_Clover_Chemical::D
void D(AFIELD &, const AFIELD &)
Definition: afopr_Clover_Chemical-tmpl.h:302
bridgeIO.h
AFopr_Clover_Chemical::m_cSW
real_t m_cSW
clover coefficient
Definition: afopr_Clover_Chemical.h:43
AFopr_Clover_Chemical::AFopr_Clover_Chemical
AFopr_Clover_Chemical(const Parameters &params)
Definition: afopr_Clover_Chemical.h:75
AFopr_Clover_Chemical::Dminmu
void Dminmu(AFIELD &, const AFIELD &)
Definition: afopr_Clover_Chemical-tmpl.h:324
AFopr
Definition: afopr.h:48
AFopr_Clover_Chemical::m_kappa
real_t m_kappa
hopping parameter
Definition: afopr_Clover_Chemical.h:42
AFopr_Clover_Chemical::flop_count
double flop_count()
this returns the number of floating point operations.
Definition: afopr_Clover_Chemical-tmpl.h:406
AFopr_Clover_Chemical::m_U
const Field_G * m_U
Definition: afopr_Clover_Chemical.h:61
Parameters
Class for parameters.
Definition: parameters.h:46
AFopr_Clover_Chemical::AFopr_Clover_Chemical
DEPRECATED AFopr_Clover_Chemical()
Definition: afopr_Clover_Chemical.h:70
AFopr_Clover_Chemical::real_t
AFIELD::real_t real_t
Definition: afopr_Clover_Chemical.h:39
AFopr_Clover_Chemical::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Clover_Chemical-tmpl.h:217
AFopr_Clover_Chemical::m_is_initial_step
bool m_is_initial_step
to avoid redundant setup
Definition: afopr_Clover_Chemical.h:65
AFopr_Clover_Chemical::m_vl
Bridge::VerboseLevel m_vl
verbose level
Definition: afopr_Clover_Chemical.h:46
AFopr_Clover_Chemical::m_repr
std::string m_repr
gamma-matrix representation
Definition: afopr_Clover_Chemical.h:47
AFopr_Clover_Chemical::needs_convert
virtual bool needs_convert()
returns true if additional field conversion is needed.
Definition: afopr_Clover_Chemical.h:111
AFopr_Clover_Chemical::m_fopr_csw
AFopr< AFIELD > * m_fopr_csw
Definition: afopr_Clover_Chemical.h:59
real_t
double real_t
Definition: bridgeQXS_Clover_coarse_double.cpp:16
AFopr_Clover_Chemical::m_kernel_type
std::string m_kernel_type
kernel type
Definition: afopr_Clover_Chemical.h:49
AFopr_Clover_Chemical::reverse
virtual void reverse(Field &v, const AFIELD &w)
reverses to a Field object from other format if necessary.
Definition: afopr_Clover_Chemical.h:119
AFopr_Clover_Chemical::m_fopr_w
AFopr< AFIELD > * m_fopr_w
Definition: afopr_Clover_Chemical.h:58
AFopr_Clover_Chemical::class_name
static const std::string class_name
Definition: afopr_Clover_Chemical.h:38
Field::real_t
double real_t
Definition: field.h:51
AFopr_Clover_Chemical::DdagD
void DdagD(AFIELD &, const AFIELD &)
Definition: afopr_Clover_Chemical-tmpl.h:367
AFopr_Clover_Chemical::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: afopr_Clover_Chemical.h:123
AFopr_Clover_Chemical::set_parameters_impl
void set_parameters_impl(const real_t kappa, const real_t cSW, const real_t mu, const std::vector< int > bc)
sets parameters given as values: private for composite operator.
Definition: afopr_Clover_Chemical-tmpl.h:184
AFopr_Clover_Chemical::m_v2
AFIELD m_v2
working field.
Definition: afopr_Clover_Chemical.h:63
AFopr_Clover_Chemical::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: afopr_Clover_Chemical.h:124
AFopr_Clover_Chemical::m_Nd
int m_Nd
Definition: afopr_Clover_Chemical.h:55
AFopr_Clover_Chemical::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: afopr_Clover_Chemical-tmpl.h:234
AFopr_Clover_Chemical::~AFopr_Clover_Chemical
~AFopr_Clover_Chemical()
Definition: afopr_Clover_Chemical.h:77
AFopr_Clover_Chemical::m_exp_mu
real_t m_exp_mu
exp(mu)
Definition: afopr_Clover_Chemical.h:56
AFopr_Clover_Chemical::Ddag
void Ddag(AFIELD &, const AFIELD &)
Definition: afopr_Clover_Chemical-tmpl.h:378
AFopr_Clover_Chemical::m_mu
real_t m_mu
isospin chemical potential
Definition: afopr_Clover_Chemical.h:44
AFopr_Clover_Chemical::m_Nc
int m_Nc
Definition: afopr_Clover_Chemical.h:55
AFopr_Clover_Chemical::H
void H(AFIELD &, const AFIELD &)
Definition: afopr_Clover_Chemical-tmpl.h:388
AFopr_Clover_Chemical::Hdag
void Hdag(AFIELD &, const AFIELD &)
Definition: afopr_Clover_Chemical-tmpl.h:397
AFopr_Clover_Chemical::m_boundary
std::vector< int > m_boundary
boundary conditions
Definition: afopr_Clover_Chemical.h:45
AFopr_Clover_Chemical::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: afopr_Clover_Chemical.h:122
AFopr_Clover_Chemical::m_Ndim
int m_Ndim
Definition: afopr_Clover_Chemical.h:54
AFopr_Clover_Chemical::tidyup
void tidyup()
Definition: afopr_Clover_Chemical-tmpl.h:137
AFopr_Clover_Chemical::m_v1
AFIELD m_v1
Definition: afopr_Clover_Chemical.h:63
AFopr_Clover_Chemical::m_mode
std::string m_mode
Definition: afopr_Clover_Chemical.h:51
AFopr_Clover_Chemical::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: afopr_Clover_Chemical-tmpl.h:248
AFopr_Clover_Chemical::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Clover_Chemical-tmpl.h:145
AFopr_Clover_Chemical::mult_gm5
void mult_gm5(AFIELD &, const AFIELD &)
multiplies gamma_5 matrix.
Definition: afopr_Clover_Chemical-tmpl.h:346
AFopr_Clover_Chemical::mult_gm5p
void mult_gm5p(const int mu, AFIELD &v, const AFIELD &w)
Definition: afopr_Clover_Chemical-tmpl.h:354
AFopr_Clover_Chemical::convert
virtual void convert(AFIELD &v, const Field &w)
converts a Field object into other format if necessary.
Definition: afopr_Clover_Chemical.h:115
AFopr_Clover_Chemical::AFopr_Clover_Chemical
DEPRECATED AFopr_Clover_Chemical(const std::string repr)
Definition: afopr_Clover_Chemical.h:73
AFopr_Clover_Chemical::m_Nvol
int m_Nvol
Definition: afopr_Clover_Chemical.h:54
AFopr_Clover_Chemical::m_NinF
int m_NinF
Definition: afopr_Clover_Chemical.h:55
Field
Container of Field-type object.
Definition: field.h:46
afopr.h
AFopr_Clover_Chemical::mult_dn
void mult_dn(const int mu, AFIELD &v, const AFIELD &w)
downward nearest neighbor hopping term.
Definition: afopr_Clover_Chemical.h:107
AFopr_Clover_Chemical::get_mode
std::string get_mode() const
returns the current mult mode.
Definition: afopr_Clover_Chemical.h:91
AFopr_Clover_Chemical::mult_up
void mult_up(const int mu, AFIELD &v, const AFIELD &w)
upward nearest neighbor hopping term.
Definition: afopr_Clover_Chemical.h:104
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
AFopr_Clover_Chemical::mult
void mult(AFIELD &v, const AFIELD &w)
multiplies fermion operator to a given field.
Definition: afopr_Clover_Chemical-tmpl.h:262
AFopr_Clover_Chemical::mult_dag
void mult_dag(AFIELD &v, const AFIELD &w)
hermitian conjugate of mult.
Definition: afopr_Clover_Chemical-tmpl.h:282
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
AFopr_Clover_Chemical
Clover fermion operator with chemical potential.
Definition: afopr_Clover_Chemical.h:35