CHROMA
wilson_flow_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Code for Wilson flow
3  *
4  * A collection of routines to compute the
5  * Wilson flow.
6  *
7  * Essentially the code implements appendix C
8  * of
9  *
10  * Properties and uses of the Wilson flow in lattice QCD.
11  * Martin Luscher
12  * Published in JHEP 1008 (2010) 071 , arXiv:1006.4518
13  *
14  * The code calls the existing stout smearing routines
15  * -- which already exist in chroma.
16  *
17  * The Wilson flow can be used to determine the lattice spacing.
18  *
19  *
20  * See below for additional information about the Wilson flow.
21  *
22  * Continuous smearing of Wilson Loops.
23  * Robert Lohmayer, Herbert Neuberger. arXiv:1110.3522.
24  * Published in PoS LATTICE2011 (2011) 249
25  *
26  *
27  *
28  *
29  */
30 
32 #include "meas/glue/mesfield.h"
33 #include "util/gauge/stout_utils.h"
34 #include "util/gauge/expmat.h"
35 #include "util/gauge/taproj.h"
36 
37 //using namespace Chroma;
38 namespace Chroma
39 {
40 
41 
42 
43  /**
44 
45  **/
46 
47 
48  void measure_wilson_gauge(multi1d<LatticeColorMatrix> & u,
49  Real & gspace, Real & gtime,
50  int t_dir)
51  {
52 
53  multi1d<LatticeColorMatrix> field_st(10) ;
54  LatticeColorMatrix tmp ;
55 
56  mesField( field_st,u);
57 
58  int offset = 0;
59 
60  gtime = 0.0 ;
61  gspace = 0.0 ;
62 
63  Double tr ;
64 
65  // for(int mu=0; mu < Nd-1; ++mu)
66 
67  for(int mu=0; mu < Nd; ++mu)
68  {
69  for(int nu=mu+1; nu < Nd; ++nu)
70  {
71  // tr = real(sum(trace(field_st[offset]))) ;
72  // tr = imag(sum(trace(field_st[offset]))) ;
73  tmp = field_st[offset] * field_st[offset] ;
74  tr = real(sum(trace(tmp))) ;
75 
76  // Real tt = 2.0 * tr ;
77  // std::cout << "DEBUG " << mu << " " << nu << " " << tt << std::endl ;
78 
79  if (nu==t_dir)
80  {
81  gtime += 2.0*(tr);
82  }
83  else
84  {
85  gspace += 2.0*(tr);
86  }
87 
88  ++offset ;
89  }
90  }
91 
92  gspace /= -2.0*Layout::vol() ;
93  gtime /= -2.0*Layout::vol() ;
94 
95  }
96 
97 
98  void wilson_flow_one_step(multi1d<LatticeColorMatrix> & u, Real rho, const multi1d<bool>& smear_in_this_dirP)
99  {
100  int mu, dir;
101  multi1d<LatticeColorMatrix> dest(Nd);
102  multi1d<LatticeColorMatrix> next(Nd);
103 
104 
105  // -------------------------------------
106 
107  multi2d<Real> rho_a(4,4) ;
108  multi2d<Real> rho_b1(4,4) ;
109  multi2d<Real> rho_b2(4,4) ;
110  multi2d<Real> rho_c(4,4) ;
111 
112  for (mu = 0; mu <= Nd-1; mu++)
113  {
114  for (dir = 0; dir <= Nd-1; dir++)
115  {
116  rho_a[mu][dir] = rho * 0.25 ;
117 
118  rho_b1[mu][dir] = rho * 8.0/9.0 ;
119  rho_b2[mu][dir] = rho * 17.0/36.0 ;
120 
121  rho_c[mu][dir] = rho * 3.0/4.0 ;
122 
123  }
124  }
125 
126 
127  Stouting::smear_links(u, dest, smear_in_this_dirP, rho_a);
128 
129  LatticeColorMatrix Q, QQ, C ;
130  LatticeColorMatrix Q2, QQ2 ;
131 
132  multi1d<LatticeColorMatrix> Q0(Nd);
133  multi1d<LatticeColorMatrix> Q1(Nd);
134 
135 
136  multi1d<LatticeComplex> f; // routine will resize these
137 
138 
139  for (mu = 0; mu <= Nd-1; mu++)
140  {
141  Stouting::getQsandCs(dest, Q1[mu],QQ,C,mu,smear_in_this_dirP,rho_b1) ;
142  Stouting::getQsandCs(u , Q0[mu],QQ,C,mu,smear_in_this_dirP,rho_b2) ;
143 
144  Q = Q1[mu] - Q0[mu] ;
145  QQ = Q * Q ;
146  Stouting::getFs(Q,QQ,f); // This routine computes the f-s
147 
148  // Assemble the stout links exp(iQ)U_{mu}
149  next[mu]=(f[0] + f[1]*Q + f[2]*QQ)*dest[mu];
150 
151  }
152 
153  for (mu = 0; mu <= Nd-1; mu++)
154  {
155  u[mu] = next[mu] ;
156  dest[mu] = next[mu] ;
157  }
158 
159 
160  for (mu = 0; mu <= Nd-1; mu++)
161  {
162  Stouting::getQsandCs(dest, Q2,QQ,C,mu,smear_in_this_dirP,rho_c) ;
163 
164  Q = Q2 - Q1[mu] + Q0[mu] ;
165  QQ = Q * Q ;
166  Stouting::getFs(Q,QQ,f); // This routine computes the f-s
167 
168  // Assemble the stout links exp(iQ)U_{mu}
169  next[mu]=(f[0] + f[1]*Q + f[2]*QQ)*dest[mu];
170 
171  }
172 
173 
174  for (mu = 0; mu <= Nd-1; mu++)
175  {
176  u[mu] = next[mu] ;
177  }
178 
179 
180 
181  }
182 
183 
184  void wilson_flow(XMLWriter& xml,
185  multi1d<LatticeColorMatrix> & u, int nstep,
186  Real wflow_eps, int t_dir, const multi1d<bool>& smear_dirs)
187  {
188  Real gact4i, gactij;
189  int dim = nstep + 1 ;
190  multi1d<Real> gact4i_vec(dim);
191  multi1d<Real> gactij_vec(dim);
192  multi1d<Real> step_vec(dim);
193 
194 
195 
196  measure_wilson_gauge(u,gactij,gact4i,t_dir);
197  gact4i_vec[0] = gact4i ;
198  gactij_vec[0] = gactij ;
199  step_vec[0] = 0.0 ;
200 
201  // QDPIO::cout << "WFLOW " << 0.0 << " " << gact4i << " " << gactij << std::endl ;
202 
203  QDPIO::cout << "START_ANALYZE_wflow" << std::endl ;
204  QDPIO::cout << "WFLOW time gact4i gactij" << std::endl ;
205 
206  for(int i=0 ; i < nstep ; ++i)
207  {
208  wilson_flow_one_step(u,wflow_eps,smear_dirs) ;
209 
210  measure_wilson_gauge(u,gactij,gact4i,t_dir) ;
211  gact4i_vec[i+1] = gact4i ;
212  gactij_vec[i+1] = gactij ;
213 
214 
215  Real xx = (i + 1) * wflow_eps ;
216  QDPIO::cout << "WFLOW " << xx << " " << gact4i << " " << gactij << std::endl ;
217 
218  step_vec[i+1] = xx ;
219 
220  }
221  QDPIO::cout << "END_ANALYZE_wflow" << std::endl ;
222 
223  push(xml, "wilson_flow_results");
224  write(xml,"wflow_step",step_vec) ;
225  write(xml,"wflow_gact4i",gact4i_vec) ;
226  write(xml,"wflow_gactij",gactij_vec) ;
227  pop(xml); // elem
228 
229  }
230 
231 
232 } // end namespace Chroma
233 
234 
int mu
Definition: cool.cc:24
int nu
Definition: cool.cc:25
Exponentiate a SU(n) lie algebra element by some method,.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void getFs(const LatticeColorMatrix &Q, const LatticeColorMatrix &QQ, multi1d< LatticeComplex > &f)
Given c0 and c1 compute the f-s and b-s.
Definition: stout_utils.cc:383
void smear_links(const multi1d< LatticeColorMatrix > &current, multi1d< LatticeColorMatrix > &next, const multi1d< bool > &smear_in_this_dirP, const multi2d< Real > &rho)
Do the smearing from level i to level i+1.
Definition: stout_utils.cc:936
void getQsandCs(const multi1d< LatticeColorMatrix > &u, LatticeColorMatrix &Q, LatticeColorMatrix &QQ, LatticeColorMatrix &C, int mu, const multi1d< bool > &smear_in_this_dirP, const multi2d< Real > &rho)
Given field U, construct the staples into C, form Q and Q^2 and compute c0 and c1.
Definition: stout_utils.cc:105
void wilson_flow(XMLWriter &xml, multi1d< LatticeColorMatrix > &u, int nstep, Real wflow_eps, int t_dir, const multi1d< bool > &smear_dirs)
Compute the Wilson flow.
Calculates the antihermitian field strength tensor iF(mu,nu)
Nd
Definition: meslate.cc:74
SpinMatrix C()
C = Gamma(10)
Definition: barspinmat_w.cc:29
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
LatticeFermion tmp
Definition: mespbg5p_w.cc:36
push(xml_out,"Condensates")
void measure_wilson_gauge(multi1d< LatticeColorMatrix > &u, Real &gspace, Real &gtime, int t_dir)
int i
Definition: pbg5p_w.cc:55
void mesField(multi1d< LatticeColorMatrixF > &f, const multi1d< LatticeColorMatrixF > &u)
Calculates the antihermitian field strength tensor iF(mu,nu)
Definition: mesfield.cc:80
pop(xml_out)
void wilson_flow_one_step(multi1d< LatticeColorMatrix > &u, Real rho, const multi1d< bool > &smear_in_this_dirP)
FloatingPoint< double > Double
Definition: gtest.h:7351
Double sum
Definition: qtopcor.cc:37
Stout utilities.
Take the traceless antihermitian projection of a color matrix.