CHROMA
lovlapms_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Internal Overlap-pole operator
4  */
5 
6 #ifndef __lovlapms_w_h__
7 #define __lovlapms_w_h__
8 
9 #include "linearop.h"
11 
12 
13 
14 namespace Chroma
15 {
16  //! Internal Overlap-pole operator
17  /*!
18  * \ingroup linop
19  *
20  * This routine is specific to Wilson fermions!
21  *
22  * Chi = (1/2)*((1+m_q) + (1-m_q) * gamma_5 * B) . Psi
23  * where B is the pole approx. to eps(H(m))
24  *
25  * Internally, it computes
26  * Chi = ((1+m_q)/(1-m_q) + gamma_5 * B) . Psi
27  * and then rescales at the end to the correct normalization
28  *
29  * NOTE: B is hermitian, so
30  * (1 + gamma_5 * B)^dag = (1 + B * gamma_5)
31  * = gamma_5 * (1 + gamma_5 * B) * gamma_5
32  */
33 
34  class lovlapms : public UnprecLinearOperator<LatticeFermion,
35  multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >
36  {
37  public:
38  // Typedefs to save typing
39  typedef LatticeFermion T;
40  typedef multi1d<LatticeColorMatrix> P;
41  typedef multi1d<LatticeColorMatrix> Q;
42 
43  //! Creation routine
44  /*!
45  * \ingroup linop
46  *
47  * \param _MdagM M^dag.M of underlying linop M (Read)
48  * \param _M Underlying linop M (Read)
49  * \param _m_q quark mass (Read)
50  * \param _numroot number of poles in expansion (Read)
51  * \param _constP constant coeff (Read)
52  * \param _resP numerator (Read)
53  * \param _rootQ denom (Read)
54  * \param _OperEigVec eigenvectors (Read)
55  * \param _EigValFunc eigenvalues (Read)
56  * \param _NEig number of eigenvalues (Read)
57  * \param _MaxCG MaxCG inner CG (Read)
58  * \param _RsdCG residual for inner CG (Read)
59  */
62  const Real& _m_q, int _numroot,
63  const Real& _constP,
64  const multi1d<Real>& _resP,
65  const multi1d<Real>& _rootQ,
66  int _NEig,
67  const multi1d<Real>& _EigValFunc,
68  const multi1d<LatticeFermion>& _EigVec,
69  int _MaxCG,
70  const Real& _RsdCG,
71  const int _ReorthFreq ) :
72  M(S_aux.linOp(state)), MdagM(S_aux.lMdagM(state)), fbc(state->getFermBC()),
73  m_q(_m_q), numroot(_numroot), constP(_constP),
74  resP(_resP), rootQ(_rootQ), EigVec(_EigVec), EigValFunc(_EigValFunc),
75  NEig(_NEig), MaxCG(_MaxCG), RsdCG(_RsdCG), ReorthFreq(_ReorthFreq) {}
76 
77  //! Destructor is automatic
78  ~lovlapms() {}
79 
80  //! Only defined on the entire lattice
81  const Subset& subset() const {return all;}
82 
83  //! Apply the operator onto a source std::vector
84  void operator() (LatticeFermion& chi, const LatticeFermion& psi, enum PlusMinus isign) const;
85 
86  //! Apply the operator onto a source std::vector
87  //! but to specified accuracy. In this case epsilon is the accuracy
88  //! (RsdCG) for the multi shift solve
89  void operator() (LatticeFermion& chi, const LatticeFermion& psi, enum PlusMinus isign, Real epsilon) const;
90 
91  //! Return the fermion BC object for this linear operator
92  const FermBC<T,P,Q>& getFermBC() const {return *fbc;}
93 
94  private:
98 
99  // Copy all of these rather than reference them.
100  const Real m_q;
101  int numroot;
102  const Real constP;
103  const multi1d<Real> resP;
104  const multi1d<Real> rootQ;
105  const multi1d<LatticeFermion> EigVec;
106  const multi1d<Real> EigValFunc;
107  int NEig;
108  int MaxCG;
109  const Real RsdCG;
110  const int ReorthFreq;
111  };
112 
113 
114 } // End Namespace Chroma
115 
116 
117 #endif
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
Unpreconditioned linear operator including derivatives.
Definition: linearop.h:185
Unpreconditioned Wilson-like fermion actions with derivatives.
Definition: fermact.orig.h:491
Internal Overlap-pole operator.
Definition: lovlapms_w.h:36
const Subset & subset() const
Only defined on the entire lattice.
Definition: lovlapms_w.h:81
const Real m_q
Definition: lovlapms_w.h:100
LatticeFermion T
Definition: lovlapms_w.h:39
const multi1d< LatticeFermion > EigVec
Definition: lovlapms_w.h:105
Handle< FermBC< T, P, Q > > fbc
Definition: lovlapms_w.h:97
const Real constP
Definition: lovlapms_w.h:102
multi1d< LatticeColorMatrix > P
Definition: lovlapms_w.h:40
multi1d< LatticeColorMatrix > Q
Definition: lovlapms_w.h:41
Handle< DiffLinearOperator< T, P, Q > > MdagM
Definition: lovlapms_w.h:96
const multi1d< Real > EigValFunc
Definition: lovlapms_w.h:106
const multi1d< Real > resP
Definition: lovlapms_w.h:103
~lovlapms()
Destructor is automatic.
Definition: lovlapms_w.h:78
Handle< DiffLinearOperator< T, P, Q > > M
Definition: lovlapms_w.h:95
const int ReorthFreq
Definition: lovlapms_w.h:110
const Real RsdCG
Definition: lovlapms_w.h:109
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
Definition: lovlapms_w.h:92
void operator()(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the operator onto a source std::vector.
Definition: lovlapms_w.cc:13
const multi1d< Real > rootQ
Definition: lovlapms_w.h:104
lovlapms(const UnprecWilsonTypeFermAct< T, P, Q > &S_aux, Handle< FermState< T, P, Q > > state, const Real &_m_q, int _numroot, const Real &_constP, const multi1d< Real > &_resP, const multi1d< Real > &_rootQ, int _NEig, const multi1d< Real > &_EigValFunc, const multi1d< LatticeFermion > &_EigVec, int _MaxCG, const Real &_RsdCG, const int _ReorthFreq)
Creation routine.
Definition: lovlapms_w.h:60
Linear Operators.
int epsilon(int i, int j, int k)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
Wilson-like fermion actions.