CHROMA
ovlap_partfrac4d_fermact_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*! \file
4  * \brief 4D Zolotarev variant of Overlap-Dirac operator
5  */
6 
7 #ifndef __ovlap_partfrac4d_fermact_w_h__
8 #define __ovlap_partfrac4d_fermact_w_h__
9 
12 #include "meas/eig/eig_w.h"
13 // #include "io/overlap_state_info.h"
14 #include "io/enum_io/enum_io.h"
15 
16 
17 namespace Chroma
18 {
19  //! Name and registration
20  /*! \ingroup fermacts */
21  namespace OvlapPartFrac4DFermActEnv
22  {
23  extern const std::string name;
24  bool registerAll();
25  }
26 
27 
28  //! Params for overlap ferm acts
29  /*! \ingroup fermacts */
31  {
33  OvlapPartFrac4DFermActParams(XMLReader& in, const std::string& path);
34 
35  Real Mass;
36  Real AuxMass; // Filled when AuxFermAct is processed
40 
41  //! Type of approximation ZOLOTAREV or TANH
43  Real approxMin;
44  Real approxMax;
45 
47  {
48  Real RsdCG;
49  int MaxCG;
52 
53  bool isChiralP;
56  };
57 
58 
59  // Reader/writers
60  /*! \ingroup fermacts */
61  void read(XMLReader& xml, const std::string& path, OvlapPartFrac4DFermActParams& param);
62  /*! \ingroup fermacts */
63  void write(XMLWriter& xml, const std::string& path, const OvlapPartFrac4DFermActParams& param);
64 
65 
66  //! 4D Zolotarev variant of Overlap-Dirac operator
67  /*!
68  * \ingroup fermacts
69  *
70  * This routine is specific to Wilson-like fermions!
71  *
72  * NOTE: for now we assume the kernel is a fund. rep. fermion type,
73  * but that is not necessary
74  */
76  {
77  public:
78  // Typedefs to save typing
79  typedef LatticeFermion T;
80  typedef multi1d<LatticeColorMatrix> P;
81  typedef multi1d<LatticeColorMatrix> Q;
82 
83  //! Construct from param struct
86 
87 
88  //! Virtual copy constructor
89  OvlapPartFrac4DFermAct* clone() const {return new OvlapPartFrac4DFermAct(*this);}
90 
91  //! Return the quark mass
92  Real getQuarkMass() const {return params.Mass;}
93 
94 
95  //! Is the operator Chiral
96  /*! The operator is chiral if it satisfies the GW
97  * relation (or a massive version of it). It is certainly
98  * the intention that this operator be chiral in this sense.
99  * However, setting it up wrongly may make it non chiral.
100  * that would need a run-time check. So this is a hack below,
101  * signifying intent */
102  bool isChiral() const { return params.isChiralP; }
103 
104  // Create state functions
105 
106  //! Create OverlapFermState<T,P,Q> from XML
108  createState(const multi1d<LatticeColorMatrix>& u,
109  XMLReader& state_info_xml,
110  const std::string& state_info_path) const;
111 
112  //! Given links, create the state needed for the linear operators
113  /*! Override the parent */
114 
115  //! Create a ConnectState with just the gauge fields
116  EigenConnectState* createState(const multi1d<LatticeColorMatrix>& u_) const;
117 
118 
119  //! Produce a linear operator for this action
120  /*!
121  * NOTE: the arg MUST be the original base because C++ requires it for a virtual func!
122  * The function will have to downcast to get the correct state
123  */
125  const Real& m_q) const;
126 
128 
129  //! Produce a linear operator M^dag.M for this action
130  /*!
131  * NOTE: the arg MUST be the original base because C++ requires it for a
132  * virtual func!
133  * The function will have to downcast to get the correct state
134  */
136 
137  //! Produce a linear operator M^dag.M for this action to be applied
138  // to a std::vector of known chirality. Chirality is passed in
140  const Chirality& chirality) const;
141 
142  //! Produce a linear operator M^dag.M for this action
143  /*!
144  * NOTE: the arg MUST be the original base because C++ requires
145  * it for a virtual func!
146  * The function will have to downcast to get the correct state
147  */
149 
150  //! Produce a linear operator M^dag.M for this action to be applied
151  // to a std::vector of known chirality. Chirality is passed in
153  const Chirality& chirality) const;
154 
155 
156  //! Produce a linear operator that gives back gamma_5 eps(H)
158 
159  //! Produce a linear operator that gives back gamma_5 eps(H)
161 
162  //! Destructor is automatic
164 
165  protected:
166  //! Return the factory object that produces a state
167  const CreateFermState<T,P,Q>& getCreateState() const {return *cfs;}
168 
169  //! Helper in construction
170  void init(int& numroot,
171  Real& coeffP,
172  multi1d<Real>& resP,
173  multi1d<Real>& rootQ,
174  int& NEig,
175  multi1d<Real>& EigValFunc,
176  const EigenConnectState& state) const;
177 
178  //! Construct stuff but use RatPolyDegPrec in the polynomial
179  void initPrec(int& numroot,
180  Real& coeffP,
181  multi1d<Real>& resP,
182  multi1d<Real>& rootQ,
183  int& NEig,
184  multi1d<Real>& EigValFunc,
185  const EigenConnectState& state) const;
186 
187 
188  private:
189  //! Partial constructor not allowed
191  // Assignment
193 
194  private:
195  Handle< FermBC<T,P,Q> > fbc; // fermion bc
196  Handle< CreateFermState<T,P,Q> > cfs; // fermion state creator
197  // Auxilliary action used for kernel of operator
200  };
201 
202 }
203 #endif
Create a fermion connection state.
Definition: create_state.h:69
Differentiable Linear Operator.
Definition: linearop.h:98
Eigen-state holder.
Definition: eigen_state.h:23
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
Base class for unpreconditioned overlap-like fermion actions.
4D Zolotarev variant of Overlap-Dirac operator
UnprecLinearOperator< T, P, Q > * unprecLinOp(Handle< FermState< T, P, Q > > state, const Real &m_q) const
Produce a linear operator for this action.
const CreateFermState< T, P, Q > & getCreateState() const
Return the factory object that produces a state.
LinearOperator< T > * lgamma5epsHPrecondition(Handle< FermState< T, P, Q > > state) const
Produce a linear operator that gives back gamma_5 eps(H)
OvlapPartFrac4DFermAct * clone() const
Virtual copy constructor.
LinearOperator< T > * linOpPrecondition(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
multi1d< LatticeColorMatrix > P
LinearOperator< T > * lMdagMPrecondition(Handle< FermState< T, P, Q > > state) const
Produce a linear operator M^dag.M for this action.
DiffLinearOperator< T, P, Q > * lMdagM(Handle< FermState< T, P, Q > > state) const
Produce a linear operator M^dag.M for this action.
Handle< UnprecWilsonTypeFermAct< T, P, Q > > Mact
multi1d< LatticeColorMatrix > Q
OvlapPartFrac4DFermActParams params
void operator=(const OvlapPartFrac4DFermAct &a)
bool isChiral() const
Is the operator Chiral.
LinearOperator< T > * lgamma5epsH(Handle< FermState< T, P, Q > > state) const
Produce a linear operator that gives back gamma_5 eps(H)
Real getQuarkMass() const
Return the quark mass.
OvlapPartFrac4DFermAct()
Partial constructor not allowed.
~OvlapPartFrac4DFermAct()
Destructor is automatic.
Handle< CreateFermState< T, P, Q > > cfs
void init(int &numroot, Real &coeffP, multi1d< Real > &resP, multi1d< Real > &rootQ, int &NEig, multi1d< Real > &EigValFunc, const EigenConnectState &state) const
Helper in construction.
void initPrec(int &numroot, Real &coeffP, multi1d< Real > &resP, multi1d< Real > &rootQ, int &NEig, multi1d< Real > &EigValFunc, const EigenConnectState &state) const
Construct stuff but use RatPolyDegPrec in the polynomial.
EigenConnectState * createState(const multi1d< LatticeColorMatrix > &u, XMLReader &state_info_xml, const std::string &state_info_path) const
Create OverlapFermState<T,P,Q> from XML.
Unpreconditioned linear operator including derivatives.
Definition: linearop.h:185
Eigenvalue measurements.
Eigenstate reader.
Enums.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
CoeffType
Coeffs type.
OverlapInnerSolverType
OverlapInnerSolver type.
bool registerAll()
Register all the factories.
const std::string name
Name to be used.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
Chirality
Definition: ischiral_w.h:8
static multi1d< LatticeColorMatrix > u
Complex a
Definition: invbicg.cc:95
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
static QDP_ColorVector * in
::std::string string
Definition: gtest.h:1979
Base class for unpreconditioned overlap-like fermion actions.
CoeffType approximation_type
Type of approximation ZOLOTAREV or TANH.
struct Chroma::OvlapPartFrac4DFermActParams::InvParamInner invParamInner