CHROMA
displacement.cc
Go to the documentation of this file.
1 // $Id: displacement.cc,v 3.1 2008-09-26 19:53:28 edwards Exp $
2 /*! \file
3  * \brief Parallel transport a lattice field
4  */
5 
6 #include "chromabase.h"
8 
9 namespace Chroma
10 {
11 
12  //! Apply a displacement operator to a lattice field
13  /*!
14  * \ingroup smear
15  *
16  * Arguments:
17  *
18  * \param u gauge field ( Read )
19  * \param chi color std::vector field ( Modify )
20  * \param length length of displacement ( Read )
21  * \param dir direction of displacement ( Read )
22  *
23  *
24  * Description:
25  *
26  * Suppose q(x) is a quark field.
27  * Displacement operator D_j^{(p)} moves quark field
28  * for p lattice sites to the direction j in covariant
29  * fashion.
30  *
31  * Namely,
32  * D_j^{(p)} q(x) = U_j(x) U_j(x+j) U_j(x+2j)...U_j(x+(p-1)j) q(x+pj),
33  * where U is the gauge-link.
34  *
35  * dir: x(0), y(1), z(2)
36  *
37  */
38 
39  template<typename T>
40  void displacement(const multi1d<LatticeColorMatrix>& u,
41  T& chi,
42  int length, int dir)
43  {
44  if (length > 0)
45  for(int n = 0; n < length; ++n)
46  {
47  T tmp = shift(chi, FORWARD, dir);
48  chi = u[dir] * tmp;
49  }
50 
51  else // If length = or < 0. If length == 0, does nothing.
52  for(int n = 0; n > length; --n)
53  {
54  T tmp = shift(adj(u[dir])*chi, BACKWARD, dir);
55  chi = tmp;
56  }
57  }
58 
59 
60  void displacement(const multi1d<LatticeColorMatrix>& u,
61  LatticeColorVector& chi,
62  int length, int dir)
63  {
64  displacement<LatticeColorVector>(u, chi, length, dir);
65  }
66 
67 
68  void displacement(const multi1d<LatticeColorMatrix>& u,
69  LatticePropagator& chi,
70  int length, int dir)
71  {
72  displacement<LatticePropagator>(u, chi, length, dir);
73  }
74 
75  void displacement(const multi1d<LatticeColorMatrix>& u,
76  LatticeFermion& chi,
77  int length, int dir)
78  {
79  displacement<LatticeFermion>(u, chi, length, dir);
80  }
81 
82 
83  void displacement(const multi1d<LatticeColorMatrix>& u,
84  LatticeStaggeredFermion& chi,
85  int length, int dir)
86  {
87  displacement<LatticeStaggeredFermion>(u, chi, length, dir);
88  }
89 
90 
91 
92  void displacement(const multi1d<LatticeColorMatrix>& u,
93  LatticeStaggeredPropagator& chi,
94  int length, int dir)
95  {
96  displacement<LatticeStaggeredPropagator>(u, chi, length, dir);
97  }
98 
99 } // end namespace Chroma
Primary include file for CHROMA library code.
Parallel transport a lattice field.
LatticePropagator displacement(const multi1d< LatticeColorMatrix > &u, const LatticePropagator &chi, int length, int dir)
Apply a displacement operator to a lattice field.
unsigned n
Definition: ldumul_w.cc:36
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeFermion > chi(Ncb)
#define FORWARD
Definition: primitives.h:82
#define BACKWARD
Definition: primitives.h:83