Bridge++  Ver. 2.0.2
fopr_NonRelativistic.h
Go to the documentation of this file.
1 
10 #ifndef FOPR_NONRELATIVISTIC_INCLUDED
11 #define FOPR_NONRELATIVISTIC_INCLUDED
12 
13 #include "Fopr/fopr.h"
14 #include "Field/field_G.h"
15 
17 
31 class Fopr_NonRelativistic : public Fopr
32 {
33  public:
34  static const std::string class_name;
35 
36  private:
37  double m_MQ;
38  int m_nstab;
40  double m_u0;
41 
43 
44  std::vector<double> m_coeff;
45  std::vector<int> m_boundary;
46  std::string m_evolution_type;
47  std::string m_correction_terms;
48 
49  std::string m_repr;
50 
51  std::string m_mode;
52 
53  int m_Nc, m_Nvc, m_Nd, m_Nd2;
54  int m_Nx, m_Ny, m_Nz, m_Nt;
55  int m_Nvol, m_Ndim;
56  int m_Nspc;
57  int m_Ltime;
58 
60 
62 
63  std::vector<Field_G> m_Fstr;
64 
65  std::vector<double> buf1_x, buf2_x;
66  std::vector<double> buf1_y, buf2_y;
67  std::vector<double> buf1_z, buf2_z;
68 
69  std::vector<Field> m_Xt;
73 
74  public:
75 
77 
78  /*
79  Fopr_NonRelativistic(): Fopr()
80  { init(); }
81  */
82 
85  { init(params); }
86 
89 
91  void set_parameters(const Parameters& params);
92 
94  void set_parameters(const double MQ,
95  const int nstab,
96  const double m_u0,
97  const std::vector<double> coeff,
98  const std::vector<int> bc,
99  const std::string evolution_type,
100  const std::string correction_terms);
101 
102  void get_parameters(Parameters& params) const;
103 
105  void set_config(Field *U);
106 
107  void set_config(unique_ptr<Field_G>& U) { set_config(U.get()); }
108 
110  void set_mode(const std::string mode);
111 
112  std::string get_mode() const { return m_mode; }
113 
115  void mult(Field& v, const Field& w);
116 
118  void mult_dag(Field& v, const Field& w);
119 
121  void mult(Field& v, const Field& w, const std::string mode);
122 
124  void mult_dag(Field& v, const Field& w, const std::string mode);
125 
127  void mult_gm5(Field& v, const Field& w);
128 
130  void mult_up(const int mu, Field& v, const Field& w);
131 
133  void mult_dn(const int mu, Field& v, const Field& w);
134 
136  int field_nvol() { return m_Nvol; }
137 
139  int field_nin() { return 2 * m_Nc * m_Nd; }
140 
142  int field_nex() { return 1; }
143 
145  double flop_count();
146 
148  double flop_count(const std::string mode);
149 
150  private:
151 
153  void init(const Parameters& params);
154 
156  void tidyup();
157 
159  void evolve(Field&, const Field&);
160 
162  void set_source(Field& Xt, const Field& b);
163 
165  void evolve_impl(Field&, const Field&, const int itime);
166 
168  void evolve_typeA(Field&, const Field&, const int itime);
169 
171  void evolve_typeB(Field&, const Field&, const int itime);
172 
174  void evolve_H0(Field&, const Field&, const int itime);
175 
177  void evolve_U4(Field&, const Field&, const int itime);
178 
180  void evolve_deltaH(Field&, const Field&, const int itime);
181 
183  void add_deltaH1(Field&, const Field&, const int itime);
184 
186  void add_deltaH2(Field&, const Field&, const int itime);
187 
189  void add_deltaH3(Field&, const Field&, const int itime);
190 
192  void add_deltaH5(Field&, const Field&, const int itime);
193 
195  void add_deltaH46(Field&, const Field&, const int itime);
196 
198  void calc_Delta2(Field&, const Field&, const int itime);
199 
201  void calc_Delta1(Field&, const Field&, const int idir, const int itime);
202 
204  void calc_Delta4(Field&, const Field&, const int itime);
205 
207  void rotation(Field& v, const Field& w, const int jd);
208 
209  void add_R2(Field& v, const Field& w, const int jd, const int itime);
210 
211  void add_R3(Field& v, const Field& w, const int itime);
212 
213  void add_R4(Field& v, const Field& w, const int itime);
214 
215  void add_R5(Field& v, const Field& w, const int itime);
216 
218  void mult_sigma1(Field& Xt, const Field& Yt);
219 
221  void mult_sigma2(Field& Xt, const Field& Yt);
222 
224  void mult_sigma3(Field& Xt, const Field& Yt);
225 
227  void shift_forward(Field& Xt, const Field& Yt,
228  const int idir, const int itime);
229 
231  void shift_backward(Field& Xt, const Field& Yt,
232  const int idir, const int itime);
233 
235  void shift_xup(Field& Xt, const Field& Yt, const int itime);
236  void shift_xdn(Field& Xt, const Field& Yt, const int itime);
237  void shift_yup(Field& Xt, const Field& Yt, const int itime);
238  void shift_ydn(Field& Xt, const Field& Yt, const int itime);
239  void shift_zup(Field& Xt, const Field& Yt, const int itime);
240  void shift_zdn(Field& Xt, const Field& Yt, const int itime);
241 
243  void mult_Gn(Field& Xt, const Field& Yt, const int idir, const int itime);
244 
246  void mult_Gd(Field& Xt, const Field& Yt, const int idir, const int itime);
247 
249  void mult_F(Field& Xt, const Field& Yt, const int icomp, const int itime);
250 
251 
252 #ifdef USE_FACTORY
253  private:
254  static Fopr *create_object_with_params(const Parameters& params)
255  { return new Fopr_NonRelativistic(params); }
256 
257  public:
258  static bool register_factory()
259  {
260  bool init = Fopr::Factory_params::Register("NonRelativistic",
261  create_object_with_params);
262  return init;
263  }
264 #endif
265 };
266 #endif
Fopr_NonRelativistic::mult
void mult(Field &v, const Field &w)
mult with m_mode
Definition: fopr_NonRelativistic.cpp:276
field_G.h
Fopr_NonRelativistic::m_Zt1
Field m_Zt1
Definition: fopr_NonRelativistic.h:72
AFopr< Field >
Fopr_NonRelativistic::m_Ny
int m_Ny
Definition: fopr_NonRelativistic.h:54
Fopr_NonRelativistic::init
void init(const Parameters &params)
initial setup.
Definition: fopr_NonRelativistic.cpp:69
Fopr_NonRelativistic::buf1_z
std::vector< double > buf1_z
Definition: fopr_NonRelativistic.h:67
Fopr_NonRelativistic::evolve_deltaH
void evolve_deltaH(Field &, const Field &, const int itime)
evolution with correction terms
Definition: fopr_NonRelativistic.cpp:756
Fopr_NonRelativistic::~Fopr_NonRelativistic
~Fopr_NonRelativistic()
destructor
Definition: fopr_NonRelativistic.h:88
Fopr_NonRelativistic::add_deltaH1
void add_deltaH1(Field &, const Field &, const int itime)
correction term deltaH(1): spin-magnetic interaction
Definition: fopr_NonRelativistic.cpp:791
Fopr_NonRelativistic::mult_dag
void mult_dag(Field &v, const Field &w)
not available
Definition: fopr_NonRelativistic.cpp:291
Parameters
Class for parameters.
Definition: parameters.h:46
Fopr_NonRelativistic::m_nstab
int m_nstab
stabilization parameter
Definition: fopr_NonRelativistic.h:38
Fopr_NonRelativistic::m_repr
std::string m_repr
gamma matrix repr. (set to Dirac)
Definition: fopr_NonRelativistic.h:49
Fopr_NonRelativistic::shift_zdn
void shift_zdn(Field &Xt, const Field &Yt, const int itime)
Definition: fopr_NonRelativistic.cpp:1497
Fopr_NonRelativistic::m_Nd
int m_Nd
Definition: fopr_NonRelativistic.h:53
Fopr_NonRelativistic::m_Fstr
std::vector< Field_G > m_Fstr
Field strenth (0-2: B, 3-5: E)
Definition: fopr_NonRelativistic.h:63
Fopr_NonRelativistic::m_u0
double m_u0
mean-field value
Definition: fopr_NonRelativistic.h:40
Fopr_NonRelativistic::m_boundary
std::vector< int > m_boundary
boundary conditions
Definition: fopr_NonRelativistic.h:45
Fopr_NonRelativistic::add_R2
void add_R2(Field &v, const Field &w, const int jd, const int itime)
Definition: fopr_NonRelativistic.cpp:512
Fopr_NonRelativistic::mult_sigma2
void mult_sigma2(Field &Xt, const Field &Yt)
multiplying Pauli matrix $\sigma_2$
Definition: fopr_NonRelativistic.cpp:1585
Fopr_NonRelativistic::add_R5
void add_R5(Field &v, const Field &w, const int itime)
Definition: fopr_NonRelativistic.cpp:581
Fopr_NonRelativistic::add_R3
void add_R3(Field &v, const Field &w, const int itime)
Definition: fopr_NonRelativistic.cpp:540
Fopr_NonRelativistic::m_Yt2
Field m_Yt2
Definition: fopr_NonRelativistic.h:71
Fopr_NonRelativistic::buf2_x
std::vector< double > buf2_x
communication buffer in x-dir.
Definition: fopr_NonRelativistic.h:65
Fopr_NonRelativistic::m_Ndim
int m_Ndim
Definition: fopr_NonRelativistic.h:55
Fopr_NonRelativistic::m_Nc
int m_Nc
Definition: fopr_NonRelativistic.h:53
Fopr_NonRelativistic::shift_ydn
void shift_ydn(Field &Xt, const Field &Yt, const int itime)
Definition: fopr_NonRelativistic.cpp:1371
Fopr_NonRelativistic::mult_dn
void mult_dn(const int mu, Field &v, const Field &w)
transporter in lower direction : not available
Definition: fopr_NonRelativistic.cpp:367
Fopr_NonRelativistic::mult_Gn
void mult_Gn(Field &Xt, const Field &Yt, const int idir, const int itime)
nultiplication of gauge field
Definition: fopr_NonRelativistic.cpp:1639
Fopr_NonRelativistic::m_coeff
std::vector< double > m_coeff
coefficients of correction terms
Definition: fopr_NonRelativistic.h:44
Fopr_NonRelativistic::buf1_y
std::vector< double > buf1_y
Definition: fopr_NonRelativistic.h:66
Fopr_NonRelativistic::m_Wt1
Field m_Wt1
Definition: fopr_NonRelativistic.h:70
Fopr_NonRelativistic::buf2_y
std::vector< double > buf2_y
communication buffer in y-dir.
Definition: fopr_NonRelativistic.h:66
Fopr_NonRelativistic::calc_Delta1
void calc_Delta1(Field &, const Field &, const int idir, const int itime)
first order covariant derivative
Definition: fopr_NonRelativistic.cpp:1048
Fopr_NonRelativistic::add_deltaH3
void add_deltaH3(Field &, const Field &, const int itime)
correction term deltaH(3)
Definition: fopr_NonRelativistic.cpp:858
Fopr_NonRelativistic::m_Nspc
int m_Nspc
spatial volume (m_Nx * m_Ny * m_Nz)
Definition: fopr_NonRelativistic.h:56
Fopr_NonRelativistic::get_parameters
void get_parameters(Parameters &params) const
gets parameters by a Parameter object: to be implemented in a subclass.
Definition: fopr_NonRelativistic.cpp:233
Fopr_NonRelativistic::flop_count
double flop_count()
number of floating point operations: not implemented
Definition: fopr_NonRelativistic.cpp:1757
Fopr_NonRelativistic::set_source
void set_source(Field &Xt, const Field &b)
extract source time slice and 3D source vector from 4D source.
Definition: fopr_NonRelativistic.cpp:1073
Fopr_NonRelativistic::shift_forward
void shift_forward(Field &Xt, const Field &Yt, const int idir, const int itime)
shifting 3D field forward in idir-direction
Definition: fopr_NonRelativistic.cpp:1147
Fopr_NonRelativistic::m_Zt2
Field m_Zt2
working field on each time slice.
Definition: fopr_NonRelativistic.h:72
Fopr_NonRelativistic::m_vl
Bridge::VerboseLevel m_vl
verbose level
Definition: fopr_NonRelativistic.h:42
Fopr_NonRelativistic::class_name
static const std::string class_name
Definition: fopr_NonRelativistic.h:34
Fopr_NonRelativistic::mult_gm5
void mult_gm5(Field &v, const Field &w)
multiply $\gamma_5$ : not available
Definition: fopr_NonRelativistic.cpp:334
Fopr_NonRelativistic::m_evolution_type
std::string m_evolution_type
type of evolution equation
Definition: fopr_NonRelativistic.h:46
Fopr_NonRelativistic::m_correction_terms
std::string m_correction_terms
order of correction terms
Definition: fopr_NonRelativistic.h:47
Fopr_NonRelativistic::m_Yt1
Field m_Yt1
Definition: fopr_NonRelativistic.h:71
Fopr_NonRelativistic::calc_Delta2
void calc_Delta2(Field &, const Field &, const int itime)
second order covariant derivative
Definition: fopr_NonRelativistic.cpp:977
Fopr_NonRelativistic::add_R4
void add_R4(Field &v, const Field &w, const int itime)
Definition: fopr_NonRelativistic.cpp:552
Fopr_NonRelativistic::add_deltaH5
void add_deltaH5(Field &, const Field &, const int itime)
correction term deltaH(5)
Definition: fopr_NonRelativistic.cpp:950
Fopr_NonRelativistic::m_Nz
int m_Nz
Definition: fopr_NonRelativistic.h:54
Fopr_NonRelativistic::set_config
void set_config(unique_ptr< Field_G > &U)
Definition: fopr_NonRelativistic.h:107
Fopr_NonRelativistic::rotation
void rotation(Field &v, const Field &w, const int jd)
field rotation (jd = 1: normal, -1: conjugate)
Definition: fopr_NonRelativistic.cpp:435
Fopr_NonRelativistic::shift_xdn
void shift_xdn(Field &Xt, const Field &Yt, const int itime)
Definition: fopr_NonRelativistic.cpp:1245
Fopr_NonRelativistic::evolve_H0
void evolve_H0(Field &, const Field &, const int itime)
evolution with kinetic term
Definition: fopr_NonRelativistic.cpp:693
Fopr_NonRelativistic::m_Yt3
Field m_Yt3
working field on each time slice.
Definition: fopr_NonRelativistic.h:71
Fopr_NonRelativistic::evolve_typeA
void evolve_typeA(Field &, const Field &, const int itime)
evolution equation according to [1]
Definition: fopr_NonRelativistic.cpp:628
Fopr_NonRelativistic::field_nex
int field_nex()
extra degree of freedom
Definition: fopr_NonRelativistic.h:142
Fopr_NonRelativistic::evolve_typeB
void evolve_typeB(Field &, const Field &, const int itime)
evolution equation according to [2]
Definition: fopr_NonRelativistic.cpp:659
Fopr_NonRelativistic::field_nin
int field_nin()
inner degree of freedom as a 4-spinor
Definition: fopr_NonRelativistic.h:139
Fopr_NonRelativistic::set_config
void set_config(Field *U)
setting gauge configuration and field strength
Definition: fopr_NonRelativistic.cpp:247
Fopr_NonRelativistic::m_Nx
int m_Nx
Definition: fopr_NonRelativistic.h:54
Fopr_NonRelativistic::m_itime_src
int m_itime_src
source time slice
Definition: fopr_NonRelativistic.h:59
Fopr_NonRelativistic::m_MQ
double m_MQ
heavy quark mass
Definition: fopr_NonRelativistic.h:37
Fopr_NonRelativistic::calc_Delta4
void calc_Delta4(Field &, const Field &, const int itime)
fourth order covariant derivative
Definition: fopr_NonRelativistic.cpp:1005
Fopr_NonRelativistic::get_mode
std::string get_mode() const
Definition: fopr_NonRelativistic.h:112
Fopr_NonRelativistic::m_Xt
std::vector< Field > m_Xt
heavy quark field.
Definition: fopr_NonRelativistic.h:69
Fopr_NonRelativistic::m_num_correct
int m_num_correct
number of correction terms
Definition: fopr_NonRelativistic.h:39
fopr.h
Fopr_NonRelativistic::m_U
Field_G m_U
gauge configuration
Definition: fopr_NonRelativistic.h:61
Fopr_NonRelativistic::m_Wt3
Field m_Wt3
working field on each time slice.
Definition: fopr_NonRelativistic.h:70
Fopr_NonRelativistic::shift_yup
void shift_yup(Field &Xt, const Field &Yt, const int itime)
Definition: fopr_NonRelativistic.cpp:1306
Fopr_NonRelativistic::m_Ltime
int m_Ltime
global temporal extent
Definition: fopr_NonRelativistic.h:57
Fopr_NonRelativistic::set_parameters
void set_parameters(const Parameters &params)
seting parameters with a Parameter object
Definition: fopr_NonRelativistic.cpp:149
Fopr_NonRelativistic::buf1_x
std::vector< double > buf1_x
Definition: fopr_NonRelativistic.h:65
Fopr_NonRelativistic
Definition: fopr_NonRelativistic.h:31
Fopr_NonRelativistic::mult_Gd
void mult_Gd(Field &Xt, const Field &Yt, const int idir, const int itime)
nultiplication of gauge field (hermitian conjugate)
Definition: fopr_NonRelativistic.cpp:1717
Fopr_NonRelativistic::add_deltaH2
void add_deltaH2(Field &, const Field &, const int itime)
correction term deltaH(2)
Definition: fopr_NonRelativistic.cpp:814
Fopr_NonRelativistic::Fopr_NonRelativistic
Fopr_NonRelativistic(const Parameters &params)
constructor without argument
Definition: fopr_NonRelativistic.h:84
Fopr_NonRelativistic::mult_sigma3
void mult_sigma3(Field &Xt, const Field &Yt)
multiplying Pauli matrix $\sigma_3$
Definition: fopr_NonRelativistic.cpp:1612
Fopr_NonRelativistic::mult_up
void mult_up(const int mu, Field &v, const Field &w)
transporter in upper direction : not available
Definition: fopr_NonRelativistic.cpp:358
Fopr_NonRelativistic::m_Nvol
int m_Nvol
Definition: fopr_NonRelativistic.h:55
Fopr_NonRelativistic::m_Nvc
int m_Nvc
Definition: fopr_NonRelativistic.h:53
Fopr_NonRelativistic::m_mode
std::string m_mode
mode of multiplication
Definition: fopr_NonRelativistic.h:51
Fopr_NonRelativistic::set_mode
void set_mode(const std::string mode)
setting mult mode: 'Evolve' and 'Rotation'
Definition: fopr_NonRelativistic.cpp:264
Field
Container of Field-type object.
Definition: field.h:46
Fopr_NonRelativistic::m_Wt2
Field m_Wt2
Definition: fopr_NonRelativistic.h:70
Fopr_NonRelativistic::evolve_U4
void evolve_U4(Field &, const Field &, const int itime)
evolution with one time slice ahead
Definition: fopr_NonRelativistic.cpp:717
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
Fopr_NonRelativistic::shift_backward
void shift_backward(Field &Xt, const Field &Yt, const int idir, const int itime)
shifting 3D field backward in idir-direction
Definition: fopr_NonRelativistic.cpp:1165
Fopr_NonRelativistic::buf2_z
std::vector< double > buf2_z
communication buffer in z-dir.
Definition: fopr_NonRelativistic.h:67
Fopr_NonRelativistic::m_Nd2
int m_Nd2
Definition: fopr_NonRelativistic.h:53
Fopr_NonRelativistic::shift_xup
void shift_xup(Field &Xt, const Field &Yt, const int itime)
implemetation of shifting field
Definition: fopr_NonRelativistic.cpp:1183
Fopr_NonRelativistic::shift_zup
void shift_zup(Field &Xt, const Field &Yt, const int itime)
Definition: fopr_NonRelativistic.cpp:1437
Fopr_NonRelativistic::field_nvol
int field_nvol()
volume size as a 4D operator
Definition: fopr_NonRelativistic.h:136
Fopr_NonRelativistic::evolve_impl
void evolve_impl(Field &, const Field &, const int itime)
called from evolve() and switchs evlution equation
Definition: fopr_NonRelativistic.cpp:610
Fopr_NonRelativistic::evolve
void evolve(Field &, const Field &)
evolution equation (facade).
Definition: fopr_NonRelativistic.cpp:376
Fopr_NonRelativistic::mult_sigma1
void mult_sigma1(Field &Xt, const Field &Yt)
multiplying Pauli matrix $\sigma_1$
Definition: fopr_NonRelativistic.cpp:1558
Fopr_NonRelativistic::m_Nt
int m_Nt
Definition: fopr_NonRelativistic.h:54
Fopr_NonRelativistic::mult_F
void mult_F(Field &Xt, const Field &Yt, const int icomp, const int itime)
nultiplication of field strength
Definition: fopr_NonRelativistic.cpp:1678
Fopr_NonRelativistic::add_deltaH46
void add_deltaH46(Field &, const Field &, const int itime)
correction terms deltaH(4) + deltaH(6)
Definition: fopr_NonRelativistic.cpp:962
Fopr_NonRelativistic::tidyup
void tidyup()
final clean up.
Definition: fopr_NonRelativistic.cpp:142