CHROMA
vector_smear.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief std::vector smearing of color std::vector
3  */
4 
5 #include "chromabase.h"
7 #include "util/ft/sftmom.h"
8 
9 namespace Chroma
10 {
11 
12  //! Do a std::vector smearing of a lattice colorstd::vector field
13  /*!
14  * Arguments:
15  *
16  * \param chi color std::vector field ( Modify )
17  * \param vecs vectors for the smearing ( Read )
18  * \param sigma exponential smearing parameter ( Read )
19  * \param j_decay direction of decay ( Read )
20  */
21 
22  void vectorSmear(LatticeColorVector& chi,
23  const MapObject<int,EVPair<LatticeColorVector> >& vecs,
24  const Real& sigma, const int& j_decay)
25  {
26  LatticeColorVector psi = zero;
27 
28  int num_vecs = vecs.size();
29 
30  SftMom phases(0, false, j_decay);
31  int nt = phases.numSubsets();
32 
33  for (int n = 0 ; n < num_vecs ; ++n)
34  {
36  vecs.get(n, ev);
37 
38  const multi1d<Real>& evals = ev.eigenValue.weights;
39  LatticeColorVector cvec = ev.eigenVector;
40  LatticeComplex tmp = localInnerProduct( cvec, chi );
41 
42  multi2d<DComplex> t_sum = phases.sft(tmp);
43 
44  if (nt != evals.size())
45  {
46  QDPIO::cerr << __func__ << ": number of evalues not decay extent\n";
47  QDP_abort(1);
48  }
49 
50  for (int t = 0 ; t < nt ; ++t)
51  {
52  psi[phases.getSet()[t]] += cvec * t_sum[0][t] *
53  exp( Real(-1.0) * sigma * sigma / Real(4.0) * evals[t]);
54  }
55  }
56 
57  chi = psi;
58  }
59 
60 
61  //! Do a std::vector smearing of a color matrix
62  /*!
63  * Arguments:
64  *
65  * \param chi color matrix field ( Modify )
66  * \param vecs vectors for the smearing ( Read )
67  * \param sigma exponential smearing parameter ( Read )
68  * \param j_decay direction of decay ( Read )
69  */
70 
71  void vectorSmear(LatticeColorMatrix& chi,
72  const MapObject<int,EVPair<LatticeColorVector> >& vecs,
73  const Real& sigma, const int& j_decay)
74  {
75  LatticeColorMatrix col_out = zero;
76 
77  // Smear a color matrix
78  for (int cc = 0 ; cc < Nc ; ++cc)
79  {
80  LatticeColorVector vec_in = zero;
81 
82  // Extract column of color matrix
83  for (int cr = 0 ; cr < Nc ; ++cr)
84  {
85  pokeColor(vec_in, peekColor(chi, cr, cc), cr);
86  }
87 
88  // Smear that column
89  vectorSmear(vec_in, vecs, sigma, j_decay);
90 
91  // Insert it back in
92  for (int cr = 0 ; cr < Nc ; ++cr)
93  {
94  pokeColor(col_out, peekColor(vec_in, cr), cr, cc);
95  }
96  } // cc
97 
98  chi = col_out;
99  }
100 
101 
102  //! Do a std::vector smearing of a lattice fermion field
103  /*!
104  * Arguments:
105  *
106  * \param chi fermion field ( Modify )
107  * \param vecs vectors for the smearing ( Read )
108  * \param sigma exponential smearing parameter ( Read )
109  * \param j_decay direction of decay ( Read )
110  */
111 
112  void vectorSmear(LatticeFermion& chi,
113  const MapObject<int,EVPair<LatticeColorVector> >& vecs,
114  const Real& sigma, const int& j_decay)
115  {
116  LatticeFermion psi = zero;
117 
118  for (int s = 0 ; s < Ns ; ++s)
119  {
120  LatticeColorVector chi_s = peekSpin(chi, s);
121  vectorSmear(chi_s, vecs, sigma, j_decay);
122 
123  pokeSpin(psi, chi_s, s);
124  }
125 
126  chi = psi;
127  }
128 
129  //! Do a std::vector smearing of a lattice fermion field
130  /*!
131  * Arguments:
132  *
133  * \param chi fermion field ( Modify )
134  * \param vecs vectors for the smearing ( Read )
135  * \param sigma exponential smearing parameter ( Read )
136  * \param j_decay direction of decay ( Read )
137  */
138 
139  void vectorSmear(LatticeStaggeredPropagator& chi,
140  const MapObject<int,EVPair<LatticeColorVector> >& vecs,
141  const Real& sigma, const int& j_decay)
142  {
143  LatticeStaggeredPropagator psi = zero;
144 
145  QDPIO::cerr << __func__ << ": not implemented\n";
146  QDP_abort(1);
147 
148  chi = psi;
149  }
150 
151  //! Do a std::vector smearing of a lattice fermion field
152  /*!
153  * Arguments:
154  *
155  * \param chi fermion field ( Modify )
156  * \param vecs vectors for the smearing ( Read )
157  * \param sigma exponential smearing parameter ( Read )
158  * \param j_decay direction of decay ( Read )
159  */
160 
161  void vectorSmear(LatticePropagator& chi,
162  const MapObject<int,EVPair<LatticeColorVector> >& vecs,
163  const Real& sigma, const int& j_decay)
164  {
165  LatticePropagator psi = zero;
166 
167  for (int sc = 0 ; sc < Ns ; ++sc)
168  {
169  for (int sr = 0 ; sr < Ns ; ++sr)
170  {
171  LatticeColorMatrix col = peekSpin(chi, sr, sc);
172 
173  vectorSmear(col, vecs, sigma, j_decay);
174 
175  pokeSpin(psi, col, sr, sc);
176  } // sr
177  } // sc
178 
179  chi = psi;
180  }
181 
182 } // end namespace Chroma
Primary include file for CHROMA library code.
Fourier transform phase factor support.
Definition: sftmom.h:35
int numSubsets() const
Number of subsets - length in decay direction.
Definition: sftmom.h:63
multi2d< DComplex > sft(const LatticeComplex &cf) const
Do a sumMulti(cf*phases,getSet())
Definition: sftmom.cc:524
const Set & getSet() const
The set to be used in sumMulti.
Definition: sftmom.h:57
void vectorSmear(LatticeColorVector &chi, const MapObject< int, EVPair< LatticeColorVector > > &vecs, const Real &sigma, const int &j_decay)
Do a std::vector smearing of a lattice colorstd::vector field.
Definition: vector_smear.cc:22
unsigned n
Definition: ldumul_w.cc:36
int j_decay
Definition: meslate.cc:22
int t
Definition: meslate.cc:37
QDPSubTypeTrait< typename BinaryReturn< C1, C2, FnLocalInnerProduct >::Type_t >::Type_t localInnerProduct(const QDPSubType< T1, C1 > &l, const QDPType< T2, C2 > &r)
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
Double zero
Definition: invbicg.cc:106
multi1d< LatticeFermion > s(Ncb)
Fourier transform phase factor support.
A Pair type.
SubsetVectorWeight_t eigenValue
std::vector smearing of color std::vector