CHROMA
wilstype_fermact_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*! @file
4  * @brief Wilson-like fermion actions
5  */
6 
7 #ifndef __wilstype_fermact_w_h__
8 #define __wilstype_fermact_w_h__
9 
10 #include "fermact.h"
11 #include "eoprec_linop.h"
12 
13 namespace Chroma
14 {
15 
16  //-------------------------------------------------------------------------------------------
17  //! Wilson-like fermion actions
18  /*! @ingroup actions
19  *
20  * Wilson-like fermion actions
21  */
22  template<typename T, typename P, typename Q>
23  class WilsonTypeFermAct : public DiffFermAct4D<T,P,Q>
24  {
25  public:
26  //! Virtual destructor to help with cleanup;
27  virtual ~WilsonTypeFermAct() {}
28 
29  //! Produce a linear operator M^dag.M for this action
30  /*! Default implementation */
32  {
33  return new DiffMdagMLinOp<T,P,Q>(this->linOp(state));
34  }
35 
36  //! Produce a hermitian version of the linear operator
38 
39  //! Return a linear operator solver for this action to solve M*psi=chi
40  /*! Default implementation */
42  const GroupXML_t& invParam) const;
43 
44  //! Return a linear operator solver for this action to solve MdagM*psi=chi
45  /*! Default implementation */
47  const GroupXML_t& invParam) const;
48 
49  //! Return a multi-shift linear operator solver for this action to solve (M+shift)*psi=chi
50  /*! Default implementation */
52  const GroupXML_t& invParam) const;
53 
54  //! Return a multi-shift linear operator solver for this action to solve (MdagM+shift)*psi=chi
55  /*! Default implementation */
57  const GroupXML_t& invParam) const;
58 
59  /*! Default implementation */
61  const GroupXML_t& invParam) const;
62 
63  //! Given a complete propagator as a source, this does all the inversions needed
64  /*!
65  * Provides a default version
66  *
67  * \param q_sol quark propagator ( Write )
68  * \param q_src source ( Read )
69  * \param xml_out diagnostic output ( Modify )
70  * \param state gauge connection state ( Read )
71  * \param invParam inverter parameters ( Read )
72  * \param quarkSpinType compute only a non-relativistic prop ( Read )
73  * \param ncg_had number of solver iterations ( Write )
74  */
75  virtual void quarkProp(typename PropTypeTraits<T>::Type_t& q_sol,
76  XMLWriter& xml_out,
77  const typename PropTypeTraits<T>::Type_t& q_src,
79  const GroupXML_t& invParam,
80  QuarkSpinType quarkSpinType,
81  int& ncg_had) const;
82  };
83 
84 
85  //-------------------------------------------------------------------------------------------
86  //! Wilson-like fermion actions
87  /*! @ingroup actions
88  *
89  * Wilson-like fermion actions
90  */
91  template<typename T, typename P, typename Q>
92  class WilsonTypeFermAct5D : public DiffFermAct5D<T,P,Q>
93  {
94  public:
95  //! Virtual destructor to help with cleanup;
96  virtual ~WilsonTypeFermAct5D() {}
97 
98  //! Produce a linear operator M^dag.M for this action
99  /*! Default implementation */
101  {
102  return new DiffMdagMLinOpArray<T,P,Q>(this->linOp(state));
103  }
104 
105  //! Produce a hermitian version of the linear operator
107 
108  //! Return a linear operator solver for this action to solve M*psi=chi
109  /*! Default implementation provided */
111  const GroupXML_t& invParam) const;
112 
113  //! Return a linear operator solver for this action to solve MdagM*psi=chi
114  /*! Default implementation provided */
116  const GroupXML_t& invParam) const;
117 
118  //! Return a linear operator solver for this action to solve PV*psi=chi
119  /*!
120  * Default implementation provided
121  *
122  * Do we need this critter?
123  */
125  const GroupXML_t& invParam) const;
126 
127  //! Return a linear operator solver for this action to solve PV^dag*PV*psi=chi
128  /*! Default implementation provided */
130  const GroupXML_t& invParam) const;
131 
132  //! Return a multi-shift linear operator solver for this action to solve (MdagM+shift)*psi=chi
133  /*! Default implementation provided */
135  const GroupXML_t& invParam) const;
136 
137  //! Return a multi-shift linear operator solver for this action to solve (MdagM+shift)*psi=chi
138  /*! Default implementation provided */
140  const GroupXML_t& invParam) const;
141 
142 
143  //! Return a multi-shift linear operator solver for this action to solve (MdagM+shift)*psi=chi
144  /*! Default implementation provided */
146  const GroupXML_t& invParam) const;
147 
148  //! Return a multi-shift linear operator solver for this action to solve (PV^dag*PV+shift)*psi=chi
149  /*! Default implementation provided */
151  const GroupXML_t& invParam) const;
152 
153  //! Produce an unpreconditioned linear operator projecting 5D to 4D (the inverse of qprop below)
155  const Real& m_q,
156  const GroupXML_t& invParam) const = 0;
157 
158  //! Produce a DeltaLs = 1-epsilon^2(H) operator
160  const GroupXML_t& invParam) const = 0;
161 
162  //! Given a complete propagator as a source, this does all the inversions needed
163  /*!
164  * Provides a default version
165  *
166  * \param q_sol quark propagator ( Write )
167  * \param q_src source ( Read )
168  * \param xml_out diagnostic output ( Modify )
169  * \param state gauge connection state ( Read )
170  * \param invParam inverter parameters ( Read )
171  * \param quarkSpinType compute only a non-relativistic prop ( Read )
172  * \param ncg_had number of solver iterations ( Write )
173  */
174  virtual void quarkProp(typename PropTypeTraits<T>::Type_t& q_sol,
175  XMLWriter& xml_out,
176  const typename PropTypeTraits<T>::Type_t& q_src,
178  const GroupXML_t& invParam,
179  QuarkSpinType quarkSpinType,
180  int& ncg_had) const;
181  };
182 
183 
184 
185 
186 
187 
188 
189 }
190 
191 #endif
Base class for quadratic matter actions (e.g., fermions)
Definition: fermact.h:224
virtual DiffLinearOperator< T, Q, P > * linOp(Handle< FermState< T, P, Q > > state) const =0
Produce a linear operator for this action.
Base class of quadratic matter actions (e.g., fermions) living in an extra dimension.
Definition: fermact.h:344
virtual DiffLinearOperatorArray< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const =0
Produce a linear operator for this action.
Differentiable Linear Operator.
Definition: linearop.h:150
Differentiable Linear Operator.
Definition: linearop.h:98
M^dag.M linear operator over arrays.
Definition: lmdagm.h:247
Differentiable M^dag.M linear operator.
Definition: lmdagm.h:160
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
SystemSolver disambiguator.
SystemSolver disambiguator.
Linear Operator to arrays.
Definition: linearop.h:61
Linear Operator.
Definition: linearop.h:27
SystemSolver disambiguator.
SystemSolver disambiguator.
Wilson-like fermion actions.
Definition: fermact.orig.h:403
virtual MdagMMultiSystemSolverArray< T > * mInvMdagM(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a multi-shift linear operator solver for this action to solve (MdagM+shift)*psi=chi.
virtual LinearOperatorArray< T > * hermitianLinOp(Handle< FermState< T, P, Q > > state) const =0
Produce a hermitian version of the linear operator.
virtual MdagMMultiSystemSolverAccumulateArray< T > * mInvMdagMPVAcc(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a multi-shift linear operator solver for this action to solve (PV^dag*PV+shift)*psi=chi.
virtual LinearOperator< T > * DeltaLs(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const =0
Produce a DeltaLs = 1-epsilon^2(H) operator.
virtual LinOpSystemSolverArray< T > * invLinOpPV(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a linear operator solver for this action to solve PV*psi=chi.
virtual void quarkProp(typename PropTypeTraits< T >::Type_t &q_sol, XMLWriter &xml_out, const typename PropTypeTraits< T >::Type_t &q_src, Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam, QuarkSpinType quarkSpinType, int &ncg_had) const
Given a complete propagator as a source, this does all the inversions needed.
virtual MdagMMultiSystemSolverAccumulateArray< T > * mInvMdagMAcc(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a multi-shift linear operator solver for this action to solve (MdagM+shift)*psi=chi.
virtual MdagMSystemSolverArray< T > * invMdagM(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a linear operator solver for this action to solve MdagM*psi=chi.
virtual ~WilsonTypeFermAct5D()
Virtual destructor to help with cleanup;.
virtual MdagMSystemSolverArray< T > * invMdagMPV(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a linear operator solver for this action to solve PV^dag*PV*psi=chi.
virtual LinearOperator< T > * linOp4D(Handle< FermState< T, P, Q > > state, const Real &m_q, const GroupXML_t &invParam) const =0
Produce an unpreconditioned linear operator projecting 5D to 4D (the inverse of qprop below)
virtual MdagMMultiSystemSolverArray< T > * mInvMdagMPV(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a multi-shift linear operator solver for this action to solve (MdagM+shift)*psi=chi.
virtual LinOpSystemSolverArray< T > * invLinOp(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a linear operator solver for this action to solve M*psi=chi.
virtual DiffLinearOperatorArray< T, P, Q > * lMdagM(Handle< FermState< T, P, Q > > state) const
Produce a linear operator M^dag.M for this action.
Wilson-like fermion actions.
Definition: fermact.orig.h:344
virtual ~WilsonTypeFermAct()
Virtual destructor to help with cleanup;.
virtual LinOpMultiSystemSolver< T > * mInvLinOp(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a multi-shift linear operator solver for this action to solve (M+shift)*psi=chi.
virtual DiffLinearOperator< T, P, Q > * lMdagM(Handle< FermState< T, P, Q > > state) const
Produce a linear operator M^dag.M for this action.
virtual MdagMMultiSystemSolver< T > * mInvMdagM(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a multi-shift linear operator solver for this action to solve (MdagM+shift)*psi=chi.
virtual MdagMMultiSystemSolverAccumulate< T > * mInvMdagMAcc(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
virtual void quarkProp(typename PropTypeTraits< T >::Type_t &q_sol, XMLWriter &xml_out, const typename PropTypeTraits< T >::Type_t &q_src, Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam, QuarkSpinType quarkSpinType, int &ncg_had) const
Given a complete propagator as a source, this does all the inversions needed.
virtual MdagMSystemSolver< T > * invMdagM(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a linear operator solver for this action to solve MdagM*psi=chi.
virtual LinOpSystemSolver< T > * invLinOp(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a linear operator solver for this action to solve M*psi=chi.
virtual LinearOperator< T > * hermitianLinOp(Handle< FermState< T, P, Q > > state) const =0
Produce a hermitian version of the linear operator.
Base class for even-odd preconditioned 4D and 5D Linop.
Class structure for fermion actions.
QuarkSpinType
Quark spin type.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
Hold group xml and type id.
SystemSolver disambiguator.
SystemSolver disambiguator.