2 #error "NOT FULLY CONVERTED"
20 multi1d<LatticeColorMatrix>
u(
Nd);
76 if ( j_decay != Nd-1 && j_decay > 0 )
77 QDP_error_exit("code requires
j_decay ==
Nd-1 and > 0
", j_decay);
90 /* Lattice version of S_ratio */
91 rtmp = TO_REAL(2*Nd*(Nd-1)*Nc);
95 /* Loop over checkerboards and triplet of perpendicular planes */
97 for(cb = 0;cb <= ( 1); ++cb )
98 for(nu1 = 1;nu1 < ( Nd); ++nu1 )
100 /* First "plus-plus
" plaquette */
101 /* tmp_1(x) = u(x+mu1,nu1) */
102 tmp_1(rb[cb]) = shift(u[nu1][1-cb], FORWARD, mu1);
104 /* tmp_2(x) = u(x+nu1,mu1) */
105 tmp_2(rb[cb]) = shift(u[mu1][1-cb], FORWARD, nu1);
107 /* tmp_3(x) = tmp_1 * tmp_2^dag = u(x+mu1,nu1)*u_dag(x+nu1,mu1) */
108 tmp_3 = tmp_1 * adj(tmp_2);
110 /* tmp_1(x) = tmp_3 * u_dag(x,nu1)= u(x+mu1,nu1)*u_dag(x+nu1,mu1)*u_dag(x,nu1) */
111 tmp_1 = tmp_3 * adj(u[nu1][cb]);
113 /* u_clov1(x) = u(x,mu1) * tmp_1 = u(x,mu1)*u(x+mu1,nu1)* */
114 /* u_dag(x+nu1,mu1)*u_dag(x,nu1) */
115 u_clov1 = u[mu1][cb] * tmp_1;
117 plaq_tmp = real(trace(u_clov1));
118 plaq += sum(plaq_tmp);
119 lract[cb] -= plaq_tmp;
121 /* First "plus-minus
" plaquette */
122 /* tmp_1(x) = u(x+mu1,nu1) */
123 tmp_1(rb[1-cb]) = shift(u[nu1][cb], FORWARD, mu1);
125 /* tmp_2(x) = u(x,mu1) * tmp_1 = u(x,mu1)*u(x+mu1,nu1) */
126 tmp_2 = u[mu1][1-cb] * tmp_1;
128 /* tmp_1(x) = tmp_2_dag * u(x,nu1) = u_dag(x+mu1,nu1)*u_dag(x,mu1)*u(x,nu1) */
129 tmp_1 = adj(tmp_2) * u[nu1][1-cb];
131 /* tmp_2(x) = tmp_1(x-nu1) */
132 tmp_2(rb[cb]) = shift(tmp_1, BACKWARD, nu1);
134 /* tmp_1(x) = u(x,mu1) * tmp_2 = u(x,mu1)*u_dag(x-nu1+mu1,nu1)* */
135 /* u_dag(x-nu1,mu1)*u(x-nu1,nu1) */
136 tmp_1 = u[mu1][cb] * tmp_2;
140 plaq_tmp = real(trace(tmp_1));
141 plaq += sum(plaq_tmp);
142 lract[cb] -= plaq_tmp;
144 /* First "minus-minus
" plaquette */
145 /* tmp_1(x) = u(x+mu1,nu1) */
146 tmp_1(rb[cb]) = shift(u[nu1][1-cb], FORWARD, mu1);
148 /* tmp_2(x) = u(x,mu1) * tmp_1 = u(x,mu1)*u(x+mu1,nu1) */
149 tmp_2 = u[mu1][cb] * tmp_1;
151 /* tmp_1(x) = u_dag(x,nu1) * tmp_2 = u_dag(x,nu1)*u(x,mu1)*u(x+mu1,nu1) */
152 tmp_1 = adj(u[nu1][cb]) * tmp_2;
154 /* tmp_2(x) = tmp_1(x-nu1) */
155 tmp_2(rb[1-cb]) = shift(tmp_1, BACKWARD, nu1);
157 /* tmp_1(x) = u_dag(x,mu1) * tmp_2 = u_dag(x,mu1)*u_dag(x-nu1,nu1)* */
158 /* u(x-nu1,mu1)*u(x-nu1+mu1,nu1) */
159 tmp_1 = adj(u[mu1][1-cb]) * tmp_2;
161 /* tmp_2(x) = tmp_1(x-mu1) */
162 tmp_2(rb[cb]) = shift(tmp_1, BACKWARD, mu1);
166 plaq_tmp = real(trace(tmp_2));
167 plaq += sum(plaq_tmp);
168 lract[cb] -= plaq_tmp;
170 /* First "minus-plus
" plaquette */
171 /* tmp_1(x) = u_dag(x,mu1) * u(x,nu1) */
172 tmp_1 = adj(u[mu1][1-cb]) * u[nu1][1-cb];
174 /* tmp_2(x) = u(x+nu1,mu1) */
175 tmp_2(rb[1-cb]) = shift(u[mu1][cb], FORWARD, nu1);
177 /* tmp_3(x) = tmp_1 * tmp_2 = u_dag(x,mu1)*u(x,nu1)*u(x+nu1,mu1) */
178 tmp_3 = tmp_1 * tmp_2;
180 /* tmp_1(x) = tmp_3(x-mu1) */
181 tmp_1(rb[cb]) = shift(tmp_3, BACKWARD, mu1);
183 /* tmp_2(x) = tmp_1 * u_dag(x,nu1) = u_dag(x-mu1,mu1)*u(x-mu1,nu1)* */
184 /* u(x-mu1+nu1,mu1)*u_dag(x,nu1) */
185 tmp_2 = tmp_1 * adj(u[nu1][cb]);
189 plaq_tmp = real(trace(tmp_2));
190 plaq += sum(plaq_tmp);
191 lract[cb] -= plaq_tmp;
193 mu2 = INTEGER_MOD_FUNCTION(nu1,3) + 1;
194 nu2 = INTEGER_MOD_FUNCTION(mu2,3) + 1;
196 /* Second "plus-plus
" plaquette */
197 /* tmp_1(x) = u(x+mu2,nu2) */
198 tmp_1(rb[cb]) = shift(u[nu2][1-cb], FORWARD, mu2);
200 /* tmp_2(x) = u(x+nu2,mu2) */
201 tmp_2(rb[cb]) = shift(u[mu2][1-cb], FORWARD, nu2);
203 /* tmp_3(x) = tmp_1 * tmp_2^dag = u(x+mu2,nu2)*u_dag(x+nu2,mu2) */
204 tmp_3 = tmp_1 * adj(tmp_2);
206 /* tmp_1(x) = tmp_3 * u_dag(x,nu2)= u(x+mu2,nu2)*u_dag(x+nu2,mu2)*u_dag(x,nu2) */
207 tmp_1 = tmp_3 * adj(u[nu2][cb]);
209 /* u_clov2(x) = u(x,mu2) * tmp_1 = u(x,mu2)*u(x+mu2,nu2)* */
210 /* u_dag(x+nu2,mu2)*u_dag(x,nu2) */
211 u_clov2 = u[mu2][cb] * tmp_1;
213 plaq_tmp = real(trace(u_clov2));
214 plaq += sum(plaq_tmp);
215 lract[cb] -= plaq_tmp;
217 /* Second "plus-minus
" plaquette */
218 /* tmp_1(x) = u(x+mu2,nu2) */
219 tmp_1(rb[1-cb]) = shift(u[nu2][cb], FORWARD, mu2);
221 /* tmp_2(x) = u(x,mu2) * tmp_1 = u(x,mu2)*u(x+mu2,nu2) */
222 tmp_2 = u[mu2][1-cb] * tmp_1;
224 /* tmp_1(x) = tmp_2_dag * u(x,nu2) = u_dag(x+mu2,nu2)*u_dag(x,mu2)*u(x,nu2) */
225 tmp_1 = adj(tmp_2) * u[nu2][1-cb];
227 /* tmp_2(x) = tmp_1(x-nu2) */
228 tmp_2(rb[cb]) = shift(tmp_1, BACKWARD, nu2);
230 /* tmp_1(x) = u(x,mu2) * tmp_2 = u(x,mu2)*u_dag(x-nu2+mu2,nu2)* */
231 /* u_dag(x-nu2,mu2)*u(x-nu2,nu2) */
232 tmp_1 = u[mu2][cb] * tmp_2;
236 plaq_tmp = real(trace(tmp_1));
237 plaq += sum(plaq_tmp);
238 lract[cb] -= plaq_tmp;
240 /* Second "minus-minus
" plaquette */
241 /* tmp_1(x) = u(x+mu2,nu2) */
242 tmp_1(rb[cb]) = shift(u[nu2][1-cb], FORWARD, mu2);
244 /* tmp_2(x) = u(x,mu2) * tmp_1 = u(x,mu2)*u(x+mu2,nu2) */
245 tmp_2 = u[mu2][cb] * tmp_1;
247 /* tmp_1(x) = u_dag(x,nu2) * tmp_2 = u_dag(x,nu2)*u(x,mu2)*u(x+mu2,nu2) */
248 tmp_1 = adj(u[nu2][cb]) * tmp_2;
250 /* tmp_2(x) = tmp_1(x-nu2) */
251 tmp_2(rb[1-cb]) = shift(tmp_1, BACKWARD, nu2);
253 /* tmp_1(x) = u_dag(x,mu2) * tmp_2 = u_dag(x,mu2)*u_dag(x-nu2,nu2)* */
254 /* u(x-nu2,mu2)*u(x-nu2+mu2,nu2) */
255 tmp_1 = adj(u[mu2][1-cb]) * tmp_2;
257 /* tmp_2(x) = tmp_1(x-mu2) */
258 tmp_2(rb[cb]) = shift(tmp_1, BACKWARD, mu2);
262 plaq_tmp = real(trace(tmp_2));
263 plaq += sum(plaq_tmp);
264 lract[cb] -= plaq_tmp;
266 /* Second "minus-plus
" plaquette */
267 /* tmp_1(x) = u_dag(x,mu2) * u(x,nu2) */
268 tmp_1 = adj(u[mu2][1-cb]) * u[nu2][1-cb];
270 /* tmp_2(x) = u(x+nu2,mu2) */
271 tmp_2(rb[1-cb]) = shift(u[mu2][cb], FORWARD, nu2);
273 /* tmp_3(x) = tmp_1 * tmp_2 = u_dag(x,mu2)*u(x,nu2)*u(x+nu2,mu2) */
274 tmp_3 = tmp_1 * tmp_2;
276 /* tmp_1(x) = tmp_3(x-mu2) */
277 tmp_1(rb[cb]) = shift(tmp_3, BACKWARD, mu2);
279 /* tmp_2(x) = tmp_1 * u_dag(x,nu2) = u_dag(x-mu2,mu2)*u(x-mu2,nu2)* */
280 /* u(x-mu2+nu2,mu2)*u_dag(x,nu2) */
281 tmp_2 = tmp_1 * adj(u[nu2][cb]);
285 plaq_tmp = real(trace(tmp_2));
286 plaq += sum(plaq_tmp);
287 lract[cb] -= plaq_tmp;
289 /* Now comes the contribution to the topological charge */
291 tmp_2 = adj(u_clov1) * tmp_1;
293 tmp_2 = adj(u_clov2) * tmp_1;
295 tmp_2 = u_clov1 * u_clov2;
297 qtop_tmp = real(trace(tmp_2));
298 lrqtop[cb] -= qtop_tmp;
302 plaq = plaq / TO_DOUBLE(2*(vol)*Nd*(Nd-1)*Nc);
304 /* Lattice version of S_ratio */
306 rtmp = TO_REAL(WORD_VALUE(WORD_rtmp,ONE) / (16*rtmp*rtmp));
307 lract[0] = lract[0] * rtmp;
308 lract[1] = lract[1] * rtmp;
311 S_ratio = sum(lract[0]);
312 S_ratio += sum(lract[1]);
314 /* Lattice version of qtop */
316 rtmp = TO_REAL(WORD_VALUE(WORD_rtmp,ONE) / (256*rtmp*rtmp));
317 lrqtop[0] = lrqtop[0] * rtmp;
318 lrqtop[1] = lrqtop[1] * rtmp;
321 qtop = sum(lrqtop[0]);
322 qtop += sum(lrqtop[1]);
324 /* sum the action density over each time slice */
325 action_slice = sumMulti(lract[0], timeslice);
326 action_slice += sumMulti(lract[1], timeslice);
328 /* sum the topological charge density over each time slice */
329 qtop_slice = sumMulti(lrqtop[0], timeslice);
330 qtop_slice += sumMulti(lrqtop[1], timeslice);
333 /*### Print out the action and topological charge density in SCIAN stf format */
335 fprintf(unit_21," TIME %4
d\
n RANK 3\
n DIMENSIONS %4
d%4
d%4
d\
n\
336 BOUNDS 0 %4
d 0 %4
d 0 %4
d\
n SCALAR\
n ORDER COLUMN\
n INTERLACED\
n DATA\
n",
337 i_cool,lx+1,ly+1,lz+1,lx,ly,lz);
338 fprintf(unit_22," TIME %4
d\
n RANK 3\
n DIMENSIONS %4
d%4
d%4
d\
n\
339 BOUNDS 0 %4
d 0 %4
d 0 %4
d\
n SCALAR\
n ORDER COLUMN\
n INTERLACED\
n DATA\
n",
340 i_cool,lx+1,ly+1,lz+1,lx,ly,lz);
342 /* Extend the x,y,z axes for padding. Done for Scian and periodic BC. */
343 for(z = 0;z <= ( lz); ++z )
344 for(y = 0;y <= ( ly); ++y )
345 for(x = 0;x <= ( lx); ++x )
347 ix = INTEGER_MOD_FUNCTION(x,lx);
348 iy = INTEGER_MOD_FUNCTION(y,ly);
349 iz = INTEGER_MOD_FUNCTION(z,lz);
350 it = INTEGER_MOD_FUNCTION(t_slice,lt);
352 cb = INTEGER_MOD_FUNCTION(ix+iy+iz+it,2);
360 INDEXING(lract(cb),coord,rtmp);
361 fprintf(unit_21," %14.7g\
n",rtmp);
363 INDEXING(lrqtop(cb),coord,rtmp);
364 fprintf(unit_22," %14.7g\
n",rtmp);
367 fprintf(unit_21," END\
n");
368 fprintf(unit_22," END\
n");
370 /*### END ############### */
373 /*### Print out the action and topological charge density in SCIAN stf format */
378 fprintf(unit_23," TIME %4
d\
n RANK 4\
n DIMENSIONS %4
d%4
d%4
d%4
d\
n\
379 BOUNDS 0 %4
d 0 %4
d 0 %4
d 0 %4
d\
n SCALAR\
n ORDER COLUMN\
n INTERLACED\
n DATA\
n",
380 i_cool,lx+1,ly+1,lz+1,lt+1,lx,ly,lz,lt);
383 /* Extend the x,y,z axes for padding. Done for Scian and periodic BC. */
384 for(t = 0;t <= ( lt); ++t )
385 for(z = 0;z <= ( lz); ++z )
386 for(y = 0;y <= ( ly); ++y )
387 for(x = 0;x <= ( lx); ++x )
389 ix = INTEGER_MOD_FUNCTION(x,lx);
390 iy = INTEGER_MOD_FUNCTION(y,ly);
391 iz = INTEGER_MOD_FUNCTION(z,lz);
392 it = INTEGER_MOD_FUNCTION(t,lt);
399 INDEXING(lract(0),coord,rtmp);
400 fprintf(unit_23," %14.7g\
n",rtmp);
403 fprintf(unit_23," END\
n");
405 /*### END ############### */
407 printf(" %
d %
d %g %g %g\
n",i_cool,t_slice,plaq,qtop,S_ratio);
408 push(xml_out,"MesLatE
");
409 write(xml_out, "i_cool", i_cool);
410 write(xml_out, "t_slice", t_slice);
411 write(xml_out, "plaq", plaq);
412 write(xml_out, "qtop", qtop);
413 write(xml_out, "S_ratio", S_ratio);
multi1d< Double > action_slice(lt)
LatticeColorMatrix u_clov2
include(types.mh) multi1d< LatticeColorMatrix > u(Nd)
LatticeColorMatrix u_clov1
multi1d< Double > qtop_slice(lt)
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