CHROMA
seoprec_clover_linop_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Symmetric even-odd preconditioned Clover fermion linear operator
4  */
5 
6 #ifndef __seoprec_clover_linop_w_h__
7 #define __seoprec_clover_linop_w_h__
8 
9 #include "state.h"
10 #include "fermbc.h"
11 #include "seoprec_logdet_linop.h"
15 
16 
17 namespace Chroma
18 {
19  //! Symmetric even-odd preconditioned Clover-Dirac operator
20  /*!
21  * \ingroup linop
22  *
23  * This routine is specific to Wilson fermions!
24  *
25  * The kernel for Clover fermions is
26  *
27  * M = A + (d+M) - (1/2) D'
28  */
30  multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >
31  {
32  public:
33  // Typedefs to save typing
34  typedef LatticeFermion T;
35  typedef multi1d<LatticeColorMatrix> P;
36  typedef multi1d<LatticeColorMatrix> Q;
37 
38  //! Partial constructor
40 
41  //! Full constructor
43  const CloverFermActParams& param_)
44  {
45  create(fs,param_);
46  }
47 
48  //! Destructor is automatic
50  }
51 
52  //! Return the fermion BC object for this linear operator
53  const FermBC<T,P,Q>& getFermBC() const {return D.getFermBC();}
54 
55  //! Creation routine
56  void create(Handle< FermState<T,P,Q> > fs,
57  const CloverFermActParams& param_);
58 
59  //! Apply the the even-even block onto a source std::vector
60  void unprecEvenEvenLinOp(T& chi, const T& psi,
61  enum PlusMinus isign) const;
62 
63  //! Apply the inverse of the even-even block onto a source std::vector
64  void unprecEvenEvenInvLinOp(T& chi, const T& psi,
65  enum PlusMinus isign) const;
66 
67  //! Apply the the odd-odd block onto a source std::vector
68  void unprecOddOddLinOp(T& chi, const T& psi,
69  enum PlusMinus isign) const;
70 
71  //! Apply the inverse of the odd-odd block onto a source std::vector
72  void unprecOddOddInvLinOp(T& chi, const T& psi,
73  enum PlusMinus isign) const;
74 
75  //! Apply the the even-odd block onto a source std::vector
76  void unprecEvenOddLinOp(T& chi, const T& psi,
77  enum PlusMinus isign) const ;
78 
79  //! Apply the the odd-even block onto a source std::vector
80  void unprecOddEvenLinOp(T& chi, const T& psi,
81  enum PlusMinus isign) const ;
82 
83 
84 
85  // Deriv of A_ee
86  virtual void derivUnprecEvenEvenLinOp(P& ds_u, const T& chi, const T& psi,
87  enum PlusMinus isign) const;
88 
89  // Deriv of A_oo
90  virtual void derivUnprecOddOddLinOp(P& ds_u, const T& chi, const T& psi,
91  enum PlusMinus isign) const;
92 
93  // Deriv of D_eo
94  virtual void derivUnprecEvenOddLinOp(P& ds_u, const T& chi, const T& psi,
95  enum PlusMinus isign) const;
96 
97  // Deriv of D_oe
98  virtual void derivUnprecOddEvenLinOp(P& ds_u, const T& chi, const T& psi,
99  enum PlusMinus isign) const;
100 
101  //! Apply the even-even block onto a source std::vector
102  void derivLogDetEvenEvenLinOp(P& ds_u,
103  enum PlusMinus isign) const;
104 
105  //! Apply the odd-odd block onto a source std::vector
106  void derivLogDetOddOddLinOp(P& ds_u,
107  enum PlusMinus isign) const;
108 
109  // Override inherited one with a few more funkies
110  //
111  // Optimized operator() work on it when the category default works.
112  void operator()(T& chi, const T& psi,
113  enum PlusMinus isign) const override;
114 
115  void deriv(P& ds_u, const T& chi, const T& psi,
116  enum PlusMinus isign) const override;
117 
118 
119  //! Deriv
120  void derivMultipole(P& ds_u, const multi1d<T>& chi,
121  const multi1d<T>& psi,
122  enum PlusMinus isign) const override;
123 
124  //! Return flops performed by the operator()
125  unsigned long nFlops() const;
126 
127  //! Get the log det of the even even part
128  Double logDetEvenEvenLinOp(void) const;
129 
130  //! Get the log det of the odd odd part
131  Double logDetOddOddLinOp(void) const;
132 
133  private:
137  CloverTerm invclov; // needed for even-even and odd-odd
138  mutable double clov_apply_time;
139  mutable double clov_deriv_time;
140  mutable StopWatch swatch;
141  };
142 
143 
144 
145 } // End Namespace Chroma
146 
147 
148 #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
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
Symmetric even-odd preconditioned Clover-Dirac operator.
multi1d< LatticeColorMatrix > P
void operator()(T &chi, const T &psi, enum PlusMinus isign) const override
Apply even-odd preconditioned Clover fermion linear operator.
void unprecEvenEvenLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the the even-even block onto a source std::vector.
void unprecOddEvenLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the the odd-even block onto a source std::vector.
Double logDetEvenEvenLinOp(void) const
Get the log det of the even even part.
void derivMultipole(P &ds_u, const multi1d< T > &chi, const multi1d< T > &psi, enum PlusMinus isign) const override
Deriv.
SymEvenOddPrecCloverLinOp()
Partial constructor.
void create(Handle< FermState< T, P, Q > > fs, const CloverFermActParams &param_)
Creation routine.
void unprecOddOddInvLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the inverse of the odd-odd block onto a source std::vector.
void derivLogDetEvenEvenLinOp(P &ds_u, enum PlusMinus isign) const
Apply the even-even block onto a source std::vector.
virtual void derivUnprecEvenEvenLinOp(P &ds_u, const T &chi, const T &psi, enum PlusMinus isign) const
Apply the even-even block onto a source std::vector.
virtual void derivUnprecEvenOddLinOp(P &ds_u, const T &chi, const T &psi, enum PlusMinus isign) const
Apply the the even-odd block onto a source std::vector.
multi1d< LatticeColorMatrix > Q
virtual void derivUnprecOddOddLinOp(P &ds_u, const T &chi, const T &psi, enum PlusMinus isign) const
Apply the the odd-odd block onto a source std::vector.
void derivLogDetOddOddLinOp(P &ds_u, enum PlusMinus isign) const
Apply the odd-odd block onto a source std::vector.
void unprecEvenEvenInvLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the inverse of 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.
SymEvenOddPrecCloverLinOp(Handle< FermState< T, P, Q > > fs, const CloverFermActParams &param_)
Full constructor.
unsigned long nFlops() const
Return flops performed by the operator()
void unprecOddOddLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the the odd-odd block onto a source std::vector.
void unprecEvenOddLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the the even-odd block onto a source std::vector.
Double logDetOddOddLinOp(void) const
Get the log det of the odd odd part.
void deriv(P &ds_u, const T &chi, const T &psi, enum PlusMinus isign) const override
Deriv.
~SymEvenOddPrecCloverLinOp()
Destructor is automatic.
virtual void derivUnprecOddEvenLinOp(P &ds_u, const T &chi, const T &psi, enum PlusMinus isign) const
Apply the the odd-even block onto a source std::vector.
Even-odd preconditioned linear operator.
Parameters for Clover fermion action.
Include possibly optimized Clover terms.
Include possibly optimized Wilson dslash.
Fermion action boundary conditions.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
FloatingPoint< double > Double
Definition: gtest.h:7351
Symmetric preconditioned linear pperators where the even-even and odd-odd parts depends on the gauge ...
Support class for fermion actions and linear operators.
Params for clover ferm acts.
multi1d< LatticeColorMatrix > P
Definition: t_clover.cc:13