Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_WilsonGeneral_impl.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_WILSON_GENERAL_IMPL_ORG_INCLUDED
15 #define FOPR_WILSON_GENERAL_IMPL_ORG_INCLUDED
16 
17 #include "Fopr/fopr.h"
18 
19 #include "Field/shiftField_lex.h"
20 
21 #include "Tools/gammaMatrixSet.h"
22 
23 #include "IO/bridgeIO.h"
24 using Bridge::vout;
25 
27 
35 namespace Org {
36  class Fopr_WilsonGeneral : public Fopr
37  {
38  public:
39  static const std::string class_name;
40 
41  private:
42  // lattice parameters
43  int m_Nvol;
44  int m_Ndim;
45  int m_Nc;
46  int m_Nd;
47 
49  double m_nu_s, m_r_s;
50  std::vector<int> m_boundary;
51 
52  std::string m_mode;
53  std::string m_repr;
54 
55  void (Fopr_WilsonGeneral::*m_mult)(Field&, const Field&);
57 
58  const Field_G *m_U;
59 
60  std::vector<GammaMatrix> m_GM;
61 
64 
66 
67 
68  public:
69  Fopr_WilsonGeneral() { init("Dirac"); }
70  Fopr_WilsonGeneral(std::string repr) { init(repr); }
72 
73  void init(const std::string repr);
74 
75  void set_parameters(const Parameters& params);
76  void set_parameters(const double kappa_s, const double kappa_t,
77  const double nu_s, const double r_s);
78  void set_parameters(const double kappa_s, const double kappa_t,
79  const double nu_s, const double r_s,
80  const std::vector<int> bc);
81 
82  void set_config(Field *U)
83  { m_U = (Field_G *)U; }
84 
86  { return set_config(U.get()); }
87 
88  void set_mode(const std::string mode);
89 
90  std::string get_mode() const;
91 
92  inline void mult(Field& v, const Field& f)
93  { (this->*m_mult)(v, f); }
94 
95  inline void mult_dag(Field& v, const Field& f)
96  { (this->*m_mult_dag)(v, f); }
97 
98  void mult_gm5(Field& v, const Field& f);
99 
100  void proj_chiral(Field& w, const int ex1, const Field& v, const int ex2, const int ipm);
101 
102  void D(Field& v, const Field& f);
103 
104  void D_ex(Field& v, const int ex1, const Field& f, const int ex2);
105 
106  inline void Ddag(Field& w, const Field& f)
107  {
108  Field w2(f.nin(), f.nvol(), f.nex());
109 
110  mult_gm5(w, f);
111  D(w2, w);
112  mult_gm5(w, w2);
113  }
114 
115  inline void DdagD(Field& w, const Field& f)
116  {
117  Field w2(f.nin(), f.nvol(), f.nex());
118 
119  D(w2, f);
120  mult_gm5(w, w2);
121  D(w2, w);
122  mult_gm5(w, w2);
123  }
124 
125  inline void DDdag(Field& w, const Field& f)
126  {
127  Field w2(f.nin(), f.nvol(), f.nex());
128 
129  mult_gm5(w2, f);
130  D(w, w2);
131  mult_gm5(w2, w);
132  D(w, w2);
133  }
134 
135  inline void H(Field& w, const Field& f)
136  {
137  Field w2(f.nin(), f.nvol(), f.nex());
138 
139  D(w2, f);
140  mult_gm5(w, w2);
141  }
142 
143  inline void mult_undef(Field&, const Field& f)
144  {
145  vout.crucial(m_vl, "Error at %s: mode undefined.\n", class_name.c_str());
146  exit(EXIT_FAILURE);
147  }
148 
149  const Field_F mult_gm5p(const int mu, const Field_F& w);
150 
151  void mult_gm5p(const int mu, Field_F& v, const Field_F& w);
152 
153  // void gm5p(Field_F& v, const int mu, const Field_F& w);
154 
156  double flop_count();
157 
159  { return CommonParameters::Nvol(); }
160  int field_nin()
161  { return 2 * CommonParameters::Nc() * CommonParameters::Nd(); }
162  int field_nex()
163  { return 1; }
164 
165  void mult_up(const int mu, Field& w, const Field& f);
166  void mult_dn(const int mu, Field& w, const Field& f);
167 
168  private:
169  //- prohibit copy
172 
173  // void mult_p (int mu, Field_F&, const Field_F&);
174  // void mult_m (int mu, Field_F&, const Field_F&);
175 
176 #ifdef USE_FACTORY
177  private:
178  static Fopr *create_object()
179  {
180  return new Fopr_WilsonGeneral();
181  }
182 
183  static Fopr *create_object_with_arg(const std::string& repr)
184  {
185  return new Fopr_WilsonGeneral(repr);
186  }
187 
188  public:
189  static bool register_factory()
190  {
191  bool init1 = Fopr::Factory_noarg::Register("WilsonGeneral/Org", create_object);
192  bool init2 = Fopr::Factory_string::Register("WilsonGeneral/Org", create_object_with_arg);
193 
194  return init1 && init2;
195  }
196 #endif
197  };
198 }
199 #endif /* FOPR_WILSON_GENERAL_IMPL_ORG_INCLUDED */
void(Fopr_WilsonGeneral::* m_mult_dag)(Field &, const Field &)
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
void proj_chiral(Field &w, const int ex1, const Field &v, const int ex2, const int ipm)
Fopr_WilsonGeneral(const Fopr_WilsonGeneral &)
BridgeIO vout
Definition: bridgeIO.cpp:503
void mult_undef(Field &, const Field &f)
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Fopr_WilsonGeneral & operator=(const Fopr_WilsonGeneral &)
int field_nvol()
returns the volume for which the fermion operator is defined.
void mult_up(const int mu, Field &w, const Field &f)
nearest neighbor hopping term: temporary entry [H.Matsufuru]
Container of Field-type object.
Definition: field.h:45
void init(const std::string repr)
int nvol() const
Definition: field.h:127
void H(Field &w, const Field &f)
void set_config(unique_ptr< Field_G > &U)
Class for parameters.
Definition: parameters.h:46
std::string get_mode() const
only for Fopr_Overlap
void set_parameters(const Parameters &params)
Wilson-type fermion field.
Definition: field_F.h:37
int nin() const
Definition: field.h:126
void mult_dn(const int mu, Field &w, const Field &f)
SU(N) gauge field.
Definition: field_G.h:38
static const std::string class_name
std::vector< GammaMatrix > m_GM
const Field_F mult_gm5p(const int mu, const Field_F &w)
void DDdag(Field &w, const Field &f)
double flop_count()
this returns the number of floating point operations.
pointer get() const
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
int nex() const
Definition: field.h:128
void DdagD(Field &w, const Field &f)
void mult_gm5(Field &v, const Field &f)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void(Fopr_WilsonGeneral::* m_mult)(Field &, const Field &)
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
void Ddag(Field &w, const Field &f)
void set_config(Field *U)
setting pointer to the gauge configuration.
VerboseLevel
Definition: bridgeIO.h:42
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
Fopr_WilsonGeneral(std::string repr)
void D_ex(Field &v, const int ex1, const Field &f, const int ex2)
Methods to shift a field in the lexical site index.
void D(Field &v, const Field &f)
Base class of fermion operator family.
Definition: fopr.h:46