CHROMA
polycor.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Construct Polyakov loop correlation functions from fuzzy links
3  */
4 
5 #include "chromabase.h"
6 #include "util/gauge/shift2.h"
7 #include "meas/glue/polycor.h"
8 
9 namespace Chroma
10 {
11 
12  //! Construct Polyakov loop correlation functions from fuzzy links
13  /*!
14  * \ingroup glue
15  *
16  * Construct Polyakov loop correlation functions from fuzzy links at
17  * blocking level bl_level in the directions orthogonal to j_decay
18  * and Write them in (pseudo) XML format.
19  *
20  * \param xml_out xml file object ( Write )
21  * \param xml_group std::string used for writing xml data ( Read )
22  * \param u (blocked) gauge field ( Read )
23  * \param block_latt block lattice size ( Read )
24  * \param bl_level blocking level ( Read )
25  * \param phases object holds list of momenta and Fourier phases ( Read )
26  */
27 
28  void polycor(XMLWriter& xml_out, const std::string& xml_group,
29  const multi1d<LatticeColorMatrix>& u,
30  const SftMom& phases,
31  int bl_level)
32  {
33  START_CODE();
34 
35  // Length of lattice in decay direction
36  int length = phases.numSubsets();
37  int j_decay = phases.getDir();
38 
39  int half_length = length/2 + 1;
40 
41  LatticeColorMatrix u_dble;
42  LatticeColorMatrix pol;
43  LatticeColorMatrix tmp_1;
44 
45  multi1d< multi1d<DComplex> > poly_loop_slice(Nd-1);
46  multi1d<DComplex> poly_slice(length);
47  multi1d<Double> poly_corr(half_length);
48  DComplex poly_loop;
49  DComplex cdummy;
50  Double dummy;
51  int block_latt;
52  int j_poly;
53  int mu;
54  int n;
55  int t;
56  int t0;
57  int t1;
58  int mu_inc;
59 
60  push(xml_out, xml_group);
61 
62  for(int i=0; i < poly_loop_slice.size(); ++i)
63  {
64  poly_loop_slice[i].resize(length);
65  }
66 
67  /* Loop over directions orthogonal to j_decay */
68  mu_inc = 0;
69  for(mu = 0; mu < Nd; ++mu)
70  {
71  if( mu != j_decay )
72  {
73  j_poly = mu;
74  mu_inc = mu_inc + 1;
75 
76  /* Write fine size of blocked lattice in direction mu */
77  block_latt = QDP::Layout::lattSize()[j_poly] / (1 << bl_level);
78 
79  /* Construct double links */
80  tmp_1 = shift2(u[mu], FORWARD, mu, bl_level);
81  u_dble = u[mu] * tmp_1;
82 
83  /* Multiply together to get the Polyakov loop */
84  pol = u_dble;
85 
86  for(n = 2; n <= block_latt/2; ++n) /* runs over half the linear block size */
87  {
88  tmp_1 = shift2(pol, FORWARD, mu, bl_level+1);
89  pol = u_dble * tmp_1;
90  }
91 
92  /* Multiply last link for odd blocked lattice size */
93  if ( (block_latt & 1) != 0 )
94  {
95  tmp_1 = shift2(pol, FORWARD, mu, bl_level);
96  pol = u[mu] * tmp_1;
97  }
98 
99  /* Take the trace and sum up */
100  poly_slice = sumMulti(trace(pol), phases.getSet());
101 
102  /* Keep a copy of poly_slice */
103  for(t = 0; t < length; ++t)
104  poly_loop_slice[mu_inc-1][t] = poly_slice[t];
105 
106  /* Initialize Polyakov loop correlations to zero */
107  poly_loop = 0;
108  poly_corr = 0;
109 
110  /* vacuum expectation value */
111  for(t = 0;t < ( length); ++t )
112  poly_loop += poly_slice[t];
113 
114  /* And now the Polyakov loop correlation function */
115  for(t0 = 0;t0 < ( length); ++t0 )
116  for(t = 0;t < ( half_length); ++t )
117  {
118  t1 = (t + t0) % length;
119  cdummy = poly_slice[t0] * adj(poly_slice[t1]);
120 
121  dummy = real(cdummy);
122  poly_corr[t] += dummy;
123  }
124 
125  /* Normalize */
126  dummy = Double(1) / Double(QDP::Layout::vol());
127  poly_loop = poly_loop * dummy;
128 
129  for(t = 0;t < ( half_length); ++t )
130  poly_corr[t] = poly_corr[t] * dummy;
131 
132  /* Finally Write Polyakov loop correlations in XML format */
133  push(xml_out,"Poly_loop_correlation");
134  write(xml_out, "j_decay", j_decay);
135  write(xml_out, "bl_level", bl_level);
136  write(xml_out, "j_poly", j_poly);
137  write(xml_out, "poly_loop", poly_loop);
138  write(xml_out, "poly_corr", poly_corr);
139  pop(xml_out);
140  } /* end if( mu != j_decay ) */
141  } /* end loop over mu */
142 
143  push(xml_out,"Poly_loop_slice");
144  write(xml_out, "j_decay", j_decay);
145  write(xml_out, "bl_level", bl_level);
146  push(xml_out, "Slices");
147  for(int i=0; i < poly_loop_slice.size(); ++i)
148  {
149  push(xml_out, "elem");
150  write(xml_out, "slice", i);
151  write(xml_out, "poly_loop_slice", poly_loop_slice[i]);
152  pop(xml_out);
153  }
154  pop(xml_out);
155  pop(xml_out);
156 
157  pop(xml_out);
158 
159  END_CODE();
160  }
161 
162 }
Primary include file for CHROMA library code.
Fourier transform phase factor support.
Definition: sftmom.h:35
int numSubsets() const
Number of subsets - length in decay direction.
Definition: sftmom.h:63
int getDir() const
Decay direction.
Definition: sftmom.h:69
const Set & getSet() const
The set to be used in sumMulti.
Definition: sftmom.h:57
int mu
Definition: cool.cc:24
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
LatticeColorMatrix shift2(const LatticeColorMatrix &s1, int isign, int dir, int level)
A simple not-fancy power of 2 shift.
Definition: shift2.cc:13
void polycor(XMLWriter &xml_out, const std::string &xml_group, const multi1d< LatticeColorMatrix > &u, const SftMom &phases, int bl_level)
Construct Polyakov loop correlation functions from fuzzy links.
Definition: polycor.cc:28
unsigned n
Definition: ldumul_w.cc:36
int j_decay
Definition: meslate.cc:22
int t
Definition: meslate.cc:37
LatticeColorMatrix tmp_1
Definition: meslate.cc:50
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
int i
Definition: pbg5p_w.cc:55
pop(xml_out)
START_CODE()
FloatingPoint< double > Double
Definition: gtest.h:7351
::std::string string
Definition: gtest.h:1979
Construct Polyakov loop correlation functions from fuzzy links.
#define FORWARD
Definition: primitives.h:82
Real dummy
Definition: qtopcor.cc:36
Shift by a power of 2.