30 XMLReader inputtop(xml, path);
54 XMLReader inputtop(xml, path);
72 namespace InlineRitzEnv
112 XMLReader inputtop(xml_in, path);
114 if (inputtop.count(
"Frequency") == 1)
123 if( inputtop.count(
"Param/StateInfo") == 1 ) {
124 XMLReader xml_state_info(inputtop,
"Param/StateInfo");
125 std::ostringstream os;
126 xml_state_info.print(os);
130 XMLBufferWriter s_i_xml;
131 push(s_i_xml,
"StateInfo");
133 stateInfo = s_i_xml.printCurrentContext();
140 if (inputtop.count(
"xml_file") != 0)
147 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
163 XMLReader xml_header(header_is);
164 xml_out << xml_header;
190 push(xml_out,
"RitzEigenHw");
191 write(xml_out,
"update_no", update_no);
192 write(xml_out,
"xml_file", xml_file);
195 XMLFileWriter xml(xml_file);
196 func(update_no, xml);
200 func(update_no, xml_out);
212 QDP::StopWatch snoop;
217 XMLBufferWriter gauge_xml;
218 multi1d<LatticeColorMatrix>
u =
222 push(xml_out,
"RitzEigenHw");
223 write(xml_out,
"update_no", update_no);
232 XMLBufferWriter record_xml;
236 write(xml_out,
"Config_info", gauge_xml);
238 push(xml_out,
"Output_version");
239 write(xml_out,
"out_version", 1);
243 MesPlq(xml_out,
"Observables",
u);
252 XMLBufferWriter file_xml;
253 push(file_xml,
"RitzEigenHw");
264 XMLReader fermacttop(xml_s);
268 XMLReader state_info_xml(state_info_is);
271 bool success =
false;
279 QDPIO::cout <<
"Try the various factories" << std::endl;
282 typedef LatticeFermion
T;
283 typedef multi1d<LatticeColorMatrix>
P;
284 typedef multi1d<LatticeColorMatrix>
Q;
301 QDPIO::cout <<
"Eigenvalues/-vectors computed: time= "
302 << swatch.getTimeInSeconds()
303 <<
" secs" << std::endl;
310 QDPIO::cout <<
InlineRitzEnv::name <<
": caught exception around quarkprop: " << e << std::endl;
316 QDPIO::cerr <<
"Error: no fermact found" << std::endl;
322 << snoop.getTimeInSeconds()
323 <<
" secs" << std::endl;
342 const Subset&
s = MM->subset();
345 multi1d<Real> check_norm(
params.Neig);
358 Real delta_cycle = Real(1);
359 XMLBufferWriter eig_spec_xml;
361 int n_jacob_count = 0;
383 xml_out << eig_spec_xml;
384 write(xml_out,
"lambda_Msq", lambda);
389 LatticeFermion lambda_e;
391 lambda_e[
s] = lambda[
i]*
psi[
i];
398 check_norm[
i] = sqrt(check_norm[
i]);
400 write(xml_out,
"check_norm", check_norm);
403 check_norm[
i] /= fabs(lambda[
i]);
405 write(xml_out,
"check_norm_rel", check_norm);
409 multi1d<bool> valid_eig(
params.Neig);
424 push(xml_out,
"eigFix");
425 write(xml_out,
"lambda_Hw", lambda);
426 write(xml_out,
"n_valid", n_valid);
427 write(xml_out,
"valid_eig", valid_eig);
433 bool zeroP = toBool( fabs(lambda[
i]) <
params.RsdZero );
435 check_norm[
i] = norm2(Me,
s);
436 check_norm[
i] = sqrt(check_norm[
i]);
439 LatticeFermion lambda_e;
442 lambda_e[
s] = lambda[
i]*
psi[
i];
447 check_norm[
i] = sqrt(check_norm[
i]);
450 QDPIO::cout <<
"lambda_lo[" <<
i <<
"] = " << lambda[
i] <<
" ";
451 QDPIO::cout <<
"check_norm["<<
i<<
"] = " << check_norm[
i] << std::endl;
453 write(xml_out,
"check_norm", check_norm);
456 check_norm[
i] /= fabs(lambda[
i]);
457 QDPIO::cout <<
"check_norm_rel["<<
i <<
"] = " << check_norm[
i] << std::endl;
459 QDPIO::cout << std::flush ;
460 write(xml_out,
"check_norm_rel", check_norm);
466 Real hi_RsdR = 1.0e-4;
467 Real hi_RsdA = 1.0e-4;
469 multi1d<Real> lambda_high_aux(1);
470 multi1d<LatticeFermion> lambda_high_vec(1);
474 lambda_high_vec[0][
s] /= sqrt(norm2(lambda_high_vec[0],
s));
477 XMLBufferWriter high_xml;
481 lambda_high_aux[0] = Real(8);
484 push(high_xml,
"LambdaHighRitz");
504 QDPIO::cout <<
"Got Here" << std::endl << std::flush ;
506 lambda_high_aux[0] = sqrt(fabs(lambda_high_aux[0]));
507 QDPIO::cout <<
"|| lambda_hi || = " << lambda_high_aux[0] <<
" hi_Rsd_r = " << hi_RsdR << std::endl;
512 push(xml_out,
"Highest");
513 write(xml_out,
"lambda_hi", lambda_high_aux[0]);
Inline measurement factory.
Hold eigenvalues and eigenvectors.
const Real & getLargest() const
Getter.
const multi1d< T > & getEvectors() const
Getter.
const multi1d< Real > & getEvalues() const
Getter.
Class for counted reference semantics.
Inline measurement of eigenvalues.
void func(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
void operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
Hold eigenvalues and eigenvectors.
Class structure for fermion actions.
Fermion action factories.
All Wilson-type fermion actions.
void EigSpecRitzCG(const LinearOperator< LatticeFermion > &M, multi1d< Real > &lambda_H, multi1d< LatticeFermion > &psi, int n_eig, int n_renorm, int n_min, int MaxCG, const Real &Rsd_r, const Real &Rsd_a, const Real &zero_cutoff, const bool ProjApsiP, int &n_cg_tot, XMLWriter &xml_out)
Compute low lying eigenvalues of the hermitian H.
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.
std::string uniqueId()
Return a unique id.
void proginfo(XMLWriter &xml)
Print out basic information about this program.
std::string makeXMLFileName(std::string xml_file, unsigned long update_no)
Return a xml file name for inline measurements.
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
Inline construction of eigenvalues (Ritz)
Named object function std::map.
static bool registered
Local registration flag.
multi1d< LatticeColorMatrix > P
bool registerAll()
Register all the factories.
void RitzCode4DHw(Handle< LinearOperator< LatticeFermion > > &MM, Handle< LinearOperator< LatticeFermion > > &H, const RitzParams_t ¶ms, XMLWriter &xml_out, EigenInfo< LatticeFermion > &eigenvec_val)
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
void fixMMev2Mev(const LinearOperator< LatticeFermion > &M, multi1d< Real > &lambda, multi1d< LatticeFermion > &ev_psi, const int n_eig, const Real &Rsd_r, const Real &Rsd_a, const Real &zero_cutoff, multi1d< bool > &valid_eig, int &n_valid, int &n_jacob)
void EigSpecRitzKS(const LinearOperator< LatticeFermion > &M, multi1d< Real > &lambda_H, multi1d< LatticeFermion > &psi, int n_eig, int n_dummy, int n_renorm, int n_min, int n_max, int n_max_KS, const Real &gamma_factor, int MaxCG, const Real &Rsd_r, const Real &Rsd_a, const Real &zero_cutoff, const bool ProjApsiP, int &n_cg_tot, int &n_KS, int &n_jacob_tot, XMLWriter &xml_out)
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
multi1d< LatticeFermion > s(Ncb)
Print out basic info about this program.
Fourier transform phase factor support.
struct Chroma::InlineRitzEnv::Params::Param_t param
void writeXML(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineRitzEnv::Params::NamedObject_t named_obj
Struct for parameters needed for a Ritz KS type solve.
Read an XML group as a std::string.