CHROMA
hex_smear.cc
Go to the documentation of this file.
1 // $Id: hyp_smear.cc,v 3.1 2006-08-11 16:13:30 edwards Exp $
2 /*! \file
3  * \brief Hyp-smearing of the gauge configuration
4  */
5 
6 #include "chromabase.h"
7 #include "meas/smear/hex_smear.h"
8 #include "util/gauge/eesu3.h"
9 #include "util/gauge/taproj.h"
10 
11 namespace Chroma
12 {
13  //! Construct one iteration of the "hex-smeared" links of Capitani et al
14  /*! hep-lat/0607006
15  * \ingroup smear
16  *
17  * Construct the "hyp-smeared" links of Capitani et al., with
18  * staple coefficients alpha1, alpha2 and alpha3
19  *
20  * Arguments:
21  *
22  * \param u gauge field (Read)
23  * \param u_hyp "hex-smeared" gauge field (Write)
24  *
25  */
26 
27  void Hex_Smear_onestepp(multi1d<LatticeColorMatrix>& u,
28  multi1d<LatticeColorMatrix>& u_hyp)
29  {
30  multi1d<LatticeColorMatrix> u_lv1(Nd*(Nd-1));
31  multi1d<LatticeColorMatrix> u_lv2(Nd*(Nd-1));
32  LatticeColorMatrix u_tmp;
33  LatticeColorMatrix tmp_1;
34  LatticeComplex tt;
35 
36  /** see equation 4 in hep-lat/0607006 **/
37  /** the parameters below were empirically obtained
38  by BMW personnel **/
39 
40  const Real hex_alpha1 = 0.95 ;
41  const Real hex_alpha2 = 0.76 ;
42  const Real hex_alpha3 = 0.38 ;
43 
44  /** to get agreement with BMW code **/
45  const Real hex_alpha3_fact = hex_alpha3 / 2.0 ;
46  const Real hex_alpha2_fact = hex_alpha2 / 4.0 ;
47  const Real hex_alpha1_fact = hex_alpha1 / 6.0 ;
48 
49  int rho;
50  int sigma;
51  int ii;
52  int jj;
53  int kk;
54 
55  START_CODE();
56 
57  if (Nd != 4)
58  QDP_error_exit("Hex-smearing only implemented for Nd=4",Nd);
59 
60  /*
61  * Construct "level 1" smeared links in mu-direction with
62  * staples only in one orthogonal direction, nu
63  */
64 
65  ii = -1;
66  for(int mu = 0; mu < Nd; ++mu)
67  {
68  for(int nu = 0; nu < Nd; ++nu)
69  {
70  if(nu == mu) continue;
71 
72  ii++;
73  /*
74  * Forward staple
75  *
76  * u_tmp(x) = u(x,nu)*u(x+nu,mu)*u_dag(x+mu,nu)
77  */
78  u_tmp = u[nu] * shift(u[mu],FORWARD,nu) * adj(shift(u[nu],FORWARD,mu));
79 
80  /*
81  * Backward staple
82  *
83  * u_tmp(x) += u_dag(x-nu,nu)*u(x-nu,mu)*u(x-nu+mu,nu)
84  */
85  u_tmp += shift(adj(u[nu]) * u[mu] * shift(u[nu],FORWARD,mu),BACKWARD,nu);
86 
87  /*
88  * Unprojected level 1 link
89  */
90  tmp_1 = u_tmp * adj(u[mu]) ;
91 
92  /*
93  * Exponentiation of AntiHermitian traceless matrix
94  */
95  u_tmp = hex_alpha3_fact * tmp_1 ;
96  taproj(u_tmp) ;
97  eesu3(u_tmp) ;
98 
99  u_lv1[ii] = u_tmp * u[mu];
100 
101  } // end loop over nu
102  } // end loop over mu
103 
104  /*
105  * Construct "level 2" smeared links in mu-direction with
106  * "level 1" staples not in the orthogonal direction, nu,
107  * and the "level 1" links decorated in the 4-th orthogonal direction
108  */
109 
110  ii = -1;
111  for(int mu = 0; mu < Nd; ++mu)
112  {
113  for(int nu = 0; nu < Nd; ++nu)
114  {
115  if(nu == mu) continue;
116 
117  ii++;
118  u_tmp = 0;
119  for(rho = 0; rho < Nd; ++rho)
120  {
121  if(rho == mu || rho == nu) continue;
122 
123  /* 4-th orthogonal direction: sigma */
124  for(jj = 0; jj < Nd; ++jj)
125  {
126  if(jj != mu && jj != nu && jj != rho) sigma = jj;
127  }
128  jj = (Nd-1)*mu + sigma;
129  if(sigma > mu ) jj--;
130  kk = (Nd-1)*rho + sigma;
131  if(sigma > rho ) kk--;
132 
133  /*
134  * Forward staple
135  *
136  * u_tmp(x) += u_lv1(x,kk)*u_lv1(x+rho,jj)*u_lv1_dag(x+mu,kk)
137  */
138  u_tmp += u_lv1[kk] * shift(u_lv1[jj],FORWARD,rho) * adj(shift(u_lv1[kk],FORWARD,mu));
139 
140  /*
141  * Backward staple
142  *
143  * u_tmp(x) += u_lv1_dag(x-rho,kk)*u_lv1(x-rho,jj)*u_lv1(x-rho+mu,kk)
144  */
145  u_tmp += shift(adj(u_lv1[kk]) * u_lv1[jj] * shift(u_lv1[kk],FORWARD,mu),BACKWARD,rho);
146  }
147 
148  /*
149  * Unprojected level 2 link
150  */
151  tmp_1 = u_tmp * adj(u[mu]) ;
152 
153  /*
154  * Exponentiation of AntiHermitian traceless matrix
155  */
156  u_tmp = hex_alpha2_fact * tmp_1 ;
157  taproj(u_tmp) ;
158  eesu3( u_tmp ) ;
159  u_lv2[ii] = u_tmp * u[mu] ;
160 
161  }
162  }
163 
164  /*
165  * Construct hyp-smeared links in mu-direction with
166  * "level 2" staples in the orthogonal direction, nu,
167  * and the "level 2" links not decorated in the mu and nu directions
168  */
169 
170  for(int mu = 0; mu < Nd; ++mu)
171  {
172  u_tmp = 0;
173  for(int nu = 0; nu < Nd; ++nu)
174  {
175  if(nu == mu) continue;
176 
177  jj = (Nd-1)*mu + nu;
178  if(nu > mu ) jj--;
179  kk = (Nd-1)*nu + mu;
180  if(mu > nu ) kk--;
181 
182  /*
183  * Forward staple
184  *
185  * u_tmp(x) += u_lv2(x,kk)*u_lv2(x+nu,jj)*u_lv2_dag(x+mu,kk)
186  */
187  u_tmp += u_lv2[kk] * shift(u_lv2[jj],FORWARD,nu) * adj(shift(u_lv2[kk],FORWARD,mu));
188 
189  /*
190  * Backward staple
191  *
192  * u_tmp(x) += u_lv2_dag(x-nu,kk)*u_lv2(x-nu,jj)*u_lv2(x-nu+mu,kk)
193  */
194  u_tmp += shift(adj(u_lv2[kk]) * u_lv2[jj] * shift(u_lv2[kk],FORWARD,mu),BACKWARD,nu);
195  }
196 
197  /*
198  * Unprojected hyp-smeared link
199  */
200  tmp_1 = u_tmp * adj(u[mu]) ;
201 
202  /*
203  * Exponentiation of AntiHermitian traceless matrix
204  */
205  u_tmp = hex_alpha1_fact * tmp_1 ;
206  taproj(u_tmp) ;
207  eesu3( u_tmp ) ;
208 
209  u_hyp[mu] = u_tmp * u[mu] ;
210  }
211 
212 
213  END_CODE();
214  }
215 
216  //! Construct nstep iterations of the "hex-smeared" links of Capitani et al
217  /*! hep-lat/0607006
218  * \ingroup smear
219  *
220  * Construct the "hyp-smeared" links of Capitani et al.,
221  *
222  * Arguments:
223  *
224  * \param u gauge field (Read)
225  * \param u_hyp "hex-smeared" gauge field (Write)
226  * \param nstep number of hex steps (Read)
227  *
228  */
229 
230 
231 
232  void Hex_Smear(const multi1d<LatticeColorMatrix>& u,
233  multi1d<LatticeColorMatrix>& u_hyp, const int nstep)
234  {
235  multi1d<LatticeColorMatrix> u_last(Nd);
236  int i ;
237  START_CODE();
238 
239  if( nstep == 0)
240  {
241  u_hyp = u ;
242  }
243  else
244  {
245  u_last = u ;
246  for(i=0 ; i < nstep ; ++i)
247  {
248  Hex_Smear_onestepp(u_last,u_hyp) ;
249  u_last = u_hyp ;
250  }
251  }
252 
253  END_CODE();
254  }
255 
256 } // ENd namespace Chroma
Primary include file for CHROMA library code.
int mu
Definition: cool.cc:24
int nu
Definition: cool.cc:25
Exactly exponentiate a SU(3) lie algebra element.
void eesu3(LatticeColorMatrix &iQ)
Exact exponentiation of SU(3) matrix.
Definition: eesu3.cc:20
void taproj(LatticeColorMatrix &a)
Take the traceless antihermitian projection of a color matrix.
Definition: taproj.cc:31
void Hex_Smear(const multi1d< LatticeColorMatrix > &u, multi1d< LatticeColorMatrix > &u_hyp, const int nstep)
Construct nstep iterations of the "hex-smeared" links of Capitani et al.
Definition: hex_smear.cc:232
void Hex_Smear_onestepp(multi1d< LatticeColorMatrix > &u, multi1d< LatticeColorMatrix > &u_hyp)
Construct one iteration of the "hex-smeared" links of Capitani et al.
Definition: hex_smear.cc:27
Hex smear a gauge field.
LatticeColorMatrix tmp_1
Definition: meslate.cc:50
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
QDP_error_exit("too many BiCG iterations", n_count, rsd_sq, cp, c, re_rvr, im_rvr, re_a, im_a, re_b, im_b)
static multi1d< LatticeColorMatrix > u
int i
Definition: pbg5p_w.cc:55
START_CODE()
#define FORWARD
Definition: primitives.h:82
#define BACKWARD
Definition: primitives.h:83
Take the traceless antihermitian projection of a color matrix.