CHROMA
unprec_dwftransf_linop_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Unpreconditioned Wilson fermion linear operator
4  */
5 
6 #ifndef __unprec_dwftransf_linop_w_h__
7 #define __unprec_dwftransf_linop_w_h__
8 
9 #include "linearop.h"
10 #include "handle.h"
13 
14 
15 namespace Chroma
16 {
17  //! Apply gamma_5 * H_T
18  /*!
19  * where
20  * H_T = (b5 + c5) H_w * ( 2 + (b5 + c5) D_w )^(-1)
21  * = (b5 + c5) ( 2 + (b5 + c5) D_w^dag )^(-1) * H_w
22  */
23  class UnprecDWFTransfLinOp : public UnprecLinearOperator<LatticeFermion,
24  multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >
25  {
26  public:
27  // Typedefs to save typing
28  typedef LatticeFermion T;
29  typedef multi1d<LatticeColorMatrix> P;
30  typedef multi1d<LatticeColorMatrix> Q;
31 
32  //! Partial constructor
34 
35  //! Full constructor
37  const Real& Mass_,
38  const Real& b5_,
39  const Real& c5_,
40  const SysSolverCGParams& invParam_)
41  {create(fs,Mass_, b5_, c5_, invParam_);}
42 
43  //! Destructor is automatic
45 
46  //! Only defined on the entire lattice
47  const Subset& subset() const {return all;}
48 
49  //! Creation routine
50  void create(Handle< FermState<T,P,Q> > fs,
51  const Real& Mass_,
52  const Real& b5_,
53  const Real& c5_,
54  const SysSolverCGParams& invParam_);
55 
56  //! Apply the operator onto a source std::vector
57  void operator() (LatticeFermion& chi, const LatticeFermion& psi, enum PlusMinus isign) const;
58 
59  //! Return the fermion BC object for this linear operator
60  const FermBC<T,P,Q>& getFermBC() const {return *fbc;}
61 
62  private:
63  Real Mass;
64  Real b5;
65  Real c5;
70  };
71 
72 
73  //! Apply H_T * H_T
74  /*!
75  * where
76  * H_T^2 = (b5 + c5)^2 * H_w * [( 2 + (b5 + c5) D_w^dag )*( 2 + (b5 + c5) D_w )]^(-1) * H_w
77  */
78  class UnprecDWFTransfMdagMLinOp : public UnprecLinearOperator<LatticeFermion,
79  multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >
80  {
81  public:
82  // Typedefs to save typing
83  typedef LatticeFermion T;
84  typedef multi1d<LatticeColorMatrix> P;
85  typedef multi1d<LatticeColorMatrix> Q;
86 
87  //! Partial constructor
89 
90  //! Full constructor
92  const Real& Mass_,
93  const Real& b5_,
94  const Real& c5_,
95  const SysSolverCGParams& invParam_)
96  {create(fs, Mass_, b5_, c5_, invParam_);}
97 
98  //! Destructor is automatic
100 
101  //! Only defined on the entire lattice
102  const Subset& subset() const {return all;}
103 
104  //! Return the fermion BC object for this linear operator
105  const FermBC<T,P,Q>& getFermBC() const {return *fbc;}
106 
107  //! Creation routine
108  void create(Handle< FermState<T,P,Q> > fs,
109  const Real& Mass_,
110  const Real& b5_,
111  const Real& c5_,
112  const SysSolverCGParams& invParam_);
113 
114  //! Apply the operator onto a source std::vector
115  void operator() (LatticeFermion& chi, const LatticeFermion& psi, enum PlusMinus isign) const;
116 
117 
118  private:
119  Real Mass;
120  Real b5;
121  Real c5;
126  };
127 
128 
129 
130  //! Operator to apply the denominator
131  /*!
132  * ( 2 + (b5 - c5) D )
133  */
134  class UnprecDWFTransfDenLinOp : public LinearOperator<LatticeFermion>
135  {
136  public:
137  //! Partial constructor
139 
140  //! Full constructor
141  UnprecDWFTransfDenLinOp(const Real& b5_minus_c5_,
142  const Handle<LinearOperator<LatticeFermion> > D_w_ )
143  : b5_minus_c5(b5_minus_c5_), D_w(D_w_) {}
144 
145 
146  //! Destructor is automatic
148 
149  //! Only defined on the entire lattice
150  const Subset& subset() const {return all;}
151 
152  //! Apply the operator onto a source std::vector
153  void operator() (LatticeFermion& chi, const LatticeFermion& psi, enum PlusMinus isign) const
154  {
155  // Apply chi ( 2 + (b5-c5) D_w ) psi
156  (*D_w)(chi, psi, isign);
157  chi *= b5_minus_c5;
158  chi += Real(2)*psi;
159  }
160 
161 
162  private:
165  };
166 
167 } // End Namespace Chroma
168 
169 
170 
171 #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
Linear Operator.
Definition: linearop.h:27
Operator to apply the denominator.
Handle< LinearOperator< LatticeFermion > > D_w
void operator()(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the operator onto a source std::vector.
~UnprecDWFTransfDenLinOp()
Destructor is automatic.
UnprecDWFTransfDenLinOp(const Real &b5_minus_c5_, const Handle< LinearOperator< LatticeFermion > > D_w_)
Full constructor.
const Subset & subset() const
Only defined on the entire lattice.
UnprecDWFTransfLinOp()
Partial constructor.
void operator()(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the operator onto a source std::vector.
Handle< FermBC< T, P, Q > > fbc
multi1d< LatticeColorMatrix > P
Handle< LinearOperator< LatticeFermion > > D_denum
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
UnprecDWFTransfLinOp(Handle< FermState< T, P, Q > > fs, const Real &Mass_, const Real &b5_, const Real &c5_, const SysSolverCGParams &invParam_)
Full constructor.
void create(Handle< FermState< T, P, Q > > fs, const Real &Mass_, const Real &b5_, const Real &c5_, const SysSolverCGParams &invParam_)
Creation routine.
multi1d< LatticeColorMatrix > Q
Handle< LinearOperator< LatticeFermion > > D_w
~UnprecDWFTransfLinOp()
Destructor is automatic.
const Subset & subset() const
Only defined on the entire lattice.
UnprecDWFTransfMdagMLinOp(Handle< FermState< T, P, Q > > fs, const Real &Mass_, const Real &b5_, const Real &c5_, const SysSolverCGParams &invParam_)
Full constructor.
~UnprecDWFTransfMdagMLinOp()
Destructor is automatic.
Handle< LinearOperator< LatticeFermion > > D_denum
const Subset & subset() const
Only defined on the entire lattice.
Handle< LinearOperator< LatticeFermion > > D_w
void create(Handle< FermState< T, P, Q > > fs, const Real &Mass_, const Real &b5_, const Real &c5_, const SysSolverCGParams &invParam_)
Creation routine.
void operator()(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the operator onto a source std::vector.
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
Unpreconditioned linear operator including derivatives.
Definition: linearop.h:185
Class for counted reference semantics.
Linear Operators.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
Params for CG inverter.
Solve a CG1 system.
Unpreconditioned Wilson fermion linear operator.