CHROMA
hyp_smear3d.cc
Go to the documentation of this file.
1 // $Id: hyp_smear3d.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"
8 #include "util/gauge/sun_proj.h"
9 
10 namespace Chroma
11 {
12  //! Construct the "hyp-smeared" links of Anna Hasenfratz involving only the spatial links
13  /*!
14  * \ingroup smear
15  *
16  * Construct the "hyp-smeared" links of Anna Hasenfratz, with
17  * staple coefficients alpha1, alpha2 and alpha3
18  *
19  * Arguments:
20  *
21  * \param u gauge field (Read)
22  * \param u_hyp "hyp-smeared" gauge field (Write)
23  * \param alpha1 staple coefficient "1" (Read, not used)
24  * \param alpha2 staple coefficient "2" (Read)
25  * \param alpha3 staple coefficient "3" (Read)
26  * \param BlkAccu accuracy in SU(Nc) projection (Read)
27  * \param BlkMax max number of iterations in SU(Nc) projection (Read)
28  * \param j_decay direction of no staple(Read)
29  */
30 
31  void Hyp_Smear3d(const multi1d<LatticeColorMatrix>& u,
32  multi1d<LatticeColorMatrix>& u_hyp,
33  const Real& alpha1, const Real& alpha2, const Real& alpha3,
34  const Real& BlkAccu, int BlkMax,int j_decay)
35  {
36  multi1d<LatticeColorMatrix> u_lv1((Nd-1)*(Nd-2));
37  LatticeColorMatrix u_tmp;
38  LatticeColorMatrix tmp_1;
39  Real ftmp1;
40  Real ftmp2;
41  int rho;
42  int ii;
43  int jj;
44  int kk;
45 
46  START_CODE();
47 
48  if (Nd > 4)
49  QDP_error_exit("Hyp-smearing-3D only implemented for Nd=4",Nd);
50 
51  /*
52  * Construct "level 1" smeared links in mu-direction
53  * with staples only in one orthogonal direction, nu
54  */
55  QDPIO::cout << "HYP-smearing-3D only involving spatial links!" << std::endl;
56 
57  u_hyp = u; // only need to make sure j_decay direction is set
58 
59  ftmp1 = 1.0 - alpha3;
60  ftmp2 = alpha3 / 2;
61  ii = -1;
62  for(int mu = 0; mu < Nd; ++mu) if ( mu != j_decay )
63  {
64  for(int nu = 0; nu < Nd; ++nu) if (nu != mu && nu != j_decay )
65  {
66  ii++;
67  /*
68  * Forward staple
69  *
70  * u_tmp(x) = u(x,nu)*u(x+nu,mu)*u_dag(x+mu,nu)
71  */
72  u_tmp = u[nu] * shift(u[mu],FORWARD,nu) * adj(shift(u[nu],FORWARD,mu));
73 
74  /*
75  * Backward staple
76  *
77  * u_tmp(x) += u_dag(x-nu,nu)*u(x-nu,mu)*u(x-nu+mu,nu)
78  */
79  u_tmp += shift(adj(u[nu]) * u[mu] * shift(u[nu],FORWARD,mu),BACKWARD,nu);
80 
81  /*
82  * Unprojected level 1 link
83  */
84  tmp_1 = ftmp1*u[mu] + ftmp2*u_tmp;
85  u_tmp = adj(tmp_1);
86 
87  /*
88  * Project onto SU(Nc)
89  */
90  u_lv1[ii] = u[mu];
91  sun_proj(u_tmp, u_lv1[ii], BlkAccu, BlkMax);
92  }
93  }
94 
95  /*
96  * Construct hyp-smeared links in mu-direction with
97  * "level 1" staples in the orthogonal direction, nu,
98  * & "level 1" links decorated in 3-rd orthogonal direction
99  */
100 
101  ftmp1 = 1.0 - alpha2;
102  ftmp2 = alpha2 / 4;
103  for(int mu = 0; mu < Nd; ++mu) if ( mu != j_decay )
104  {
105  u_tmp = 0;
106  for(int nu = 0; nu < Nd; ++nu) if (nu != mu && nu != j_decay )
107  {
108  /* 3-th orthogonal direction: rho */
109  for(jj = 0; jj < Nd; ++jj)
110  {
111  if(jj != mu && jj != nu && jj != j_decay) rho = jj;
112  }
113  jj = (Nd-2)*mu + rho;
114  if(rho > mu ) jj--;
115  kk = (Nd-2)*nu + rho;
116  if(rho > nu ) kk--;
117 
118  /*
119  * Forward staple
120  *
121  * u_tmp(x) += u_lv1(x,kk)*u_lv1(x+nu,jj)*u_lv1_dag(x+mu,kk)
122  */
123  u_tmp += u_lv1[kk] * shift(u_lv1[jj],FORWARD,nu) * adj(shift(u_lv1[kk],FORWARD,mu));
124 
125  /*
126  * Backward staple
127  *
128  * u_tmp(x) += u_lv1_dag(x-nu,kk)*u_lv1(x-nu,jj)*u_lv1(x-nu+mu,kk)
129  */
130  u_tmp += shift(adj(u_lv1[kk]) * u_lv1[jj] * shift(u_lv1[kk],FORWARD,mu),BACKWARD,nu);
131  }
132 
133  /*
134  * Unprojected hyp-smeared link
135  */
136  tmp_1 = ftmp1*u[mu] + ftmp2*u_tmp;
137  u_tmp = adj(tmp_1);
138 
139  /*
140  * Project onto SU(Nc)
141  */
142  u_hyp[mu] = u[mu];
143  sun_proj(u_tmp, u_hyp[mu], BlkAccu, BlkMax);
144  }
145 
146  END_CODE();
147  }
148 
149 } // ENd namespace Chroma
Primary include file for CHROMA library code.
int mu
Definition: cool.cc:24
int nu
Definition: cool.cc:25
void Hyp_Smear3d(const multi1d< LatticeColorMatrix > &u, multi1d< LatticeColorMatrix > &u_hyp, const Real &alpha1, const Real &alpha2, const Real &alpha3, const Real &BlkAccu, int BlkMax, int j_decay)
Construct the "hyp-smeared" links of Anna Hasenfratz involving only the spatial links.
Definition: hyp_smear3d.cc:31
Hyp smear a gauge field.
int j_decay
Definition: meslate.cc:22
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
void sun_proj(const LatticeColorMatrix &w, LatticeColorMatrix &v, const Real &BlkAccu, int BlkMax)
Definition: sun_proj.cc:101
START_CODE()
#define FORWARD
Definition: primitives.h:82
#define BACKWARD
Definition: primitives.h:83
Project a complex Nc x Nc matrix W onto SU(Nc) by maximizing Tr(VW)
Double ftmp1
Definition: topol.cc:29
Double ftmp2
Definition: topol.cc:30