CHROMA
stag_fermact_s.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Staggered fermion action
3  */
4 
5 #include "chromabase.h"
7 #include "actions/ferm/linop/stag_linop_s.h"
8 #include "actions/ferm/linop/stag_mdagm_linop_s.h"
9 
10 namespace Chroma
11 {
12  //! Produce a linear operator for this action
13  /*!
14  * The operator acts on the entire lattice
15  *
16  * \param state gauge field (Read)
17  */
20  {
21  return new StagLinOp(state, Mass);
22  }
23 
24  //! Produce a M^dag.M linear operator for this action
25  /*!
26  * The operator acts on the entire lattice
27  *
28  * \param state gauge field (Read)
29  */
32  {
33  return new StagMdagMLinOp(state, Mass);
34  }
35 
36 
37 #if 0
38 
39 #error "NEEDS MORE CONVERSION"
40 
41 //! Computes the derivative of the fermionic action respect to the link field
42 /*!
43  * | dS dS_f
44  * ds_u -- | ---- + ----- ( Write )
45  * | dU dU
46  *
47  * psi -- [1./(M_dag*M)]*chi_ ( read )
48  *
49  * \param ds_u result ( Write )
50  * \param state gauge field ( Read )
51  * \param psi solution to linear system ( Read )
52  */
53 
54  void
55  StagFermAct::dsdu(multi1d<LatticeColorMatrix> & ds_u,
57  const LatticeStaggeredFermion& psi) const
58  {
59  LatticeStaggeredFermion u_psi;
60  LatticeStaggeredFermion rho;
61  LatticeStaggeredFermion u_rho;
62 
63  LatticeStaggeredFermion tmp_1;
64  Real dummy;
65  int mu;
66  int cb;
67 
68  START_CODE();
69 
70  /* rho = Dslash(1<-0) * psi */
71  dslash (u, psi, rho, PLUS, 0);
72 
73  /* rho = (KappaMD^2)*rho = (KappaMC^2)*Dslash*psi */
75  rho = rho * dummy;
76 
77  for(mu = 0;mu < ( Nd); ++mu )
78  {
79  cb = 0;
80 
81  /* tmp_1(x) = rho(x+mu) */
82  tmp_1[rb[cb]] = shift(rho, FORWARD, mu);
83 
84  /* u_rho(x) = u(x,mu)*rho(x+mu) = u(x,mu)*tmp_1(x) */
85  /* Note the KS phase factors are already included in the U's! */
86  u_rho = u[mu][cb] * tmp_1;
87 
88  /* ds_u(x,mu) = - u_rho(x) * psi_dag(x,mu) */
89  ds_u[mu][cb] -= u_rho * adj(psi);
90 
91  cb = 1;
92 
93  /* tmp_1(x) = psi(x+mu) */
94  tmp_1[rb[cb]] = shift(psi, FORWARD, mu);
95 
96  /* u_psi(x) = u(x,mu)*psi(x+mu) = u(x,mu)*tmp_1(x) */
97  /* Note the KS phase factors are already included in the U's! */
98  u_psi = u[mu][cb] * tmp_1;
99 
100  /* ds_u(x,mu) = u_psi(x) * rho_dag(x,mu) */
101  ds_u[mu][cb] += u_psi * adj(rho);
102  }
103 
104  END_CODE();
105  }
106 
107 } // End Namespace Chroma
108 
109 #endif
Primary include file for CHROMA library code.
Even odd Linear Operator (for staggered like things )
Definition: eo_linop.h:28
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
EvenOddLinearOperator< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator 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.
EXTERN Real KappaMD
int mu
Definition: cool.cc:24
LatticeColorMatrix tmp_1
Definition: meslate.cc:50
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
@ PLUS
Definition: chromabase.h:45
dslash(u, eta, tmp, MINUS, 1)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
START_CODE()
int cb
Definition: invbicg.cc:120
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
#define FORWARD
Definition: primitives.h:82
Real dummy
Definition: qtopcor.cc:36
Staggered fermion action.