QDP++
generic_fused_spin_proj.h
Go to the documentation of this file.
1#ifndef GENERIC_FUSED_SPIN_PROJ_H
2#define GENERIC_FUSED_SPIN_PROJ_H
3
4
5namespace QDP {
6
7// Convenience Types
12
13/* **************************************************************************
14 * **************************************************************************
15 * FUSED: adj(x)*spinProjectDir0Plus(y)
16 *
17 * All that is below is needed.
18 *
19 * **************************************************************************
20 * ************************************************************************* */
21// This is a struct for adj(x)*spinProjectDir0Plus(y)
23{
24 // Boilerplate
26
27 // OK This is an operator() so we can create instances of this
28 // object and treat them as functions()
29 template<class T1, class T2>
31 operator()(const T1 &a, const T2 &b) const
32 {
33 // Print Diagnostics
34 // cout << "FnAdjMultSprojDir0Plus" << endl << flush;
35
36 // Call the appropriate match
37 return (adjMultSprojDir0Plus(a,b));
38 }
39};
40
41
42// This is an operator* that rewrites:
43//
44// from: adj(l)*spinProjectDir0Plus(r)
45// to: FnAdjMultSprojDir0Plus(l,r)
46//
47// The spinProjectDir0Plus gets grabbed and turned into an op identity
48// adj(l) gets grabbed and turned into an op identity
49// the operation is encoded in the FnAdjMultSprojDir0Plus
50//
51
52template<class T1,class C1,class T2,class C2>
53inline typename MakeReturn<BinaryNode<FnAdjMultSprojDir0Plus,
55 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t>,
59{
60 // Print Diagnostics
61 // cout << "FnAdjMultSprojDir0Plus(l,r) <- adj(l)*FnSpinProjectDir0Plus(r)" << endl;
62
63 typedef UnaryNode<OpIdentity,T1> NewExpr1_t; // Shorthand for the new type for adj(l)
64 typedef UnaryNode<OpIdentity,T2> NewExpr2_t; // Shorthand for the new type for spinProj
65
66 // A name for the new node: Tree_t
69 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t> Tree_t;
70
71 // Create the result: Tree_t = Binary node
72 // Return type is the return type defined in structs below
73 // The CreateLeaf-s do the rewriting -
74 // unwrap the previous expression and rewrap it as the new type
76 CreateLeaf<QDPExpr<NewExpr1_t,C1> >::make(NewExpr1_t(l.expression().child())),
77 CreateLeaf<QDPExpr<NewExpr2_t,C2> >::make(NewExpr2_t(r.expression().child()))
78 )
79 );
80}
81
82// Return types Fused su3*spinProj(Spin4)->Spin2
83template<>
87
88// This is what you need to specialise now. It'll get called by
89// the operator() of the FnAdjMultSprojDir0Plus struct
90template<typename T1, typename T2>
91inline
93adjMultSprojDir0Plus(const T1& a, const T2& b)
94{
96
97 tmp = spinProjectDir0Plus(b);
98 return( adj(a)*tmp );
99}
100
101// This is what you need to specialise now. It'll get called by
102// the operator() of the FnAdjMultSprojDir0Plus struct
103template<>
104inline
105BinaryReturn<PScalar<ColMat>, Spin4, FnAdjMultSprojDir0Plus >::Type_t
107{
110
111 inlineSpinProjDir0Plus(&(b.elem(0).elem(0).real()),
112 &(d.elem(0).elem(0).real()),
113 1);
114
115 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(0),ret.elem(0)) ;
116 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(1),ret.elem(1)) ;
117
118 return ret;
119}
120
121
122/* **************************************************************************
123 * **************************************************************************
124 * FUSED: adj(x)*spinProjectDir0Minus(y)
125 *
126 * All that is below is needed.
127 *
128 * **************************************************************************
129 * ************************************************************************* */
130
131// This is a struct for adj(x)*spinProjectDir0Minus(y)
133{
134 // Boilerplate
136
137 // OK This is an operator() so we can create instances of this
138 // object and treat them as functions()
139 template<class T1, class T2>
141 operator()(const T1 &a, const T2 &b) const
142 {
143 // Call the appropriate match
144 return (adjMultSprojDir0Minus(a,b));
145 }
146};
147
148
149// This is an operator* that rewrites:
150//
151// from: adj(l)*spinProjectDir0Minus(r)
152// to: FnAdjMultSprojDir0Minus(l,r)
153//
154// The spinProjectDir0Minus gets grabbed and turned into an op identity
155// adj(l) gets grabbed and turned into an op identity
156// the operation is encoded in the FnAdjMultSprojDir0Minus
157//
158
159template<class T1,class C1,class T2,class C2>
160inline typename MakeReturn<BinaryNode<FnAdjMultSprojDir0Minus,
161 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
162 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t>,
166{
167 // Print Diagnostics
168 // cout << "FnAdjMultSprojDir0Minus(l,r) <- adj(l)*FnSpinProjectDir0Minus(r)" << endl;
169
170 typedef UnaryNode<OpIdentity,T1> NewExpr1_t; // Shorthand for the new type for adj(l)
171 typedef UnaryNode<OpIdentity,T2> NewExpr2_t; // Shorthand for the new type for spinProj
172
173 // A name for the new node: Tree_t
175 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
176 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t> Tree_t;
177
178 // Create the result: Tree_t = Binary node
179 // Return type is the return type defined in structs below
180 // The CreateLeaf-s do the rewriting -
181 // unwrap the previous expression and rewrap it as the new type
183 CreateLeaf<QDPExpr<NewExpr1_t,C1> >::make(NewExpr1_t(l.expression().child())),
184 CreateLeaf<QDPExpr<NewExpr2_t,C2> >::make(NewExpr2_t(r.expression().child()))
185 )
186 );
187}
188
189// Return types Fused su3*spinProj(Spin4)->Spin2
190template<>
194
195// This is what you need to specialise now. It'll get called by
196// the operator() of the FnAdjMultSprojDir0Minus struct
197template<typename T1, typename T2>
198inline
200adjMultSprojDir0Minus(const T1& a, const T2& b)
201{
203
204 tmp = spinProjectDir0Minus(b);
205 return( adj(a)*tmp );
206}
207
208// This is what you need to specialise now. It'll get called by
209// the operator() of the FnAdjMultSprojDir0Minus struct
210template<>
211inline
212BinaryReturn<PScalar<ColMat>, Spin4, FnAdjMultSprojDir0Minus >::Type_t
214{
217
218 inlineSpinProjDir0Minus(&(b.elem(0).elem(0).real()),
219 &(d.elem(0).elem(0).real()),
220 1);
221
222 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(0),ret.elem(0)) ;
223 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(1),ret.elem(1)) ;
224
225 return ret;
226}
227
228
229/* **************************************************************************
230 * **************************************************************************
231 * FUSED: adj(x)*spinProjectDir1Plus(y)
232 *
233 * All that is below is needed.
234 *
235 * **************************************************************************
236 * ************************************************************************* */
237
238// This is a struct for adj(x)*spinProjectDir1Plus(y)
240{
241 // Boilerplate
243
244 // OK This is an operator() so we can create instances of this
245 // object and treat them as functions()
246 template<class T1, class T2>
248 operator()(const T1 &a, const T2 &b) const
249 {
250 // Call the appropriate match
251 return (adjMultSprojDir1Plus(a,b));
252 }
253};
254
255
256// This is an operator* that rewrites:
257//
258// from: adj(l)*spinProjectDir1Plus(r)
259// to: FnAdjMultSprojDir1Plus(l,r)
260//
261// The spinProjectDir1Plus gets grabbed and turned into an op identity
262// adj(l) gets grabbed and turned into an op identity
263// the operation is encoded in the FnAdjMultSprojDir1Plus
264//
265
266template<class T1,class C1,class T2,class C2>
267inline typename MakeReturn<BinaryNode<FnAdjMultSprojDir1Plus,
268 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
269 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t>,
273{
274 // Print Diagnostics
275 // cout << "FnAdjMultSprojDir1Plus(l,r) <- adj(l)*FnSpinProjectDir1Plus(r)" << endl;
276
277 typedef UnaryNode<OpIdentity,T1> NewExpr1_t; // Shorthand for the new type for adj(l)
278 typedef UnaryNode<OpIdentity,T2> NewExpr2_t; // Shorthand for the new type for spinProj
279
280 // A name for the new node: Tree_t
282 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
283 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t> Tree_t;
284
285 // Create the result: Tree_t = Binary node
286 // Return type is the return type defined in structs below
287 // The CreateLeaf-s do the rewriting -
288 // unwrap the previous expression and rewrap it as the new type
290 CreateLeaf<QDPExpr<NewExpr1_t,C1> >::make(NewExpr1_t(l.expression().child())),
291 CreateLeaf<QDPExpr<NewExpr2_t,C2> >::make(NewExpr2_t(r.expression().child()))
292 )
293 );
294}
295
296// Return types Fused su3*spinProj(Spin4)->Spin2
297template<>
301
302// This is what you need to specialise now. It'll get called by
303// the operator() of the FnAdjMultSprojDir1Plus struct
304template<typename T1, typename T2>
305inline
307adjMultSprojDir1Plus(const T1& a, const T2& b)
308{
310
311 tmp = spinProjectDir1Plus(b);
312 return( adj(a)*tmp );
313}
314
315// This is what you need to specialise now. It'll get called by
316// the operator() of the FnAdjMultSprojDir1Plus struct
317template<>
318inline
319BinaryReturn<PScalar<ColMat>, Spin4, FnAdjMultSprojDir1Plus >::Type_t
321{
324
325 inlineSpinProjDir1Plus(&(b.elem(0).elem(0).real()),
326 &(d.elem(0).elem(0).real()),
327 1);
328
329 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(0),ret.elem(0)) ;
330 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(1),ret.elem(1)) ;
331
332 return ret;
333}
334
335/* **************************************************************************
336 * **************************************************************************
337 * FUSED: adj(x)*spinProjectDir1Minus(y)
338 *
339 * All that is below is needed.
340 *
341 * **************************************************************************
342 * ************************************************************************* */
343
344
345// This is a struct for adj(x)*spinProjectDir1Minus(y)
347{
348 // Boilerplate
350
351 // OK This is an operator() so we can create instances of this
352 // object and treat them as functions()
353 template<class T1, class T2>
355 operator()(const T1 &a, const T2 &b) const
356 {
357
358 // Call the appropriate match
359 return (adjMultSprojDir1Minus(a,b));
360 }
361};
362
363
364// This is an operator* that rewrites:
365//
366// from: adj(l)*spinProjectDir1Minus(r)
367// to: FnAdjMultSprojDir1Minus(l,r)
368//
369// The spinProjectDir1Minus gets grabbed and turned into an op identity
370// adj(l) gets grabbed and turned into an op identity
371// the operation is encoded in the FnAdjMultSprojDir1Minus
372//
373
374template<class T1,class C1,class T2,class C2>
375inline typename MakeReturn<BinaryNode<FnAdjMultSprojDir1Minus,
376 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
377 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t>,
381{
382 // Print Diagnostics
383 // cout << "FnAdjMultSprojDir1Minus(l,r) <- adj(l)*FnSpinProjectDir1Minus(r)" << endl;
384
385 typedef UnaryNode<OpIdentity,T1> NewExpr1_t; // Shorthand for the new type for adj(l)
386 typedef UnaryNode<OpIdentity,T2> NewExpr2_t; // Shorthand for the new type for spinProj
387
388 // A name for the new node: Tree_t
390 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
391 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t> Tree_t;
392
393 // Create the result: Tree_t = Binary node
394 // Return type is the return type defined in structs below
395 // The CreateLeaf-s do the rewriting -
396 // unwrap the previous expression and rewrap it as the new type
398 CreateLeaf<QDPExpr<NewExpr1_t,C1> >::make(NewExpr1_t(l.expression().child())),
399 CreateLeaf<QDPExpr<NewExpr2_t,C2> >::make(NewExpr2_t(r.expression().child()))
400 )
401 );
402}
403
404// Return types Fused su3*spinProj(Spin4)->Spin2
405template<>
409
410// This is what you need to specialise now. It'll get called by
411// the operator() of the FnAdjMultSprojDir1Minus struct
412template<typename T1, typename T2>
413inline
415adjMultSprojDir1Minus(const T1& a, const T2& b)
416{
418
419 tmp = spinProjectDir1Minus(b);
420 return( adj(a)*tmp );
421}
422
423// This is what you need to specialise now. It'll get called by
424// the operator() of the FnAdjMultSprojDir1Minus struct
425template<>
426inline
427BinaryReturn<PScalar<ColMat>, Spin4, FnAdjMultSprojDir1Minus >::Type_t
429{
432
433 inlineSpinProjDir1Minus(&(b.elem(0).elem(0).real()),
434 &(d.elem(0).elem(0).real()),
435 1);
436
437 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(0),ret.elem(0)) ;
438 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(1),ret.elem(1)) ;
439
440 return ret;
441}
442
443/* **************************************************************************
444 * **************************************************************************
445 * FUSED: adj(x)*spinProjectDir2Plus(y)
446 *
447 * All that is below is needed.
448 *
449 * **************************************************************************
450 * ************************************************************************* */
451
452
453// This is a struct for adj(x)*spinProjectDir2Plus(y)
455{
456 // Boilerplate
458
459 // OK This is an operator() so we can create instances of this
460 // object and treat them as functions()
461 template<class T1, class T2>
463 operator()(const T1 &a, const T2 &b) const
464 {
465 // Call the appropriate match
466 return (adjMultSprojDir2Plus(a,b));
467 }
468};
469
470
471// This is an operator* that rewrites:
472//
473// from: adj(l)*spinProjectDir2Plus(r)
474// to: FnAdjMultSprojDir2Plus(l,r)
475//
476// The spinProjectDir2Plus gets grabbed and turned into an op identity
477// adj(l) gets grabbed and turned into an op identity
478// the operation is encoded in the FnAdjMultSprojDir2Plus
479//
480
481template<class T1,class C1,class T2,class C2>
482inline typename MakeReturn<BinaryNode<FnAdjMultSprojDir2Plus,
483 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
484 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t>,
488{
489 // Print Diagnostics
490 // cout << "FnAdjMultSprojDir2Plus(l,r) <- adj(l)*FnSpinProjectDir2Plus(r)" << endl;
491
492 typedef UnaryNode<OpIdentity,T1> NewExpr1_t; // Shorthand for the new type for adj(l)
493 typedef UnaryNode<OpIdentity,T2> NewExpr2_t; // Shorthand for the new type for spinProj
494
495 // A name for the new node: Tree_t
497 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
498 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t> Tree_t;
499
500 // Create the result: Tree_t = Binary node
501 // Return type is the return type defined in structs below
502 // The CreateLeaf-s do the rewriting -
503 // unwrap the previous expression and rewrap it as the new type
505 CreateLeaf<QDPExpr<NewExpr1_t,C1> >::make(NewExpr1_t(l.expression().child())),
506 CreateLeaf<QDPExpr<NewExpr2_t,C2> >::make(NewExpr2_t(r.expression().child()))
507 )
508 );
509}
510
511// Return types Fused su3*spinProj(Spin4)->Spin2
512template<>
516
517// This is what you need to specialise now. It'll get called by
518// the operator() of the FnAdjMultSprojDir2Plus struct
519template<typename T1, typename T2>
520inline
522adjMultSprojDir2Plus(const T1& a, const T2& b)
523{
525
526 tmp = spinProjectDir2Plus(b);
527 return( adj(a)*tmp );
528}
529
530// This is what you need to specialise now. It'll get called by
531// the operator() of the FnAdjMultSprojDir2Plus struct
532template<>
533inline
534BinaryReturn<PScalar<ColMat>, Spin4, FnAdjMultSprojDir2Plus >::Type_t
536{
539
540 inlineSpinProjDir2Plus(&(b.elem(0).elem(0).real()),
541 &(d.elem(0).elem(0).real()),
542 1);
543
544 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(0),ret.elem(0)) ;
545 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(1),ret.elem(1)) ;
546
547 return ret;
548}
549
550/* **************************************************************************
551 * **************************************************************************
552 * FUSED: adj(x)*spinProjectDir2Minus(y)
553 *
554 * All that is below is needed.
555 *
556 * **************************************************************************
557 * ************************************************************************* */
558// This is a struct for adj(x)*spinProjectDir2Minus(y)
560{
561 // Boilerplate
563
564 // OK This is an operator() so we can create instances of this
565 // object and treat them as functions()
566 template<class T1, class T2>
568 operator()(const T1 &a, const T2 &b) const
569 {
570
571 // Call the appropriate match
572 return (adjMultSprojDir2Minus(a,b));
573 }
574};
575
576
577// This is an operator* that rewrites:
578//
579// from: adj(l)*spinProjectDir2Minus(r)
580// to: FnAdjMultSprojDir2Minus(l,r)
581//
582// The spinProjectDir2Minus gets grabbed and turned into an op identity
583// adj(l) gets grabbed and turned into an op identity
584// the operation is encoded in the FnAdjMultSprojDir2Minus
585//
586
587template<class T1,class C1,class T2,class C2>
588inline typename MakeReturn<BinaryNode<FnAdjMultSprojDir2Minus,
589 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
590 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t>,
594{
595 // Print Diagnostics
596 // cout << "FnAdjMultSprojDir2Minus(l,r) <- adj(l)*FnSpinProjectDir2Minus(r)" << endl;
597
598 typedef UnaryNode<OpIdentity,T1> NewExpr1_t; // Shorthand for the new type for adj(l)
599 typedef UnaryNode<OpIdentity,T2> NewExpr2_t; // Shorthand for the new type for spinProj
600
601 // A name for the new node: Tree_t
603 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
604 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t> Tree_t;
605
606 // Create the result: Tree_t = Binary node
607 // Return type is the return type defined in structs below
608 // The CreateLeaf-s do the rewriting -
609 // unwrap the previous expression and rewrap it as the new type
611 CreateLeaf<QDPExpr<NewExpr1_t,C1> >::make(NewExpr1_t(l.expression().child())),
612 CreateLeaf<QDPExpr<NewExpr2_t,C2> >::make(NewExpr2_t(r.expression().child()))
613 )
614 );
615}
616
617// Return types Fused su3*spinProj(Spin4)->Spin2
618template<>
622
623// This is what you need to specialise now. It'll get called by
624// the operator() of the FnAdjMultSprojDir2Minus struct
625template<typename T1, typename T2>
626inline
628adjMultSprojDir2Minus(const T1& a, const T2& b)
629{
631
632 tmp = spinProjectDir2Minus(b);
633 return( adj(a)*tmp );
634}
635
636// This is what you need to specialise now. It'll get called by
637// the operator() of the FnAdjMultSprojDir2Minus struct
638template<>
639inline
640BinaryReturn<PScalar<ColMat>, Spin4, FnAdjMultSprojDir2Minus >::Type_t
642{
645
646 inlineSpinProjDir2Minus(&(b.elem(0).elem(0).real()),
647 &(d.elem(0).elem(0).real()),
648 1);
649
650 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(0),ret.elem(0)) ;
651 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(1),ret.elem(1)) ;
652 return ret;
653}
654
655/* **************************************************************************
656 * **************************************************************************
657 * FUSED: adj(x)*spinProjectDir3Plus(y)
658 *
659 * All that is below is needed.
660 *
661 * **************************************************************************
662 * ************************************************************************* */
663// This is a struct for adj(x)*spinProjectDir3Plus(y)
665{
666 // Boilerplate
668
669 // OK This is an operator() so we can create instances of this
670 // object and treat them as functions()
671 template<class T1, class T2>
673 operator()(const T1 &a, const T2 &b) const
674 {
675 // Call the appropriate match
676 return (adjMultSprojDir3Plus(a,b));
677 }
678};
679
680
681// This is an operator* that rewrites:
682//
683// from: adj(l)*spinProjectDir3Plus(r)
684// to: FnAdjMultSprojDir3Plus(l,r)
685//
686// The spinProjectDir3Plus gets grabbed and turned into an op identity
687// adj(l) gets grabbed and turned into an op identity
688// the operation is encoded in the FnAdjMultSprojDir3Plus
689//
690
691template<class T1,class C1,class T2,class C2>
692inline typename MakeReturn<BinaryNode<FnAdjMultSprojDir3Plus,
693 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
694 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t>,
698{
699 // Print Diagnostics
700 // cout << "FnAdjMultSprojDir3Plus(l,r) <- adj(l)*FnSpinProjectDir3Plus(r)" << endl;
701
702 typedef UnaryNode<OpIdentity,T1> NewExpr1_t; // Shorthand for the new type for adj(l)
703 typedef UnaryNode<OpIdentity,T2> NewExpr2_t; // Shorthand for the new type for spinProj
704
705 // A name for the new node: Tree_t
707 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
708 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t> Tree_t;
709
710 // Create the result: Tree_t = Binary node
711 // Return type is the return type defined in structs below
712 // The CreateLeaf-s do the rewriting -
713 // unwrap the previous expression and rewrap it as the new type
715 CreateLeaf<QDPExpr<NewExpr1_t,C1> >::make(NewExpr1_t(l.expression().child())),
716 CreateLeaf<QDPExpr<NewExpr2_t,C2> >::make(NewExpr2_t(r.expression().child()))
717 )
718 );
719}
720
721// Return types Fused su3*spinProj(Spin4)->Spin2
722template<>
726
727// This is what you need to specialise now. It'll get called by
728// the operator() of the FnAdjMultSprojDir3Plus struct
729template<typename T1, typename T2>
730inline
732adjMultSprojDir3Plus(const T1& a, const T2& b)
733{
735
736 tmp = spinProjectDir3Plus(b);
737 return( adj(a)*tmp );
738}
739
740// This is what you need to specialise now. It'll get called by
741// the operator() of the FnAdjMultSprojDir3Plus struct
742template<>
743inline
744BinaryReturn<PScalar<ColMat>, Spin4, FnAdjMultSprojDir3Plus >::Type_t
746{
749
750 inlineSpinProjDir3Plus(&(b.elem(0).elem(0).real()),
751 &(d.elem(0).elem(0).real()),
752 1);
753
754
755 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(0),ret.elem(0)) ;
756 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(1),ret.elem(1)) ;
757
758 return ret;
759}
760
761/* **************************************************************************
762 * **************************************************************************
763 * FUSED: adj(x)*spinProjectDir3Minus(y)
764 *
765 * All that is below is needed.
766 *
767 * **************************************************************************
768 * ************************************************************************* */
769
770// This is a struct for adj(x)*spinProjectDir3Minus(y)
772{
773 // Boilerplate
775
776 // OK This is an operator() so we can create instances of this
777 // object and treat them as functions()
778 template<class T1, class T2>
780 operator()(const T1 &a, const T2 &b) const
781 {
782
783 // Call the appropriate match
784 return (adjMultSprojDir3Minus(a,b));
785 }
786};
787
788
789// This is an operator* that rewrites:
790//
791// from: adj(l)*spinProjectDir3Minus(r)
792// to: FnAdjMultSprojDir3Minus(l,r)
793//
794// The spinProjectDir3Minus gets grabbed and turned into an op identity
795// adj(l) gets grabbed and turned into an op identity
796// the operation is encoded in the FnAdjMultSprojDir3Minus
797//
798
799template<class T1,class C1,class T2,class C2>
800inline typename MakeReturn<BinaryNode<FnAdjMultSprojDir3Minus,
801 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
802 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t>,
806{
807 // Print Diagnostics
808 // cout << "FnAdjMultSprojDir3Minus(l,r) <- adj(l)*FnSpinProjectDir3Minus(r)" << endl;
809
810 typedef UnaryNode<OpIdentity,T1> NewExpr1_t; // Shorthand for the new type for adj(l)
811 typedef UnaryNode<OpIdentity,T2> NewExpr2_t; // Shorthand for the new type for spinProj
812
813 // A name for the new node: Tree_t
815 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T1>,C1> >::Leaf_t,
816 typename CreateLeaf<QDPExpr<UnaryNode<OpIdentity,T2>,C2> >::Leaf_t> Tree_t;
817
818 // Create the result: Tree_t = Binary node
819 // Return type is the return type defined in structs below
820 // The CreateLeaf-s do the rewriting -
821 // unwrap the previous expression and rewrap it as the new type
823 CreateLeaf<QDPExpr<NewExpr1_t,C1> >::make(NewExpr1_t(l.expression().child())),
824 CreateLeaf<QDPExpr<NewExpr2_t,C2> >::make(NewExpr2_t(r.expression().child()))
825 )
826 );
827}
828
829// Return types Fused su3*spinProj(Spin4)->Spin2
830template<>
834
835// This is what you need to specialise now. It'll get called by
836// the operator() of the FnAdjMultSprojDir3Minus struct
837template<typename T1, typename T2>
838inline
840adjMultSprojDir3Minus(const T1& a, const T2& b)
841{
843
844 tmp = spinProjectDir3Minus(b);
845 return( adj(a)*tmp );
846}
847
848// This is what you need to specialise now. It'll get called by
849// the operator() of the FnAdjMultSprojDir3Minus struct
850template<>
851inline
852BinaryReturn<PScalar<ColMat>, Spin4, FnAdjMultSprojDir3Minus >::Type_t
854{
857
858 inlineSpinProjDir3Minus(&(b.elem(0).elem(0).real()),
859 &(d.elem(0).elem(0).real()),
860 1);
861
862
863 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(0),ret.elem(0));
864 _inline_mult_adj_su3_mat_vec(a.elem(),d.elem(1),ret.elem(1));
865
866 return ret;
867}
868
869
870} // namespace QDP;
871
872#endif
#define PETE_EMPTY_CONSTRUCTORS(CLASS)
Definition PETE.h:58
Primitive color Matrix class.
Primitive color Vector class.
Primitive Scalar.
Primitive spin Vector class.
T & elem(int i)
Expression class for QDP.
Definition qdp_qdpexpr.h:16
#define _inline_mult_adj_su3_mat_vec(aa, bb, cc)
Yet another random number generator.
MakeReturn< UnaryNode< FnAdjoint, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnAdjoint >::Type_t >::Expression_t adj(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4842
MakeReturn< UnaryNode< FnSpinProjectDir2Minus, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnSpinProjectDir2Minus >::Type_t >::Expression_t spinProjectDir2Minus(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5128
BinaryReturn< T1, T2, FnAdjMultSprojDir3Minus >::Type_t adjMultSprojDir3Minus(const T1 &a, const T2 &b)
MakeReturn< UnaryNode< FnSpinProjectDir1Minus, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnSpinProjectDir1Minus >::Type_t >::Expression_t spinProjectDir1Minus(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5115
PColorVector< RComplex< REAL >, 3 > ColVec
BinaryReturn< T1, T2, FnAdjMultSprojDir0Minus >::Type_t adjMultSprojDir0Minus(const T1 &a, const T2 &b)
MakeReturn< UnaryNode< FnSpinProjectDir0Plus, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnSpinProjectDir0Plus >::Type_t >::Expression_t spinProjectDir0Plus(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5050
PColorMatrix< RComplex< REAL >, 3 > ColMat
MakeReturn< BinaryNode< OpMultiply, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpMultiply >::Type_t >::Expression_t operator*(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2588
BinaryReturn< T1, T2, FnAdjMultSprojDir2Plus >::Type_t adjMultSprojDir2Plus(const T1 &a, const T2 &b)
MakeReturn< UnaryNode< FnSpinProjectDir3Minus, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnSpinProjectDir3Minus >::Type_t >::Expression_t spinProjectDir3Minus(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5141
PSpinVector< ColVec, 4 > Spin4
BinaryReturn< T1, T2, FnAdjMultSprojDir1Minus >::Type_t adjMultSprojDir1Minus(const T1 &a, const T2 &b)
void inlineSpinProjDir0Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_0).
BinaryReturn< T1, T2, FnAdjMultSprojDir0Plus >::Type_t adjMultSprojDir0Plus(const T1 &a, const T2 &b)
void inlineSpinProjDir0Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_0).
PSpinVector< ColVec, 2 > Spin2
BinaryReturn< T1, T2, FnAdjMultSprojDir2Minus >::Type_t adjMultSprojDir2Minus(const T1 &a, const T2 &b)
MakeReturn< UnaryNode< FnSpinProjectDir2Plus, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnSpinProjectDir2Plus >::Type_t >::Expression_t spinProjectDir2Plus(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5076
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).
BinaryReturn< T1, T2, FnAdjMultSprojDir3Plus >::Type_t adjMultSprojDir3Plus(const T1 &a, const T2 &b)
void inlineSpinProjDir3Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_3).
MakeReturn< UnaryNode< FnSpinProjectDir3Plus, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnSpinProjectDir3Plus >::Type_t >::Expression_t spinProjectDir3Plus(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5089
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).
BinaryReturn< T1, T2, FnAdjMultSprojDir1Plus >::Type_t adjMultSprojDir1Plus(const T1 &a, const T2 &b)
void inlineSpinProjDir2Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_2).
MakeReturn< UnaryNode< FnSpinProjectDir0Minus, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnSpinProjectDir0Minus >::Type_t >::Expression_t spinProjectDir0Minus(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5102
MakeReturn< UnaryNode< FnSpinProjectDir1Plus, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnSpinProjectDir1Plus >::Type_t >::Expression_t spinProjectDir1Plus(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5063
Promote< T1, T2 >::Type_t Type_t
Promote< T1, T2 >::Type_t Type_t
Definition qdp.h:377
BinaryReturn< T1, T2, FnAdjMultSprojDir0Minus >::Type_t operator()(const T1 &a, const T2 &b) const
BinaryReturn< T1, T2, FnAdjMultSprojDir0Plus >::Type_t operator()(const T1 &a, const T2 &b) const
BinaryReturn< T1, T2, FnAdjMultSprojDir1Minus >::Type_t operator()(const T1 &a, const T2 &b) const
BinaryReturn< T1, T2, FnAdjMultSprojDir1Plus >::Type_t operator()(const T1 &a, const T2 &b) const
BinaryReturn< T1, T2, FnAdjMultSprojDir2Minus >::Type_t operator()(const T1 &a, const T2 &b) const
BinaryReturn< T1, T2, FnAdjMultSprojDir2Plus >::Type_t operator()(const T1 &a, const T2 &b) const
BinaryReturn< T1, T2, FnAdjMultSprojDir3Minus >::Type_t operator()(const T1 &a, const T2 &b) const
BinaryReturn< T1, T2, FnAdjMultSprojDir3Plus >::Type_t operator()(const T1 &a, const T2 &b) const