Bridge++  Ver. 2.0.2
field_F_1spinor.cpp
Go to the documentation of this file.
1 
14 #include "Field/field_F_1spinor.h"
15 #include "Field/field_thread-inc.h"
17 
18 #if defined USE_GROUP_SU3
20 #elif defined USE_GROUP_SU2
22 #elif defined USE_GROUP_SU_N
24 #endif
25 
26 //====================================================================
27 void mult_Field_Gn(Field_F_1spinor& y, const int ex,
28  const Field_G& U, int ex1,
29  const Field_F_1spinor& x, int ex2)
30 {
31  int Nvol = y.nvol();
32  assert(U.nvol() == Nvol);
33  assert(x.nvol() == Nvol);
34  assert(ex < y.nex());
35  assert(ex1 < U.nex());
36  assert(ex2 < x.nex());
37 
38  const int Nd = 1;
39  const int Nc = CommonParameters::Nc();
40  const int Nc2 = 2 * CommonParameters::Nc();
41  const int Ncd2 = Nc2 * Nd;
42  const int Ndf = Nc2 * Nc;
43 
44  int ith, nth, is, ns;
45  set_threadtask(ith, nth, is, ns, Nvol);
46 
47  double *v = y.ptr(0, is, ex);
48  const double *g = U.ptr(0, is, ex1);
49  const double *w = x.ptr(0, is, ex2);
50 
51  for (int site = is; site < ns; ++site) {
52  int ig = Ndf * site;
53  int iv = Ncd2 * site;
54  for (int s = 0; s < Nd; ++s) {
55  for (int ic = 0; ic < Nc; ++ic) {
56  int ig2 = ic * Nc2 + ig;
57  int iv2 = s * Nc2 + iv;
58  v[2 * ic + iv2] = mult_Gn_r(&g[ig2], &w[iv2], Nc);
59  v[2 * ic + 1 + iv2] = mult_Gn_i(&g[ig2], &w[iv2], Nc);
60  }
61  }
62  }
63 }
64 
65 
66 //====================================================================
67 void mult_Field_Gd(Field_F_1spinor& y, const int ex,
68  const Field_G& U, int ex1,
69  const Field_F_1spinor& x, int ex2)
70 {
71  int Nvol = y.nvol();
72  assert(U.nvol() == Nvol);
73  assert(x.nvol() == Nvol);
74  assert(ex < y.nex());
75  assert(ex1 < U.nex());
76  assert(ex2 < x.nex());
77 
78  const int Nd = 1;
79  const int Nc = CommonParameters::Nc();
80  const int Nc2 = 2 * CommonParameters::Nc();
81  const int Ncd2 = Nc2 * Nd;
82  const int Ndf = Nc2 * Nc;
83 
84  int ith, nth, is, ns;
85  set_threadtask(ith, nth, is, ns, Nvol);
86 
87  double *v = y.ptr(0, is, ex);
88  const double *g = U.ptr(0, is, ex1);
89  const double *w = x.ptr(0, is, ex2);
90 
91  for (int site = is; site < ns; ++site) {
92  int ig = Ndf * site;
93  int iv = Ncd2 * site;
94  for (int s = 0; s < Nd; ++s) {
95  for (int ic = 0; ic < Nc; ++ic) {
96  int ig2 = ic * 2 + ig;
97  int iv2 = s * Nc2 + iv;
98  v[2 * ic + iv2] = mult_Gd_r(&g[ig2], &w[iv2], Nc);
99  v[2 * ic + 1 + iv2] = mult_Gd_i(&g[ig2], &w[iv2], Nc);
100  }
101  }
102  }
103 }
104 
105 
106 //============================================================END=====
Field::nex
int nex() const
Definition: field.h:128
mult_Field_Gd
void mult_Field_Gd(Field_F_1spinor &y, const int ex, const Field_G &U, int ex1, const Field_F_1spinor &x, int ex2)
y=U^\dagger*x
Definition: field_F_1spinor.cpp:67
field_F_imp_SU2-inc.h
CommonParameters::Nc
static int Nc()
Definition: commonParameters.h:115
mult_Field_Gn
void mult_Field_Gn(Field_F_1spinor &y, const int ex, const Field_G &U, int ex1, const Field_F_1spinor &x, int ex2)
y=U*x
Definition: field_F_1spinor.cpp:27
field_F_1spinor.h
threadManager.h
field_F_imp_SU_N-inc.h
Field::nvol
int nvol() const
Definition: field.h:127
field_F_imp_SU3-inc.h
Field::ptr
const double * ptr(const int jin, const int site, const int jex) const
Definition: field.h:153
Field_F_1spinor
Staggered-type fermion field.
Definition: field_F_1spinor.h:38
field_thread-inc.h
Field_G
SU(N) gauge field.
Definition: field_G.h:38