CHROMA
eoprec_parwilson_linop_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Even-odd preconditioned Wilson fermion linear operator with parity breaking term
4  */
5 
6 #ifndef __prec_parwilson_linop_w_h__
7 #define __prec_parwilson_linop_w_h__
8 
11 
12 
13 namespace Chroma
14 {
15  //! Even-odd preconditioned Wilson fermion linear operator with parity breaking term
16  /*!
17  * \ingroup linop
18  *
19  * This routine is specific to Wilson fermions!
20  *
21  * The kernel for Wilson fermions with a parity breaking term is
22  *
23  * M = (d+M) + i*H*gamma_5 - (1/2) D'
24  */
25 
27  multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >
28  {
29  public:
30  // Typedefs to save typing
31  typedef LatticeFermion T;
32  typedef multi1d<LatticeColorMatrix> P;
33  typedef multi1d<LatticeColorMatrix> Q;
34 
35  //! Partial constructor
37 
38  //! Full constructor
40  const Real& Mass_, const Real& H_)
41  {create(fs,Mass_,H_);}
42 
43  //! Destructor is automatic
45 
46  //! Return the fermion BC object for this linear operator
47  const FermBC<T,P,Q>& getFermBC() const {return D.getFermBC();}
48 
49  //! Creation routine
50  void create(Handle< FermState<T,P,Q> > fs,
51  const Real& Mass_, const Real& H_);
52 
53  //! Apply the the even-even block onto a source std::vector
54  void evenEvenLinOp(LatticeFermion& chi, const LatticeFermion& psi,
55  enum PlusMinus isign) const;
56 
57  //! Apply the inverse of the even-even block onto a source std::vector
58  void evenEvenInvLinOp(LatticeFermion& chi, const LatticeFermion& psi,
59  enum PlusMinus isign) const;
60 
61  //! Apply the the even-odd block onto a source std::vector
62  void evenOddLinOp(LatticeFermion& chi, const LatticeFermion& psi,
63  enum PlusMinus isign) const;
64 
65  //! Apply the the odd-even block onto a source std::vector
66  void oddEvenLinOp(LatticeFermion& chi, const LatticeFermion& psi,
67  enum PlusMinus isign) const;
68 
69  //! Apply the the odd-odd block onto a source std::vector
70  void oddOddLinOp(LatticeFermion& chi, const LatticeFermion& psi,
71  enum PlusMinus isign) const;
72 
73  //! Override inherited one with a few more funkies
74  void operator()(LatticeFermion& chi, const LatticeFermion& psi,
75  enum PlusMinus isign) const;
76 
77  //! Apply the even-even block onto a source std::vector
78  inline
79  void derivEvenEvenLinOp(multi1d<LatticeColorMatrix>& ds_u,
80  const LatticeFermion& chi, const LatticeFermion& psi,
81  enum PlusMinus isign) const
82  {
83  ds_u.resize(Nd);
84  ds_u = zero;
85  }
86 
87  //! Apply the the even-odd block onto a source std::vector
88  void derivEvenOddLinOp(multi1d<LatticeColorMatrix>& ds_u,
89  const LatticeFermion& chi, const LatticeFermion& psi,
90  enum PlusMinus isign) const;
91 
92  //! Apply the the odd-even block onto a source std::vector
93  void derivOddEvenLinOp(multi1d<LatticeColorMatrix>& ds_u,
94  const LatticeFermion& chi, const LatticeFermion& psi,
95  enum PlusMinus isign) const;
96 
97  //! Apply the the odd-odd block onto a source std::vector
98  inline
99  void derivOddOddLinOp(multi1d<LatticeColorMatrix>& ds_u,
100  const LatticeFermion& chi, const LatticeFermion& psi,
101  enum PlusMinus isign) const
102  {
103  ds_u.resize(Nd);
104  ds_u = zero;
105  }
106 
107  //! Return flops performed by the operator()
108  unsigned long nFlops() const;
109 
110  private:
111  Real fact; // tmp holding Nd+Mass
112  Real invfact1; // tmp holding [1/(Nd+Mass)]*[1/(1+H^2/(Nd+Mass)^2)]
113  Real invfact2; // tmp holding H/[(Nd+Mass)^2 + H^2]
114 
115  Real Mass;
116  Real H;
117 // multi1d<LatticeColorMatrix> u;
119  };
120 
121 } // End Namespace Chroma
122 
123 
124 #endif
Even-odd preconditioned linear operator.
Even-odd preconditioned Wilson fermion linear operator with parity breaking term.
void evenEvenInvLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the inverse of the even-even block onto a source std::vector.
void derivEvenEvenLinOp(multi1d< LatticeColorMatrix > &ds_u, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the even-even block onto a source std::vector.
void oddEvenLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the odd-even block onto a source std::vector.
void evenOddLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the even-odd block onto a source std::vector.
void create(Handle< FermState< T, P, Q > > fs, const Real &Mass_, const Real &H_)
Creation routine.
EvenOddPrecParWilsonLinOp(Handle< FermState< T, P, Q > > fs, const Real &Mass_, const Real &H_)
Full constructor.
~EvenOddPrecParWilsonLinOp()
Destructor is automatic.
unsigned long nFlops() const
Return flops performed by the operator()
void derivEvenOddLinOp(multi1d< LatticeColorMatrix > &ds_u, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the even-odd block onto a source std::vector.
void derivOddOddLinOp(multi1d< LatticeColorMatrix > &ds_u, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the odd-odd block onto a source std::vector.
void operator()(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Override inherited one with a few more funkies.
void evenEvenLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the even-even block onto a source std::vector.
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
void derivOddEvenLinOp(multi1d< LatticeColorMatrix > &ds_u, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the odd-even block onto a source std::vector.
void oddOddLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the odd-odd block onto a source std::vector.
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.
Definition: lwldslash_w.h:48
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
Definition: lwldslash_w.h:92
Include possibly optimized Wilson dslash.
Preconditioned 4D Linop with Gauge Independent Even-Even part.
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
Double zero
Definition: invbicg.cc:106