17 #if defined USE_GROUP_SU3
19 #elif defined USE_GROUP_SU2
21 #elif defined USE_GROUP_SU_N
37 const Field_G& U,
const int ex1,
38 const Field_F& x,
const int ex2)
41 assert(ex1 < U.
nex());
42 assert(ex2 < x.
nex());
44 assert(U.
nvol() == Nvol);
45 assert(x.
nvol() == Nvol);
47 const int Nd = x.
nd();
48 const int Nc = x.
nc();
49 const int Nc2 = x.
nc2();
50 const int Ncd2 = Nc2 * Nd;
51 const int Ndf = Nc2 * Nc;
54 set_threadtask(ith, nth, is, ns, Nvol);
56 double *v = y.
ptr(0, is, ex);
57 const double *g = U.
ptr(0, is, ex1);
58 const double *w = x.
ptr(0, is, ex2);
60 for (
int site = 0; site < ns; ++site) {
63 for (
int s = 0; s < Nd; ++s) {
64 for (
int ic = 0; ic < Nc; ++ic) {
65 int ig2 = ic * Nc2 + ig;
66 int iv2 = s * Nc2 + iv;
67 v[2 * ic + iv2] = mult_Gn_r(&g[ig2], &w[iv2], Nc);
68 v[2 * ic + 1 + iv2] = mult_Gn_i(&g[ig2], &w[iv2], Nc);
77 const Field_G& U,
const int ex1,
78 const Field_F& x,
const int ex2)
81 assert(ex1 < U.
nex());
82 assert(ex2 < x.
nex());
84 assert(U.
nvol() == Nvol);
85 assert(x.
nvol() == Nvol);
87 const int Nd = x.
nd();
88 const int Nc = x.
nc();
89 const int Nc2 = x.
nc2();
90 const int Ncd2 = Nc2 * Nd;
91 const int Ndf = Nc2 * Nc;
94 set_threadtask(ith, nth, is, ns, Nvol);
96 double *v = y.
ptr(0, is, ex);
97 const double *g = U.
ptr(0, is, ex1);
98 const double *w = x.
ptr(0, is, ex2);
100 for (
int site = 0; site < ns; ++site) {
102 int iv = Ncd2 * site;
103 for (
int s = 0; s < Nd; ++s) {
104 for (
int ic = 0; ic < Nc; ++ic) {
105 int ig2 = ic * 2 + ig;
106 int iv2 = s * Nc2 + iv;
107 v[2 * ic + iv2] = mult_Gd_r(&g[ig2], &w[iv2], Nc);
108 v[2 * ic + 1 + iv2] = mult_Gd_i(&g[ig2], &w[iv2], Nc);
117 const Field_G& U,
const int ex1,
118 const Field_F& x,
const int ex2,
121 assert(ex < y.
nex());
122 assert(ex1 < U.
nex());
123 assert(ex2 < x.
nex());
125 assert(U.
nvol() == Nvol);
126 assert(x.
nvol() == Nvol);
128 const int Nd = x.
nd();
129 const int Nc = x.
nc();
130 const int Nc2 = x.
nc2();
131 const int Ncd2 = Nc2 * Nd;
132 const int Ndf = Nc2 * Nc;
134 int ith, nth, is, ns;
135 set_threadtask(ith, nth, is, ns, Nvol);
137 double *v = y.
ptr(0, is, ex);
138 const double *g = U.
ptr(0, is, ex1);
139 const double *w = x.
ptr(0, is, ex2);
141 for (
int site = 0; site < ns; ++site) {
143 int iv = Ncd2 * site;
144 for (
int s = 0; s < Nd; ++s) {
145 for (
int ic = 0; ic < Nc; ++ic) {
146 int ig2 = ic * Nc2 + ig;
147 int iv2 = s * Nc2 + iv;
148 v[2 * ic + iv2] += a * mult_Gn_r(&g[ig2], &w[iv2], Nc);
149 v[2 * ic + 1 + iv2] += a * mult_Gn_i(&g[ig2], &w[iv2], Nc);
158 const Field_G& U,
const int ex1,
159 const Field_F& x,
const int ex2,
162 assert(ex < y.
nex());
163 assert(ex1 < U.
nex());
164 assert(ex2 < x.
nex());
166 assert(U.
nvol() == Nvol);
167 assert(x.
nvol() == Nvol);
169 const int Nd = x.
nd();
170 const int Nc = x.
nc();
171 const int Nc2 = x.
nc2();
172 const int Ncd2 = Nc2 * Nd;
173 const int Ndf = Nc2 * Nc;
175 int ith, nth, is, ns;
176 set_threadtask(ith, nth, is, ns, Nvol);
178 double *v = y.
ptr(0, is, ex);
179 const double *g = U.
ptr(0, is, ex1);
180 const double *w = x.
ptr(0, is, ex2);
182 for (
int site = 0; site < ns; ++site) {
184 int iv = Ncd2 * site;
185 for (
int s = 0; s < Nd; ++s) {
186 for (
int ic = 0; ic < Nc; ++ic) {
187 int ig2 = ic * 2 + ig;
188 int iv2 = s * Nc2 + iv;
189 v[2 * ic + iv2] += a * mult_Gd_r(&g[ig2], &w[iv2], Nc);
190 v[2 * ic + 1 + iv2] += a * mult_Gd_i(&g[ig2], &w[iv2], Nc);
200 assert(x.
nex() == y.
nex());
202 assert(x.
nvol() == Nvol);
204 const int Nd = x.
nd();
205 const int Nc = x.
nc();
206 const int Nc2 = x.
nc2();
207 const int Ncd2 = Nc2 * Nd;
215 for (
int s = 0; s < Nd; ++s) {
220 idc_i[s] = 1 - idc_r[s];
223 int ith, nth, is, ns;
224 set_threadtask(ith, nth, is, ns, Nvol);
226 const int Nex = y.
nex();
228 for (
int ex = 0; ex < Nex; ++ex) {
229 double *v = y.
ptr(0, is, ex);
230 const double *w = x.
ptr(0, is, ex);
232 for (
int site = 0; site < ns; ++site) {
233 int iv = Ncd2 * site;
235 for (
int s = 0; s < Nd; ++s) {
236 int iv2 = s * Nc2 + iv;
237 int iw2 =
id[s] * Nc2 + iv;
239 for (
int ic = 0; ic < Nc; ++ic) {
240 v[2 * ic + iv2] = gv_r[s] * w[2 * ic + idc_r[s] + iw2];
241 v[2 * ic + 1 + iv2] = gv_i[s] * w[2 * ic + idc_i[s] + iw2];
252 assert(x.
nex() == y.
nex());
254 assert(x.
nvol() == Nvol);
256 assert(x.
nd() ==
ND);
257 const int Nc = x.
nc();
258 const int Nc2 = x.
nc2();
259 const int Ncd2 = Nc2 *
ND;
267 for (
int s = 0; s <
ND; ++s) {
272 idc_i[s] = 1 - idc_r[s];
275 int ith, nth, is, ns;
276 set_threadtask(ith, nth, is, ns, Nvol);
278 const int Nex = y.
nex();
280 for (
int ex = 0; ex < Nex; ++ex) {
281 double *v = y.
ptr(0, is, ex);
282 const double *w = x.
ptr(0, is, ex);
284 for (
int site = 0; site < ns; ++site) {
285 int iv = Ncd2 * site;
287 for (
int s = 0; s <
ND; ++s) {
288 int iv2 = s * Nc2 + iv;
289 int iw2 =
id[s] * Nc2 + iv;
290 for (
int ic = 0; ic < Nc; ++ic) {
291 v[2 * ic + iv2] = gv_r[s] * w[2 * ic + idc_r[s] + iw2];
292 v[2 * ic + 1 + iv2] = gv_i[s] * w[2 * ic + idc_i[s] + iw2];
306 assert(w.
nex() == y.
nex());
313 }
else if (pm == -1) {
317 vout.
crucial(
"Error at %s: wrong pm.\n", __func__);
329 assert(w.
nex() == y.
nex());
335 }
else if (pm == -1) {
339 vout.
crucial(
"Error at %s: wrong pm.\n", __func__);
354 assert(w.
nex() == y.
nex());
361 }
else if (pm == -1) {
365 vout.
crucial(
"Error at %s: wrong pm = %d\n", __func__, pm);