17 int main(
int argc,
char **argv)
24 multi1d<int> nrow(
Nd);
25 QDPIO::cout <<
"Enter lattice size\n";
29 Layout::setLattSize(nrow);
35 push(xml_out,
"cfgtransf");
40 bool szin_gauge_header_initP =
false;
44 QDPIO::cout <<
"Enter Anisotropy or not [Y/N = 1/0]\n";
52 QDPIO::cout <<
"Enter the bare anisitopy factor\n";
55 QDPIO::cout <<
"Enter the time direction, t_dir\n";
58 QDPIO::cerr <<
"Currently do not support anisotropy" << std::endl;
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";
88 QDPIO::cin >> input_type;
96 if ( input_type == 9 )
98 QDPIO::cout <<
"This will be a Schroedinger style config used for c_sw measurements\n" << std::endl;
100 QDPIO::cout <<
"Enter extent of loops in decay direction\n" << std::endl;
101 QDPIO::cin >> loop_extent;;
103 QDPIO::cout <<
"Enter multiplier for Schroedinger boundary fields\n";
104 QDPIO::cin >> SchrPhiMult;
106 QDPIO::cout <<
"Enter the boundary condition direction\n";
107 QDPIO::cin >> decay_dir;
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;
131 QDPIO::cout <<
"Enter input file name\n";
132 QDPIO::cin >> cfg_input_file;
135 QDPIO::cout <<
"Enter output file name\n";
136 QDPIO::cin >> cfg_output_file;
141 multi2d<Real> theta(2,
Nd);
145 QDPIO::cout <<
"Complex conjugate of config?\n";
146 QDPIO::cin >> CGaugeP;
148 QDPIO::cout <<
"Hermitian conjugate of config?\n";
149 QDPIO::cin >> HGaugeP;
151 if ( input_type > 3 )
153 QDPIO::cout <<
"Random gauge transform of config?\n";
154 QDPIO::cin >> RGaugeP;
160 QDPIO::cout <<
"APE gauge smearing?\n";
161 QDPIO::cin >> GSmearP;
164 Real BlkAccu = 1.0-5;
174 QDPIO::cout <<
"Enter the direction of decay\n";
177 QDPIO::cout <<
"Enter the number of smearing\n";
178 QDPIO::cin >> sm_numb;
180 QDPIO::cout <<
"Enter the smearing factor\n";
181 QDPIO::cin >> sm_fact;
185 QDPIO::cout <<
"HYP gauge smearing?\n";
186 QDPIO::cin >> HypSmearP;
197 QDPIO::cout <<
"Enter the number of smearing\n";
198 QDPIO::cin >> sm_numb;
200 QDPIO::cout <<
"Enter the smearing parameters alpha1, alpha2 and alpha3\n";
201 QDPIO::cin >> alpha1 >> alpha2 >> alpha3;
205 QDPIO::cout <<
"Gauge fixing?\n";
215 QDPIO::cout <<
"Enter the direction of decay\n";
218 QDPIO::cout <<
"Enter the gauge fixing accuracy\n";
219 QDPIO::cin >> GFAccu;
221 QDPIO::cout <<
"Enter the maximum number of gauge fixing sweeps\n";
224 QDPIO::cout <<
"Want over-relaxation? (yes=YES)\n";
225 QDPIO::cin >> OrlxDo;
227 QDPIO::cout <<
"Enter the over-relaxtion parameter\n";
228 QDPIO::cin >> OrPara;
230 QDPIO::cout <<
"Enter gauge rotation file name\n";
231 QDPIO::cin >> gauge_rotate_file;
234 QDPIO::cout <<
"I am working on it...\n";
236 push(xml_out,
"Lattis");
238 write(xml_out,
"Nc", Nc);
239 write(xml_out,
"nrow", nrow);
245 push(xml_out,
"Anisotropy_parameters");
246 write(xml_out,
"AnisoP", AnisoP);
248 write(xml_out,
"t_dir", t_dir);
257 SetSFbc(SchrPhiMult, SchrFermP, theta,
j_decay);
258 push(xml_out,
"Schroed_Func_parameters");
259 write(xml_out,
"SchrFun", SchrFun);
261 write(xml_out,
"SchrPhiMult", SchrPhiMult);
262 write(xml_out,
"SchrFermP", SchrFermP);
263 write(xml_out,
"theta", theta);
272 multi1d<LatticeColorMatrix>
u(
Nd);
273 XMLReader gauge_xml_in, gauge_file_xml_in, gauge_record_xml_in;
279 push(xml_out,
"Free_Field");
280 write(xml_out,
"input_type", input_type);
282 QDPIO::cout <<
"Fill u with free field\n";
287 push(xml_out,
"Free_Field_with_random_gauge_transformation");
288 write(xml_out,
"input_type", input_type);
290 QDPIO::cout <<
"Fill u with random gauge transformed free field\n";
296 push(xml_out,
"Semi-Haar_measure");
297 write(xml_out,
"input_type", input_type);
299 QDPIO::cout <<
"Fill u with semi-Haar\n";
305 push(xml_out,
"SZIN_configuration");
306 write(xml_out,
"input_type", input_type);
307 write(xml_out,
"cfg_input_file", cfg_input_file);
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;
319 push(xml_out,
"MILC_config");
320 write(xml_out,
"input_type", input_type);
321 write(xml_out,
"cfg_input_file", cfg_input_file);
323 QDPIO::cout <<
"Read MILC u from FE file\n";
324 readMILC(gauge_xml_in,
u, cfg_input_file);
332 push(xml_out,
"Schroedinger_BC_config");
333 write(xml_out,
"input_type", input_type);
337 params.loop_extent = loop_extent;
338 params.SchrPhiMult = SchrPhiMult;
339 params.decay_dir = decay_dir;
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);
355 QDPIO::cout <<
"Read ASCII MILC u from FE file\n";
356 readascii (
u, cfg_input_file);
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);
367 QDPIO::cout <<
"Read fund to adj SZIN from file " << cfg_input_file << std::endl;
368 readFunToAdj (
u, cfg_input_file);
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);
379 QDPIO::cout <<
"Read O(3) to U(1) SZIN from file " << cfg_input_file << std::endl;
380 ReadO3toU1 (
u, cfg_input_file);
388 multi1d<Real> center(
Nd);
395 QDPIO::cerr <<
"Instanton construction requires Nc>1";
399 QDPIO::cout <<
"Enter instanton center coordinates\n";
400 QDPIO::cin >> center;
401 QDPIO::cout <<
"Enter instanton size\n";
403 QDPIO::cout <<
"Enter instanton sign (+/-1)\n";
407 int j = Nc*(Nc-1)/2 - 1;
408 QDPIO::cout <<
"Enter SU(2) subgroup index, 0 .. " <<
j <<
"\n";
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);
419 write(xml_out,
"sign", sign);
421 QDPIO::cout <<
"Create instanton configuration\n";
428 push(xml_out,
"QCD_Archive_config");
429 write(xml_out,
"input_type", input_type);
431 QDPIO::cout <<
"Read QCD Archive u from FE file\n";
432 readArchiv(gauge_xml_in,
u, cfg_input_file);
438 push(xml_out,
"MIT_config");
439 write(xml_out,
"input_type", input_type);
441 QDPIO::cout <<
"Read MIT gauge config from FE file\n";
442 readmitu (cfg_input_file,
u);
449 push(xml_out,
"MIT_double_config");
450 write(xml_out,
"input_type", input_type);
452 QDPIO::cout <<
"Read double prec. MIT gauge config from FE file\n";
453 readmitdu (cfg_input_file,
u);
459 push(xml_out,
"Kentucky_config");
460 write(xml_out,
"input_type", input_type);
462 QDPIO::cout <<
"Read Kentucky gauge config from FE file\n";
469 push(xml_out,
"UKQCD_config");
470 write(xml_out,
"input_type", input_type);
472 QDPIO::cout <<
"Read UKQCD gauge config from FE file\n";
473 readukqcd (cfg_input_file,
u);
481 push(xml_out,
"UKQCD_single_config");
482 write(xml_out,
"input_type", input_type);
484 QDPIO::cout <<
"Read single-precision UKQCD gauge config from FE file\n";
485 readukqcdsingle (cfg_input_file,
u);
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);
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,
499 read(gauge_xml_in,
"/szin", szin_gauge_header);
500 szin_gauge_header_initP =
true;
509 QDPIO::cout <<
"Enter angles for direction " <<
mu << std::endl;
510 QDPIO::cin >> theta(0,
mu) >> theta(1,
mu);
513 push(xml_out,
"Const_diag_gauge");
514 write(xml_out,
"input_type", input_type);
516 QDPIO::cout <<
"Creating constant diagonal gauge\n";
526 write(xml_out,
"input_gauge_header", gauge_xml_in);
530 MesPlq(xml_out,
"Observables",
u);
536 MesPlq(xml_out,
"Rand_Gtransf_observables",
u);
541 MesPlq(xml_out,
"Conj_GTansf_observables",
u);
545 LatticeColorMatrix u_tmp;
548 multi1d<int> posn(
Nd);
558 uin = peekSite(
u[
mu], posn);
559 uout = peekSite(u_tmp, posn);
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++){
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;
576 MesPlq(xml_out,
"Herm_Gtransf_observables",
u);
582 multi1d<LatticeColorMatrix> u_tmp(
Nd);
586 for(
int i = 0;
i < sm_numb; ++
i)
595 push(xml_out,
"Smearing_parameters");
596 write(xml_out,
"sm_numb",sm_numb);
597 write(xml_out,
"sm_fact", sm_fact);
601 MesPlq(xml_out,
"Smeared_observables",
u);
606 multi1d<LatticeColorMatrix> u_tmp(
Nd);
607 for(
int i = 0;
i < sm_numb; ++
i)
609 Hyp_Smear(
u, u_tmp, alpha1, alpha2, alpha3, BlkAccu, BlkMax);
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);
620 MesPlq(xml_out,
"HypSmeared_observables",
u);
623 LatticeColorMatrix g;
629 push(xml_out,
"Gauge_fixing_parameters");
631 write(xml_out,
"GFAccu", GFAccu);
632 write(xml_out,
"GFMax", GFMax);
633 write(xml_out,
"OrlxDo",OrlxDo);
634 write(xml_out,
"OrPara", OrPara);
637 MesPlq(xml_out,
"Gauge_fixed_observables",
u);
639 push(xml_out,
"Relaxation_iterations_in_GFIX");
640 write(xml_out,
"nrl_gf", nrl_gf);
661 QDPIO::cout <<
"Enter new szin header?" << std::endl;
662 QDPIO::cin >> new_headerP;
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";
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;
712 writeSzin(szin_gauge_header,
u, cfg_output_file);
727 ArchivGauge_t arc_out;
730 writeArchiv(arc_out,
u, cfg_output_file);
738 wrtmitu (cfg_output_file,
u);
750 QDP_volfmt_t volfmt = (output_type == 7) ? QDPIO_SINGLEFILE : QDPIO_MULTIFILE;
751 XMLBufferWriter gauge_file_xml_out, gauge_record_xml_out;
753 push(gauge_file_xml_out,
"gauge");
754 write(gauge_file_xml_out,
"id",
int(0));
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);
763 XMLBufferWriter transf_file_xml_out, transf_record_xml_out;
765 push(transf_file_xml_out,
"gauge_transf");
766 write(transf_file_xml_out,
"id",
int(0));
767 pop(transf_file_xml_out);
769 push(transf_record_xml_out,
"szin_transf");
770 push(transf_record_xml_out,
"Gauge_fixing_parameters");
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);
780 QDPFileWriter to(transf_file_xml_out,gauge_rotate_file,volfmt,QDPIO_SERIAL,QDPIO_OPEN);
782 LatticeColorMatrixF g_f = g;
783 write(to,transf_record_xml_out,g_f);
792 QDPIO::cout <<
"Enter the boundary condition direction\n";
795 QDPIO::cout <<
"Number of times to replicat\n";
796 QDPIO::cin >> n_replica;
int main(int argc, char **argv)
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.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams ¶m)
Writer parameters.
void constgauge(multi1d< LatticeColorMatrix > &u, const multi2d< Real > theta)
Const diagonal gauge field.
void conjgauge(multi1d< LatticeColorMatrix > &u)
Take complex conjugate of gauge field u.
void rgauge(multi1d< LatticeColorMatrix > &u, LatticeColorMatrix &g)
Do a random gauge transformation on the u fields.
void HotSt(multi1d< LatticeColorMatrix > &u)
Set a gauge field from a sample of (almost) Haar measure.
void instanton(multi1d< LatticeColorMatrix > &u_inst, const multi1d< Real > ¢er, Real rho, int su2_index, int sign)
Instanton construction.
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.
void proginfo(XMLWriter &xml)
Print out basic information about this program.
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.
void readMILC(MILCGauge_t &header, multi1d< LatticeColorMatrixF > &u, const std::string &cfg_file)
Read a MILC configuration file.
void writeKYU(const multi1d< LatticeColorMatrix > &u, const std::string &cfg_file)
Write a Kentucky gauge configuration.
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.
void writeSzin(const SzinGauge_t &header, const multi1d< LatticeColorMatrix > &u, const std::string &cfg_file)
Write a SZIN configuration file.
void readKYU(multi1d< LatticeColorMatrix > &u, const std::string &cfg_file)
Read a Kentucky gauge configuration.
void writeMILC(const MILCGauge_t &header, const multi1d< LatticeColorMatrix > &u, const std::string &cfg_file)
Write a MILC configuration file.
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.
void readSzin(SzinGauge_t &header, multi1d< LatticeColorMatrix > &u, const std::string &cfg_file)
Read a SZIN configuration file.
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:
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.
Construct an instanton or anti-instanton configuration in singular gauge.
void savern(int iseed[4])
Asqtad Staggered-Dirac operator.
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
void setXMLOutputFileName(const std::string &name)
Set output file name.
push(xml_out,"Condensates")
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
FloatingPoint< double > Double