CHROMA
unprec_parwilson_linop_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Unpreconditioned Wilson linear operator with parity breaking term
3  */
4 
5 #include "chromabase.h"
7 
8 using namespace QDP::Hints;
9 namespace Chroma
10 {
11  //! Creation routine
12  /*! \ingroup fermact
13  *
14  * \param u_ gauge field (Read)
15  * \param Mass_ fermion kappa (Read)
16  * \param H__ parity breaking term (Read)
17  */
18  void UnprecParWilsonLinOp::create(Handle< FermState<T,P,Q> > fs,
19  const Real& Mass_, const Real& H_)
20  {
21  START_CODE();
22 
23  Mass = Mass_;
24  H = H_;
25 // u = u_;
26  D.create(fs);
27 
28 // CoeffWilsr_s = (AnisoP) ? Wilsr_s / xiF_0 : 1;
29 
30  END_CODE();
31  }
32 
33 
34  //! Apply unpreconditioned Wilson fermion linear operator with parity breaking term
35  /*!
36  * \ingroup linop
37  *
38  * The operator acts on the entire lattice
39  *
40  * \param chi Pseudofermion field (Write)
41  * \param psi Pseudofermion field (Read)
42  * \param isign Flag ( PLUS | MINUS ) (Read)
43  */
44  void UnprecParWilsonLinOp::operator() (LatticeFermion& chi, const LatticeFermion& psi,
45  enum PlusMinus isign) const
46  {
47  START_CODE();
48 
49  //
50  // Chi = (Nd+Mass)*Psi - (1/2) * D' Psi
51  //
52  LatticeFermion tmp; moveToFastMemoryHint(tmp);
53  Real fact1 = Nd + Mass;
54  Real fact2 = -0.5;
55 
56  // D is a Dslash - must apply to both CB-s
57  D(tmp, psi, isign);
58 
59  //
60  chi = fact1*psi + fact2*tmp;
61 
62  switch (isign)
63  {
64  case PLUS:
65  chi += Gamma(Ns*Ns-1)*(H*timesI(psi));
66  break;
67 
68  case MINUS:
69  chi -= Gamma(Ns*Ns-1)*(H*timesI(psi));
70  break;
71  }
72 
73  getFermBC().modifyF(chi);
74 
75  END_CODE();
76  }
77 
78 
79  //! Derivative of unpreconditioned ParWilson dM/dU
80  /*!
81  * \param chi left std::vector on cb (Read)
82  * \param psi right std::vector on 1-cb (Read)
83  * \param isign D'^dag or D' ( MINUS | PLUS ) resp. (Read)
84  * \param cb Checkerboard of chi std::vector (Read)
85  *
86  * \return Computes \f$\chi^\dag * \dot(D} * \psi\f$
87  */
88  void
89  UnprecParWilsonLinOp::deriv(multi1d<LatticeColorMatrix>& ds_u,
90  const LatticeFermion& chi, const LatticeFermion& psi,
91  enum PlusMinus isign) const
92  {
93  START_CODE();
94 
95  // This does both parities
96  D.deriv(ds_u, chi, psi, isign);
97 
98  // Factor from the -1/2 in front of the dslash
99  for(int mu = 0; mu < Nd; ++mu)
100  ds_u[mu] *= Real(-0.5);
101 
102  END_CODE();
103  }
104 
105 
106 } // End Namespace Chroma
107 
108 
Primary include file for CHROMA library code.
#define END_CODE()
Definition: chromabase.h:65
#define START_CODE()
Definition: chromabase.h:64
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
int mu
Definition: cool.cc:24
Real Mass
Double tmp
Definition: meslate.cc:60
Nd
Definition: meslate.cc:74
multi1d< Hadron2PtContraction_t > operator()(const multi1d< LatticeColorMatrix > &u)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
@ MINUS
Definition: chromabase.h:45
@ PLUS
Definition: chromabase.h:45
chi
Definition: pade_trln_w.cc:24
psi
Definition: pade_trln_w.cc:191
multi1d< LatticeColorMatrix > deriv(const EvenOddPrecLinearOperator< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &AP, const LatticeFermion &chi, const LatticeFermion &psi, enum PlusMinus isign)
Apply the operator onto a source std::vector.
Unpreconditioned Wilson fermion linear operator with parity breaking term.