CHROMA
lg5Rherm_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 #ifndef __lg5Rherm_h__
4 #define __lg5Rherm_h__
5 
6 #include "handle.h"
7 #include "linearop.h"
8 
9 
10 namespace Chroma
11 {
12  //! Gamma(5) R hermitian linear operator
13  /*!
14  * \ingroup linop
15  *
16  * This routine is specific to DWF fermions!
17  *
18  * This operator evaluates g5 R D
19  * where D the input DWF operator
20  * and R is the reflection matrix R_{s,s'}=\delta_{s, Ls-1-s'}
21  *
22  * = ( 0 ...... 1 )
23  * ( 0 .....1 0 )
24  * ( 0 ...1 0 0 )
25  * ( 0 .. 0 )
26  * ( 0 1 ... 0 )
27  * ( 1 0 0 ...0 )
28  */
29 
30  /*! \ingroup linop */
31  template<typename T>
33  {
34  public:
35  //! Initialize pointer with existing pointer
36  /*! Requires that the pointer p is a return value of new */
38 
39  //! Copy pointer (one more owner)
41 
42  //! Assignment
43  lg5RHermArray(const lg5RHermArray& a) {D = a.D;}
44 
45  //! Destructor
47 
48  //! Subset comes from underlying operator
49  inline const Subset& subset() const {return D->subset();}
50 
51  //! The size of the 5D operator
52  inline int size() const { return D->size(); }
53 
54  //! Apply the operator onto a source std::vector
55  /*! For this operator, the sign is ignored */
56  inline void operator() (multi1d<T>& chi, const multi1d<T>& psi, enum PlusMinus isign) const
57  {
58  multi1d<T> tmp(D->size()); moveToFastMemoryHint(tmp);
59  const Subset& sub = (*D).subset();
60  int N5 = (*D).size();
61  // Operator is hermitian so can ignore isign
62 
63  // tmp = D psi
64  (*D)(tmp, psi, PLUS);
65 
66  // tmp = R tmp
67  for(int s=0; s < N5; s++) {
68  tmp[s][sub] = tmp[N5-1-s];
69  }
70 
71  // chi = G_5 tmp
72  for(int s=0; s < N5; s++) {
73  chi[s][sub] = GammaConst<Ns,Ns*Ns-1>()*tmp[s];
74  }
75 
76  // tmp disappears here...
77  }
78 
79  private:
81  };
82 
83 
84 
85 } // End Namespace Chroma
86 
87 
88 #endif
Class for counted reference semantics.
Definition: handle.h:33
Linear Operator to arrays.
Definition: linearop.h:61
Gamma(5) R hermitian linear operator.
Definition: lg5Rherm_w.h:33
const Subset & subset() const
Subset comes from underlying operator.
Definition: lg5Rherm_w.h:49
Handle< LinearOperatorArray< T > > D
Definition: lg5Rherm_w.h:80
lg5RHermArray(const lg5RHermArray &a)
Assignment.
Definition: lg5Rherm_w.h:43
~lg5RHermArray()
Destructor.
Definition: lg5Rherm_w.h:46
lg5RHermArray(Handle< LinearOperatorArray< T > > p)
Copy pointer (one more owner)
Definition: lg5Rherm_w.h:40
int size() const
The size of the 5D operator.
Definition: lg5Rherm_w.h:52
lg5RHermArray(LinearOperatorArray< T > *p)
Initialize pointer with existing pointer.
Definition: lg5Rherm_w.h:37
void operator()(multi1d< T > &chi, const multi1d< T > &psi, enum PlusMinus isign) const
Apply the operator onto a source std::vector.
Definition: lg5Rherm_w.h:56
Class for counted reference semantics.
Linear Operators.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
@ PLUS
Definition: chromabase.h:45
multi1d< LatticeFermion > chi(Ncb)
Complex a
Definition: invbicg.cc:95
LatticeFermion psi
Definition: mespbg5p_w.cc:35
multi1d< LatticeFermion > s(Ncb)