QDP++
generic_spin_recon_inlines.h
Go to the documentation of this file.
1#ifndef GENERIC_SPIN_RECON_INLINES_H
2#define GENERIC_SPIN_RECON_INLINES_H
3
4/* File: generic_spin_recon_inlines.h
5 Purpose: Supply inline functions to do spin reconstruction
6 Author: $Id: generic_spin_recon_inlines.h,v 1.3 2007-07-17 16:56:09 bjoo Exp $
7*/
8namespace QDP {
9
22inline
23void inlineSpinReconDir0Plus(const REAL* src, REAL *dst, unsigned int n_vec)
24{
25
26#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
27 QDPIO::cout << "inlineSpinProjDir0Plus" << endl;
28#endif
29
30 /* 1 + \gamma_0 = 1 0 0 i
31 0 1 i 0
32 0 -i 1 0
33 -i 0 0 1
34
35 * ( b2r + i b2i ) = ( {a2r + a1i} + i{a2i - a1r} ) = ( b1i - i b1r )
36 * ( b3r + i b3i ) ( {a3r + a0i} + i{a3i - a0r} ) ( b0i - i b0r )
37 */
38
39 REAL tmp_hspinor[4][3][2];
40
41 const REAL* src_shadow = src;
42 REAL* dst_shadow = dst;
43
44 const int re = 0;
45 const int im = 1;
46 const int Ncmpx = 2;
47 const int Nsby2 = 2;
48
49 for(unsigned int site=0; site < n_vec; site++) {
50 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
51
52 // Stream in the half spinor - write out the first two components
53 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
54 REAL tmp = *(src_shadow++);
55 *(tmp_shadow++) = tmp;
56 *(dst_shadow++) = tmp;
57 }
58
59 // Reconstruct Spin 2
60 for(int col=0; col < Nc; col++) {
61 *(dst_shadow++) = tmp_hspinor[1][col][im];
62 *(dst_shadow++) = -tmp_hspinor[1][col][re];
63 }
64
65 // Reconstruct Spin 3;
66 for(int col=0; col < Nc; col++) {
67 *(dst_shadow++) = tmp_hspinor[0][col][im];
68 *(dst_shadow++) = -tmp_hspinor[0][col][re];
69 }
70
71
72 }
73}
74
87inline
88void inlineSpinReconDir0Minus(const REAL* src, REAL *dst, unsigned int n_vec)
89{
90
91#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
92 QDPIO::cout << "inlineSpinReconDir0Minus" << endl;
93#endif
94
95 /* ( 1 0 0 -i) ( a0 ) ( a0 - i a3 )
96 * B := ( 1 - Gamma ) A = ( 0 1 -i 0) ( a1 ) = ( a1 - i a2 )
97 * 0 ( 0 i 1 0) ( a2 ) ( a2 + i a1 )
98 * ( i 0 0 1) ( a3 ) ( a3 + i a0 )
99
100 * The bottom components of be may be reconstructed using the formula
101 * ( b2r + i b2i ) = ( {a2r - a1i} + i{a2i + a1r} ) = ( - b1i + i b1r )
102 * ( b3r + i b3i ) ( {a3r - a0i} + i{a3i + a0r} ) ( - b0i + i b0r )
103 */
104
105 REAL tmp_hspinor[4][3][2];
106
107 const REAL* src_shadow = src;
108 REAL* dst_shadow = dst;
109
110 const int re = 0;
111 const int im = 1;
112 const int Ncmpx = 2;
113 const int Nsby2 = 2;
114
115 for(unsigned int site=0; site < n_vec; site++) {
116 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
117
118 // Stream in the half spinor - write out the first two components
119 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
120 REAL tmp = *(src_shadow++);
121 *(tmp_shadow++) = tmp;
122 *(dst_shadow++) = tmp;
123 }
124
125 // Reconstruct Spin 2
126 for(int col=0; col < Nc; col++) {
127 *(dst_shadow++) = -tmp_hspinor[1][col][im];
128 *(dst_shadow++) = tmp_hspinor[1][col][re];
129 }
130
131 // Reconstruct Spin 3;
132 for(int col=0; col < Nc; col++) {
133 *(dst_shadow++) = -tmp_hspinor[0][col][im];
134 *(dst_shadow++) = tmp_hspinor[0][col][re];
135 }
136
137
138 }
139}
140
153inline
154void inlineSpinReconDir1Plus(const REAL* src, REAL *dst, unsigned int n_vec)
155{
156
157#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
158 QDPIO::cout << "inlineSpinReconDir0Plus" << endl;
159#endif
160
161
162
163 REAL tmp_hspinor[4][3][2];
164
165 const REAL* src_shadow = src;
166 REAL* dst_shadow = dst;
167
168 const int re = 0;
169 const int im = 1;
170 const int Ncmpx = 2;
171 const int Nsby2 = 2;
172
173 for(unsigned int site=0; site < n_vec; site++) {
174 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
175
176 // Stream in the half spinor - write out the first two components
177 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
178 REAL tmp = *(src_shadow++);
179 *(tmp_shadow++) = tmp;
180 *(dst_shadow++) = tmp;
181 }
182
183 /* 1 + \gamma_1 = 1 0 0 -1
184 * 0 1 1 0
185 * 0 1 1 0
186 * -1 0 0 1
187
188 * ( b2r + i b2i ) = ( {a2r + a1r} + i{a2i + a1i} ) = ( b1r + i b1i )
189 * ( b3r + i b3i ) ( {a3r - a0r} + i{a3i - a0i} ) ( - b0r - i b0i )
190
191 */
192 // Reconstruct Spin 2
193 for(int col=0; col < Nc; col++) {
194 *(dst_shadow++) = tmp_hspinor[1][col][re];
195 *(dst_shadow++) = tmp_hspinor[1][col][im];
196 }
197
198 // Reconstruct Spin 3;
199 for(int col=0; col < Nc; col++) {
200 *(dst_shadow++) = -tmp_hspinor[0][col][re];
201 *(dst_shadow++) = -tmp_hspinor[0][col][im];
202 }
203
204
205 }
206}
207
220inline
221void inlineSpinReconDir1Minus(const REAL* src, REAL *dst, unsigned int n_vec)
222{
223
224#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
225 QDPIO::cout << "inlineSpinReconDir0Minus" << endl;
226#endif
227
228
229 REAL tmp_hspinor[4][3][2];
230
231 const REAL* src_shadow = src;
232 REAL* dst_shadow = dst;
233
234 const int re = 0;
235 const int im = 1;
236 const int Ncmpx = 2;
237 const int Nsby2 = 2;
238
239 for(unsigned int site=0; site < n_vec; site++) {
240 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
241
242 // Stream in the half spinor - write out the first two components
243 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
244 REAL tmp = *(src_shadow++);
245 *(tmp_shadow++) = tmp;
246 *(dst_shadow++) = tmp;
247 }
248
249
250 /* ( 1 0 0 1) ( a0 ) ( a0 + a3 )
251 * B := ( 1 - Gamma ) A = ( 0 1 -1 0) ( a1 ) = ( a1 - a2 )
252 * 1 ( 0 -1 1 0) ( a2 ) ( a2 - a1 )
253 * ( 1 0 0 1) ( a3 ) ( a3 + a0 )
254
255 * The bottom components of be may be reconstructed using the formula
256
257 * ( b2r + i b2i ) = ( {a2r - a1r} + i{a2i - a1i} ) = ( - b1r - i b1i )
258 * ( b3r + i b3i ) ( {a3r + a0r} + i{a3i + a0i} ) ( b0r + i b0i )
259 */
260
261
262 // Reconstruct Spin 2
263 for(int col=0; col < Nc; col++) {
264 *(dst_shadow++) = -tmp_hspinor[1][col][re];
265 *(dst_shadow++) = -tmp_hspinor[1][col][im];
266 }
267
268 // Reconstruct Spin 3;
269 for(int col=0; col < Nc; col++) {
270 *(dst_shadow++) = tmp_hspinor[0][col][re];
271 *(dst_shadow++) = tmp_hspinor[0][col][im];
272 }
273
274
275 }
276}
277
278
291inline
292void inlineSpinReconDir2Plus(const REAL* src, REAL *dst, unsigned int n_vec)
293{
294
295#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
296 QDPIO::cout << "inlineSpinReconDir0Plus" << endl;
297#endif
298
299
300
301 REAL tmp_hspinor[4][3][2];
302
303 const REAL* src_shadow = src;
304 REAL* dst_shadow = dst;
305
306 const int re = 0;
307 const int im = 1;
308 const int Ncmpx = 2;
309 const int Nsby2 = 2;
310
311 for(unsigned int site=0; site < n_vec; site++) {
312 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
313
314 // Stream in the half spinor - write out the first two components
315 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
316 REAL tmp = *(src_shadow++);
317 *(tmp_shadow++) = tmp;
318 *(dst_shadow++) = tmp;
319 }
320
321 /* 1 + \gamma_2 = 1 0 i 0
322 * 0 1 0 -i
323 * -i 0 1 0
324 * 0 i 0 1
325 *
326 * ( b2r + i b2i ) = ( {a2r + a0i} + i{a2i - a0r} ) = ( b0i - i b0r )
327 * ( b3r + i b3i ) ( {a3r - a1i} + i{a3i + a1r} ) ( - b1i + i b1r )
328 */
329
330 // Reconstruct Spin 2
331 for(int col=0; col < Nc; col++) {
332 *(dst_shadow++) = tmp_hspinor[0][col][im];
333 *(dst_shadow++) = -tmp_hspinor[0][col][re];
334 }
335
336 // Reconstruct Spin 3;
337 for(int col=0; col < Nc; col++) {
338 *(dst_shadow++) = -tmp_hspinor[1][col][im];
339 *(dst_shadow++) = tmp_hspinor[1][col][re];
340 }
341
342
343 }
344}
345
358inline
359void inlineSpinReconDir2Minus(const REAL* src, REAL *dst, unsigned int n_vec)
360{
361
362#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
363 QDPIO::cout << "inlineSpinReconDir0Minus" << endl;
364#endif
365
366
367 REAL tmp_hspinor[4][3][2];
368
369 const REAL* src_shadow = src;
370 REAL* dst_shadow = dst;
371
372 const int re = 0;
373 const int im = 1;
374 const int Ncmpx = 2;
375 const int Nsby2 = 2;
376
377 for(unsigned int site=0; site < n_vec; site++) {
378 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
379
380 // Stream in the half spinor - write out the first two components
381 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
382 REAL tmp = *(src_shadow++);
383 *(tmp_shadow++) = tmp;
384 *(dst_shadow++) = tmp;
385 }
386
387 /* ( 1 0 -i 0) ( a0 ) ( a0 - i a2 )
388 * B := ( 1 - Gamma ) A = ( 0 1 0 i) ( a1 ) = ( a1 + i a3 )
389 * 2 ( i 0 1 0) ( a2 ) ( a2 + i a0 )
390 * ( 0 -i 0 1) ( a3 ) ( a3 - i a1 )
391
392 * The bottom components of be may be reconstructed using the formula
393 * ( b2r + i b2i ) = ( {a2r - a0i} + i{a2i + a0r} ) = ( - b0i + i b0r )
394 * ( b3r + i b3i ) ( {a3r + a1i} + i{a3i - a1r} ) ( b1i - i b1r )
395 */
396
397 // Reconstruct Spin 2
398 for(int col=0; col < Nc; col++) {
399 *(dst_shadow++) = -tmp_hspinor[0][col][im];
400 *(dst_shadow++) = tmp_hspinor[0][col][re];
401 }
402
403 // Reconstruct Spin 3;
404 for(int col=0; col < Nc; col++) {
405 *(dst_shadow++) = tmp_hspinor[1][col][im];
406 *(dst_shadow++) = -tmp_hspinor[1][col][re];
407 }
408
409
410 }
411}
412
413
426inline
427void inlineSpinReconDir3Plus(const REAL* src, REAL *dst, unsigned int n_vec)
428{
429
430#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
431 QDPIO::cout << "inlineSpinReconDir0Plus" << endl;
432#endif
433
434
435
436 REAL tmp_hspinor[4][3][2];
437
438 const REAL* src_shadow = src;
439 REAL* dst_shadow = dst;
440
441 const int re = 0;
442 const int im = 1;
443 const int Ncmpx = 2;
444 const int Nsby2 = 2;
445
446 for(unsigned int site=0; site < n_vec; site++) {
447 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
448
449 // Stream in the half spinor - write out the first two components
450 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
451 REAL tmp = *(src_shadow++);
452 *(tmp_shadow++) = tmp;
453 *(dst_shadow++) = tmp;
454 }
455
456 /* ( 1 0 1 0) ( a0 ) ( a0 + a2 )
457 * B := ( 1 + Gamma ) A = ( 0 1 0 1) ( a1 ) = ( a1 + a3 )
458 * 3 ( 1 0 1 0) ( a2 ) ( a2 + a0 )
459 * ( 0 1 0 1) ( a3 ) ( a3 + a1 )
460
461 * The bottom components of be may be reconstructed using the formula
462
463 * ( b2r + i b2i ) = ( {a2r + a0r} + i{a2i + a0i} ) = ( b0r + i b0i )
464 * ( b3r + i b3i ) ( {a3r + a1r} + i{a3i + a1i} ) ( b1r + i b1i )
465 */
466 // Reconstruct Spin 2
467 for(int col=0; col < Nc; col++) {
468 *(dst_shadow++) = tmp_hspinor[0][col][re];
469 *(dst_shadow++) = tmp_hspinor[0][col][im];
470 }
471
472 // Reconstruct Spin 3;
473 for(int col=0; col < Nc; col++) {
474 *(dst_shadow++) = tmp_hspinor[1][col][re];
475 *(dst_shadow++) = tmp_hspinor[1][col][im];
476 }
477
478
479 }
480}
481
494inline
495void inlineSpinReconDir3Minus(const REAL* src, REAL *dst, unsigned int n_vec)
496{
497
498#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
499 QDPIO::cout << "inlineSpinReconDir0Minus" << endl;
500#endif
501
502
503 REAL tmp_hspinor[4][3][2];
504
505 const REAL* src_shadow = src;
506 REAL* dst_shadow = dst;
507
508 const int re = 0;
509 const int im = 1;
510 const int Ncmpx = 2;
511 const int Nsby2 = 2;
512
513 for(unsigned int site=0; site < n_vec; site++) {
514 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
515
516 // Stream in the half spinor - write out the first two components
517 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
518 REAL tmp = *(src_shadow++);
519 *(tmp_shadow++) = tmp;
520 *(dst_shadow++) = tmp;
521 }
522
523 /* ( 1 0 -1 0) ( a0 ) ( a0 - a2 )
524 * B := ( 1 - Gamma ) A = ( 0 1 0 -1) ( a1 ) = ( a1 - a3 )
525 * 3 (-1 0 1 0) ( a2 ) ( a2 - a0 )
526 * ( 0 -1 0 1) ( a3 ) ( a3 - a1 )
527
528 * The bottom components of be may be reconstructed using the formula
529 * ( b2r + i b2i ) = ( {a2r - a0r} + i{a2i - a0i} ) = ( - b0r - i b0i )
530 * ( b3r + i b3i ) ( {a3r - a1r} + i{a3i - a1i} ) ( - b1r - i b1i )
531 */
532 // Reconstruct Spin 2
533 for(int col=0; col < Nc; col++) {
534 *(dst_shadow++) = -tmp_hspinor[0][col][re];
535 *(dst_shadow++) = -tmp_hspinor[0][col][im];
536 }
537
538 // Reconstruct Spin 3;
539 for(int col=0; col < Nc; col++) {
540 *(dst_shadow++) = -tmp_hspinor[1][col][re];
541 *(dst_shadow++) = -tmp_hspinor[1][col][im];
542 }
543
544
545 }
546}
547
548
549
562inline
563void inlineAddSpinReconDir0Plus(const REAL* src, REAL *dst, unsigned int n_vec)
564{
565
566#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
567 QDPIO::cout << "inlinaAddSpinReconDir0Plus" << endl;
568#endif
569
570 /* 1 + \gamma_0 = 1 0 0 i
571 0 1 i 0
572 0 -i 1 0
573 -i 0 0 1
574
575 * ( b2r + i b2i ) = ( {a2r + a1i} + i{a2i - a1r} ) = ( b1i - i b1r )
576 * ( b3r + i b3i ) ( {a3r + a0i} + i{a3i - a0r} ) ( b0i - i b0r )
577 */
578
579 REAL tmp_hspinor[4][3][2];
580
581 const REAL* src_shadow = src;
582 REAL* dst_shadow = dst;
583
584 const int re = 0;
585 const int im = 1;
586 const int Ncmpx = 2;
587 const int Nsby2 = 2;
588
589 for(unsigned int site=0; site < n_vec; site++) {
590 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
591
592 // Stream in the half spinor - write out the first two components
593 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
594 REAL tmp = *(src_shadow++);
595 *(tmp_shadow++) = tmp;
596 *(dst_shadow++) += tmp;
597 }
598
599 // Reconstruct Spin 2
600 for(int col=0; col < Nc; col++) {
601 *(dst_shadow++) += tmp_hspinor[1][col][im];
602 *(dst_shadow++) -= tmp_hspinor[1][col][re];
603 }
604
605 // Reconstruct Spin 3;
606 for(int col=0; col < Nc; col++) {
607 *(dst_shadow++) += tmp_hspinor[0][col][im];
608 *(dst_shadow++) -= tmp_hspinor[0][col][re];
609 }
610
611
612 }
613}
614
627inline
628void inlineAddSpinReconDir0Minus(const REAL* src, REAL *dst, unsigned int n_vec)
629{
630
631#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
632 QDPIO::cout << "inlinaAddSpinReconDir0Minus" << endl;
633#endif
634
635 /* ( 1 0 0 -i) ( a0 ) ( a0 - i a3 )
636 * B := ( 1 - Gamma ) A = ( 0 1 -i 0) ( a1 ) = ( a1 - i a2 )
637 * 0 ( 0 i 1 0) ( a2 ) ( a2 + i a1 )
638 * ( i 0 0 1) ( a3 ) ( a3 + i a0 )
639
640 * The bottom components of be may be reconstructed using the formula
641 * ( b2r + i b2i ) = ( {a2r - a1i} + i{a2i + a1r} ) = ( - b1i + i b1r )
642 * ( b3r + i b3i ) ( {a3r - a0i} + i{a3i + a0r} ) ( - b0i + i b0r )
643 */
644
645 REAL tmp_hspinor[4][3][2];
646
647 const REAL* src_shadow = src;
648 REAL* dst_shadow = dst;
649
650 const int re = 0;
651 const int im = 1;
652 const int Ncmpx = 2;
653 const int Nsby2 = 2;
654
655 for(unsigned int site=0; site < n_vec; site++) {
656 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
657
658 // Stream in the half spinor - write out the first two components
659 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
660 REAL tmp = *(src_shadow++);
661 *(tmp_shadow++) = tmp;
662 *(dst_shadow++) += tmp;
663 }
664
665 // Reconstruct Spin 2
666 for(int col=0; col < Nc; col++) {
667 *(dst_shadow++) -= tmp_hspinor[1][col][im];
668 *(dst_shadow++) += tmp_hspinor[1][col][re];
669 }
670
671 // Reconstruct Spin 3;
672 for(int col=0; col < Nc; col++) {
673 *(dst_shadow++) -= tmp_hspinor[0][col][im];
674 *(dst_shadow++) += tmp_hspinor[0][col][re];
675 }
676
677
678 }
679}
680
693inline
694void inlineAddSpinReconDir1Plus(const REAL* src, REAL *dst, unsigned int n_vec)
695{
696
697#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
698 QDPIO::cout << "inlinaAddSpinReconDir0Plus" << endl;
699#endif
700
701
702
703 REAL tmp_hspinor[4][3][2];
704
705 const REAL* src_shadow = src;
706 REAL* dst_shadow = dst;
707
708 const int re = 0;
709 const int im = 1;
710 const int Ncmpx = 2;
711 const int Nsby2 = 2;
712
713 for(unsigned int site=0; site < n_vec; site++) {
714 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
715
716 // Stream in the half spinor - write out the first two components
717 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
718 REAL tmp = *(src_shadow++);
719 *(tmp_shadow++) = tmp;
720 *(dst_shadow++) += tmp;
721 }
722
723 /* 1 + \gamma_1 = 1 0 0 -1
724 * 0 1 1 0
725 * 0 1 1 0
726 * -1 0 0 1
727
728 * ( b2r + i b2i ) = ( {a2r + a1r} + i{a2i + a1i} ) = ( b1r + i b1i )
729 * ( b3r + i b3i ) ( {a3r - a0r} + i{a3i - a0i} ) ( - b0r - i b0i )
730
731 */
732 // Reconstruct Spin 2
733 for(int col=0; col < Nc; col++) {
734 *(dst_shadow++) += tmp_hspinor[1][col][re];
735 *(dst_shadow++) += tmp_hspinor[1][col][im];
736 }
737
738 // Reconstruct Spin 3;
739 for(int col=0; col < Nc; col++) {
740 *(dst_shadow++) -= tmp_hspinor[0][col][re];
741 *(dst_shadow++) -= tmp_hspinor[0][col][im];
742 }
743
744
745 }
746}
747
760inline
761void inlineAddSpinReconDir1Minus(const REAL* src, REAL *dst, unsigned int n_vec)
762{
763
764#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
765 QDPIO::cout << "inlinaAddSpinReconDir0Minus" << endl;
766#endif
767
768
769 REAL tmp_hspinor[4][3][2];
770
771 const REAL* src_shadow = src;
772 REAL* dst_shadow = dst;
773
774 const int re = 0;
775 const int im = 1;
776 const int Ncmpx = 2;
777 const int Nsby2 = 2;
778
779 for(unsigned int site=0; site < n_vec; site++) {
780 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
781
782 // Stream in the half spinor - write out the first two components
783 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
784 REAL tmp = *(src_shadow++);
785 *(tmp_shadow++) = tmp;
786 *(dst_shadow++) += tmp;
787 }
788
789
790 /* ( 1 0 0 1) ( a0 ) ( a0 + a3 )
791 * B := ( 1 - Gamma ) A = ( 0 1 -1 0) ( a1 ) = ( a1 - a2 )
792 * 1 ( 0 -1 1 0) ( a2 ) ( a2 - a1 )
793 * ( 1 0 0 1) ( a3 ) ( a3 + a0 )
794
795 * The bottom components of be may be reconstructed using the formula
796
797 * ( b2r + i b2i ) = ( {a2r - a1r} + i{a2i - a1i} ) = ( - b1r - i b1i )
798 * ( b3r + i b3i ) ( {a3r + a0r} + i{a3i + a0i} ) ( b0r + i b0i )
799 */
800
801
802 // Reconstruct Spin 2
803 for(int col=0; col < Nc; col++) {
804 *(dst_shadow++) -= tmp_hspinor[1][col][re];
805 *(dst_shadow++) -= tmp_hspinor[1][col][im];
806 }
807
808 // Reconstruct Spin 3;
809 for(int col=0; col < Nc; col++) {
810 *(dst_shadow++) += tmp_hspinor[0][col][re];
811 *(dst_shadow++) += tmp_hspinor[0][col][im];
812 }
813
814
815 }
816}
817
818
831inline
832void inlineAddSpinReconDir2Plus(const REAL* src, REAL *dst, unsigned int n_vec)
833{
834
835#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
836 QDPIO::cout << "inlinaAddSpinReconDir0Plus" << endl;
837#endif
838
839
840
841 REAL tmp_hspinor[4][3][2];
842
843 const REAL* src_shadow = src;
844 REAL* dst_shadow = dst;
845
846 const int re = 0;
847 const int im = 1;
848 const int Ncmpx = 2;
849 const int Nsby2 = 2;
850
851 for(unsigned int site=0; site < n_vec; site++) {
852 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
853
854 // Stream in the half spinor - write out the first two components
855 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
856 REAL tmp = *(src_shadow++);
857 *(tmp_shadow++) = tmp;
858 *(dst_shadow++) += tmp;
859 }
860
861 /* 1 + \gamma_2 = 1 0 i 0
862 * 0 1 0 -i
863 * -i 0 1 0
864 * 0 i 0 1
865 *
866 * ( b2r + i b2i ) = ( {a2r + a0i} + i{a2i - a0r} ) = ( b0i - i b0r )
867 * ( b3r + i b3i ) ( {a3r - a1i} + i{a3i + a1r} ) ( - b1i + i b1r )
868 */
869
870 // Reconstruct Spin 2
871 for(int col=0; col < Nc; col++) {
872 *(dst_shadow++) += tmp_hspinor[0][col][im];
873 *(dst_shadow++) -= tmp_hspinor[0][col][re];
874 }
875
876 // Reconstruct Spin 3;
877 for(int col=0; col < Nc; col++) {
878 *(dst_shadow++) -= tmp_hspinor[1][col][im];
879 *(dst_shadow++) += tmp_hspinor[1][col][re];
880 }
881
882
883 }
884}
885
898inline
899void inlineAddSpinReconDir2Minus(const REAL* src, REAL *dst, unsigned int n_vec)
900{
901
902#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
903 QDPIO::cout << "inlinaAddSpinReconDir0Minus" << endl;
904#endif
905
906
907 REAL tmp_hspinor[4][3][2];
908
909 const REAL* src_shadow = src;
910 REAL* dst_shadow = dst;
911
912 const int re = 0;
913 const int im = 1;
914 const int Ncmpx = 2;
915 const int Nsby2 = 2;
916
917 for(unsigned int site=0; site < n_vec; site++) {
918 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
919
920 // Stream in the half spinor - write out the first two components
921 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
922 REAL tmp = *(src_shadow++);
923 *(tmp_shadow++) = tmp;
924 *(dst_shadow++) += tmp;
925 }
926
927 /* ( 1 0 -i 0) ( a0 ) ( a0 - i a2 )
928 * B := ( 1 - Gamma ) A = ( 0 1 0 i) ( a1 ) = ( a1 + i a3 )
929 * 2 ( i 0 1 0) ( a2 ) ( a2 + i a0 )
930 * ( 0 -i 0 1) ( a3 ) ( a3 - i a1 )
931
932 * The bottom components of be may be reconstructed using the formula
933 * ( b2r + i b2i ) = ( {a2r - a0i} + i{a2i + a0r} ) = ( - b0i + i b0r )
934 * ( b3r + i b3i ) ( {a3r + a1i} + i{a3i - a1r} ) ( b1i - i b1r )
935 */
936
937 // Reconstruct Spin 2
938 for(int col=0; col < Nc; col++) {
939 *(dst_shadow++) -= tmp_hspinor[0][col][im];
940 *(dst_shadow++) += tmp_hspinor[0][col][re];
941 }
942
943 // Reconstruct Spin 3;
944 for(int col=0; col < Nc; col++) {
945 *(dst_shadow++) += tmp_hspinor[1][col][im];
946 *(dst_shadow++) -= tmp_hspinor[1][col][re];
947 }
948
949
950 }
951}
952
953
966inline
967void inlineAddSpinReconDir3Plus(const REAL* src, REAL *dst, unsigned int n_vec)
968{
969
970#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
971 QDPIO::cout << "inlinaAddSpinReconDir0Plus" << endl;
972#endif
973
974
975
976 REAL tmp_hspinor[4][3][2];
977
978 const REAL* src_shadow = src;
979 REAL* dst_shadow = dst;
980
981 const int re = 0;
982 const int im = 1;
983 const int Ncmpx = 2;
984 const int Nsby2 = 2;
985
986 for(unsigned int site=0; site < n_vec; site++) {
987 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
988
989 // Stream in the half spinor - write out the first two components
990 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
991 REAL tmp = *(src_shadow++);
992 *(tmp_shadow++) = tmp;
993 *(dst_shadow++) += tmp;
994 }
995
996 /* ( 1 0 1 0) ( a0 ) ( a0 + a2 )
997 * B := ( 1 + Gamma ) A = ( 0 1 0 1) ( a1 ) = ( a1 + a3 )
998 * 3 ( 1 0 1 0) ( a2 ) ( a2 + a0 )
999 * ( 0 1 0 1) ( a3 ) ( a3 + a1 )
1000
1001 * The bottom components of be may be reconstructed using the formula
1002
1003 * ( b2r + i b2i ) = ( {a2r + a0r} + i{a2i + a0i} ) = ( b0r + i b0i )
1004 * ( b3r + i b3i ) ( {a3r + a1r} + i{a3i + a1i} ) ( b1r + i b1i )
1005 */
1006 // Reconstruct Spin 2
1007 for(int col=0; col < Nc; col++) {
1008 *(dst_shadow++) += tmp_hspinor[0][col][re];
1009 *(dst_shadow++) += tmp_hspinor[0][col][im];
1010 }
1011
1012 // Reconstruct Spin 3;
1013 for(int col=0; col < Nc; col++) {
1014 *(dst_shadow++) += tmp_hspinor[1][col][re];
1015 *(dst_shadow++) += tmp_hspinor[1][col][im];
1016 }
1017
1018
1019 }
1020}
1021
1034inline
1035void inlineAddSpinReconDir3Minus(const REAL* src, REAL *dst, unsigned int n_vec)
1036{
1037
1038#ifdef DEBUG_GENERIC_SPIN_RECON_INLINES
1039 QDPIO::cout << "inlinaAddSpinReconDir0Minus" << endl;
1040#endif
1041
1042
1043 REAL tmp_hspinor[4][3][2];
1044
1045 const REAL* src_shadow = src;
1046 REAL* dst_shadow = dst;
1047
1048 const int re = 0;
1049 const int im = 1;
1050 const int Ncmpx = 2;
1051 const int Nsby2 = 2;
1052
1053 for(unsigned int site=0; site < n_vec; site++) {
1054 REAL* tmp_shadow = &(tmp_hspinor[0][0][0]);
1055
1056 // Stream in the half spinor - write out the first two components
1057 for(int stream=0; stream < Nsby2*Nc*Ncmpx; stream++) {
1058 REAL tmp = *(src_shadow++);
1059 *(tmp_shadow++) = tmp;
1060 *(dst_shadow++) += tmp;
1061 }
1062
1063 /* ( 1 0 -1 0) ( a0 ) ( a0 - a2 )
1064 * B := ( 1 - Gamma ) A = ( 0 1 0 -1) ( a1 ) = ( a1 - a3 )
1065 * 3 (-1 0 1 0) ( a2 ) ( a2 - a0 )
1066 * ( 0 -1 0 1) ( a3 ) ( a3 - a1 )
1067
1068 * The bottom components of be may be reconstructed using the formula
1069 * ( b2r + i b2i ) = ( {a2r - a0r} + i{a2i - a0i} ) = ( - b0r - i b0i )
1070 * ( b3r + i b3i ) ( {a3r - a1r} + i{a3i - a1i} ) ( - b1r - i b1i )
1071 */
1072 // Reconstruct Spin 2
1073 for(int col=0; col < Nc; col++) {
1074 *(dst_shadow++) -= tmp_hspinor[0][col][re];
1075 *(dst_shadow++) -= tmp_hspinor[0][col][im];
1076 }
1077
1078 // Reconstruct Spin 3;
1079 for(int col=0; col < Nc; col++) {
1080 *(dst_shadow++) -= tmp_hspinor[1][col][re];
1081 *(dst_shadow++) -= tmp_hspinor[1][col][im];
1082 }
1083
1084
1085 }
1086}
1087
1088
1089} // namespace QDP
1090
1091#endif
REAL32 REAL
const int Nc
Definition qdp_params.h:25
StandardOutputStream cout
Definition qdp_stdio.cc:21
Yet another random number generator.
void inlineSpinReconDir0Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_0).
void inlineAddSpinReconDir1Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_1).
void inlineAddSpinReconDir2Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_2).
void inlineAddSpinReconDir1Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_1).
void inlineSpinReconDir2Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_2).
void inlineSpinReconDir1Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_1).
void inlineAddSpinReconDir3Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma3).
void inlineSpinReconDir2Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_2).
void inlineAddSpinReconDir3Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma3).
void inlineSpinReconDir3Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma3).
void inlineAddSpinReconDir0Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_0).
void inlineAddSpinReconDir2Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_2).
void inlineSpinReconDir3Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma3).
void inlineAddSpinReconDir0Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_0).
void inlineSpinReconDir1Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_1).
void inlineSpinReconDir0Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_0).