CHROMA
gaus_smear.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Gaussian smearing of color std::vector
3  */
4 
5 #include "chromabase.h"
8 
9 namespace Chroma
10 {
11 
12  //! Do a covariant Gaussian smearing of a lattice field
13  /*!
14  * Arguments:
15  *
16  * \param u gauge field ( Read )
17  * \param chi color std::vector field ( Modify )
18  * \param width width of "shell" wave function ( Read )
19  * \param ItrGaus number of iterations to approximate Gaussian ( Read )
20  * \param j_decay direction of decay ( Read )
21  */
22 
23  template<typename T>
24  void gausSmear(const multi1d<LatticeColorMatrix>& u,
25  T& chi,
26  const Real& width, int ItrGaus, int j_decay)
27  {
28  T psi;
29 
30  Real ftmp = - (width*width) / Real(4*ItrGaus);
31  /* The Klein-Gordon operator is (Lapl + mass_sq), where Lapl = -d^2/dx^2.. */
32  /* We want (1 + ftmp * Lapl ) = (Lapl + 1/ftmp)*ftmp */
33  Real ftmpi = Real(1) / ftmp;
34 
35  for(int n = 0; n < ItrGaus; ++n)
36  {
37  psi = chi * ftmp;
38  klein_gord(u, psi, chi, ftmpi, j_decay);
39  }
40  }
41 
42 
43  //! Do a covariant Gaussian smearing of a lattice color std::vector field
44  /*! This is a wrapper over the template definition
45  *
46  * \ingroup smear
47  *
48  * Arguments:
49  *
50  * \param u gauge field ( Read )
51  * \param chi color std::vector field ( Modify )
52  * \param width width of "shell" wave function ( Read )
53  * \param ItrGaus number of iterations to approximate Gaussian ( Read )
54  * \param j_decay direction of decay ( Read )
55  */
56 
57  void gausSmear(const multi1d<LatticeColorMatrix>& u,
58  LatticeColorVector& chi,
59  const Real& width, int ItrGaus, int j_decay)
60  {
61  gausSmear<LatticeColorVector>(u, chi, width, ItrGaus, j_decay);
62  }
63 
64 
65  //! Do a covariant Gaussian smearing of a lattice fermion field
66  /*! This is a wrapper over the template definition
67  *
68  * \ingroup smear
69  *
70  * Arguments:
71  *
72  * \param u gauge field ( Read )
73  * \param chi fermion field ( Modify )
74  * \param width width of "shell" wave function ( Read )
75  * \param ItrGaus number of iterations to approximate Gaussian ( Read )
76  * \param j_decay direction of decay ( Read )
77  */
78 
79  void gausSmear(const multi1d<LatticeColorMatrix>& u,
80  LatticeFermion& chi,
81  const Real& width, int ItrGaus, int j_decay)
82  {
83  gausSmear<LatticeFermion>(u, chi, width, ItrGaus, j_decay);
84  }
85 
86 
87  //! Do a covariant Gaussian smearing of a lattice propagator field
88  /*! This is a wrapper over the template definition
89  *
90  * \ingroup smear
91  *
92  * Arguments:
93  *
94  * \param u gauge field ( Read )
95  * \param chi propagator field ( Modify )
96  * \param width width of "shell" wave function ( Read )
97  * \param ItrGaus number of iterations to approximate Gaussian ( Read )
98  * \param j_decay direction of decay ( Read )
99  */
100 
101  void gausSmear(const multi1d<LatticeColorMatrix>& u,
102  LatticeStaggeredPropagator& chi,
103  const Real& width, int ItrGaus, int j_decay)
104  {
105  gausSmear<LatticeStaggeredPropagator>(u, chi, width, ItrGaus, j_decay);
106  }
107 
108 
109  //! Do a covariant Gaussian smearing of a lattice propagator field
110  /*! This is a wrapper over the template definition
111  *
112  * \ingroup smear
113  *
114  * Arguments:
115  *
116  * \param u gauge field ( Read )
117  * \param chi propagator field ( Modify )
118  * \param width width of "shell" wave function ( Read )
119  * \param ItrGaus number of iterations to approximate Gaussian ( Read )
120  * \param j_decay direction of decay ( Read )
121  */
122 
123  void gausSmear(const multi1d<LatticeColorMatrix>& u,
124  LatticePropagator& chi,
125  const Real& width, int ItrGaus, int j_decay)
126  {
127  gausSmear<LatticePropagator>(u, chi, width, ItrGaus, j_decay);
128  }
129 
130 
131 } // end namespace Chroma
Primary include file for CHROMA library code.
Gaussian smearing of color std::vector.
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
void gausSmear(const multi1d< LatticeColorMatrix > &u, T &chi, const Real &width, int ItrGaus, int j_decay)
Do a covariant Gaussian smearing of a lattice field.
Definition: gaus_smear.cc:24
Klein-Gordon operator.
unsigned n
Definition: ldumul_w.cc:36
int j_decay
Definition: meslate.cc:22
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