CHROMA
lwldslash_base_array_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Wilson Dslash linear operator over arrays
4  */
5 
6 #ifndef __lwldslash_base_array_h__
7 #define __lwldslash_base_array_h__
8 
9 #include "linearop.h"
10 #include "io/aniso_io.h"
11 
12 
13 namespace Chroma
14 {
15  //! General Wilson-Dirac dslash over arrays
16  /*!
17  * \ingroup linop
18  *
19  * DSLASH
20  *
21  * This routine is specific to Wilson fermions!
22  *
23  * Description:
24  *
25  * This routine applies the operator D' to Psi, putting the result in Chi.
26  *
27  * Nd-1
28  * ---
29  * \
30  * chi(x) := > U (x) (1 - isign gamma ) psi(x+mu)
31  * / mu mu
32  * ---
33  * mu=0
34  *
35  * Nd-1
36  * ---
37  * \ +
38  * + > U (x-mu) (1 + isign gamma ) psi(x-mu)
39  * / mu mu
40  * ---
41  * mu=0
42  *
43  */
44 
45  class WilsonDslashBaseArray : public DslashLinearOperatorArray<LatticeFermion,
46  multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >
47  {
48  public:
49  // Typedefs to save typing
50  typedef LatticeFermion T;
51  typedef multi1d<LatticeColorMatrix> P;
52  typedef multi1d<LatticeColorMatrix> Q;
53 
54  //! No real need for cleanup here
56 
57  //! Subset is all here
58  const Subset& subset() const {return all;}
59 
60  /**
61  * Apply a std::vector dslash
62  *
63  * \param chi result (Write)
64  * \param psi source (Read)
65  * \param isign D'^dag or D' ( MINUS | PLUS ) resp. (Read)
66  * \param cb Checkerboard of OUTPUT std::vector (Read)
67  *
68  * \return The output of applying dslash on psi
69  */
70  virtual void apply (multi1d<LatticeFermion>& chi,
71  const multi1d<LatticeFermion>& psi,
72  enum PlusMinus isign, int cb) const = 0;
73 
74  /**
75  * Apply a dslash
76  *
77  * \param chi result (Write)
78  * \param psi source (Read)
79  * \param isign D'^dag or D' ( MINUS | PLUS ) resp. (Read)
80  * \param cb Checkerboard of OUTPUT std::vector (Read)
81  *
82  * \return The output of applying dslash on psi
83  */
84  virtual void apply (LatticeFermion& chi,
85  const LatticeFermion& psi,
86  enum PlusMinus isign, int cb) const = 0;
87 
88  //! Take deriv of D
89  /*!
90  * \param chi left std::vector (Read)
91  * \param psi right std::vector (Read)
92  * \param isign D'^dag or D' ( MINUS | PLUS ) resp. (Read)
93  *
94  * \return Computes \f$\chi^\dag * \dot(D} * \psi\f$
95  */
96  virtual void deriv(multi1d<LatticeColorMatrix>& ds_u,
97  const multi1d<LatticeFermion>& chi,
98  const multi1d<LatticeFermion>& psi,
99  enum PlusMinus isign) const;
100 
101 
102  //! Take deriv of D
103  /*!
104  * \param chi left std::vector on cb (Read)
105  * \param psi right std::vector on 1-cb (Read)
106  * \param isign D'^dag or D' ( MINUS | PLUS ) resp. (Read)
107  * \param cb Checkerboard of chi std::vector (Read)
108  *
109  * \return Computes \f$\chi^\dag * \dot(D} * \psi\f$
110  */
111  virtual void deriv(multi1d<LatticeColorMatrix>& ds_u,
112  const multi1d<LatticeFermion>& chi,
113  const multi1d<LatticeFermion>& psi,
114  enum PlusMinus isign, int cb) const;
115 
116  //! Take deriv of D
117  /*!
118  * \param chi left std::vector (Read)
119  * \param psi right std::vector (Read)
120  * \param isign D'^dag or D' ( MINUS | PLUS ) resp. (Read)
121  * \param cb Checkerboard of chi std::vector (Read)
122  *
123  * \return Computes \f$\chi^\dag * \dot(D} * \psi\f$
124  */
125  virtual void deriv(multi1d<LatticeColorMatrix>& ds_u,
126  const LatticeFermion& chi,
127  const LatticeFermion& psi,
128  enum PlusMinus isign, int cb) const;
129 
130  //! Return flops performed by the operator()
131  unsigned long nFlops() const;
132 
133  //! Return the fermion BC object for this linear operator
134  virtual const FermBC<T,P,Q>& getFermBC() const = 0;
135 
136  protected:
137  //! Get the anisotropy parameters
138  virtual const multi1d<Real>& getCoeffs() const = 0;
139 
140  };
141 
142 
143 } // End Namespace Chroma
144 
145 
146 #endif
Anisotropy parameters.
Dslash-like Linear Operator for arrays.
Definition: linearop.h:315
Base class for all fermion action boundary conditions.
Definition: fermbc.h:20
General Wilson-Dirac dslash over arrays.
unsigned long nFlops() const
Return flops performed by the operator()
virtual ~WilsonDslashBaseArray()
No real need for cleanup here.
const Subset & subset() const
Subset is all here.
virtual const multi1d< Real > & getCoeffs() const =0
Get the anisotropy parameters.
virtual void apply(multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign, int cb) const =0
virtual const FermBC< T, P, Q > & getFermBC() const =0
Return the fermion BC object for this linear operator.
virtual void apply(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign, int cb) const =0
virtual void deriv(multi1d< LatticeColorMatrix > &ds_u, const multi1d< LatticeFermion > &chi, const multi1d< LatticeFermion > &psi, enum PlusMinus isign) const
Take deriv of D.
multi1d< LatticeColorMatrix > Q
multi1d< LatticeColorMatrix > P
Linear Operators.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
int cb
Definition: invbicg.cc:120