Bridge++  Ver. 1.1.x
 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 "bridgeIO.h"
20 using Bridge::vout;
21 
23 
30 //- parameters class
32 {
33  public:
35 };
36 //- end
37 
39 {
40  private:
41  int m_Nvol, m_Ndim;
42  double m_kappa;
43  double m_mu;
44  std::valarray<int> m_boundary;
45  std::string m_mode;
47 
48  double m_exp_mu;
49 
50  std::string m_repr;
53  void (Fopr_Wilson_Isochemical::*m_D) (Field&, const Field&);
55 
56  const Field_G *m_U;
57 
58  public:
59 
61  {
62  init("Dirac");
63  }
64 
65  Fopr_Wilson_Isochemical(std::string repr) : Fopr()
66  {
67  init(repr);
68  }
69 
71  {
72  tidyup();
73  }
74 
75  // this method is temporary. After all calls specify bc, to be removed.
76  void set_parameters(const Parameters& params);
77 
78  void set_parameters(const double kappa, const double mu,
79  const std::valarray<int> bc);
80 
81  void set_config(Field *U)
82  {
83  m_U = (Field_G *)U;
84  m_fopr_w->set_config(U);
85  }
86 
87  const Field mult(const Field& f)
88  {
89  Field v(f.nin(), f.nvol(), f.nex());
90 
91  mult(v, f);
92  return v;
93  }
94 
95  const Field mult_dag(const Field& f)
96  {
97  Field v(f.nin(), f.nvol(), f.nex());
98 
99  mult_dag(v, f);
100  return v;
101  }
102 
103  void mult(Field& v, const Field& f)
104  {
105  (this->*m_mult)(v, f);
106  }
107 
108  void mult_dag(Field& v, const Field& f)
109  {
110  (this->*m_mult_dag)(v, f);
111  }
112 
113  void set_mode(std::string mode)
114  {
115  m_mode = mode;
116 
117  if (m_mode == "D") {
120  } else if (m_mode == "Ddag") {
123  } else if (m_mode == "DdagD") {
126  } else if (m_mode == "H") {
129  } else {
130  vout.crucial(m_vl, "Fopr_Wilson_Isochemical: input mode is undefined.\n");
131  abort();
132  }
133  }
134 
135  std::string get_mode() const
136  {
137  return m_mode;
138  }
139 
140  const Field mult_gm5(const Field& f)
141  {
142  Field v(f.nin(), f.nvol(), f.nex());
143 
144  mult_gm5(v, f);
145  return v;
146  }
147 
148  const Field_F mult_gm5p(int mu, const Field_F& w);
149 
150  void mult_gm5(Field&, const Field&);
151  void D(Field&, const Field&);
152  void Dminmu(Field&, const Field&);
153  void Dspc(Field&, const Field&);
154 
155  void DdagD(Field&, const Field&);
156  void Ddag(Field&, const Field&);
157  void H(Field&, const Field&);
158  void Hdag(Field&, const Field&);
159 
160  void mult_undef(Field&, const Field&)
161  {
162  vout.crucial(m_vl, "Fopr_Wilson_Isochemical: mode undefined.\n");
163  abort();
164  }
165 
166  void mult_up(int mu, Field& v, const Field& w)
167  {
168  m_fopr_w->mult_up(mu, v, w);
169  }
170 
171  void mult_dn(int mu, Field& v, const Field& w)
172  {
173  m_fopr_w->mult_dn(mu, v, w);
174  }
175 
177  {
178  v *= (2.0 * m_kappa);
179  }
180 
182  {
183  v *= 1.0 / (2.0 * m_kappa);
184  }
185 
186  int field_nvol() { return CommonParameters::Nvol(); }
188  int field_nex() { return 1; }
189 
190  private:
191  void init(std::string repr);
192  void tidyup();
193 };
194 #endif