CHROMA
cool.cc
Go to the documentation of this file.
1 
2 #error "NOT FULLY CONVERTED"
3 
4 
5 /* Make one interation of "cooling" of a gauge field configuration: */
6 /* minimize the gauge action locally for each link. */
7 /* In the case of SU(3), for each link we loop over the 3 SU(2) subgroups. */
8 
9 /* Warning: this works only for Nc = 2 and 3 ! */
10 
11 /* u -- gauge field ( Modify ) */
12 include(types.mh)
13 
14 SUBROUTINE(cool, u)
15 
16 multi1d<LatticeColorMatrix> u(Nd);
17 
18 { /* Local Variables */
19  include(COMMON_DECLARATIONS)
20  LatticeColorMatrix tmp_1;
21  LatticeColorMatrix tmp_tot;
22  LatticeBoolean bad; /* not used here */
23 
24  int mu;
25  int nu;
26  int cb;
27  int su2_index;
28  int numbad; /* not used here */
29 
31 
32 
33  for(cb = 0;cb <= ( 1); ++cb )
34  for(mu = 0;mu < ( Nd); ++mu )
35  {
36  tmp_tot = 0;
37 
38 
39  for(nu = 0;nu < ( Nd); ++nu )
40  {
41  if(nu == mu) continue;
42 
43  /* Forward staple */
44  /* tmp_1(x) = u(x+mu,nu) * u_dag(x+nu,mu) */
45  tmp_1 = shift(u[nu][1-cb], cb, FORWARD, mu) * shift(adj[u[mu][1-cb]], cb, FORWARD, nu);
46 
47  /* tmp_tot(x) += tmp_1(x) * u_dag(x,nu)
48  += u(x+mu,nu) * u_dag(x+nu,mu)*u_dag(x,nu) */
49  tmp_tot += tmp_1 * adj(u[nu][cb]);
50 
51  /* Backward staple */
52  /* tmp_1(x) = u(x,mu) * u(x+mu,nu) */
53  tmp_1 = u[mu][1-cb] * shift(u[nu][cb], 1-cb, FORWARD, mu);
54 
55  /* tmp_tot(x) += tmp_1_dag(x-nu) * u(x-nu,nu)
56  += u_dag(x+mu-nu,nu) * u_dag(x-nu,mu) * u(x-nu,nu) */
57  tmp_tot += shift(adj[tmp_1], cb, BACKWARD, nu) * shift(u[nu][1-cb], cb, BACKWARD, nu);
58  }
59 
60 
61  /* Loop over SU(2) subgroup su2_index to maximize tr(u*tmp_tot) */
62  if (SchrFun > 0)
63  {
64  /* Make it easy, since these are overwritten anyway! */
65  FILLMASK(u(cb,mu), lSFmask(cb,mu), ONE);
66  FILLMASK(tmp_tot, lSFmask(cb,mu), ONE);
67  }
68  for(su2_index = 0; su2_index < Nc*(Nc-1)/2; ++su2_index)
70 
71  /* Reunitarize */
72  /*#reunit (u[mu][cb], bad, OPTION[REUNITARIZE_ERROR], numbad); */
73  reunit (u[mu][cb], bad, OPTION[REUNITARIZE], numbad);
74 
75  if (SchrFun > 0)
76  {
77  /* Now do the overwrite. */
78  copymask(u[mu][cb], lSFmask[mu][cb], SFBndFld[mu][cb], REPLACE);
79  }
80  }
81 
82 
83  END_CODE();
84 }
#define END_CODE()
Definition: chromabase.h:65
START_CODE()
int cb
Definition: cool.cc:26
int numbad
Definition: cool.cc:28
int mu
Definition: cool.cc:24
LatticeColorMatrix tmp_tot
Definition: cool.cc:18
include(types.mh) multi1d< LatticeColorMatrix > u(Nd)
int su2_index
Definition: cool.cc:27
int nu
Definition: cool.cc:25
LatticeBoolean bad
Definition: cool.cc:22
LatticeColorMatrix tmp_1
Definition: meslate.cc:50
Nd
Definition: meslate.cc:74
static multi1d< LatticeColorMatrix > u
void su3proj(LatticeColorMatrix &u, const LatticeColorMatrix &w, int su2_index)
Definition: su3proj.cc:76
void reunit(LatticeColorMatrixF3 &xa)
Definition: reunit.cc:467
@ REUNITARIZE
Definition: reunit.h:29
#define FORWARD
Definition: primitives.h:82
#define BACKWARD
Definition: primitives.h:83
copymask(lcoord, lbit, ltmp_1, REPLACE)
#define ONE