CHROMA
jacobi_smear.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Jacobi smearing of color std::vector
3  */
4 
5 #include "chromabase.h"
7 
8 namespace Chroma
9 {
10 
11  //! Do a covariant Jacobi smearing of a lattice field
12  /*!
13  * Arguments:
14  *
15  * \param u gauge field ( Read )
16  * \param chi propagator field ( Modify )
17  * \param kappa hopping parameter ( Read )
18  * \param iter number of iterations ( Read )
19  * \param no_smear_dir no smearing in this direction ( Read )
20  */
21 
22  template<typename T>
23  void jacobiSmear(const multi1d<LatticeColorMatrix>& u,
24  T& chi,
25  const Real& kappa, int iter, int no_smear_dir)
26  {
27  T psi;
28  Real norm;
29 
30  T s_0,h_smear;
31  s_0 = chi;
32 
33  for(int n = 0; n < iter; ++n)
34  {
35  psi = chi;
36  bool first = true;
37 
38  for(int mu = 0; mu < Nd; ++mu )
39  if( mu != no_smear_dir )
40  {
41  if (first)
42  h_smear = u[mu]*shift(psi, FORWARD, mu) + shift(adj(u[mu])*psi, BACKWARD, mu);
43  else
44  h_smear += u[mu]*shift(psi, FORWARD, mu) + shift(adj(u[mu])*psi, BACKWARD, mu);
45  first = false;
46  }
47  chi = s_0 + kappa * h_smear;
48  }
49  }
50 
51 
52  //! Do a covariant Jacobi smearing of a lattice color std::vector field
53  /*! This is a wrapper over the template definition
54  *
55  * \ingroup smear
56  *
57  * Arguments:
58  *
59  * \param u gauge field ( Read )
60  * \param chi propagator field ( Modify )
61  * \param kappa hopping parameter ( Read )
62  * \param iter number of iterations ( Read )
63  * \param no_smear_dir no smearing in this direction ( Read )
64  */
65 
66  void jacobiSmear(const multi1d<LatticeColorMatrix>& u,
67  LatticeColorVector& chi,
68  const Real& kappa, int iter, int no_smear_dir)
69  {
70  jacobiSmear<LatticeColorVector>(u, chi, kappa, iter, no_smear_dir);
71  }
72 
73 
74  //! Do a covariant Jacobi smearing of a lattice fermion field
75  /*! This is a wrapper over the template definition
76  *
77  * \ingroup smear
78  *
79  * Arguments:
80  *
81  * \param u gauge field ( Read )
82  * \param chi propagator field ( Modify )
83  * \param kappa hopping parameter ( Read )
84  * \param iter number of iterations ( Read )
85  * \param no_smear_dir no smearing in this direction ( Read )
86  */
87 
88  void jacobiSmear(const multi1d<LatticeColorMatrix>& u,
89  LatticeFermion& chi,
90  const Real& kappa, int iter, int no_smear_dir)
91  {
92  jacobiSmear<LatticeFermion>(u, chi, kappa, iter, no_smear_dir);
93  }
94 
95 
96  //! Do a covariant Jacobi smearing of a lattice propagator field
97  /*! This is a wrapper over the template definition
98  *
99  * \ingroup smear
100  *
101  * Arguments:
102  *
103  * \param u gauge field ( Read )
104  * \param chi propagator field ( Modify )
105  * \param kappa hopping parameter ( Read )
106  * \param iter number of iterations ( Read )
107  * \param no_smear_dir no smearing in this direction ( Read )
108  */
109 
110  void jacobiSmear(const multi1d<LatticeColorMatrix>& u,
111  LatticeStaggeredPropagator& chi,
112  const Real& kappa, int iter, int no_smear_dir)
113  {
114  jacobiSmear<LatticeStaggeredPropagator>(u, chi, kappa, iter, no_smear_dir);
115  }
116 
117 
118  //! Do a covariant Jacobi smearing of a lattice propagator field
119  /*! This is a wrapper over the template definition
120  *
121  * \ingroup smear
122  *
123  * Arguments:
124  *
125  * \param u gauge field ( Read )
126  * \param chi propagator field ( Modify )
127  * \param kappa hopping parameter ( Read )
128  * \param iter number of iterations ( Read )
129  * \param no_smear_dir no smearing in this direction ( Read )
130  */
131 
132  void jacobiSmear(const multi1d<LatticeColorMatrix>& u,
133  LatticePropagator& chi,
134  const Real& kappa, int iter, int no_smear_dir)
135  {
136  jacobiSmear<LatticePropagator>(u, chi, kappa, iter, no_smear_dir);
137  }
138 
139 
140 } // end namespace Chroma
Primary include file for CHROMA library code.
int mu
Definition: cool.cc:24
void jacobiSmear(const multi1d< LatticeColorMatrix > &u, T &chi, const Real &kappa, int iter, int no_smear_dir)
Do a covariant Jacobi smearing of a lattice field.
Definition: jacobi_smear.cc:23
Jacobi smearing of color std::vector.
unsigned n
Definition: ldumul_w.cc:36
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
int kappa
Definition: pade_trln_w.cc:112
#define FORWARD
Definition: primitives.h:82
#define BACKWARD
Definition: primitives.h:83
int norm
Definition: qtopcor.cc:35