Bridge++  Ver. 2.0.2
afopr_Wilson_Chemical.h
Go to the documentation of this file.
1 
14 #ifndef AFOPR_WILSON_CHEMICAL_INCLUDED
15 #define AFOPR_WILSON_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_Wilson_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:
44  std::vector<int> m_boundary;
46 
47  std::string m_kernel_type;
48  std::string m_repr;
49 
51 
52  std::string m_mode;
53 
54  // internal data members
57 
58  const Field_G *m_U;
59 
61 
63 
64  public:
65 
67  AFopr_Wilson_Chemical() { init("Dirac"); }
68 
70  AFopr_Wilson_Chemical(const std::string repr) { init(repr); }
71 
72  AFopr_Wilson_Chemical(const Parameters& params) { init(params); }
73 
75 
76  void set_parameters(const Parameters& params);
77 
78  void get_parameters(Parameters& params) const;
79 
80  void set_config(Field *U);
81 
82  void set_mode(const std::string mode);
83 
84  void mult(AFIELD& v, const AFIELD& w);
85 
86  void mult_dag(AFIELD& v, const AFIELD& w);
87 
88  std::string get_mode() const { return m_mode; }
89 
90  void mult_gm5p(const int mu, AFIELD& v, const AFIELD& w);
91 
92  void mult_gm5(AFIELD&, const AFIELD&);
93  void D(AFIELD&, const AFIELD&);
94  void Dminmu(AFIELD&, const AFIELD&);
95  void Dspc(AFIELD&, const AFIELD&);
96 
97  void DdagD(AFIELD&, const AFIELD&);
98  void Ddag(AFIELD&, const AFIELD&);
99  void H(AFIELD&, const AFIELD&);
100  void Hdag(AFIELD&, const AFIELD&);
101 
102  void mult_up(const int mu, AFIELD& v, const AFIELD& w)
103  { m_fopr_w->mult_up(mu, v, w); }
104 
105  void mult_dn(const int mu, AFIELD& v, const AFIELD& w)
106  { m_fopr_w->mult_dn(mu, v, w); }
107 
109  virtual bool needs_convert()
110  { return m_fopr_w->needs_convert(); }
111 
113  virtual void convert(AFIELD& v, const Field& w)
114  { m_fopr_w->convert(v, w); }
115 
117  virtual void reverse(Field& v, const AFIELD& w)
118  { m_fopr_w->reverse(v, w); }
119 
120  int field_nin() { return m_NinF; }
121  int field_nvol() { return m_Nvol; }
122  int field_nex() { return 1; }
123 
125  double flop_count();
126 
127  private:
128  void init(const std::string repr);
129 
130  void init(const Parameters& params);
131 
132  void tidyup();
133 
135  void set_parameters_impl(const real_t kappa,
136  const real_t mu,
137  const std::vector<int> bc);
138 
139 #ifdef USE_FACTORY
140  private:
141  static AFopr<AFIELD> *create_object()
142  { return new AFopr_Wilson_Chemical<AFIELD>(); }
143 
144  static AFopr<AFIELD> *create_object_with_repr(const std::string& repr)
145  { return new AFopr_Wilson_Chemical<AFIELD>(repr); }
146 
147  static AFopr<AFIELD> *create_object_with_params(const Parameters& params)
148  { return new AFopr_Wilson_Chemical<AFIELD>(params); }
149 
150  public:
151  static bool register_factory()
152  {
153  bool init = true;
154  init &= AFopr<AFIELD>::Factory_noarg::Register("Wilson_Chemical",
155  create_object);
156  init &= AFopr<AFIELD>::Factory_string::Register("Wilson_Chemical",
157  create_object_with_repr);
158  init &= AFopr<AFIELD>::Factory_params::Register("Wilson_Chemical",
159  create_object_with_params);
160  return init;
161  }
162 #endif
163 };
164 #endif
AFopr_Wilson_Chemical::Dspc
void Dspc(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_Chemical-tmpl.h:340
AFopr_Wilson_Chemical::get_mode
std::string get_mode() const
returns the current mult mode.
Definition: afopr_Wilson_Chemical.h:88
bridgeIO.h
AFopr_Wilson_Chemical::m_v1
AFIELD m_v1
Definition: afopr_Wilson_Chemical.h:60
AFopr_Wilson_Chemical::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: afopr_Wilson_Chemical.h:120
AFopr_Wilson_Chemical::mult_dag
void mult_dag(AFIELD &v, const AFIELD &w)
hermitian conjugate of mult.
Definition: afopr_Wilson_Chemical-tmpl.h:275
AFopr
Definition: afopr.h:48
AFopr_Wilson_Chemical::D
void D(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_Chemical-tmpl.h:295
AFopr_Wilson_Chemical::set_parameters_impl
void set_parameters_impl(const real_t kappa, const real_t mu, const std::vector< int > bc)
sets parameters given as values: private for composite operator.
Definition: afopr_Wilson_Chemical-tmpl.h:181
Parameters
Class for parameters.
Definition: parameters.h:46
AFopr_Wilson_Chemical::mult_gm5
void mult_gm5(AFIELD &, const AFIELD &)
multiplies gamma_5 matrix.
Definition: afopr_Wilson_Chemical-tmpl.h:362
AFopr_Wilson_Chemical::m_is_initial_step
bool m_is_initial_step
to avoid redundant setup
Definition: afopr_Wilson_Chemical.h:62
AFopr_Wilson_Chemical::m_exp_mu
real_t m_exp_mu
exp(mu)
Definition: afopr_Wilson_Chemical.h:56
AFopr_Wilson_Chemical
Wilson fermion operator with chemical potential.
Definition: afopr_Wilson_Chemical.h:35
AFopr_Wilson_Chemical::tidyup
void tidyup()
Definition: afopr_Wilson_Chemical-tmpl.h:135
real_t
double real_t
Definition: bridgeQXS_Clover_coarse_double.cpp:16
AFopr_Wilson_Chemical::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Wilson_Chemical-tmpl.h:143
Field::real_t
double real_t
Definition: field.h:51
AFopr_Wilson_Chemical::~AFopr_Wilson_Chemical
~AFopr_Wilson_Chemical()
Definition: afopr_Wilson_Chemical.h:74
AFopr_Wilson_Chemical::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: afopr_Wilson_Chemical.h:122
AFopr_Wilson_Chemical::real_t
AFIELD::real_t real_t
Definition: afopr_Wilson_Chemical.h:39
AFopr_Wilson_Chemical::m_NinF
int m_NinF
Definition: afopr_Wilson_Chemical.h:55
AFopr_Wilson_Chemical::m_Ndim
int m_Ndim
Definition: afopr_Wilson_Chemical.h:55
AFopr_Wilson_Chemical::m_vl
Bridge::VerboseLevel m_vl
Definition: afopr_Wilson_Chemical.h:45
AFopr_Wilson_Chemical::reverse
virtual void reverse(Field &v, const AFIELD &w)
reverses to a Field object from other format if necessary.
Definition: afopr_Wilson_Chemical.h:117
AFopr_Wilson_Chemical::DdagD
void DdagD(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_Chemical-tmpl.h:383
AFopr_Wilson_Chemical::H
void H(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_Chemical-tmpl.h:404
AFopr_Wilson_Chemical::m_v2
AFIELD m_v2
working field.
Definition: afopr_Wilson_Chemical.h:60
AFopr_Wilson_Chemical::flop_count
double flop_count()
this returns the number of floating point operations.
Definition: afopr_Wilson_Chemical-tmpl.h:422
AFopr_Wilson_Chemical::class_name
static const std::string class_name
Definition: afopr_Wilson_Chemical.h:38
AFopr_Wilson_Chemical::m_mode
std::string m_mode
Definition: afopr_Wilson_Chemical.h:52
AFopr_Wilson_Chemical::AFopr_Wilson_Chemical
DEPRECATED AFopr_Wilson_Chemical(const std::string repr)
Definition: afopr_Wilson_Chemical.h:70
AFopr_Wilson_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_Wilson_Chemical-tmpl.h:241
AFopr_Wilson_Chemical::needs_convert
virtual bool needs_convert()
returns true if additional field conversion is needed.
Definition: afopr_Wilson_Chemical.h:109
AFopr_Wilson_Chemical::m_Nvol
int m_Nvol
Definition: afopr_Wilson_Chemical.h:55
AFopr_Wilson_Chemical::m_mu
real_t m_mu
isospin chemical potential
Definition: afopr_Wilson_Chemical.h:43
AFopr_Wilson_Chemical::set_config
void set_config(Field *U)
sets the gauge configuration.
Definition: afopr_Wilson_Chemical-tmpl.h:227
AFopr_Wilson_Chemical::Hdag
void Hdag(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_Chemical-tmpl.h:413
AFopr_Wilson_Chemical::m_boundary
std::vector< int > m_boundary
Definition: afopr_Wilson_Chemical.h:44
AFopr_Wilson_Chemical::m_fopr_w
AFopr< AFIELD > * m_fopr_w
Definition: afopr_Wilson_Chemical.h:50
AFopr_Wilson_Chemical::AFopr_Wilson_Chemical
DEPRECATED AFopr_Wilson_Chemical()
Definition: afopr_Wilson_Chemical.h:67
AFopr_Wilson_Chemical::m_U
const Field_G * m_U
Definition: afopr_Wilson_Chemical.h:58
AFopr_Wilson_Chemical::m_kernel_type
std::string m_kernel_type
kernel type
Definition: afopr_Wilson_Chemical.h:47
AFopr_Wilson_Chemical::mult_dn
void mult_dn(const int mu, AFIELD &v, const AFIELD &w)
downward nearest neighbor hopping term.
Definition: afopr_Wilson_Chemical.h:105
AFopr_Wilson_Chemical::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: afopr_Wilson_Chemical.h:121
AFopr_Wilson_Chemical::AFopr_Wilson_Chemical
AFopr_Wilson_Chemical(const Parameters &params)
Definition: afopr_Wilson_Chemical.h:72
AFopr_Wilson_Chemical::Ddag
void Ddag(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_Chemical-tmpl.h:394
AFopr_Wilson_Chemical::mult_gm5p
void mult_gm5p(const int mu, AFIELD &v, const AFIELD &w)
Definition: afopr_Wilson_Chemical-tmpl.h:370
AFopr_Wilson_Chemical::m_repr
std::string m_repr
Definition: afopr_Wilson_Chemical.h:48
AFopr_Wilson_Chemical::mult_up
void mult_up(const int mu, AFIELD &v, const AFIELD &w)
upward nearest neighbor hopping term.
Definition: afopr_Wilson_Chemical.h:102
AFopr_Wilson_Chemical::init
void init(const std::string repr)
Definition: afopr_Wilson_Chemical-tmpl.h:88
Field
Container of Field-type object.
Definition: field.h:46
afopr.h
AFopr_Wilson_Chemical::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Wilson_Chemical-tmpl.h:211
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
AFopr_Wilson_Chemical::Dminmu
void Dminmu(AFIELD &, const AFIELD &)
Definition: afopr_Wilson_Chemical-tmpl.h:318
AFopr_Wilson_Chemical::m_kappa
real_t m_kappa
hopping parameter
Definition: afopr_Wilson_Chemical.h:42
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
AFopr_Wilson_Chemical::convert
virtual void convert(AFIELD &v, const Field &w)
converts a Field object into other format if necessary.
Definition: afopr_Wilson_Chemical.h:113
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
AFopr_Wilson_Chemical::mult
void mult(AFIELD &v, const AFIELD &w)
multiplies fermion operator to a given field.
Definition: afopr_Wilson_Chemical-tmpl.h:255