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