CHROMA
eoprec_clover_linop_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Even-odd preconditioned Clover fermion linear operator
4  */
5 
6 #ifndef __prec_clover_linop_w_h__
7 #define __prec_clover_linop_w_h__
8 
9 #include "state.h"
10 #include "fermbc.h"
11 #include "eoprec_logdet_linop.h"
15 
16 
17 namespace Chroma
18 {
19  //! 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  QDPIO::cout << "CLOV_LINOP: Time spent in clov deriv (total) = " << clov_deriv_time << std::endl;
51  QDPIO::cout << "CLOV_LINOP: Time spent in clov apply/invapply (total) = " << clov_apply_time << std::endl;
52 
53  }
54 
55  //! Return the fermion BC object for this linear operator
56  const FermBC<T,P,Q>& getFermBC() const {return D.getFermBC();}
57 
58  //! Creation routine
59  void create(Handle< FermState<T,P,Q> > fs,
60  const CloverFermActParams& param_);
61 
62  //! Apply the the even-even block onto a source std::vector
63  void evenEvenLinOp(LatticeFermion& chi, const LatticeFermion& psi,
64  enum PlusMinus isign) const;
65 
66  //! Apply the inverse of the even-even block onto a source std::vector
67  void evenEvenInvLinOp(LatticeFermion& chi, const LatticeFermion& psi,
68  enum PlusMinus isign) const;
69 
70  //! Apply the the even-odd block onto a source std::vector
71  void evenOddLinOp(LatticeFermion& chi, const LatticeFermion& psi,
72  enum PlusMinus isign) const;
73 
74  //! Apply the the odd-even block onto a source std::vector
75  void oddEvenLinOp(LatticeFermion& chi, const LatticeFermion& psi,
76  enum PlusMinus isign) const;
77 
78  //! Apply the the odd-odd block onto a source std::vector
79  void oddOddLinOp(LatticeFermion& chi, const LatticeFermion& psi,
80  enum PlusMinus isign) const;
81 
82  // Override inherited one with a few more funkies
83  void operator()(LatticeFermion& chi, const LatticeFermion& psi,
84  enum PlusMinus isign) const;
85 
86  //! Apply the even-even block onto a source std::vector
87  void derivEvenEvenLinOp(multi1d<LatticeColorMatrix>& ds_u,
88  const LatticeFermion& chi, const LatticeFermion& psi,
89  enum PlusMinus isign) const;
90 
91  //! Apply the even-even block onto a source std::vector
92  void derivEvenEvenLinOpMP(multi1d<LatticeColorMatrix>& ds_u,
93  const multi1d<LatticeFermion>& chi, const multi1d<LatticeFermion>& psi,
94  enum PlusMinus isign) const;
95 
96  void derivLogDetEvenEvenLinOp(multi1d<LatticeColorMatrix>& ds_u,
97  enum PlusMinus isign) const;
98 
99  //! Apply the the even-odd block onto a source std::vector
100  void derivEvenOddLinOp(multi1d<LatticeColorMatrix>& ds_u,
101  const LatticeFermion& chi, const LatticeFermion& psi,
102  enum PlusMinus isign) const;
103 
104  //! Apply the the odd-even block onto a source std::vector
105  void derivOddEvenLinOp(multi1d<LatticeColorMatrix>& ds_u,
106  const LatticeFermion& chi, const LatticeFermion& psi,
107  enum PlusMinus isign) const;
108 
109  //! Apply the the odd-odd block onto a source std::vector
110  void derivOddOddLinOp(multi1d<LatticeColorMatrix>& ds_u,
111  const LatticeFermion& chi, const LatticeFermion& psi,
112  enum PlusMinus isign) const;
113 
114  void derivOddOddLinOpMP(multi1d<LatticeColorMatrix>& ds_u,
115  const multi1d<LatticeFermion>& chi, const multi1d<LatticeFermion>& psi,
116  enum PlusMinus isign) const;
117 
118  //! Return flops performed by the operator()
119  unsigned long nFlops() const;
120 
121  //! Get the log det of the even even part
122  Double logDetEvenEvenLinOp(void) const;
123 
124  private:
128  CloverTerm invclov; // uggh, only needed for evenEvenLinOp
129  mutable double clov_apply_time;
130  mutable double clov_deriv_time;
131  mutable StopWatch swatch;
132  };
133 
134 
135 
136 } // End Namespace Chroma
137 
138 
139 #endif
Even-odd preconditioned Clover-Dirac operator.
void derivLogDetEvenEvenLinOp(multi1d< LatticeColorMatrix > &ds_u, enum PlusMinus isign) const
Apply 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.
unsigned long nFlops() const
Return flops performed by the operator()
~EvenOddPrecCloverLinOp()
Destructor is automatic.
void oddOddLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the odd-odd block onto a source std::vector.
multi1d< LatticeColorMatrix > Q
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.
EvenOddPrecCloverLinOp(Handle< FermState< T, P, Q > > fs, const CloverFermActParams &param_)
Full constructor.
void oddEvenLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the the odd-even block onto a source std::vector.
void derivOddOddLinOpMP(multi1d< LatticeColorMatrix > &ds_u, const multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign) const
multi1d< LatticeColorMatrix > P
void create(Handle< FermState< T, P, Q > > fs, const CloverFermActParams &param_)
Creation routine.
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.
EvenOddPrecCloverLinOp()
Partial constructor.
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 operator()(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply even-odd preconditioned Clover fermion linear 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.
Double logDetEvenEvenLinOp(void) const
Get the log det of the even even part.
void derivEvenEvenLinOpMP(multi1d< LatticeColorMatrix > &ds_u, const multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign) const
Apply 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 evenEvenInvLinOp(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the inverse of the even-even block onto a source std::vector.
Even-odd preconditioned linear operator.
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
Parameters for Clover fermion action.
Include possibly optimized Clover terms.
Include possibly optimized Wilson dslash.
Preconditioned Linear Operators where the Even Even part depends on the gauge field.
Fermion action boundary conditions.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
FloatingPoint< double > Double
Definition: gtest.h:7351
Support class for fermion actions and linear operators.
Params for clover ferm acts.