CHROMA
mesq.cc
Go to the documentation of this file.
1 
2 #error "NOT FULLY CONVERTED"
3 
4 /* Return the value of the trivial geometric definition of */
5 /* the topological Charge */
6 
7 /* Only for U(1) in 2 dim (Nc=1,Nd=2)*/
8 
9 /* u -- gauge field (Read) */
10 /* q -- topological charge (Write) */
11 
12 include(types.mh)
13 
14 SUBROUTINE(MesQ, u, q)
15 
16 multi1d<LatticeColorMatrix> u(Nd);
18 {
19  include(COMMON_DECLARATIONS)
20 
21  LatticeColorMatrix tmp_0;
22  LatticeColorMatrix tmp_1;
23  LatticeComplex wplaq_tmp;
24  LatticeReal tmp_r;
25  LatticeReal tmp_x;
26  LatticeReal tmp_y;
27  LatticeReal phi;
28 
32 
33  int cb;
34  int mu;
35  int nu;
36 
38 
39 
40  phi = 0;
41 
42  if ( Nd != 2 )
43  QDP_error_exit("only support 2 dimensions");
44 
45  if ( Nc != 1 )
46  QDP_error_exit("only support for U[1]);
47 
48  mu=0;
49  nu=1;
50 
51  for(cb=0; cb < 2; ++cb)
52  {
53  /* tmp_0 = u(x+mu,nu)*u_dag(x+nu,mu) */
54  tmp_0 = shift(u[nu][1-cb], cb, FORWARD, mu) * shift(adj[u[mu][1-cb]], cb, FORWARD, nu);
55 
56  /* tmp_1 = tmp_0*u_dag(x,nu)=u(x+mu,nu)*u_dag(x+nu,mu)*u_dag(x,nu) */
57  tmp_1 = tmp_0 * adj(u[nu][cb]);
58 
59  /* wplaq_tmp = tr(u(x,mu)*tmp_1=u(x,mu)*u(x+mu,nu)*u_dag(x+nu,mu)*u_dag(x,nu)) */
60  wplaq_tmp = trace(u[mu][cb] * tmp_1);
61 
62  tmp_x = real(wplaq_tmp);
63  tmp_y = imag(wplaq_tmp);
64  tmp_r = atan2(tmp_y, tmp_x);
65  phi += tmp_r;
66  }
67 
68  tmp = -sum(phi);
69 
70 
71  tmp2 = 8*atan(1);
72  q = tmp / tmp2;
73 
74  END_CODE();
75 }
Nd
Definition: meslate.cc:74
START_CODE()
int cb
Definition: mesq.cc:33
Double q
Definition: mesq.cc:17
LatticeReal tmp_x
Definition: mesq.cc:25
int mu
Definition: mesq.cc:34
int nu
Definition: mesq.cc:35
LatticeComplex wplaq_tmp
Definition: mesq.cc:23
Double tmp2
Definition: mesq.cc:30
LatticeReal tmp_r
Definition: mesq.cc:24
LatticeReal tmp_y
Definition: mesq.cc:26
Double tmp3
Definition: mesq.cc:31
LatticeReal phi
Definition: mesq.cc:27
include(types.mh) multi1d< LatticeColorMatrix > u(Nd)
Double tmp
Definition: mesq.cc:29
LatticeColorMatrix tmp_1
Definition: mesq.cc:18
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
FloatingPoint< double > Double
Definition: gtest.h:7351