QDP++
qdp_generic_fused_spin_proj_evaluates.h
Go to the documentation of this file.
1#ifndef QDP_GENERIC_FUSED_SPIN_PROJ_EVALUATES_H
2#define QDP_GENERIC_FUSED_SPIN_PROJ_EVALUATES_H
4
5/* Evaluates for things like adj(u)*spinProjectDir0Plus(y) */
6using namespace QDP;
7namespace QDP {
8
10
11
14// Threading evaluates
15//
16// by Xu Guo, EPCC, 28 August, 2008
18
19// ther wrappers for the functions to be threaded
21
22
23// HalfVec = adj(u)*SpinProjectDir0Plus(Vec);
24template<>
25inline
27 const OpAssign& op,
28 const QDPExpr<
31
34
37 >,
39 >&rhs,
40 const Subset& s)
41{
42 const OLattice< SU3Mat >& u = static_cast< const OLattice< SU3Mat >& >(rhs.expression().left().child());
43 const OLattice< FVec >& a = static_cast< const OLattice< FVec >& >(rhs.expression().right().child());
44
45
53
55 // Original code
57 /*
58 for(int site = s.start(); site <= s.end(); site++) {
59 HVec tmp;
60 inlineSpinProjDir0Plus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
61 (REAL *)&(tmp.elem(0).elem(0).real()),
62 1);
63
64
65 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
66 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
67
68 }*/
69 }
70 else {
71 const int *tab = s.siteTable().slice();
72
73 int totalSize = s.numSiteTable();
74
76
78
80 // Original code
82 /*
83 for(int j=0; j < s.numSiteTable(); j++) {
84 int site = tab[j];
85
86 HVec tmp;
87 inlineSpinProjDir0Plus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
88 (REAL *)&(tmp.elem(0).elem(0).real()),
89 1);
90
91
92 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
93 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
94
95 }*/
96 }
97}
98
99// HalfVec = adj(u)*SpinProjectDir0Minus(Vec);
100template<>
101inline
103 const OpAssign& op,
104 const QDPExpr<
105 BinaryNode<
107
110
113 >,
115 >&rhs,
116 const Subset& s)
117{
118 const OLattice< SU3Mat >& u = static_cast< const OLattice< SU3Mat >& >(rhs.expression().left().child());
119 const OLattice< FVec >& a = static_cast< const OLattice< FVec >& >(rhs.expression().right().child());
120
121 if( s.hasOrderedRep() ) {
122 int totalSize = s.end() - s.start() +1;
123
125
127
129 // Original code
131 /*
132 for(int site = s.start(); site <= s.end(); site++) {
133 HVec tmp;
134 inlineSpinProjDir0Minus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
135 (REAL *)&(tmp.elem(0).elem(0).real()),
136 1);
137
138
139 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
140 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
141
142 }*/
143 }
144 else {
145
146 const int *tab = s.siteTable().slice();
147
148 int totalSize = s.numSiteTable();
149
151
153
155 // Original code
157 /*
158 for(int j=0; j < s.numSiteTable(); j++) {
159 int site = tab[j];
160
161
162 HVec tmp;
163 inlineSpinProjDir0Minus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
164 (REAL *)&(tmp.elem(0).elem(0).real()),
165 1);
166
167
168 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
169 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
170
171 }*/
172 }
173
174}
175
176// HalfVec = adj(u)*SpinProjectDir1Plus(Vec);
177template<>
178inline
180 const OpAssign& op,
181 const QDPExpr<
182 BinaryNode<
184
187
190 >,
192 >&rhs,
193 const Subset& s)
194{
195 const OLattice< SU3Mat >& u = static_cast< const OLattice< SU3Mat >& >(rhs.expression().left().child());
196 const OLattice< FVec >& a = static_cast< const OLattice< FVec >& >(rhs.expression().right().child());
197
198 if( s.hasOrderedRep() ) {
199 int totalSize = s.end() - s.start() +1;
200
202
204
206 // Original code
208 /*
209 for(int site = s.start(); site <= s.end(); site++) {
210 HVec tmp;
211 inlineSpinProjDir1Plus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
212 (REAL *)&(tmp.elem(0).elem(0).real()),
213 1);
214
215
216 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
217 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
218
219
220 }*/
221 }
222 else {
223
224 const int *tab = s.siteTable().slice();
225
226 int totalSize = s.numSiteTable();
227
229
231
233 // Original code
235 /*
236 for(int j=0; j < s.numSiteTable(); j++) {
237 int site = tab[j];
238
239
240 HVec tmp;
241 inlineSpinProjDir1Plus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
242 (REAL *)&(tmp.elem(0).elem(0).real()),
243 1);
244
245
246 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
247 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
248
249 }*/
250 }
251
252}
253
254// HalfVec = adj(u)*SpinProjectDir1Minus(Vec);
255template<>
256inline
258 const OpAssign& op,
259 const QDPExpr<
260 BinaryNode<
262
265
268 >,
270 >&rhs,
271 const Subset& s)
272{
273 const OLattice< SU3Mat >& u = static_cast< const OLattice< SU3Mat >& >(rhs.expression().left().child());
274 const OLattice< FVec >& a = static_cast< const OLattice< FVec >& >(rhs.expression().right().child());
275
276 if( s.hasOrderedRep() ) {
277 int totalSize = s.end() - s.start() +1;
278
280
282
284 // Original code
286 /*
287 for(int site = s.start(); site <= s.end(); site++) {
288 HVec tmp;
289 inlineSpinProjDir1Minus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
290 (REAL *)&(tmp.elem(0).elem(0).real()),
291 1);
292
293
294 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
295 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
296
297 }*/
298 }
299 else {
300
301 const int *tab = s.siteTable().slice();
302
303 int totalSize = s.numSiteTable();
304
306
308
310 // Original code
312 /*
313 for(int j=0; j < s.numSiteTable(); j++) {
314 int site = tab[j];
315
316 HVec tmp;
317 inlineSpinProjDir1Minus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
318 (REAL *)&(tmp.elem(0).elem(0).real()),
319 1);
320
321
322 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
323 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
324
325 }*/
326 }
327}
328
329
330// HalfVec = adj(u)*SpinProjectDir2Plus(Vec);
331template<>
332inline
334 const OpAssign& op,
335 const QDPExpr<
336 BinaryNode<
338
341
344 >,
346 >&rhs,
347 const Subset& s)
348{
349 const OLattice< SU3Mat >& u = static_cast< const OLattice< SU3Mat >& >(rhs.expression().left().child());
350 const OLattice< FVec >& a = static_cast< const OLattice< FVec >& >(rhs.expression().right().child());
351
352
353 if( s.hasOrderedRep() ) {
354 int totalSize = s.end() - s.start() +1;
355
357
359
361 // Original code
363 /*
364 for(int site = s.start(); site <= s.end(); site++) {
365 HVec tmp;
366 inlineSpinProjDir2Plus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
367 (REAL *)&(tmp.elem(0).elem(0).real()),
368 1);
369
370
371 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
372 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
373
374 }*/
375 }
376 else {
377
378 const int *tab = s.siteTable().slice();
379
380 int totalSize = s.numSiteTable();
381
383
385
387 // Original code
389 /*
390 for(int j=0; j < s.numSiteTable(); j++) {
391 int site = tab[j];
392
393 HVec tmp;
394 inlineSpinProjDir2Plus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
395 (REAL *)&(tmp.elem(0).elem(0).real()),
396 1);
397
398
399 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
400 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
401
402 }*/
403 }
404
405}
406
407// HalfVec = adj(u)*SpinProjectDir2Minus(Vec);
408template<>
409inline
411 const OpAssign& op,
412 const QDPExpr<
413 BinaryNode<
415
418
421 >,
423 >&rhs,
424 const Subset& s)
425{
426 const OLattice< SU3Mat >& u = static_cast< const OLattice< SU3Mat >& >(rhs.expression().left().child());
427 const OLattice< FVec >& a = static_cast< const OLattice< FVec >& >(rhs.expression().right().child());
428
429 if( s.hasOrderedRep() ) {
430 int totalSize = s.end() - s.start() +1;
431
433
435
437 // Original code
439 /*
440 for(int site = s.start(); site <= s.end(); site++) {
441
442 HVec tmp;
443 inlineSpinProjDir2Minus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
444 (REAL *)&(tmp.elem(0).elem(0).real()),
445 1);
446
447
448 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
449 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
450
451 }*/
452 }
453 else {
454
455 const int *tab = s.siteTable().slice();
456
457 int totalSize = s.numSiteTable();
458
460
462
464 // Original code
466 /*
467 for(int j=0; j < s.numSiteTable(); j++) {
468 int site = tab[j];
469
470
471 HVec tmp;
472 inlineSpinProjDir2Minus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
473 (REAL *)&(tmp.elem(0).elem(0).real()),
474 1);
475
476
477 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
478 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
479
480 }*/
481 }
482
483}
484// HalfVec = adj(u)*SpinProjectDir3Plus(Vec);
485template<>
486inline
488 const OpAssign& op,
489 const QDPExpr<
490 BinaryNode<
492
495
498 >,
500 >&rhs,
501 const Subset& s)
502{
503 const OLattice< SU3Mat >& u = static_cast< const OLattice< SU3Mat >& >(rhs.expression().left().child());
504 const OLattice< FVec >& a = static_cast< const OLattice< FVec >& >(rhs.expression().right().child());
505
506
507
508 if( s.hasOrderedRep() ) {
509 int totalSize = s.end() - s.start() +1;
510
512
514
516 // Original code
518 /*
519 for(int site = s.start(); site <= s.end(); site++) {
520 HVec tmp;
521 inlineSpinProjDir3Plus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
522 (REAL *)&(tmp.elem(0).elem(0).real()),
523 1);
524
525
526 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
527 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
528
529 }*/
530 }
531 else {
532
533 const int *tab = s.siteTable().slice();
534
535 int totalSize = s.numSiteTable();
536
538
540
542 // Original code
544 /*
545 for(int j=0; j < s.numSiteTable(); j++) {
546 int site = tab[j];
547
548 HVec tmp;
549 inlineSpinProjDir3Plus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
550 (REAL *)&(tmp.elem(0).elem(0).real()),
551 1);
552
553
554 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
555 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
556
557 }*/
558 }
559}
560
561// HalfVec = adj(u)*SpinProjectDir3Minus(Vec);
562template<>
563inline
565 const OpAssign& op,
566 const QDPExpr<
567 BinaryNode<
569
572
575 >,
577 >&rhs,
578 const Subset& s)
579{
580 const OLattice< SU3Mat >& u = static_cast< const OLattice< SU3Mat >& >(rhs.expression().left().child());
581 const OLattice< FVec >& a = static_cast< const OLattice< FVec >& >(rhs.expression().right().child());
582
583 if( s.hasOrderedRep() ) {
584
585 int totalSize = s.end() - s.start() +1;
586
588
590
592 // Original code
594 /*
595
596 for(int site = s.start(); site <= s.end(); site++) {
597
598 HVec tmp;
599 inlineSpinProjDir3Minus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
600 (REAL *)&(tmp.elem(0).elem(0).real()),
601 1);
602
603
604 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
605 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
606
607 }*/
608 }
609 else {
610
611 const int *tab = s.siteTable().slice();
612
613 int totalSize = s.numSiteTable();
614
616
618
620 // Original code
622 /*
623 for(int j=0; j < s.numSiteTable(); j++) {
624 int site = tab[j];
625
626 HVec tmp;
627 inlineSpinProjDir3Minus( (REAL *)&(a.elem(site).elem(0).elem(0).real()),
628 (REAL *)&(tmp.elem(0).elem(0).real()),
629 1);
630
631
632 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(0), d.elem(site).elem(0));
633 _inline_mult_adj_su3_mat_vec(u.elem(site).elem(), tmp.elem(1), d.elem(site).elem(1));
634
635 }*/
636 }
637}
638
639} // namespace QDP;
640
641#endif
Outer grid Lattice type.
Definition qdp_outer.h:264
Primitive Scalar.
Expression class for QDP.
Definition qdp_qdpexpr.h:16
QDPType - major type class/container for all QDP objects.
Definition qdp_qdptype.h:29
Subsets - controls how lattices are looped.
Definition qdp_subset.h:39
int end() const
Definition qdp_subset.h:81
const multi1d< int > & siteTable() const
Definition qdp_subset.h:83
int numSiteTable() const
Definition qdp_subset.h:84
bool hasOrderedRep() const
Definition qdp_subset.h:79
int start() const
Definition qdp_subset.h:80
const T * slice() const
Return ref to a column slice.
Definition qdp_multi.h:225
void evaluate(OLattice< DCol > &d, const OpAssign &op, const QDPExpr< BinaryNode< OpMultiply, Reference< QDPType< DCol, OLattice< DCol > > >, Reference< QDPType< DCol, OLattice< DCol > > > >, OLattice< DCol > > &rhs, const Subset &s)
Yet another random number generator.
PScalar< PColorMatrix< RComplex< REAL >, 3 > > SU3Mat
void dispatch_to_threads(int numSiteTable, Arg a, void(*func)(int, int, int, Arg *))
void ordered_fused_spin_proj_evaluate_function(int lo, int hi, int myId, ordered_fused_spin_proj_user_arg *arg)
void unordered_fused_spin_proj_evaluate_function(int lo, int hi, int myId, unordered_fused_spin_proj_user_arg *arg)
void inlineSpinProjDir0Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_0).
void inlineSpinProjDir0Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_0).
void inlineSpinProjDir1Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_1).
void inlineSpinProjDir1Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_1).
void inlineSpinProjDir3Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_3).
void inlineSpinProjDir3Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_3).
void inlineSpinProjDir2Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_2).
void inlineSpinProjDir2Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_2).
PSpinVector< PColorVector< RComplex< REAL >, 3 >, 4 > FVec