Real(1.0e-7),
int main(int argc, char **argv){  // Put the machine into a known state  QDP_initialize(&argc, &argv);  // Read the parameters   Param_t params;  try {     readParams("./DATA", params);  }  catch(const string& s) {     QDPIO::cerr << "Caught exception " << s << endl;    exit(1);  }  // Setup the lattice  Layout::setLattSize(params.nrow);  Layout::create();  // Write out the params  XMLFileWriter xml_out("t_ritz.xml");  push(xml_out, "ritzTest");  dumpParams(xml_out, params);  // Create a FermBC  Handle<FermBC<LatticeFermion> >  fbc(new SimpleFermBC<LatticeFermion>(params.boundary));    // The Gauge Field  multi1d<LatticeColorMatrix> u(Nd);    switch ((GaugeStartType)params.gauge_start_type) {   case COLD_START:    for(int j = 0; j < Nd; j++) {       u(j) = Real(1);    }    break;  case HOT_START:    // Hot (disordered) start    for(int j=0; j < Nd; j++) {       random(u(j));      reunit(u(j));    }    break;  case FILE_START:    // Start from File     switch( (GaugeFormat)params.gauge_file_format) {     case SZIN_GAUGE_FORMAT:      {	XMLReader szin_xml;	readSzin(szin_xml, u, params.gauge_filename);	try { 	  push(xml_out, "GaugeInfo");	  xml_out << szin_xml;	  pop(xml_out);	}	catch(const string& e) {	  cerr << "Error: " << e << endl;	}	      }      break;    case NERSC_GAUGE_FORMAT:      {	XMLReader nersc_xml;	readArchiv(nersc_xml, u, params.gauge_filename);	try { 	  push(xml_out, "GaugeInfo");	  xml_out << nersc_xml;	  pop(xml_out);	}	catch(const string& e) {	  cerr << "Error: " << e << endl;	}      }      break;    default:      ostringstream file_read_error;      file_read_error << "Unknown gauge file format" << params.gauge_file_format ;      throw file_read_error.str();    }    break;  default:    ostringstream startup_error;    startup_error << "Unknown start type " << params.gauge_start_type <<endl;    throw startup_error.str();  }  // Measure the plaquette on the gauge  Double w_plaq, s_plaq, t_plaq, link;  MesPlq(u, w_plaq, s_plaq, t_plaq, link);  push(xml_out, "plaquette");  Write(xml_out, w_plaq);  Write(xml_out, s_plaq);  Write(xml_out, t_plaq);  Write(xml_out, link);  pop(xml_out);  //! Wilsoniums;  // Put this puppy into a handle to allow Zolo to copy it around as a **BASE** class  // WARNING: the handle now owns the data. The use of a bare S_w below is legal,  // but just don't delete it.  UnprecWilsonFermAct  S_w(fbc, params.quark_mass);  Handle< const ConnectState > connect_state = S_w.createState(u);  Handle< const LinearOperator<LatticeFermion> > MM = S_w.lMdagM(connect_state);  int n_dummy = 2;  // Try and get lowest eigenvalue of MM  multi1d<Real> lambda(params.n_eig+n_dummy);  multi1d<Real> check_norm(params.n_eig);  multi1d<LatticeFermion> psi(params.n_eig+n_dummy);    int n_renorm = 10;  int n_min = 5;  bool ProjApsiP = true;  int n_CG_count;  Real delta_cycle = Real(1);  Real gamma_factor = Real(1);  XMLBufferWriter eig_spec_xml;  for(int i =0; i < params.n_eig+ n_dummy; i++) {     gaussian(psi[i]);  }  int n_KS_count = 0;  int n_jacob_count = 0;  EigSpecRitzKS(*MM, 		lambda, 		psi, 		params.n_eig,		n_dummy,                // No of dummies		n_renorm, 		n_min, 		200,             // Max iters / KS cycle		1000,            // Max no of KS cycles		Real(0.1),       // Gamma factor		params.max_cg,		params.rsd_r,		Real(1.0e-7),    // Jacobi to machine prec		ProjApsiP,		n_CG_count,		n_KS_count,		n_jacob_count,		eig_spec_xml);  xml_out << eig_spec_xml;  write(xml_out, "lambda", lambda);   // Check norms  for(int i=0; i < params.n_eig; i++) {     LatticeFermion Me;    LatticeFermion lambda_e;    (*MM)(Me, psi[i], PLUS);    lambda_e = lambda[i]*psi[i];    LatticeFermion r_norm = Me - lambda_e;    check_norm[i] = sqrt(norm2(r_norm))/fabs(lambda[i]);    QDPIO::cout << "check_norm["<<i+1<<"] = " << check_norm[i] << endl;  }     write(xml_out, "check_norm_rel", check_norm);    pop(xml_out);  QDP_finalize();      exit(0);}