CHROMA
eoprec_nef_linop_array_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief 4D Even Odd preconditioned NEF domain-wall fermion linear operator
4  */
5 
6 #ifndef __prec_nef_linop_array_w_h__
7 #define __prec_nef_linop_array_w_h__
8 
9 #include "linearop.h"
12 
13 
14 namespace Chroma
15 {
16  //! 4D Even Odd preconditioned NEF domain-wall Dirac operator
17  /*!
18  * \ingroup linop
19  *
20  * This routine is specific to Wilson fermions!
21  */
23  multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >
24  {
25  public:
26  // Typedefs to save typing
27  typedef LatticeFermion T;
28  typedef multi1d<LatticeColorMatrix> P;
29  typedef multi1d<LatticeColorMatrix> Q;
30 
31  // ***** HACK *****
33  const Real& WilsonMass_, const multi1d<Real>& b5_,
34  const multi1d<Real>& c5_, const Real& m_q, int N5_)
35  {QDP_error_exit("not supported");}
36  // ***** HACK *****
37 
38 
39  /*!
40  Full constructor
41  Set b5 = 1.0 and c5=0.0 to get Shamir DWF with a5=1.
42  Set b5 = 1.0 and c5=1.0 to get Borichi DWF.
43  */
45  const Real& WilsonMass_, const Real &b5_,
46  const Real &c5_, const Real& m_q, int N5_)
47  {create(fs,WilsonMass_,b5_,c5_,m_q,N5_);}
48 
49  //! Creation routine
50  void create(Handle< FermState<T,P,Q> > fs,
51  const Real& WilsonMass_, const Real &b5_,
52  const Real &c5_, const Real& m_q_, int N5_);
53 
54  //! set b5 and c5 given kappa and a5
55  //void set_b5_c5(const Real &kappa_, const Real &a5_);
56 
57  //! Destructor is automatic
59 
60  //! Return the fermion BC object for this linear operator
61  const FermBC<T,P,Q>& getFermBC() const {return D.getFermBC();}
62 
63  //! Length of DW flavor index/space
64  int size() const {return N5;}
65 
66  //! Apply the even-even block onto a source std::vector
67  inline
68  void evenEvenLinOp(multi1d<LatticeFermion>& chi,
69  const multi1d<LatticeFermion>& psi,
70  enum PlusMinus isign) const
71  {
72  applyDiag(chi, psi, isign, 0);
73  }
74 
75  //! Apply the inverse of the even-even block onto a source std::vector
76  inline
77  void evenEvenInvLinOp(multi1d<LatticeFermion>& chi,
78  const multi1d<LatticeFermion>& psi,
79  enum PlusMinus isign) const
80  {
81  applyDiagInv(chi, psi, isign, 0);
82  }
83 
84  //! Apply the the even-odd block onto a source std::vector
85  void evenOddLinOp(multi1d<LatticeFermion>& chi,
86  const multi1d<LatticeFermion>& psi,
87  enum PlusMinus isign) const
88  {
89  applyOffDiag(chi, psi, isign, 0);
90  }
91 
92  //! Apply the the odd-even block onto a source std::vector
93  void oddEvenLinOp(multi1d<LatticeFermion>& chi,
94  const multi1d<LatticeFermion>& psi,
95  enum PlusMinus isign) const
96  {
97  applyOffDiag(chi, psi, isign, 1);
98  }
99 
100  //! Apply the the odd-odd block onto a source std::vector
101  inline
102  void oddOddLinOp(multi1d<LatticeFermion>& chi,
103  const multi1d<LatticeFermion>& psi,
104  enum PlusMinus isign) const
105  {
106  applyDiag(chi, psi, isign, 1);
107  }
108 
109  //! Apply the inverse of the odd-odd block onto a source std::vector
110  inline
111  void oddOddInvLinOp(multi1d<LatticeFermion>& chi,
112  const multi1d<LatticeFermion>& psi,
113  enum PlusMinus isign) const
114  {
115  applyDiagInv(chi, psi, isign, 1);
116  }
117 
118  //! Apply the Dminus operator on a lattice fermion. See my notes ;-)
119  void Dminus(LatticeFermion& chi,
120  const LatticeFermion& psi,
121  enum PlusMinus isign,
122  int s5) const;
123 
124  protected:
125 
126  //! Apply the even-even (odd-odd) coupling piece of the domain-wall fermion operator
127  /*!
128  * \param chi result (Modify)
129  * \param psi source (Read)
130  * \param isign Flag ( PLUS | MINUS ) (Read)
131  * \param cb checkerboard ( 0 | 1 ) (Read)
132  */
133  void applyDiag(multi1d<LatticeFermion>& chi,
134  const multi1d<LatticeFermion>& psi,
135  enum PlusMinus isign,
136  const int cb) const;
137 
138  //! Apply the inverse even-even (odd-odd) coupling piece of the domain-wall fermion operator
139  /*!
140  * \param chi result (Modify)
141  * \param psi source (Read)
142  * \param isign Flag ( PLUS | MINUS ) (Read)
143  * \param cb checkerboard ( 0 | 1 ) (Read)
144  */
145  void applyDiagInv(multi1d<LatticeFermion>& chi,
146  const multi1d<LatticeFermion>& psi,
147  enum PlusMinus isign,
148  const int cb) const;
149 
150 
151  //! Apply the even-odd (odd-even) coupling piece of the NEF operator
152  /*!
153  * \ingroup linop
154  *
155  * The operator acts on the entire lattice
156  *
157  * \param psi Pseudofermion field (Read)
158  * \param isign Flag ( PLUS | MINUS ) (Read)
159  * \param cb checkerboard ( 0 | 1 ) (Read)
160  */
161  void applyOffDiag(multi1d<LatticeFermion>& chi,
162  const multi1d<LatticeFermion>& psi,
163  enum PlusMinus isign,
164  const int cb) const ;
165 
166  protected:
167  //! Partial constructor
169  //! Partial constructor
171 
172  private:
174  Real c5;
175  Real b5;
176  Real m_q;
177  int N5;
178 
179  Real c5TwoKappa ;
181  Real b5TwoKappa ;
183 
184  //Real InvTwoKappa ;
185  Real TwoKappa ;
186  Real Kappa;
187  Real invDfactor ;
188 
190  };
191 
192 } // End Namespace Chroma
193 
194 
195 
196 #endif
4D Even Odd preconditioned domain-wall Dirac operator
4D Even Odd preconditioned NEF domain-wall Dirac operator
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
void operator=(const EvenOddPrecNEFDWLinOpArray &)
Partial constructor.
void oddOddInvLinOp(multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign) const
Apply the inverse of the odd-odd block onto a source std::vector.
void oddOddLinOp(multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign) const
Apply the the odd-odd block onto a source std::vector.
void evenEvenLinOp(multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign) const
Apply the even-even block onto a source std::vector.
void evenEvenInvLinOp(multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign) const
Apply the inverse of the even-even block onto a source std::vector.
int size() const
Length of DW flavor index/space.
EvenOddPrecNEFDWLinOpArray(Handle< FermState< T, P, Q > > fs, const Real &WilsonMass_, const Real &b5_, const Real &c5_, const Real &m_q, int N5_)
void Dminus(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign, int s5) const
Apply the Dminus operator on a lattice fermion. See my notes ;-)
void oddEvenLinOp(multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign) const
Apply the the odd-even block onto a source std::vector.
EvenOddPrecNEFDWLinOpArray(Handle< FermState< T, P, Q > > fs, const Real &WilsonMass_, const multi1d< Real > &b5_, const multi1d< Real > &c5_, const Real &m_q, int N5_)
void evenOddLinOp(multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign) const
Apply the the even-odd block onto a source std::vector.
~EvenOddPrecNEFDWLinOpArray()
set b5 and c5 given kappa and a5
Base class for all fermion action boundary conditions.
Definition: fermbc.h:20
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
General Wilson-Dirac dslash of arrays.
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
Include possibly optimized Wilson dslash.
Base class for even-odd preconditioned domain-wall-like linops.
void create(Handle< FermState< T, P, Q > > fs, const Real &WilsonMass_, const Real &b5_, const Real &c5_, const Real &m_q_, int N5_)
Creation routine.
void applyOffDiag(multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign, const int cb) const
Apply the even-odd (odd-even) coupling piece of the NEF operator.
void applyDiag(multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign, const int cb) const
Apply the even-even (odd-odd) coupling piece of the domain-wall fermion operator.
void applyDiagInv(multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign, const int cb) const
Apply the inverse even-even (odd-odd) coupling piece of the domain-wall fermion operator.
Linear Operators.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
QDP_error_exit("too many BiCG iterations", n_count, rsd_sq, cp, c, re_rvr, im_rvr, re_a, im_a, re_b, im_b)
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
int cb
Definition: invbicg.cc:120