Bridge++  Ver. 2.0.2
afopr_Domainwall_5din_eo.h
Go to the documentation of this file.
1 
10 #ifndef QXS_AFOPR_DOMAINWALL_5DIN_EO_INCLUDED
11 #define QXS_AFOPR_DOMAINWALL_5DIN_EO_INCLUDED
12 
13 #include <vector>
14 #include <string>
15 
16 #include "lib/Fopr/afopr.h"
17 
20 #include "lib/IO/bridgeIO.h"
21 using Bridge::vout;
22 
25 
26 class Field;
27 class Field_G;
28 
30 
34 template<typename AFIELD>
35 class AFopr_Domainwall_5din_eo : public AFopr<AFIELD>
36 {
37  public:
38  typedef typename AFIELD::real_t real_t;
39  static const std::string class_name;
40 
41  private:
42  // parameters common to overlap fermion
45  int m_Ns;
46  std::vector<int> m_boundary;
47  std::vector<real_t> m_b;
48  std::vector<real_t> m_c;
49  std::string m_repr;
50 
51  std::string m_mode;
52 
54 
55  int m_Nx, m_Ny, m_Nz, m_Nt;
56  int m_Nvol, m_Ndim;
58  int m_Nx2, m_Nst2;
60 
61  std::vector<int> m_Leo;
62 
64 
67 
70 
71  // for preconditioning
72  std::vector<real_t> m_dp;
73  std::vector<real_t> m_dpinv;
74  std::vector<real_t> m_dm;
75  std::vector<real_t> m_e;
76  std::vector<real_t> m_f;
78 
79  int m_Nsize[4];
80 
81  int do_comm[4];
83 
84  std::vector<int> m_Nbdsize;
85 
86  using channel_allocator_t = typename AFIELD::template aligned_allocator<char>;
88  // using channel_t = Channel_aligned<alignment_size<AFIELD::IMPL>() >;
89  std::vector<channel_t> chsend_up, chrecv_up, chsend_dn, chrecv_dn;
91 
92  public:
94  : AFopr<AFIELD>()
95  {
97  init(params);
98  }
99 
101 
102  void set_parameters(const Parameters& params);
103 
105  void set_parameters(const double mq, const double M0,
106  const int Ns, const std::vector<int> bc,
107  const double b, const double c);
108 
110  void set_kernel_parameters(const Parameters& params);
111 
113  void set_precond_parameters();
114 
116  void set_coefficients(const std::vector<double> b,
117  const std::vector<double> c);
118 
120  bool needs_convert() { return true; }
121 
123  void convert(AFIELD&, const Field&);
124 
126  void reverse(Field&, const AFIELD&);
127 
129  void set_config(Field *U);
130 
131  // void set_boundary_config(AFIELD& U, const int mu);
132 
133  void set_mode(std::string mode);
134 
135  std::string get_mode() const { return m_mode; }
136 
137  void mult(AFIELD& v, const AFIELD& w);
138 
139  void mult_dag(AFIELD& v, const AFIELD& w);
140 
142  void mult(AFIELD& v, const AFIELD& w, std::string mode);
143 
145  void mult_dag(AFIELD& v, const AFIELD& w, std::string mode);
146 
147  void DdagD(AFIELD&, const AFIELD&);
148  void D(AFIELD&, const AFIELD&);
149  void Ddag(AFIELD&, const AFIELD&);
150 
151  void D_ee(AFIELD&, const AFIELD&, const int ieo);
152  void D_ee_inv(AFIELD&, const AFIELD&, const int ieo);
153  void D_eo(AFIELD&, const AFIELD&, const int ieo);
154  void Ddag_ee(AFIELD&, const AFIELD&, const int ieo);
155  void Ddag_ee_inv(AFIELD&, const AFIELD&, const int ieo);
156  void Ddag_eo(AFIELD&, const AFIELD&, const int ieo);
157 
158  void mult_D_eo(AFIELD&, const AFIELD&, const int ieo);
159  void mult_Ddag_eo(AFIELD&, const AFIELD&, const int ieo);
160 
161  void L_inv(AFIELD&, const AFIELD&);
162  void U_inv(AFIELD&, const AFIELD&);
163  void Ldag_inv(AFIELD&, const AFIELD&);
164  void Udag_inv(AFIELD&, const AFIELD&);
165 
166  int field_nin() { return m_NinF; }
167  int field_nvol() { return m_Nst2; }
168  int field_nex() { return 1; }
169 
171  double flop_count() { return flop_count(m_mode); }
172 
174  double flop_count(std::string mode);
175 
176  private:
178  void init(const Parameters& params);
179 
181  void tidyup();
182 
184  void setup_channels();
185 
187  void set_config_omp(Field *u);
188 
190  void set_config_impl(Field *u);
191 
193  void Dhop(real_t *, real_t *, const int ieo);
194 
195  void Dhop_1(real_t *, real_t *, const int ieo);
196 
197  void Dhop_2(real_t *, real_t *, const int ieo);
198 
199  void Dhop_b(real_t *, real_t *, const int ieo);
200 
201 #ifdef USE_FACTORY
202  private:
203  static AFopr<AFIELD> *create_object_with_params(const Parameters& params)
204  { return new AFopr_Domainwall_5din_eo(params); }
205 
206  public:
207  static bool register_factory()
208  {
210  "Domainwall_5din_eo", create_object_with_params);
212  "Domainwall_General_5din_eo", create_object_with_params);
213  return init1;
214  }
215 #endif
216 };
217 
218 // for transition of the class name
219 template<class AFIELD>
221 
222 #endif
AFopr_Domainwall_5din_eo::flop_count
double flop_count()
this returns the number of floating point number operations.
Definition: afopr_Domainwall_5din_eo.h:171
AFopr_Domainwall_5din_eo::m_Nst2v
int m_Nst2v
Definition: afopr_Domainwall_5din_eo.h:59
bridgeIO.h
AFopr_Domainwall_5din_eo::m_mode
std::string m_mode
Definition: afopr_Domainwall_5din_eo.h:51
AFopr_Domainwall_5din_eo::field_nvol
int field_nvol()
returns the volume of the fermion field.
Definition: afopr_Domainwall_5din_eo.h:167
AFopr_Domainwall_5din_eo::m_Nz
int m_Nz
Definition: afopr_Domainwall_5din_eo.h:55
AFopr_Domainwall_5din_eo::m_v4
AFIELD m_v4
Definition: afopr_Domainwall_5din_eo.h:68
AFopr_Domainwall_5din_eo::m_Ulex
AFIELD m_Ulex
converted gauge config.(lexical)
Definition: afopr_Domainwall_5din_eo.h:66
AFopr_Domainwall_5din_eo::init
void init(const Parameters &params)
initial setup.
Definition: afopr_Domainwall_5din_eo-tmpl.h:17
AFopr_Domainwall_5din_eo::m_vl
Bridge::VerboseLevel m_vl
verbose level
Definition: afopr_Domainwall_5din_eo.h:53
AFopr
Definition: afopr.h:48
AFopr_Domainwall_5din_eo::m_w4
AFIELD m_w4
Definition: afopr_Domainwall_5din_eo.h:68
AFopr_Domainwall_5din_eo::m_v2
AFIELD m_v2
working 5d vectors
Definition: afopr_Domainwall_5din_eo.h:69
AFopr_Domainwall_5din_eo::U_inv
void U_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_5din_eo-tmpl.h:1051
AFopr_Domainwall_5din_eo::chrecv_dn
std::vector< channel_t > chrecv_dn
Definition: afopr_Domainwall_5din_eo.h:89
AFopr_Domainwall_5din_eo::field_nex
int field_nex()
returns the external degree of freedom of the fermion field.
Definition: afopr_Domainwall_5din_eo.h:168
communicator_impl.h
Parameters
Class for parameters.
Definition: parameters.h:46
AFopr_Domainwall_5din_eo::set_precond_parameters
void set_precond_parameters()
set parameters for preconditioning.
Definition: afopr_Domainwall_5din_eo-tmpl.h:290
AFopr_Domainwall_5din_eo::set_config_impl
void set_config_impl(Field *u)
setting gauge configuration (implementation).
Definition: afopr_Domainwall_5din_eo-tmpl.h:399
AFopr_Domainwall_5din_eo::Udag_inv
void Udag_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_5din_eo-tmpl.h:1065
AFopr_Domainwall_5din_eo::mult
void mult(AFIELD &v, const AFIELD &w)
multiplies fermion operator to a given field.
Definition: afopr_Domainwall_5din_eo-tmpl.h:575
AFopr_Domainwall_5din_eo::m_Ueo
AFIELD m_Ueo
gauge config. with boundary condition
Definition: afopr_Domainwall_5din_eo.h:65
AFopr_Domainwall_5din_eo::Ldag_inv
void Ldag_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_5din_eo-tmpl.h:1079
AFopr_Domainwall_5din_eo::set_config_omp
void set_config_omp(Field *u)
setting gauge configuration (setting omp parallel).
Definition: afopr_Domainwall_5din_eo-tmpl.h:386
AFopr_Domainwall_5din_eo::mult_dag
void mult_dag(AFIELD &v, const AFIELD &w)
hermitian conjugate of mult.
Definition: afopr_Domainwall_5din_eo-tmpl.h:592
AFopr_Domainwall_5din_eo::chset_recv
ChannelSet chset_recv
Definition: afopr_Domainwall_5din_eo.h:90
AFopr_Domainwall_5din_eo::m_b
std::vector< real_t > m_b
Definition: afopr_Domainwall_5din_eo.h:47
AFopr_Domainwall_5din_eo::do_comm_any
int do_comm_any
communication switch (if any): (0: n, 1: y).
Definition: afopr_Domainwall_5din_eo.h:82
AFopr_Domainwall_5din_eo::m_c
std::vector< real_t > m_c
Definition: afopr_Domainwall_5din_eo.h:48
AFopr_Domainwall_5din_eo::m_Nx2v
int m_Nx2v
Definition: afopr_Domainwall_5din_eo.h:59
AFopr_Domainwall_5din_eo::m_mq
real_t m_mq
quark mass
Definition: afopr_Domainwall_5din_eo.h:43
AFopr_Domainwall_5din_eo::convert
void convert(AFIELD &, const Field &)
convert Field to AField for this class.
Definition: afopr_Domainwall_5din_eo-tmpl.h:478
AFopr_Domainwall_5din_eo::m_Nt
int m_Nt
Definition: afopr_Domainwall_5din_eo.h:55
AFopr_Domainwall_5din_eo::set_mode
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
Definition: afopr_Domainwall_5din_eo-tmpl.h:562
ChannelSet
ChannelSet class for a collection of channels.
Definition: channel.h:148
AFopr_Domainwall_5din_eo
Optimal Domain-wall fermion operator.
Definition: afopr_Domainwall_5din_eo.h:35
AFopr_Domainwall_5din_eo::reverse
void reverse(Field &, const AFIELD &)
reverse AField to Field.
Definition: afopr_Domainwall_5din_eo-tmpl.h:520
AFopr_Domainwall_5din_eo::m_Nyv
int m_Nyv
Definition: afopr_Domainwall_5din_eo.h:59
AFopr_Domainwall_5din_eo::Ddag_ee_inv
void Ddag_ee_inv(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_5din_eo-tmpl.h:927
AFopr_Domainwall_5din_eo::m_repr
std::string m_repr
gamma matrix representation
Definition: afopr_Domainwall_5din_eo.h:49
AFopr_Domainwall_5din_eo::m_Nsize
int m_Nsize[4]
Definition: afopr_Domainwall_5din_eo.h:79
real_t
double real_t
Definition: bridgeQXS_Clover_coarse_double.cpp:16
AFopr_Domainwall_5din_eo::Ddag
void Ddag(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_5din_eo-tmpl.h:712
AFopr_Domainwall_5din_eo::set_kernel_parameters
void set_kernel_parameters(const Parameters &params)
set parameters of kernel operaotr.
AFopr_Domainwall_5din_eo::setup_channels
void setup_channels()
setup channels for communication.
Definition: afopr_Domainwall_5din_eo-tmpl.h:155
Field::real_t
double real_t
Definition: field.h:51
AFopr_Domainwall_5din_eo::m_e
std::vector< real_t > m_e
Definition: afopr_Domainwall_5din_eo.h:75
AFopr_Domainwall_5din_eo::class_name
static const std::string class_name
Definition: afopr_Domainwall_5din_eo.h:39
AFopr_Domainwall_5din_eo::m_Ndim
int m_Ndim
Definition: afopr_Domainwall_5din_eo.h:56
AFopr_Domainwall_5din_eo::Dhop
void Dhop(real_t *, real_t *, const int ieo)
hopping part of fermion operator.
AFopr_Domainwall_5din_eo::m_M0
real_t m_M0
domain-wall height
Definition: afopr_Domainwall_5din_eo.h:44
AFopr_Domainwall_5din_eo::mult_Ddag_eo
void mult_Ddag_eo(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_5din_eo-tmpl.h:831
AFopr_Domainwall_5din_eo::m_Nx2
int m_Nx2
Definition: afopr_Domainwall_5din_eo.h:58
AFopr_Domainwall_5din_eo::AFopr_Domainwall_5din_eo
AFopr_Domainwall_5din_eo(const Parameters &params)
Definition: afopr_Domainwall_5din_eo.h:93
AFopr_Domainwall_5din_eo::m_y4
AFIELD m_y4
working 4d vectors
Definition: afopr_Domainwall_5din_eo.h:68
AFopr_Domainwall_5din_eo::do_comm
int do_comm[4]
communication switch (4=Ndim): (0: n, 1: y).
Definition: afopr_Domainwall_5din_eo.h:81
AFopr_Domainwall_5din_eo::chset_send
ChannelSet chset_send
Definition: afopr_Domainwall_5din_eo.h:90
AFopr_Domainwall_5din_eo::chsend_dn
std::vector< channel_t > chsend_dn
Definition: afopr_Domainwall_5din_eo.h:89
AFopr_Domainwall_5din_eo::L_inv
void L_inv(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_5din_eo-tmpl.h:1037
AFopr_Domainwall_5din_eo::m_t4
AFIELD m_t4
Definition: afopr_Domainwall_5din_eo.h:68
AFopr_Domainwall_5din_eo::D_ee_inv
void D_ee_inv(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_5din_eo-tmpl.h:915
AFopr_Domainwall_5din_eo::m_NinF
int m_NinF
Definition: afopr_Domainwall_5din_eo.h:57
AFopr_Domainwall_5din_eo::DdagD
void DdagD(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_5din_eo-tmpl.h:666
AFopr_Domainwall_5din_eo::needs_convert
bool needs_convert()
this class needs convert of fermion field.
Definition: afopr_Domainwall_5din_eo.h:120
AFopr_Domainwall_5din_eo::get_mode
std::string get_mode() const
returns the current mult mode.
Definition: afopr_Domainwall_5din_eo.h:135
AFopr_Domainwall_5din_eo::chrecv_up
std::vector< channel_t > chrecv_up
Definition: afopr_Domainwall_5din_eo.h:89
AFopr_Domainwall_5din_eo::m_Nst2
int m_Nst2
Definition: afopr_Domainwall_5din_eo.h:58
AFopr_Domainwall_5din_eo::m_Nvol
int m_Nvol
Definition: afopr_Domainwall_5din_eo.h:56
AFopr_Domainwall_5din_eo::Ddag_ee
void Ddag_ee(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_5din_eo-tmpl.h:989
AFopr_Domainwall_5din_eo::tidyup
void tidyup()
final tidyup.
Definition: afopr_Domainwall_5din_eo-tmpl.h:147
AFopr_Domainwall_5din_eo::chsend_up
std::vector< channel_t > chsend_up
Definition: afopr_Domainwall_5din_eo.h:89
AFopr_Domainwall_5din_eo::~AFopr_Domainwall_5din_eo
~AFopr_Domainwall_5din_eo()
Definition: afopr_Domainwall_5din_eo.h:100
AFopr_Domainwall_5din_eo::m_Ndf
int m_Ndf
Definition: afopr_Domainwall_5din_eo.h:57
AFopr_Domainwall_5din_eo::set_parameters
void set_parameters(const Parameters &params)
sets parameters by a Parameter object: to be implemented in a subclass.
Definition: afopr_Domainwall_5din_eo-tmpl.h:189
AFopr_Domainwall_5din_eo::D_eo
void D_eo(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_5din_eo-tmpl.h:731
AFopr_Domainwall_5din_eo::m_Nbdsize
std::vector< int > m_Nbdsize
Definition: afopr_Domainwall_5din_eo.h:84
AFopr_Domainwall_5din_eo::m_Ny
int m_Ny
Definition: afopr_Domainwall_5din_eo.h:55
parameters.h
AFopr_Domainwall_5din_eo::Dhop_1
void Dhop_1(real_t *, real_t *, const int ieo)
AFopr_Domainwall_5din_eo::Dhop_b
void Dhop_b(real_t *, real_t *, const int ieo)
AFopr_Domainwall_5din_eo::m_dpinv
std::vector< real_t > m_dpinv
Definition: afopr_Domainwall_5din_eo.h:73
AFopr_Domainwall_5din_eo::m_dp
std::vector< real_t > m_dp
Definition: afopr_Domainwall_5din_eo.h:72
AFopr_Domainwall_5din_eo::m_Nx
int m_Nx
Definition: afopr_Domainwall_5din_eo.h:55
AFopr_Domainwall_5din_eo::mult_D_eo
void mult_D_eo(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_5din_eo-tmpl.h:751
AFopr_Domainwall_5din_eo::set_config
void set_config(Field *U)
setting gauge configuration (common interface).
Definition: afopr_Domainwall_5din_eo-tmpl.h:367
AFopr_Domainwall_5din_eo::Ddag_eo
void Ddag_eo(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_5din_eo-tmpl.h:741
AFopr_Domainwall_5din_eo::real_t
AFIELD::real_t real_t
Definition: afopr_Domainwall_5din_eo.h:38
CommonParameters::Vlevel
static Bridge::VerboseLevel Vlevel()
Definition: commonParameters.h:122
AFopr_Domainwall_5din_eo::m_boundary
std::vector< int > m_boundary
boundary conditions
Definition: afopr_Domainwall_5din_eo.h:46
AFopr_Domainwall_5din_eo::m_foprw
AFopr< AFIELD > * m_foprw
Definition: afopr_Domainwall_5din_eo.h:63
AFopr_Domainwall_5din_eo::field_nin
int field_nin()
returns the on-site degree of freedom of the fermion field.
Definition: afopr_Domainwall_5din_eo.h:166
AFopr_Domainwall_5din_eo::channel_allocator_t
typename AFIELD::template aligned_allocator< char > channel_allocator_t
Definition: afopr_Domainwall_5din_eo.h:86
AFopr_Domainwall_5din_eo::m_dm
std::vector< real_t > m_dm
Definition: afopr_Domainwall_5din_eo.h:74
AFopr_Domainwall_5din_eo::m_Nvcd
int m_Nvcd
Definition: afopr_Domainwall_5din_eo.h:57
AFopr_Domainwall_5din_eo::m_y1
AFIELD m_y1
Definition: afopr_Domainwall_5din_eo.h:69
AFopr_Domainwall_5din_eo::D_ee
void D_ee(AFIELD &, const AFIELD &, const int ieo)
Definition: afopr_Domainwall_5din_eo-tmpl.h:939
AFopr_Domainwall_5din_eo::D
void D(AFIELD &, const AFIELD &)
Definition: afopr_Domainwall_5din_eo-tmpl.h:695
commonParameters.h
AFopr_Domainwall_5din_eo::Dhop_2
void Dhop_2(real_t *, real_t *, const int ieo)
Field
Container of Field-type object.
Definition: field.h:46
afopr.h
communicator.h
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
AFopr_Domainwall_5din_eo::m_g
real_t m_g
Definition: afopr_Domainwall_5din_eo.h:77
Field_G
SU(N) gauge field.
Definition: field_G.h:38
AFopr_Domainwall_5din_eo::m_Leo
std::vector< int > m_Leo
Leo = 0 (even site) or 1 (odd site).
Definition: afopr_Domainwall_5din_eo.h:61
AFopr_Domainwall_5din_eo::m_Ns
int m_Ns
size of fifth-dimension
Definition: afopr_Domainwall_5din_eo.h:45
AFopr_Domainwall_5din_eo::m_v1
AFIELD m_v1
Definition: afopr_Domainwall_5din_eo.h:69
Channel_impl
Definition: channel.h:86
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
AFopr_Domainwall_5din_eo::m_f
std::vector< real_t > m_f
Definition: afopr_Domainwall_5din_eo.h:76
AFopr_Domainwall_5din_eo::set_coefficients
void set_coefficients(const std::vector< double > b, const std::vector< double > c)
set coefficients if they depend in s.
Definition: afopr_Domainwall_5din_eo-tmpl.h:331