CHROMA
cfgtransf.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Many-to-many gauge transformation routine
3  */
4 
5 #include "chroma.h"
6 #include "util/gauge/instanton.h"
7 
8 using namespace Chroma;
9 
10 //! Many-to-many gauge transformation routine
11 /*! \defgroup cfgtransf Tranformation routine
12  * \ingroup main
13  *
14  * Main program for transforming gauge formats
15  */
16 
17 int main(int argc, char **argv)
18 {
19  // Put the machine into a known state
20  Chroma::initialize(&argc, &argv);
21 
22  START_CODE();
23 
24  multi1d<int> nrow(Nd);
25  QDPIO::cout << "Enter lattice size\n";
26  QDPIO::cin >> nrow;
27 
28  // Setup QDP
29  Layout::setLattSize(nrow);
30  Layout::create();
31 
32 // XMLFileWriter xml_out("cfgtransf.xml");
33  Chroma::setXMLOutputFileName("cfgtransf.xml");
34  XMLFileWriter& xml_out = Chroma::getXMLOutputInstance();
35  push(xml_out, "cfgtransf");
36 
37  proginfo(xml_out); // Print out basic program info
38 
39  SzinGauge_t szin_gauge_header; // In case we want to write out a szin
40  bool szin_gauge_header_initP = false;
41 
42 #if 0
43  bool AnisoP;
44  QDPIO::cout << "Enter Anisotropy or not [Y/N = 1/0]\n";
45  QDPIO::cin >> AnisoP;
46 
47  if ( AnisoP )
48  {
49  Real xi_0;
50  int t_dir;
51 
52  QDPIO::cout << "Enter the bare anisitopy factor\n";
53  QDPIO::cin >> xi_0;
54 
55  QDPIO::cout << "Enter the time direction, t_dir\n";
56  QDPIO::cin >> t_dir;
57 
58  QDPIO::cerr << "Currently do not support anisotropy" << std::endl;
59  exit(1);
60  }
61 #endif
62 
63  int input_type;
64  QDPIO::cout << "Enter input Gauge field type\n"
65  << " (1) Free field\n"
66  << " (2) Random-transformed free field\n"
67  << " (3) Hot start (call hotst)\n"
68  << " (4) SZIN configuration on DV\n"
69  << " (5) SZIN configuration on FE\n"
70  << " (6) Illinois staggered configuration on DV\n"
71  << " (7) MILC configuration on FE\n"
72  << " (8) Columbia configuration on FE\n"
73  << " (9) Schroedinger classical background field\n"
74  << " (10) FORTRAN SZIN configuration on FE\n"
75  << " (11) ASCII MILC configuration on FE\n"
76  << " (12) SZIN configuration with fund to adj transf.\n"
77  << " (13) O(3) config to U(1)\n"
78  << " (14) Instanton configuration\n"
79  << " (15) QCD Archive configuration on FE\n"
80  << " (16) MIT gauge configuration on FE\n"
81  << " (17) double prec. MIT gauge configuration on FE\n"
82  << " (18) Kentucky gauge configuration FE\n"
83  << " (19) UKQCD gauge configuration FE\n"
84  << " (20) Single-precision UKQCD gauge configuration FE\n"
85  << " (21) SZIN config in QIO format\n"
86  << " (22) Uniform back ground field\n";
87 
88  QDPIO::cin >> input_type;
89 
90 
91  // Schroedinger BC
92  Real SchrPhiMult; /* Multiplier for Schr. BC fields */
93  int loop_extent;
94  int decay_dir;
95 
96  if ( input_type == 9 )
97  {
98  QDPIO::cout << "This will be a Schroedinger style config used for c_sw measurements\n" << std::endl;
99 
100  QDPIO::cout << "Enter extent of loops in decay direction\n" << std::endl;
101  QDPIO::cin >> loop_extent;;
102 
103  QDPIO::cout << "Enter multiplier for Schroedinger boundary fields\n";
104  QDPIO::cin >> SchrPhiMult;
105 
106  QDPIO::cout << "Enter the boundary condition direction\n";
107  QDPIO::cin >> decay_dir;
108  }
109  else
110  {
111  loop_extent = 1;
112  decay_dir = Nd-1;
113  SchrPhiMult = 1;
114  }
115 
116 
117  int output_type;
118  QDPIO::cout << "Enter output Gauge field type\n"
119  << " (1) back-end SZIN (note, on most platforms back and front-end are the same)\n"
120  << " (2) front-end SZIN\n"
121  << " (3) MILC config on FE\n"
122  << " (4) QCD Archive config on FE\n"
123  << " (5) MIT gauge config on FE\n"
124  << " (6) Kentucky config on FE\n"
125  << " (7) SZIN config in QIO SINGLEFILE format\n"
126  << " (8) SZIN config in QIO MULTIFILE format\n"
127  << " (9) replicated in time dir SZIN config in szin format\n";
128  QDPIO::cin >> output_type;
129 
130  std::string cfg_input_file;
131  QDPIO::cout << "Enter input file name\n";
132  QDPIO::cin >> cfg_input_file;
133 
134  std::string cfg_output_file;
135  QDPIO::cout << "Enter output file name\n";
136  QDPIO::cin >> cfg_output_file;
137 
138  bool CGaugeP; // Flat for Complex Conjugate
139  bool HGaugeP; // Flag for Hermitian Conjugate
140  bool RGaugeP;
141  multi2d<Real> theta(2,Nd); // An array of angles for each dir
142 
143 
144  if(input_type > 1){
145  QDPIO::cout << "Complex conjugate of config?\n";
146  QDPIO::cin >> CGaugeP;
147 
148  QDPIO::cout << "Hermitian conjugate of config?\n";
149  QDPIO::cin >> HGaugeP;
150 
151  if ( input_type > 3 )
152  {
153  QDPIO::cout << "Random gauge transform of config?\n";
154  QDPIO::cin >> RGaugeP;
155  }
156  }
157 
158 
159  bool GSmearP;
160  QDPIO::cout << "APE gauge smearing?\n";
161  QDPIO::cin >> GSmearP;
162 
163  int BlkMax = 100; /* Maximum number of blocking/smearing iterations */
164  Real BlkAccu = 1.0-5; /* Blocking/smearing accuracy */
165  int sm_numb; /* 'Smearing' number */
166  Real sm_fact; /* 'Smearing' factor */
167  int j_decay;
168 
169  if ( GSmearP )
170  {
171  BlkAccu = 1.0e-5;
172  BlkMax = 100;
173 
174  QDPIO::cout << "Enter the direction of decay\n";
175  QDPIO::cin >> j_decay;
176 
177  QDPIO::cout << "Enter the number of smearing\n";
178  QDPIO::cin >> sm_numb;
179 
180  QDPIO::cout << "Enter the smearing factor\n";
181  QDPIO::cin >> sm_fact;
182  }
183 
184  bool HypSmearP;
185  QDPIO::cout << "HYP gauge smearing?\n";
186  QDPIO::cin >> HypSmearP;
187 
188  int GFMax;
189  Real alpha1; /* 'Hyp-mearing' parameter */
190  Real alpha2; /* 'Hyp-mearing' parameter */
191  Real alpha3; /* 'Hyp-mearing' parameter */
192  if ( HypSmearP )
193  {
194  BlkAccu = 1.0e-5;
195  BlkMax = 100;
196 
197  QDPIO::cout << "Enter the number of smearing\n";
198  QDPIO::cin >> sm_numb;
199 
200  QDPIO::cout << "Enter the smearing parameters alpha1, alpha2 and alpha3\n";
201  QDPIO::cin >> alpha1 >> alpha2 >> alpha3;
202  }
203 
204  bool GFixP;
205  QDPIO::cout << "Gauge fixing?\n";
206  QDPIO::cin >> GFixP;
207 
208  bool OrlxDo;
209  Real GFAccu;
210  Real OrPara;
211  std::string gauge_rotate_file;
212 
213  if ( GFixP )
214  {
215  QDPIO::cout << "Enter the direction of decay\n";
216  QDPIO::cin >> j_decay;
217 
218  QDPIO::cout << "Enter the gauge fixing accuracy\n";
219  QDPIO::cin >> GFAccu;
220 
221  QDPIO::cout << "Enter the maximum number of gauge fixing sweeps\n";
222  QDPIO::cin >> GFMax;
223 
224  QDPIO::cout << "Want over-relaxation? (yes=YES)\n";
225  QDPIO::cin >> OrlxDo;
226 
227  QDPIO::cout << "Enter the over-relaxtion parameter\n";
228  QDPIO::cin >> OrPara;
229 
230  QDPIO::cout << "Enter gauge rotation file name\n";
231  QDPIO::cin >> gauge_rotate_file;
232  }
233 
234  QDPIO::cout << "I am working on it...\n";
235 
236  push(xml_out,"Lattis");
237  write(xml_out, "Nd", Nd);
238  write(xml_out, "Nc", Nc);
239  write(xml_out, "nrow", nrow);
240  pop(xml_out);
241 
242 #if 0
243  if ( AnisoP )
244  {
245  push(xml_out,"Anisotropy_parameters");
246  write(xml_out, "AnisoP", AnisoP);
247  write(xml_out, "xi_0", xi_0);
248  write(xml_out, "t_dir", t_dir);
249  pop(xml_out);
250  }
251 #endif
252 
253 #if 0
254  /* Setup Schroedinger boundary fields if desired */
255  if (SchrFun > 0)
256  {
257  SetSFbc(SchrPhiMult, SchrFermP, theta, j_decay);
258  push(xml_out,"Schroed_Func_parameters");
259  write(xml_out, "SchrFun", SchrFun);
260  write(xml_out, "j_decay", j_decay);
261  write(xml_out, "SchrPhiMult", SchrPhiMult);
262  write(xml_out, "SchrFermP", SchrFermP);
263  write(xml_out, "theta", theta);
264  pop(xml_out);
265  }
266 #endif
267 
268 
269  //
270  // Have params, now find out the source for the gauge field
271  //
272  multi1d<LatticeColorMatrix> u(Nd);
273  XMLReader gauge_xml_in, gauge_file_xml_in, gauge_record_xml_in;
274 
275 
276  switch (input_type)
277  {
278  case 1:
279  push(xml_out,"Free_Field");
280  write(xml_out, "input_type", input_type);
281  pop(xml_out);
282  QDPIO::cout << "Fill u with free field\n";
283  u = 1;
284  break;
285 
286  case 2:
287  push(xml_out,"Free_Field_with_random_gauge_transformation");
288  write(xml_out, "input_type", input_type);
289  pop(xml_out);
290  QDPIO::cout << "Fill u with random gauge transformed free field\n";
291  u = 1;
292  rgauge(u);
293  break;
294 
295  case 3:
296  push(xml_out,"Semi-Haar_measure");
297  write(xml_out, "input_type", input_type);
298  pop(xml_out);
299  QDPIO::cout << "Fill u with semi-Haar\n";
300  HotSt(u);
301  break;
302 
303  case 4:
304  case 5:
305  push(xml_out,"SZIN_configuration");
306  write(xml_out, "input_type", input_type);
307  write(xml_out, "cfg_input_file", cfg_input_file);
308  pop(xml_out);
309 
310  QDPIO::cout << "Read SZIN u from FE file " << cfg_input_file << std::endl;
311  readSzin(gauge_xml_in, u, cfg_input_file);
312  read(gauge_xml_in, "/szin", szin_gauge_header);
313  szin_gauge_header_initP = true;
314  break;
315 
316 // case 6: ancient Illinois staggered
317 
318  case 7:
319  push(xml_out,"MILC_config");
320  write(xml_out, "input_type", input_type);
321  write(xml_out, "cfg_input_file", cfg_input_file);
322  pop(xml_out);
323  QDPIO::cout << "Read MILC u from FE file\n";
324  readMILC(gauge_xml_in, u, cfg_input_file);
325  break;
326 
327 // case 8: Ancient columbia config
328 
329 #if 0
330  case 9:
331  {
332  push(xml_out,"Schroedinger_BC_config");
333  write(xml_out, "input_type", input_type);
334  pop(xml_out);
335 
337  params.loop_extent = loop_extent;
338  params.SchrPhiMult = SchrPhiMult;
339  params.decay_dir = decay_dir;
340  SchrNonPertGaugeBC gaugebc(params);
341  u = gaugebc.SFBndFld();
342  }
343  break;
344 #endif
345 
346 // case 10: Ancient fortran szin_config
347 
348 #if 0
349  // Not sure I want this ...
350  case 11:
351  push(xml_out,"Ascii_MILC_config");
352  write(xml_out, "input_type", input_type);
353  write(xml_out, "cfg_input_file", cfg_input_file);
354  pop(xml_out);
355  QDPIO::cout << "Read ASCII MILC u from FE file\n";
356  readascii (u, cfg_input_file);
357  break;
358 #endif
359 
360 #if 0
361  // Not yet...
362  case 12:
363  push(xml_out,"Fund_to_adj_SZIN_config");
364  write(xml_out, "input_type", input_type);
365  write(xml_out, "cfg_input_file", cfg_input_file);
366  pop(xml_out);
367  QDPIO::cout << "Read fund to adj SZIN from file " << cfg_input_file << std::endl;
368  readFunToAdj (u, cfg_input_file);
369  break;
370 #endif
371 
372 #if 0
373  // Not yet...
374  case 13:
375  push(xml_out,"O3_to_U1_config");
376  write(xml_out, "input_type", input_type);
377  write(xml_out, "cfg_input_file", cfg_input_file);
378  pop(xml_out);
379  QDPIO::cout << "Read O(3) to U(1) SZIN from file " << cfg_input_file << std::endl;
380  ReadO3toU1 (u, cfg_input_file);
381  break;
382 #endif
383 
384 #if 1
385  // Hurray!
386  case 14:
387  {
388  multi1d<Real> center(Nd);
389  Real rho;
390  int su2_index;
391  int sign;
392 
393  if (Nc == 1)
394  {
395  QDPIO::cerr << "Instanton construction requires Nc>1";
396  QDP_abort(1);
397  }
398 
399  QDPIO::cout << "Enter instanton center coordinates\n";
400  QDPIO::cin >> center;
401  QDPIO::cout << "Enter instanton size\n";
402  QDPIO::cin >> rho;
403  QDPIO::cout << "Enter instanton sign (+/-1)\n";
404  QDPIO::cin >> sign;
405  if (Nc > 2)
406  {
407  int j = Nc*(Nc-1)/2 - 1;
408  QDPIO::cout << "Enter SU(2) subgroup index, 0 .. " << j << "\n";
409  QDPIO::cin >> su2_index;
410  }
411  else
412  su2_index = 0;
413 
414  push(xml_out,"Instanton_config");
415  write(xml_out, "input_type", input_type);
416  write(xml_out, "center", center);
417  write(xml_out, "rho", rho);
418  write(xml_out, "su2_index", su2_index);
419  write(xml_out, "sign", sign);
420  pop(xml_out);
421  QDPIO::cout << "Create instanton configuration\n";
422  instanton (u, center, rho, su2_index, sign);
423  }
424  break;
425 #endif
426 
427  case 15:
428  push(xml_out,"QCD_Archive_config");
429  write(xml_out, "input_type", input_type);
430  pop(xml_out);
431  QDPIO::cout << "Read QCD Archive u from FE file\n";
432  readArchiv(gauge_xml_in, u, cfg_input_file);
433  break;
434 
435 #if 0
436  // Someday...
437  case 16:
438  push(xml_out,"MIT_config");
439  write(xml_out, "input_type", input_type);
440  pop(xml_out);
441  QDPIO::cout << "Read MIT gauge config from FE file\n";
442  readmitu (cfg_input_file, u);
443  break;
444 #endif
445 
446 #if 0
447  // Not now...
448  case 17:
449  push(xml_out,"MIT_double_config");
450  write(xml_out, "input_type", input_type);
451  pop(xml_out);
452  QDPIO::cout << "Read double prec. MIT gauge config from FE file\n";
453  readmitdu (cfg_input_file, u);
454  savern (seed_old);
455  break;
456 #endif
457 
458  case 18:
459  push(xml_out,"Kentucky_config");
460  write(xml_out, "input_type", input_type);
461  pop(xml_out);
462  QDPIO::cout << "Read Kentucky gauge config from FE file\n";
463  readKYU(u, cfg_input_file);
464  break;
465 
466 #if 0
467  // Not now...
468  case 19:
469  push(xml_out,"UKQCD_config");
470  write(xml_out, "input_type", input_type);
471  pop(xml_out);
472  QDPIO::cout << "Read UKQCD gauge config from FE file\n";
473  readukqcd (cfg_input_file, u);
474  savern (seed_old);
475  break;
476 #endif
477 
478 #if 0
479  // Not now...
480  case 20:
481  push(xml_out,"UKQCD_single_config");
482  write(xml_out, "input_type", input_type);
483  pop(xml_out);
484  QDPIO::cout << "Read single-precision UKQCD gauge config from FE file\n";
485  readukqcdsingle (cfg_input_file, u);
486  savern (seed_old);
487  break;
488 #endif
489 
490  case 21:
491  push(xml_out,"SZIN_QIO_configuration");
492  write(xml_out, "input_type", input_type);
493  write(xml_out, "cfg_input_file", cfg_input_file);
494  pop(xml_out);
495 
496  QDPIO::cout << "Read SZIN u from QIO file " << cfg_input_file << std::endl;
497  readGauge(gauge_file_xml_in, gauge_xml_in, u, cfg_input_file,
498  QDPIO_SERIAL);
499  read(gauge_xml_in, "/szin", szin_gauge_header);
500  szin_gauge_header_initP = true;
501  break;
502 
503  case 22:
504  // Here we have a uniform, diagonal background field
505  // with each direction written as
506  // U = diag(exp(i t_1), exp(i t_2), exp(-i(t_1 + t_2))
507 
508  for(int mu = 0; mu < Nd; mu++){
509  QDPIO::cout << "Enter angles for direction " << mu << std::endl;
510  QDPIO::cin >> theta(0, mu) >> theta(1, mu);
511  }
512 
513  push(xml_out,"Const_diag_gauge");
514  write(xml_out, "input_type", input_type);
515  pop(xml_out);
516  QDPIO::cout << "Creating constant diagonal gauge\n";
517  constgauge(u, theta);
518  break;
519 
520  default:
521  QDP_error_exit("unknown input type", input_type);
522  }
523 
524 
525  // Dump a copy of the input gauge xml
526  write(xml_out, "input_gauge_header", gauge_xml_in);
527 
528 
529  // So what's the plaquette?
530  MesPlq(xml_out, "Observables", u);
531  xml_out.flush();
532 
533  if ( RGaugeP )
534  {
535  rgauge (u);
536  MesPlq(xml_out, "Rand_Gtransf_observables", u);
537  }
538 
539  if(CGaugeP){
540  conjgauge(u);
541  MesPlq(xml_out, "Conj_GTansf_observables",u);
542  }
543 
544  if(HGaugeP){
545  LatticeColorMatrix u_tmp;
546  for(int mu = 0; mu < Nd; mu++){
547 
548  multi1d<int> posn(Nd);
549  assert( Nd == 4 );
550  posn[0] = 0;
551  posn[1] = 0;
552  posn[2] = 0;
553  posn[3] = 0;
554  ColorMatrix uin;
555  ColorMatrix uout;
556  u_tmp = adj(u[mu]);
557 
558  uin = peekSite(u[mu], posn);
559  uout = peekSite(u_tmp, posn);
560 
561  QDPIO::cout << "MU IS " << mu << std::endl << std::endl;
562  Complex element_in, element_out;
563  for(int i = 0; i < Nc; i++)
564  for(int j = 0; j < Nc; j++){
565 
566  element_in = peekColor(uin, i, j);
567  element_out = peekColor(uout, i ,j);
568  QDPIO::cout << "(i,j)= " << i << j <<
569  ", U is " << element_in << ",U dagger is "
570  << element_out << std::endl;
571  }
572  u[mu] = u_tmp;
573 
574  }
575 
576  MesPlq(xml_out, "Herm_Gtransf_observables", u);
577  }
578 
579 
580  if ( GSmearP )
581  {
582  multi1d<LatticeColorMatrix> u_tmp(Nd);
583  if ( j_decay < Nd )
584  u_tmp[j_decay] = u[j_decay];
585 
586  for(int i = 0; i < sm_numb; ++i)
587  {
588  for(int mu = 0; mu < Nd; ++mu)
589  if ( mu != j_decay )
590  APE_Smear(u, u_tmp[mu], mu, 0, sm_fact, BlkAccu, BlkMax, j_decay);
591 
592  u = u_tmp;
593  }
594 
595  push(xml_out,"Smearing_parameters");
596  write(xml_out, "sm_numb",sm_numb);
597  write(xml_out, "sm_fact", sm_fact);
598  write(xml_out, "j_decay", j_decay);
599  pop(xml_out);
600 
601  MesPlq(xml_out, "Smeared_observables", u);
602  }
603 
604  if ( HypSmearP )
605  {
606  multi1d<LatticeColorMatrix> u_tmp(Nd);
607  for(int i = 0; i < sm_numb; ++i)
608  {
609  Hyp_Smear(u, u_tmp, alpha1, alpha2, alpha3, BlkAccu, BlkMax);
610  u = u_tmp;
611  }
612 
613  push(xml_out,"HypSmearing_parameters");
614  write(xml_out, "sm_numb", sm_numb);
615  write(xml_out, "alpha1", alpha1);
616  write(xml_out, "alpha2", alpha2);
617  write(xml_out, "alpha3", alpha3);
618  pop(xml_out);
619 
620  MesPlq(xml_out, "HypSmeared_observables", u);
621  }
622 
623  LatticeColorMatrix g;
624  int nrl_gf;
625  if ( GFixP )
626  {
627  coulGauge(u, g, nrl_gf, j_decay, GFAccu, GFMax, OrlxDo, OrPara);
628 
629  push(xml_out,"Gauge_fixing_parameters");
630  write(xml_out, "j_decay", j_decay);
631  write(xml_out, "GFAccu", GFAccu);
632  write(xml_out, "GFMax", GFMax);
633  write(xml_out, "OrlxDo",OrlxDo);
634  write(xml_out, "OrPara", OrPara);
635  pop(xml_out);
636 
637  MesPlq(xml_out, "Gauge_fixed_observables", u);
638 
639  push(xml_out,"Relaxation_iterations_in_GFIX");
640  write(xml_out, "nrl_gf", nrl_gf);
641  pop(xml_out);
642  }
643 
644 
645  // Compute the plaquette again
648 
649  xml_out.flush();
650 
651  // Make a new szin header if desired
652  switch (output_type)
653  {
654  case 1:
655  case 2:
656  case 7:
657  case 8:
658  case 9:
659  {
660  bool new_headerP;
661  QDPIO::cout << "Enter new szin header?" << std::endl;
662  QDPIO::cin >> new_headerP;
663 
664  if ( new_headerP )
665  {
666  QDPIO::cout << "Enter TotalTrj\n";
667  QDPIO::cin >> szin_gauge_header.TotalTrj;
668  QDPIO::cout << "Enter NOver\n";
669  QDPIO::cin >> szin_gauge_header.NOver;
670  QDPIO::cout << "Enter BetaMC\n";
671  QDPIO::cin >> szin_gauge_header.BetaMC;
672  QDPIO::cout << "Enter BetaMD\n";
673  QDPIO::cin >> szin_gauge_header.BetaMD;
674  QDPIO::cout << "Enter KappaMC\n";
675  QDPIO::cin >> szin_gauge_header.KappaMC;
676  QDPIO::cout << "Enter KappaMD\n";
677  QDPIO::cin >> szin_gauge_header.KappaMD;
678  QDPIO::cout << "Enter dt\n";
679  QDPIO::cin >> szin_gauge_header.dt;
680  QDPIO::cout << "Enter MesTrj\n";
681  QDPIO::cin >> szin_gauge_header.MesTrj;
682  QDPIO::cout << "Enter Nf\n";
683  QDPIO::cin >> szin_gauge_header.Nf;
684  QDPIO::cout << "Enter Npf\n";
685  QDPIO::cin >> szin_gauge_header.Npf;
686  QDPIO::cout << "Enter RefMomTrj\n";
687  QDPIO::cin >> szin_gauge_header.RefMomTrj;
688  QDPIO::cout << "Enter RefFnoiseTrj\n";
689  QDPIO::cin >> szin_gauge_header.RefFnoiseTrj;
690  QDPIO::cout << "Enter LamPl\n";
691  QDPIO::cin >> szin_gauge_header.LamPl;
692  QDPIO::cout << "Enter LamMi\n";
693  QDPIO::cin >> szin_gauge_header.LamMi;
694  QDPIO::cout << "Enter AlpLog\n";
695  QDPIO::cin >> szin_gauge_header.AlpLog;
696  QDPIO::cout << "Enter AlpExp\n";
697  QDPIO::cin >> szin_gauge_header.AlpExp;
698  QDPIO::cout << "Enter seed\n";
699  QDPIO::cin >> szin_gauge_header.seed;
700  }
701  }
702  break;
703  }
704 
705 
706  /* Now write parameters to file cfg_output_file */
707  switch (output_type)
708  {
709  case 1:
710  case 2:
711  {
712  writeSzin(szin_gauge_header, u, cfg_output_file);
713  }
714  break;
715 
716  case 3:
717  {
718  /* Write a MILC format file on FE */
719  MILCGauge_t milc_out;
720  writeMILC (milc_out, u, cfg_output_file);
721  }
722  break;
723 
724  case 4:
725  {
726  /* Write a QCD Archive format file on FE */
727  ArchivGauge_t arc_out;
728  arc_out.w_plaq = w_plaq;
729  arc_out.link = link;
730  writeArchiv(arc_out, u, cfg_output_file);
731  }
732  break;
733 
734 #if 0
735  // Not yet...
736  case 5:
737  /* Write a MIT gauge format file on FE */
738  wrtmitu (cfg_output_file, u);
739  break;
740 #endif
741 
742  case 6:
743  /* Write a Kentucky gauge format file on FE */
744  writeKYU(u, cfg_output_file);
745  break;
746 
747  case 7:
748  case 8:
749  {
750  QDP_volfmt_t volfmt = (output_type == 7) ? QDPIO_SINGLEFILE : QDPIO_MULTIFILE;
751  XMLBufferWriter gauge_file_xml_out, gauge_record_xml_out;
752 
753  push(gauge_file_xml_out, "gauge");
754  write(gauge_file_xml_out, "id", int(0)); // need something better here
755  pop(gauge_file_xml_out);
756  write(gauge_record_xml_out, "szin", szin_gauge_header);
757  writeGauge(gauge_file_xml_out, gauge_record_xml_out, u, cfg_output_file,
758  volfmt, QDPIO_SERIAL);
759 
760  // Save the gauge rotation matrices if gauge fixed
761  if ( GFixP )
762  {
763  XMLBufferWriter transf_file_xml_out, transf_record_xml_out;
764 
765  push(transf_file_xml_out, "gauge_transf");
766  write(transf_file_xml_out, "id", int(0)); // need something better here
767  pop(transf_file_xml_out);
768 
769  push(transf_record_xml_out, "szin_transf");
770  push(transf_record_xml_out,"Gauge_fixing_parameters");
771  write(transf_record_xml_out, "j_decay", j_decay);
772  write(transf_record_xml_out, "GFAccu", GFAccu);
773  write(transf_record_xml_out, "GFMax", GFMax);
774  write(transf_record_xml_out, "OrlxDo",OrlxDo);
775  write(transf_record_xml_out, "OrPara", OrPara);
776  pop(transf_record_xml_out);
777  write(transf_record_xml_out, "szin", szin_gauge_header);
778  pop(transf_record_xml_out);
779 
780  QDPFileWriter to(transf_file_xml_out,gauge_rotate_file,volfmt,QDPIO_SERIAL,QDPIO_OPEN);
781 
782  LatticeColorMatrixF g_f = g;
783  write(to,transf_record_xml_out,g_f); // Always save in single precision!
784  close(to);
785  }
786  }
787  break;
788 
789  case 9:
790  {
791  int n_replica;
792  QDPIO::cout << "Enter the boundary condition direction\n";
793  QDPIO::cin >> j_decay;
794 
795  QDPIO::cout << "Number of times to replicat\n";
796  QDPIO::cin >> n_replica;
797 
798  writeSzinReplica(szin_gauge_header, u, j_decay,
799  n_replica,
800  cfg_output_file);
801  }
802  break;
803 
804  default:
805  QDP_error_exit("unknown output type", output_type);
806  }
807 
808  pop(xml_out);
809 
810  END_CODE();
811 
812  // Time to bolt
814 
815  exit(0);
816 }
int main(int argc, char **argv)
Definition: cfgtransf.cc:17
Primary include file for CHROMA in application codes.
Concrete class for Schroedinger BC - use for nonpertubative tuning.
const multi1d< LatticeColorMatrix > & SFBndFld() const
Fixed gauge links on only the lSFmask() sites.
int mu
Definition: cool.cc:24
int su2_index
Definition: cool.cc:27
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void constgauge(multi1d< LatticeColorMatrix > &u, const multi2d< Real > theta)
Const diagonal gauge field.
Definition: constgauge.cc:23
void conjgauge(multi1d< LatticeColorMatrix > &u)
Take complex conjugate of gauge field u.
Definition: conjgauge.cc:20
void rgauge(multi1d< LatticeColorMatrix > &u, LatticeColorMatrix &g)
Do a random gauge transformation on the u fields.
Definition: rgauge.cc:24
void HotSt(multi1d< LatticeColorMatrix > &u)
Set a gauge field from a sample of (almost) Haar measure.
Definition: hotst.cc:34
void instanton(multi1d< LatticeColorMatrix > &u_inst, const multi1d< Real > &center, Real rho, int su2_index, int sign)
Instanton construction.
Definition: instanton.cc:18
void coulGauge(multi1d< LatticeColorMatrix > &u, int &n_gf, int j_decay, const Real &GFAccu, int GFMax, bool OrDo, const Real &OrPara)
Coulomb (and Landau) gauge fixing.
Definition: coulgauge.cc:37
void proginfo(XMLWriter &xml)
Print out basic information about this program.
Definition: proginfo.cc:24
void writeSzinReplica(SzinGauge_t &header, const multi1d< LatticeColorMatrix > &u, int j_decay, int n_replica, const std::string &cfg_file)
Write a replicated (in time direction) SZIN configuration file.
Definition: writeszin.cc:300
void readMILC(MILCGauge_t &header, multi1d< LatticeColorMatrixF > &u, const std::string &cfg_file)
Read a MILC configuration file.
Definition: readmilc.cc:22
void writeKYU(const multi1d< LatticeColorMatrix > &u, const std::string &cfg_file)
Write a Kentucky gauge configuration.
Definition: kyugauge_io.cc:71
void readGauge(XMLReader &file_xml, XMLReader &record_xml, multi1d< LatticeColorMatrix > &u, const std::string &file, QDP_serialparallel_t serpar)
Read a gauge config in QIO format.
Definition: gauge_io.cc:19
void writeSzin(const SzinGauge_t &header, const multi1d< LatticeColorMatrix > &u, const std::string &cfg_file)
Write a SZIN configuration file.
Definition: writeszin.cc:112
void readKYU(multi1d< LatticeColorMatrix > &u, const std::string &cfg_file)
Read a Kentucky gauge configuration.
Definition: kyugauge_io.cc:20
void writeMILC(const MILCGauge_t &header, const multi1d< LatticeColorMatrix > &u, const std::string &cfg_file)
Write a MILC configuration file.
Definition: writemilc.cc:25
void writeGauge(XMLBufferWriter &file_xml, XMLBufferWriter &record_xml, const multi1d< LatticeColorMatrix > &u, const std::string &file, QDP_volfmt_t volfmt, QDP_serialparallel_t serpar)
Write a gauge config in QIO format.
Definition: gauge_io.cc:60
void readSzin(SzinGauge_t &header, multi1d< LatticeColorMatrix > &u, const std::string &cfg_file)
Read a SZIN configuration file.
Definition: readszin.cc:31
void APE_Smear(const multi1d< LatticeColorMatrix > &u, LatticeColorMatrix &u_smear, int mu, int bl_level, const Real &sm_fact, const Real &BlkAccu, int BlkMax, int j_decay)
Construct APE smeared links from:
Definition: ape_smear.cc:44
void Hyp_Smear(const multi1d< LatticeColorMatrix > &u, multi1d< LatticeColorMatrix > &u_hyp, const Real &alpha1, const Real &alpha2, const Real &alpha3, const Real &BlkAccu, int BlkMax)
Construct the "hyp-smeared" links of Anna Hasenfratz.
Definition: hyp_smear.cc:30
Params params
Construct an instanton or anti-instanton configuration in singular gauge.
unsigned j
Definition: ldumul_w.cc:35
void savern(int iseed[4])
Definition: make_seeds.cc:46
int j_decay
Definition: meslate.cc:22
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
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
static Real xi_0()
Definition: coulgauge.cc:15
void setXMLOutputFileName(const std::string &name)
Set output file name.
Definition: chroma_init.cc:104
push(xml_out,"Condensates")
int i
Definition: pbg5p_w.cc:55
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
Definition: chroma_init.cc:114
void finalize(void)
Chroma finalization routine.
Definition: chroma_init.cc:308
pop(xml_out)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
Definition: mesplq.cc:83
START_CODE()
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
Definition: chroma_init.cc:359
FloatingPoint< double > Double
Definition: gtest.h:7351
::std::string string
Definition: gtest.h:1979
Double link
Definition: pade_trln_w.cc:146
Double t_plaq
Definition: pade_trln_w.cc:145
Double w_plaq
Definition: pade_trln_w.cc:143
Double s_plaq
Definition: pade_trln_w.cc:144
MILC gauge field header.
Definition: milc_io.h:17
Szin gauge field header.
Definition: szin_io.h:17
QDP::Seed seed
Definition: szin_io.h:49