cfgtransf.cc

Go to the documentation of this file.
00001 // $Id: cfgtransf.cc,v 3.1 2006/06/11 06:30:33 edwards Exp $
00002 /*! \file
00003  *  \brief Many-to-many gauge transformation routine
00004  */
00005 
00006 #include "chroma.h"
00007 
00008 using namespace Chroma;
00009 
00010 //! Many-to-many gauge transformation routine
00011 /*! \defgroup cfgtransf Tranformation routine
00012  *  \ingroup main
00013  *
00014  * Main program for transforming gauge formats
00015  */
00016 
00017 int main(int argc, char **argv)
00018 {
00019   // Put the machine into a known state
00020   Chroma::initialize(&argc, &argv);
00021 
00022   START_CODE();
00023   
00024   multi1d<int> nrow(Nd);
00025   QDPIO::cout << "Enter lattice size\n";
00026   QDPIO::cin >> nrow;
00027   
00028   // Setup QDP
00029   Layout::setLattSize(nrow);
00030   Layout::create();
00031 
00032 //  XMLFileWriter xml_out("cfgtransf.xml");
00033   Chroma::setXMLOutputFileName("cfgtransf.xml");
00034   XMLFileWriter& xml_out = Chroma::getXMLOutputInstance();
00035   push(xml_out, "cfgtransf");
00036 
00037   proginfo(xml_out);    // Print out basic program info
00038 
00039   SzinGauge_t  szin_gauge_header;  // In case we want to write out a szin
00040   bool szin_gauge_header_initP = false;
00041 
00042 #if 0
00043   bool AnisoP;
00044   QDPIO::cout << "Enter Anisotropy or not [Y/N = 1/0]\n";
00045   QDPIO::cin >> AnisoP;
00046 
00047   if ( AnisoP )
00048   {
00049     Real xi_0;
00050     int  t_dir;
00051 
00052     QDPIO::cout << "Enter the bare anisitopy factor\n";
00053     QDPIO::cin >> xi_0;
00054 
00055     QDPIO::cout << "Enter the time direction, t_dir\n";
00056     QDPIO::cin >> t_dir;
00057 
00058     QDPIO::cerr << "Currently do not support anisotropy" << endl;
00059     exit(1);
00060   }
00061 #endif
00062 
00063   int input_type;
00064   QDPIO::cout << "Enter input Gauge field type\n"
00065               << "  (1) Free field\n"
00066               << "  (2) Random-transformed free field\n"
00067               << "  (3) Hot start (call hotst)\n"
00068               << "  (4) SZIN configuration on DV\n"
00069               << "  (5) SZIN configuration on FE\n"
00070               << "  (6) Illinois staggered configuration on DV\n"
00071               << "  (7) MILC configuration on FE\n"
00072               << "  (8) Columbia configuration on FE\n"
00073               << "  (9) Schroedinger classical background field\n"
00074               << " (10) FORTRAN SZIN configuration on FE\n"
00075               << " (11) ASCII MILC configuration on FE\n"
00076               << " (12) SZIN configuration with fund to adj transf.\n"
00077               << " (13) O(3) config to U(1)\n"
00078               << " (14) Instanton configuration\n"
00079               << " (15) QCD Archive configuration on FE\n"
00080               << " (16) MIT gauge configuration on FE\n"
00081               << " (17) double prec. MIT gauge configuration on FE\n"
00082               << " (18) Kentucky gauge configuration FE\n"
00083               << " (19) UKQCD gauge configuration FE\n"
00084               << " (20) Single-precision UKQCD gauge configuration FE\n"
00085               << " (21) SZIN config in QIO format\n"
00086               << " (22) Uniform back ground field\n";
00087   
00088   QDPIO::cin >> input_type;
00089   
00090 
00091   // Schroedinger BC
00092   Real SchrPhiMult;            /* Multiplier for Schr. BC fields */
00093   int loop_extent;
00094   int decay_dir;
00095 
00096   if ( input_type == 9 )
00097   {
00098     QDPIO::cout << "This will be a Schroedinger style config used for c_sw measurements\n" << endl;
00099 
00100     QDPIO::cout << "Enter extent of loops in decay direction\n" << endl;
00101     QDPIO::cin >> loop_extent;;
00102   
00103     QDPIO::cout << "Enter multiplier for Schroedinger boundary fields\n";
00104     QDPIO::cin >> SchrPhiMult;
00105  
00106     QDPIO::cout << "Enter the boundary condition direction\n";
00107     QDPIO::cin >> decay_dir;
00108   }
00109   else
00110   {
00111     loop_extent = 1;
00112     decay_dir   = Nd-1;
00113     SchrPhiMult = 1;
00114   }
00115 
00116 
00117   int output_type;
00118   QDPIO::cout << "Enter output Gauge field type\n"
00119               << "  (1) back-end SZIN (note, on most platforms back and front-end are the same)\n"
00120               << "  (2) front-end SZIN\n"
00121               << "  (3) MILC config on FE\n"
00122               << "  (4) QCD Archive config on FE\n"
00123               << "  (5) MIT gauge config on FE\n"
00124               << "  (6) Kentucky config on FE\n"
00125               << "  (7) SZIN config in QIO SINGLEFILE format\n"
00126               << "  (8) SZIN config in QIO MULTIFILE format\n"
00127               << "  (9) replicated in time dir SZIN config in szin format\n";
00128   QDPIO::cin >> output_type;
00129   
00130   string cfg_input_file;
00131   QDPIO::cout << "Enter input file name\n";
00132   QDPIO::cin >> cfg_input_file;
00133 
00134   string cfg_output_file;
00135   QDPIO::cout << "Enter output file name\n";
00136   QDPIO::cin >> cfg_output_file;
00137   
00138   bool CGaugeP;                 // Flat for Complex Conjugate
00139   bool HGaugeP;                 // Flag for Hermitian Conjugate
00140   bool RGaugeP;
00141   multi2d<Real> theta(2,Nd);            // An array of angles for each dir
00142 
00143 
00144   if(input_type > 1){
00145     QDPIO::cout << "Complex conjugate of config?\n";
00146     QDPIO::cin >> CGaugeP;
00147 
00148     QDPIO::cout << "Hermitian conjugate of config?\n";
00149     QDPIO::cin >> HGaugeP;
00150 
00151     if ( input_type > 3 )
00152       {
00153         QDPIO::cout << "Random gauge transform of config?\n";
00154         QDPIO::cin >> RGaugeP;
00155       }
00156   }
00157 
00158 
00159   bool GSmearP;
00160   QDPIO::cout << "APE gauge smearing?\n";
00161   QDPIO::cin >> GSmearP;
00162 
00163   int BlkMax = 100;     /* Maximum number of blocking/smearing iterations */
00164   Real BlkAccu = 1.0-5; /* Blocking/smearing accuracy */
00165   int sm_numb;          /* 'Smearing' number */
00166   Real sm_fact;         /* 'Smearing' factor */
00167   int j_decay;
00168 
00169   if ( GSmearP )
00170   {
00171     BlkAccu = 1.0e-5;
00172     BlkMax = 100;
00173 
00174     QDPIO::cout << "Enter the direction of decay\n";
00175     QDPIO::cin >> j_decay;
00176 
00177     QDPIO::cout << "Enter the number of smearing\n";
00178     QDPIO::cin >> sm_numb;
00179 
00180     QDPIO::cout << "Enter the smearing factor\n";
00181     QDPIO::cin >> sm_fact;
00182   }
00183 
00184   bool HypSmearP;
00185   QDPIO::cout << "HYP gauge smearing?\n";
00186   QDPIO::cin >> HypSmearP;
00187 
00188   int GFMax;
00189   Real alpha1;          /* 'Hyp-mearing' parameter */
00190   Real alpha2;          /* 'Hyp-mearing' parameter */
00191   Real alpha3;          /* 'Hyp-mearing' parameter */
00192   if ( HypSmearP )
00193   {
00194     BlkAccu = 1.0e-5;
00195     BlkMax = 100;
00196 
00197     QDPIO::cout << "Enter the number of smearing\n";
00198     QDPIO::cin >> sm_numb;
00199 
00200     QDPIO::cout << "Enter the smearing parameters alpha1, alpha2 and alpha3\n";
00201     QDPIO::cin >> alpha1 >> alpha2 >> alpha3;
00202   }
00203 
00204   bool GFixP;
00205   QDPIO::cout << "Gauge fixing?\n";
00206   QDPIO::cin >> GFixP;
00207 
00208   bool OrlxDo;
00209   Real GFAccu;
00210   Real OrPara;
00211   string gauge_rotate_file;
00212 
00213   if ( GFixP )
00214   {
00215     QDPIO::cout << "Enter the direction of decay\n";
00216     QDPIO::cin >> j_decay;
00217 
00218     QDPIO::cout << "Enter the gauge fixing accuracy\n";
00219     QDPIO::cin >> GFAccu;
00220 
00221     QDPIO::cout << "Enter the maximum number of gauge fixing sweeps\n";
00222     QDPIO::cin >> GFMax;
00223 
00224     QDPIO::cout << "Want over-relaxation? (yes=YES)\n";
00225     QDPIO::cin >> OrlxDo;
00226 
00227     QDPIO::cout << "Enter the over-relaxtion parameter\n";
00228     QDPIO::cin >> OrPara;
00229 
00230     QDPIO::cout << "Enter gauge rotation file name\n";
00231     QDPIO::cin >> gauge_rotate_file;
00232   }
00233 
00234   QDPIO::cout << "I am working on it...\n";
00235   
00236   push(xml_out,"Lattis");
00237   write(xml_out, "Nd", Nd);
00238   write(xml_out, "Nc", Nc);
00239   write(xml_out, "nrow", nrow);
00240   pop(xml_out);
00241   
00242 #if 0
00243   if ( AnisoP )
00244   {
00245     push(xml_out,"Anisotropy_parameters");
00246     write(xml_out, "AnisoP", AnisoP);
00247     write(xml_out, "xi_0", xi_0);
00248     write(xml_out, "t_dir", t_dir);
00249     pop(xml_out);
00250   }
00251 #endif
00252 
00253 #if 0
00254   /* Setup Schroedinger boundary fields if desired */
00255   if (SchrFun > 0)
00256   {
00257     SetSFbc(SchrPhiMult, SchrFermP, theta, j_decay);
00258     push(xml_out,"Schroed_Func_parameters");
00259     write(xml_out, "SchrFun", SchrFun);
00260     write(xml_out, "j_decay", j_decay);
00261     write(xml_out, "SchrPhiMult", SchrPhiMult);
00262     write(xml_out, "SchrFermP", SchrFermP);
00263     write(xml_out, "theta", theta);
00264     pop(xml_out);
00265   }
00266 #endif
00267 
00268 
00269   //
00270   //  Have params, now find out the source for the gauge field 
00271   //
00272   multi1d<LatticeColorMatrix> u(Nd);
00273   XMLReader gauge_xml_in, gauge_file_xml_in, gauge_record_xml_in;
00274     
00275 
00276   switch (input_type)
00277   {
00278   case 1:
00279     push(xml_out,"Free_Field");
00280     write(xml_out, "input_type", input_type);
00281     pop(xml_out);
00282     QDPIO::cout << "Fill u with free field\n";
00283     u = 1;
00284     break;
00285 
00286   case 2:
00287     push(xml_out,"Free_Field_with_random_gauge_transformation");
00288     write(xml_out, "input_type", input_type);
00289     pop(xml_out);
00290     QDPIO::cout << "Fill u with random gauge transformed free field\n";
00291     u = 1;
00292     rgauge(u);
00293     break;
00294 
00295   case 3:
00296     push(xml_out,"Semi-Haar_measure");
00297     write(xml_out, "input_type", input_type);
00298     pop(xml_out);
00299     QDPIO::cout << "Fill u with semi-Haar\n";
00300     HotSt(u);
00301     break;
00302 
00303   case 4:
00304   case 5:
00305     push(xml_out,"SZIN_configuration");
00306     write(xml_out, "input_type", input_type);
00307     write(xml_out, "cfg_input_file", cfg_input_file);
00308     pop(xml_out);
00309     
00310     QDPIO::cout << "Read SZIN u from FE file " << cfg_input_file << endl;
00311     readSzin(gauge_xml_in, u, cfg_input_file);
00312     read(gauge_xml_in, "/szin", szin_gauge_header);
00313     szin_gauge_header_initP = true;
00314     break;
00315 
00316 // case 6: ancient Illinois staggered
00317 
00318   case 7:
00319     push(xml_out,"MILC_config");
00320     write(xml_out, "input_type", input_type);
00321     write(xml_out, "cfg_input_file", cfg_input_file);
00322     pop(xml_out);
00323     QDPIO::cout << "Read MILC u from FE file\n";
00324     readMILC(gauge_xml_in, u, cfg_input_file);
00325     break;
00326 
00327 //  case 8: Ancient columbia config
00328 
00329 #if 0
00330   case 9:
00331   {
00332     push(xml_out,"Schroedinger_BC_config");
00333     write(xml_out, "input_type", input_type);
00334     pop(xml_out);
00335 
00336     SchrGaugeBCParams params;
00337     params.loop_extent = loop_extent;
00338     params.SchrPhiMult = SchrPhiMult;
00339     params.decay_dir   = decay_dir;
00340     SchrNonPertGaugeBC gaugebc(params);
00341     u = gaugebc.SFBndFld();
00342   }
00343   break;
00344 #endif
00345 
00346 // case 10: Ancient fortran szin_config
00347 
00348 #if 0
00349     // Not sure I want this ...
00350   case 11:
00351     push(xml_out,"Ascii_MILC_config");
00352     write(xml_out, "input_type", input_type);
00353     write(xml_out, "cfg_input_file", cfg_input_file);
00354     pop(xml_out);
00355     QDPIO::cout << "Read ASCII MILC u from FE file\n";
00356     readascii (u, cfg_input_file);
00357     break;
00358 #endif
00359 
00360 #if 0
00361     // Not yet...
00362   case 12:
00363     push(xml_out,"Fund_to_adj_SZIN_config");
00364     write(xml_out, "input_type", input_type);
00365     write(xml_out, "cfg_input_file", cfg_input_file);
00366     pop(xml_out);
00367     QDPIO::cout << "Read fund to adj SZIN from file " << cfg_input_file << endl;
00368     readFunToAdj (u, cfg_input_file);
00369     break;
00370 #endif
00371 
00372 #if 0
00373     // Not yet...
00374   case 13:
00375     push(xml_out,"O3_to_U1_config");
00376     write(xml_out, "input_type", input_type);
00377     write(xml_out, "cfg_input_file", cfg_input_file);
00378     pop(xml_out);
00379     QDPIO::cout << "Read O(3) to U(1) SZIN from file " << cfg_input_file << endl;
00380     ReadO3toU1 (u, cfg_input_file);
00381     break;
00382 #endif
00383 
00384 #if 0
00385   case 14:
00386   {
00387     multi1d<Real> center(Nd);
00388     Real rho;
00389     int su2_index;
00390     int sign;
00391 
00392     if (Nc == 1)
00393     {
00394       QDPIO::cerr << "Instanton construction requires Nc>1";
00395       QDP_abort(1);
00396     }
00397 
00398     QDPIO::cout << "Enter instanton center coordinates\n";
00399     QDPIO::cin >> center;
00400     QDPIO::cout << "Enter instanton size\n";
00401     QDPIO::cin >> rho;
00402     QDPIO::cout << "Enter instanton sign (+/-1)\n";
00403     QDPIO::cin >> sign;
00404     if (Nc > 2)
00405     {
00406       int j = Nc*(Nc-1)/2 - 1;
00407       QDPIO::cout << "Enter SU(2) subgroup index, 0 .. %d\n",j;
00408       QDPIO::cin >> su2_index;
00409     }
00410     else
00411       su2_index = 0;
00412 
00413     push(xml_out,"Instanton_config");
00414     write(xml_out, "input_type", input_type);
00415     write(xml_out, "center", center);
00416     write(xml_out, "rho", rho);
00417     write(xml_out, "su2_index", su2_index);
00418     write(xml_out, "sign", sign);
00419     pop(xml_out);
00420     QDPIO::cout << "Create instanton configuration\n";
00421     instanton (u, center, rho, su2_index, sign);
00422 
00423   break;
00424 #endif
00425 
00426   case 15:
00427     push(xml_out,"QCD_Archive_config");
00428     write(xml_out, "input_type", input_type);
00429     pop(xml_out);
00430     QDPIO::cout << "Read QCD Archive u from FE file\n";
00431     readArchiv(gauge_xml_in, u, cfg_input_file);
00432     break;
00433 
00434 #if 0
00435     // Someday...
00436   case 16:
00437     push(xml_out,"MIT_config");
00438     write(xml_out, "input_type", input_type);
00439     pop(xml_out);
00440     QDPIO::cout << "Read MIT gauge config from FE file\n";
00441     readmitu (cfg_input_file, u);
00442     break;
00443 #endif
00444 
00445 #if 0
00446     // Not now...
00447   case 17:
00448     push(xml_out,"MIT_double_config");
00449     write(xml_out, "input_type", input_type);
00450     pop(xml_out);
00451     QDPIO::cout << "Read double prec. MIT gauge config from FE file\n";
00452     readmitdu (cfg_input_file, u);
00453     savern (seed_old);
00454     break;
00455 #endif
00456 
00457   case 18:
00458     push(xml_out,"Kentucky_config");
00459     write(xml_out, "input_type", input_type);
00460     pop(xml_out);
00461     QDPIO::cout << "Read Kentucky gauge config from FE file\n";
00462     readKYU(u, cfg_input_file);
00463     break;
00464 
00465 #if 0
00466     // Not now...
00467   case 19:
00468     push(xml_out,"UKQCD_config");
00469     write(xml_out, "input_type", input_type);
00470     pop(xml_out);
00471     QDPIO::cout << "Read UKQCD gauge config from FE file\n";
00472     readukqcd (cfg_input_file, u);
00473     savern (seed_old);
00474     break;
00475 #endif
00476 
00477 #if 0
00478     // Not now...
00479   case 20:
00480     push(xml_out,"UKQCD_single_config");
00481     write(xml_out, "input_type", input_type);
00482     pop(xml_out);
00483     QDPIO::cout << "Read single-precision UKQCD gauge config from FE file\n";
00484     readukqcdsingle (cfg_input_file, u);
00485     savern (seed_old);
00486     break;
00487 #endif
00488 
00489   case 21:
00490     push(xml_out,"SZIN_QIO_configuration");
00491     write(xml_out, "input_type", input_type);
00492     write(xml_out, "cfg_input_file", cfg_input_file);
00493     pop(xml_out);
00494     
00495     QDPIO::cout << "Read SZIN u from QIO file " << cfg_input_file << endl;
00496     readGauge(gauge_file_xml_in, gauge_xml_in, u, cfg_input_file,
00497               QDPIO_SERIAL);
00498     read(gauge_xml_in, "/szin", szin_gauge_header);
00499     szin_gauge_header_initP = true;
00500     break;
00501 
00502   case 22:
00503     // Here we have a uniform, diagonal background field
00504     // with each direction written as 
00505     // U = diag(exp(i t_1), exp(i t_2), exp(-i(t_1 + t_2))
00506 
00507     for(int mu = 0; mu < Nd; mu++){
00508       QDPIO::cout << "Enter angles for direction " << mu << endl;
00509       QDPIO::cin >> theta(0, mu) >> theta(1, mu);
00510     }
00511 
00512     push(xml_out,"Const_diag_gauge");
00513     write(xml_out, "input_type", input_type);
00514     pop(xml_out);
00515     QDPIO::cout << "Creating constant diagonal gauge\n";
00516     constgauge(u, theta);
00517     break;
00518 
00519   default:
00520     QDP_error_exit("unknown input type", input_type);
00521   }
00522     
00523 
00524   // Dump a copy of the input gauge xml
00525   write(xml_out, "input_gauge_header", gauge_xml_in);
00526   
00527 
00528   // So what's the plaquette?
00529   MesPlq(xml_out, "Observables", u);
00530   xml_out.flush();
00531   
00532   if ( RGaugeP )
00533   {
00534     rgauge (u);
00535     MesPlq(xml_out, "Rand_Gtransf_observables", u);
00536   }
00537 
00538   if(CGaugeP){
00539     conjgauge(u);
00540     MesPlq(xml_out, "Conj_GTansf_observables",u);
00541   }
00542 
00543   if(HGaugeP){
00544     LatticeColorMatrix u_tmp;
00545     for(int mu = 0; mu < Nd; mu++){
00546 
00547       multi1d<int> posn(Nd);
00548       posn = (0,0,0,0);
00549       ColorMatrix uin;
00550       ColorMatrix uout;
00551       u_tmp = adj(u[mu]);
00552 
00553       uin = peekSite(u[mu], posn);
00554       uout = peekSite(u_tmp, posn);
00555 
00556       QDPIO::cout << "MU IS " << mu << endl << endl;
00557       Complex element_in, element_out;
00558       for(int i = 0; i < Nc; i++)
00559         for(int j = 0; j < Nc; j++){
00560 
00561           element_in = peekColor(uin, i, j);
00562           element_out = peekColor(uout, i ,j);
00563           QDPIO::cout << "(i,j)= " << i << j <<
00564             ", U is " << element_in << ",U dagger is "
00565                       << element_out << endl;
00566         }
00567       u[mu] = u_tmp;
00568     
00569     }
00570 
00571     MesPlq(xml_out, "Herm_Gtransf_observables", u);
00572   }
00573     
00574 
00575   if ( GSmearP )
00576   {
00577     multi1d<LatticeColorMatrix> u_tmp(Nd);
00578     if ( j_decay < Nd )
00579       u_tmp[j_decay] = u[j_decay];
00580 
00581     for(int i = 0; i < sm_numb; ++i)
00582     {
00583       for(int mu = 0; mu < Nd; ++mu)
00584         if ( mu != j_decay )
00585           APE_Smear(u, u_tmp[mu], mu, 0, sm_fact, BlkAccu, BlkMax, j_decay);
00586       
00587       u = u_tmp;
00588     }
00589     
00590     push(xml_out,"Smearing_parameters");
00591     write(xml_out, "sm_numb",sm_numb);
00592     write(xml_out, "sm_fact", sm_fact);
00593     write(xml_out, "j_decay", j_decay);
00594     pop(xml_out);
00595 
00596     MesPlq(xml_out, "Smeared_observables", u);
00597   }
00598 
00599   if ( HypSmearP )
00600   {
00601     multi1d<LatticeColorMatrix> u_tmp(Nd);
00602     for(int i = 0; i < sm_numb; ++i)
00603     {
00604       Hyp_Smear(u, u_tmp, alpha1, alpha2, alpha3, BlkAccu, BlkMax);
00605       u = u_tmp;
00606     }
00607     
00608     push(xml_out,"HypSmearing_parameters");
00609     write(xml_out, "sm_numb", sm_numb);
00610     write(xml_out, "alpha1", alpha1);
00611     write(xml_out, "alpha2", alpha2);
00612     write(xml_out, "alpha3", alpha3);
00613     pop(xml_out);
00614 
00615     MesPlq(xml_out, "HypSmeared_observables", u);
00616   }
00617 
00618   LatticeColorMatrix g;
00619   int nrl_gf;
00620   if ( GFixP  )
00621   {
00622     coulGauge(u, g, nrl_gf, j_decay, GFAccu, GFMax, OrlxDo, OrPara);
00623 
00624     push(xml_out,"Gauge_fixing_parameters");
00625     write(xml_out, "j_decay", j_decay);
00626     write(xml_out, "GFAccu", GFAccu);
00627     write(xml_out, "GFMax", GFMax);
00628     write(xml_out, "OrlxDo",OrlxDo);
00629     write(xml_out, "OrPara", OrPara);
00630     pop(xml_out);
00631 
00632     MesPlq(xml_out, "Gauge_fixed_observables", u);
00633     
00634     push(xml_out,"Relaxation_iterations_in_GFIX");
00635     write(xml_out, "nrl_gf", nrl_gf);
00636     pop(xml_out);
00637   }
00638 
00639 
00640   // Compute the plaquette again
00641   Double w_plaq, s_plaq, t_plaq, link;
00642   MesPlq (u, w_plaq, s_plaq, t_plaq, link);
00643   
00644   xml_out.flush();
00645   
00646   // Make a new szin header if desired
00647   switch (output_type)
00648   {
00649   case 1:
00650   case 2:
00651   case 7:
00652   case 8:
00653   case 9:
00654   {
00655     bool new_headerP;
00656     QDPIO::cout << "Enter new szin header?" << endl;
00657     QDPIO::cin >> new_headerP;
00658 
00659     if ( new_headerP )
00660     {
00661       QDPIO::cout << "Enter TotalTrj\n";
00662       QDPIO::cin >> szin_gauge_header.TotalTrj;
00663       QDPIO::cout << "Enter NOver\n";
00664       QDPIO::cin >> szin_gauge_header.NOver;
00665       QDPIO::cout << "Enter BetaMC\n";
00666       QDPIO::cin >> szin_gauge_header.BetaMC;
00667       QDPIO::cout << "Enter BetaMD\n";
00668       QDPIO::cin >> szin_gauge_header.BetaMD;
00669       QDPIO::cout << "Enter KappaMC\n";
00670       QDPIO::cin >> szin_gauge_header.KappaMC;
00671       QDPIO::cout << "Enter KappaMD\n";
00672       QDPIO::cin >> szin_gauge_header.KappaMD;
00673       QDPIO::cout << "Enter dt\n";
00674       QDPIO::cin >> szin_gauge_header.dt;
00675       QDPIO::cout << "Enter MesTrj\n";
00676       QDPIO::cin >> szin_gauge_header.MesTrj;
00677       QDPIO::cout << "Enter Nf\n";
00678       QDPIO::cin >> szin_gauge_header.Nf;
00679       QDPIO::cout << "Enter Npf\n";
00680       QDPIO::cin >> szin_gauge_header.Npf;
00681       QDPIO::cout << "Enter RefMomTrj\n";
00682       QDPIO::cin >> szin_gauge_header.RefMomTrj;
00683       QDPIO::cout << "Enter RefFnoiseTrj\n";
00684       QDPIO::cin >> szin_gauge_header.RefFnoiseTrj;
00685       QDPIO::cout << "Enter LamPl\n";
00686       QDPIO::cin >> szin_gauge_header.LamPl;
00687       QDPIO::cout << "Enter LamMi\n";
00688       QDPIO::cin >> szin_gauge_header.LamMi;
00689       QDPIO::cout << "Enter AlpLog\n";
00690       QDPIO::cin >> szin_gauge_header.AlpLog;
00691       QDPIO::cout << "Enter AlpExp\n";
00692       QDPIO::cin >> szin_gauge_header.AlpExp;
00693       QDPIO::cout << "Enter seed\n";
00694       QDPIO::cin >> szin_gauge_header.seed;
00695     }
00696   }
00697   break;
00698   }
00699 
00700 
00701   /* Now write parameters to file cfg_output_file */
00702   switch (output_type)
00703   {
00704   case 1:
00705   case 2:
00706   {
00707     writeSzin(szin_gauge_header, u, cfg_output_file);
00708   }
00709   break;
00710 
00711   case 3:
00712   {
00713     /* Write a MILC format file on FE */
00714     MILCGauge_t milc_out;
00715     writeMILC (milc_out, u, cfg_output_file);
00716   }
00717   break;
00718 
00719   case 4:
00720   {
00721     /* Write a QCD Archive format file on FE */
00722     ArchivGauge_t arc_out;
00723     arc_out.w_plaq = w_plaq;
00724     arc_out.link   = link;
00725     writeArchiv(arc_out, u, cfg_output_file);
00726   }
00727   break;
00728 
00729 #if 0
00730     // Not yet...
00731   case 5:
00732     /* Write a MIT gauge format file on FE */
00733     wrtmitu (cfg_output_file, u);
00734     break;
00735 #endif
00736 
00737   case 6:
00738     /* Write a Kentucky gauge format file on FE */
00739     writeKYU(u, cfg_output_file);
00740     break;
00741 
00742   case 7:
00743   case 8:
00744   {
00745     QDP_volfmt_t volfmt = (output_type == 7) ? QDPIO_SINGLEFILE : QDPIO_MULTIFILE;
00746     XMLBufferWriter gauge_file_xml_out, gauge_record_xml_out;
00747 
00748     push(gauge_file_xml_out, "gauge");
00749     write(gauge_file_xml_out, "id", int(0));   // need something better here
00750     pop(gauge_file_xml_out);
00751     write(gauge_record_xml_out, "szin", szin_gauge_header);
00752     writeGauge(gauge_file_xml_out, gauge_record_xml_out, u, cfg_output_file,
00753                volfmt, QDPIO_SERIAL);
00754 
00755     // Save the gauge rotation matrices if gauge fixed
00756     if ( GFixP  )
00757     {
00758       XMLBufferWriter transf_file_xml_out, transf_record_xml_out;
00759 
00760       push(transf_file_xml_out, "gauge_transf");
00761       write(transf_file_xml_out, "id", int(0));   // need something better here
00762       pop(transf_file_xml_out);
00763       
00764       push(transf_record_xml_out, "szin_transf");
00765       push(transf_record_xml_out,"Gauge_fixing_parameters");
00766       write(transf_record_xml_out, "j_decay", j_decay);
00767       write(transf_record_xml_out, "GFAccu", GFAccu);
00768       write(transf_record_xml_out, "GFMax", GFMax);
00769       write(transf_record_xml_out, "OrlxDo",OrlxDo);
00770       write(transf_record_xml_out, "OrPara", OrPara);
00771       pop(transf_record_xml_out);
00772       write(transf_record_xml_out, "szin", szin_gauge_header);
00773       pop(transf_record_xml_out);
00774 
00775       QDPFileWriter to(transf_file_xml_out,gauge_rotate_file,volfmt,QDPIO_SERIAL,QDPIO_OPEN);
00776 
00777       LatticeColorMatrixF g_f = g;
00778       write(to,transf_record_xml_out,g_f);         // Always save in single precision!
00779       close(to);
00780     }
00781   }
00782   break;
00783 
00784   case 9:
00785   {
00786     int n_replica;
00787     QDPIO::cout << "Enter the boundary condition direction\n";
00788     QDPIO::cin >> j_decay;
00789 
00790     QDPIO::cout << "Number of times to replicat\n";
00791     QDPIO::cin >> n_replica;
00792 
00793     writeSzinReplica(szin_gauge_header, u, j_decay,
00794                      n_replica,
00795                      cfg_output_file);
00796   }
00797   break;
00798 
00799   default:
00800     QDP_error_exit("unknown output type", output_type);
00801   }
00802 
00803   pop(xml_out);
00804         
00805   END_CODE();
00806   
00807   // Time to bolt
00808   Chroma::finalize();
00809 
00810   exit(0);
00811 }

Generated on Sun Nov 22 04:28:55 2009 for CHROMA by  doxygen 1.4.7