CHROMA
klein_gord.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Apply Klein-Gordon operator
3  */
4 
5 #include "chromabase.h"
7 
8 
9 namespace Chroma
10 {
11  //! Compute the covariant Klein-Gordon operator
12  /*!
13  * For 0 <= j_decay < Nd, the laplacian is only taken in the directions
14  * other than j_decay.
15  *
16  * Chi := (mass_sq + 2*(Nd[-1]) * Psi -
17  * sum_{mu ne j_decay} [ U_mu(x) * Psi(x+mu) +
18  * U^dagger_mu(x-mu) * Psi(x-mu) ]
19  *
20  *
21  * Arguments:
22  *
23  * \param u Gauge field (Read)
24  * \param psi Lattice field (Read)
25  * \param chi Lattice field (Write)
26  * \param mass_sq square of the mass term (Read)
27  * \param j_decay 'left out' direction (Read)
28  */
29 
30  template<typename T>
31  void klein_gord(const multi1d<LatticeColorMatrix>& u,
32  const T& psi,
33  T& chi,
34  const Real& mass_sq, int j_decay)
35  {
36  Real ftmp;
37 
38  if( j_decay < Nd )
39  ftmp = Real(2*Nd-2) + mass_sq;
40  else
41  ftmp = Real(2*Nd) + mass_sq;
42 
43  chi = psi * ftmp;
44 
45  for(int mu = 0; mu < Nd; ++mu )
46  if( mu != j_decay )
47  {
48  chi -= u[mu]*shift(psi, FORWARD, mu) + shift(adj(u[mu])*psi, BACKWARD, mu);
49  }
50  }
51 
52 
53  //! Compute the covariant Klein-Gordon operator on a color std::vector
54  void klein_gord(const multi1d<LatticeColorMatrix>& u,
55  const LatticeColorVector& psi,
56  LatticeColorVector& chi,
57  const Real& mass_sq, int j_decay)
58  {
59  klein_gord<LatticeColorVector>(u, psi, chi, mass_sq, j_decay);
60  }
61 
62  //! Compute the covariant Klein-Gordon operator on a color std::vector
63  void klein_gord(const multi1d<LatticeColorMatrix>& u,
64  const LatticeFermion& psi,
65  LatticeFermion& chi,
66  const Real& mass_sq, int j_decay)
67  {
68  klein_gord<LatticeFermion>(u, psi, chi, mass_sq, j_decay);
69  }
70 
71  //! Compute the covariant Klein-Gordon operator on a propagator
72  void klein_gord(const multi1d<LatticeColorMatrix>& u,
73  const LatticeStaggeredPropagator& psi,
74  LatticeStaggeredPropagator& chi,
75  const Real& mass_sq, int j_decay)
76  {
77  klein_gord<LatticeStaggeredPropagator>(u, psi, chi, mass_sq, j_decay);
78  }
79 
80  //! Compute the covariant Klein-Gordon operator on a propagator
81  void klein_gord(const multi1d<LatticeColorMatrix>& u,
82  const LatticePropagator& psi,
83  LatticePropagator& chi,
84  const Real& mass_sq, int j_decay)
85  {
86  klein_gord<LatticePropagator>(u, psi, chi, mass_sq, j_decay);
87  }
88 
89 }
Primary include file for CHROMA library code.
int mu
Definition: cool.cc:24
void klein_gord(const multi1d< LatticeColorMatrix > &u, const T &psi, T &chi, const Real &mass_sq, int j_decay)
Compute the covariant Klein-Gordon operator.
Definition: klein_gord.cc:31
Klein-Gordon operator.
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
#define FORWARD
Definition: primitives.h:82
#define BACKWARD
Definition: primitives.h:83