CHROMA
unprec_graphene_linop_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief Unpreconditioned Graphene fermion linear operator.
4  *
5  * This formulation follows Borici's variant of Creutz's graphene
6  * fermion construction. Borici's variant is described in
7  * arXiv:0712.4401 and Cruetz's original construction is described
8  * in arXiv:0712.1201
9  */
10 
11 #ifndef __unprec_graphene_linop_w_h__
12 #define __unprec_graphene_linop_w_h__
13 
14 #include "linearop.h"
15 #include "state.h"
16 #include "io/aniso_io.h"
17 
18 namespace Chroma
19 {
20  //! Unpreconditioned Graphene operator
21  /*!
22  * \ingroup linop
23  *
24  * This routine is specific to Wilson fermions!
25  *
26  * ~ ~+
27  * This subroutine applies the unpreconditioned matrix M or M the std::vector
28  * Psi,
29  *
30  * { ~
31  * { M(U) . Psi if ISign = PLUS
32  * Chi = {
33  * { ~ +
34  * { M(U) . Psi if ISign = MINUS
35  *
36  * Algorithm:
37  *
38  * The kernel for these Graphene fermions is
39  *
40  * M = m + i\sum_\mu\gamma_mu +
41  * (1/2)*[(i*\Gamma_mu+\gamma_mu)*H_\mu + (i*\Gamma_mu-\gamma_mu)*H_-\mu]
42  *
43  */
44 
45  class UnprecGrapheneLinOp : public UnprecLinearOperator<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  //! Partial constructor
56 
57  //! Full constructor
58  UnprecGrapheneLinOp(Handle< FermState<T,P,Q> > fs, const Real& Mass_)
59  {create(fs,Mass_);}
60 
61  //! Full constructor with Anisotropy
63  const Real& Mass_,
64  const AnisoParam_t& aniso)
65  {create(fs,Mass_,aniso);}
66 
67  //! Destructor is automatic
69 
70  //! Return the fermion BC object for this linear operator
71  const FermBC<T,P,Q>& getFermBC() const {return *fbc;}
72 
73  //! Creation routine
74  void create(Handle< FermState<T,P,Q> > fs,
75  const Real& Mass_);
76 
77  //! Creation routine with Anisotropy
78  void create(Handle< FermState<T,P,Q> > fs,
79  const Real& Mass_,
80  const AnisoParam_t& aniso);
81 
82  //! Apply the operator onto a source std::vector
83  void operator() (LatticeFermion& chi, const LatticeFermion& psi, enum PlusMinus isign) const;
84 
85  //! Derivative of unpreconditioned Graphene dM/dU
86  void deriv(multi1d<LatticeColorMatrix>& ds_u,
87  const LatticeFermion& chi, const LatticeFermion& psi,
88  enum PlusMinus isign) const;
89 
90  //! Return flops performed by the operator()
91  unsigned long nFlops() const;
92 
93  private:
94  //! Form gamma_mu * psi
95  void gammaMults(multi1d<LatticeFermion>& tmp1, const LatticeFermion& psi) const;
96 
97  //! Form i*Gamma_mu * psi
98  void iGamMu(LatticeFermion& iGam, const multi1d<LatticeFermion>& gams, int mu) const;
99 
100  private:
101  Real Mass;
103 
105  multi1d<LatticeColorMatrix> u;
106  multi2d<int> alpha;
107  };
108 
109 } // End Namespace Chroma
110 
111 
112 #endif
Anisotropy parameters.
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
Unpreconditioned Graphene operator.
UnprecGrapheneLinOp(Handle< FermState< T, P, Q > > fs, const Real &Mass_)
Full constructor.
unsigned long nFlops() const
Return flops performed by the operator()
UnprecGrapheneLinOp(Handle< FermState< T, P, Q > > fs, const Real &Mass_, const AnisoParam_t &aniso)
Full constructor with Anisotropy.
UnprecGrapheneLinOp()
Partial constructor.
multi1d< LatticeColorMatrix > P
multi1d< LatticeColorMatrix > Q
void gammaMults(multi1d< LatticeFermion > &tmp1, const LatticeFermion &psi) const
Form gamma_mu * psi.
void deriv(multi1d< LatticeColorMatrix > &ds_u, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Derivative of unpreconditioned Graphene dM/dU.
~UnprecGrapheneLinOp()
Destructor is automatic.
void create(Handle< FermState< T, P, Q > > fs, const Real &Mass_)
Creation routine.
Handle< FermBC< T, P, Q > > fbc
void iGamMu(LatticeFermion &iGam, const multi1d< LatticeFermion > &gams, int mu) const
Form i*Gamma_mu * psi.
multi1d< LatticeColorMatrix > u
const FermBC< T, P, Q > & getFermBC() const
Return the fermion BC object for this linear operator.
Unpreconditioned linear operator including derivatives.
Definition: linearop.h:185
int mu
Definition: cool.cc:24
void operator()(LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign) const
Apply the operator onto a source std::vector.
Linear Operators.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
Support class for fermion actions and linear operators.
Parameters for anisotropy.
Definition: aniso_io.h:24