Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fopr_Wilson_Isochemical.h
Go to the documentation of this file.
1 
14 #ifndef FOPR_WILSON_ISOCHEMICAL_INCLUDED
15 #define FOPR_WILSON_ISOCHEMICAL_INCLUDED
16 
17 #include "fopr_Wilson.h"
18 
19 #include "IO/bridgeIO.h"
20 using Bridge::vout;
21 
23 
34 {
35  public:
36  static const std::string class_name;
37 
38  private:
39  int m_Nvol, m_Ndim;
40  double m_kappa;
41  double m_mu;
42  std::vector<int> m_boundary;
43  std::string m_mode;
45 
46  double m_exp_mu;
47 
48  std::string m_repr;
51  void (Fopr_Wilson_Isochemical::*m_D)(Field&, const Field&);
53 
54  const Field_G *m_U;
55 
58 
59  public:
60 
62  {
63  init("Dirac");
64  }
65 
66  Fopr_Wilson_Isochemical(const std::string repr) : Fopr()
67  {
68  init(repr);
69  }
70 
72  {
73  tidyup();
74  }
75 
76  // this method is temporary. After all calls specify bc, to be removed.
77  void set_parameters(const Parameters& params);
78 
79  void set_parameters(const double kappa, const double mu,
80  const std::vector<int> bc);
81 
82  void set_config(Field *U)
83  {
84  m_U = (Field_G *)U;
85  m_fopr_w->set_config(U);
86  }
87 
89  {
90  m_U = U.get();
91  m_fopr_w->set_config(U.get());
92  }
93 
94  void mult(Field& v, const Field& f)
95  {
96  (this->*m_mult)(v, f);
97  }
98 
99  void mult_dag(Field& v, const Field& f)
100  {
101  (this->*m_mult_dag)(v, f);
102  }
103 
104  void set_mode(const std::string mode)
105  {
106  m_mode = mode;
107 
108  if (m_mode == "D") {
111  } else if (m_mode == "Ddag") {
114  } else if (m_mode == "DdagD") {
117  } else if (m_mode == "H") {
120  } else {
121  vout.crucial(m_vl, "Error at %s: input mode is undefined.\n", class_name.c_str());
122  exit(EXIT_FAILURE);
123  }
124  }
125 
126  std::string get_mode() const
127  {
128  return m_mode;
129  }
130 
131  void mult_gm5p(const int mu, Field_F& v, const Field_F& w);
132 
133  void mult_gm5(Field&, const Field&);
134  void D(Field&, const Field&);
135  void Dminmu(Field&, const Field&);
136  void Dspc(Field&, const Field&);
137 
138  void DdagD(Field&, const Field&);
139  void Ddag(Field&, const Field&);
140  void H(Field&, const Field&);
141  void Hdag(Field&, const Field&);
142 
143  void mult_undef(Field&, const Field&)
144  {
145  vout.crucial(m_vl, "Error at %s: mode undefined.\n", class_name.c_str());
146  exit(EXIT_FAILURE);
147  }
148 
149  void mult_up(const int mu, Field& v, const Field& w)
150  {
151  m_fopr_w->mult_up(mu, v, w);
152  }
153 
154  void mult_dn(const int mu, Field& v, const Field& w)
155  {
156  m_fopr_w->mult_dn(mu, v, w);
157  }
158 
159  int field_nvol() { return CommonParameters::Nvol(); }
161  int field_nex() { return 1; }
162 
164  double flop_count();
165 
166  private:
167  void init(const std::string repr);
168  void tidyup();
169 
170 #ifdef USE_FACTORY
171  private:
172  static Fopr *create_object()
173  {
174  return new Fopr_Wilson_Isochemical();
175  }
176 
177  static Fopr *create_object_with_repr(const std::string& repr)
178  {
179  return new Fopr_Wilson_Isochemical(repr);
180  }
181 
182  public:
183  static bool register_factory()
184  {
185  bool init1 = Fopr::Factory_noarg::Register("Wilson_Isochemical", create_object);
186  bool init2 = Fopr::Factory_string::Register("Wilson_Isochemical", create_object_with_repr);
187 
188  return init1 && init2;
189  }
190 #endif
191 };
192 #endif
void set_config(Field *U)
setting pointer to the gauge configuration.
void Hdag(Field &, const Field &)
BridgeIO vout
Definition: bridgeIO.cpp:503
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
double m_kappa
hopping parameter
void set_config(Field *U)
setting pointer to the gauge configuration.
void(Fopr_Wilson_Isochemical::* m_mult)(Field &, const Field &)
void mult_gm5(Field &, const Field &)
gamma_5 multiplication. [31 Mar 2017 H.Matsufuru]
Container of Field-type object.
Definition: field.h:45
int field_nvol()
returns the volume for which the fermion operator is defined.
void mult_up(const int mu, Field &v, const Field &w)
nearest neighbor hopping term: temporary entry [H.Matsufuru]
double flop_count()
this returns the number of floating point operations.
Class for parameters.
Definition: parameters.h:46
void(Fopr_Wilson_Isochemical::* m_D)(Field &, const Field &)
void Ddag(Field &, const Field &)
void mult(Field &v, const Field &f)
multiplies fermion operator to a given field (2nd argument)
Wilson-type fermion field.
Definition: field_F.h:37
void mult_dn(const int mu, Field &w, const Field &f)
SU(N) gauge field.
Definition: field_G.h:38
int field_nex()
returns the external d.o.f. for which the fermion operator is defined.
void D(Field &, const Field &)
Wilson fermion operator with isospin chemical potential.
Bridge::VerboseLevel m_vl
Definition: fopr.h:127
void set_parameters(const Parameters &params)
pointer get() const
void(Fopr_Wilson_Isochemical::* m_gm5)(Field &, const Field &)
void Dminmu(Field &, const Field &)
std::string get_mode() const
only for Fopr_Overlap
void mult_up(const int mu, Field &w, const Field &f)
nearest neighbor hopping term: temporary entry [H.Matsufuru]
void mult_dn(const int mu, Field &v, const Field &w)
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
void mult_gm5p(const int mu, Field_F &v, const Field_F &w)
void(Fopr_Wilson_Isochemical::* m_mult_dag)(Field &, const Field &)
double m_mu
isospin chemical potential
void H(Field &, const Field &)
void mult_undef(Field &, const Field &)
void Dspc(Field &, const Field &)
void DdagD(Field &, const Field &)
void init(const std::string repr)
void set_config(unique_ptr< Field_G > &U)
Base class of fermion operator family.
Definition: fopr.h:46
static const std::string class_name
int field_nin()
returns the on-site d.o.f. for which the fermion operator is defined.
void mult_dag(Field &v, const Field &f)
hermitian conjugate of mult(Field&, const Field&).
Fopr_Wilson_Isochemical(const std::string repr)