23 namespace InlineCreateColorVecsEnv
28 XMLReader inputtop(xml, path);
52 XMLReader inputtop(xml, path);
67 write(xml,
"num_vecs",
out.num_vecs);
68 write(xml,
"decay_dir",
out.decay_dir);
69 write(xml,
"num_iter",
out.num_iter);
70 write(xml,
"num_orthog",
out.num_orthog);
72 xml <<
out.link_smear.xml;
98 namespace InlineCreateColorVecsEnv
105 return new InlineMeas(Params(xml_in, path));
136 XMLReader paramtop(xml_in, path);
138 if (paramtop.count(
"Frequency") == 1)
150 if (paramtop.count(
"xml_file") != 0)
157 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
174 push(xml_out,
"CreateColorVecs");
175 write(xml_out,
"update_no", update_no);
176 write(xml_out,
"xml_file", xml_file);
179 XMLFileWriter xml(xml_file);
180 func(update_no, xml);
184 func(update_no, xml_out);
201 multi1d<LatticeColorMatrix>
u;
202 XMLBufferWriter gauge_xml;
208 catch( std::bad_cast )
210 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
215 QDPIO::cerr <<
name <<
": std::map call failed: " << e << std::endl;
219 push(xml_out,
"CreateColorVecs");
220 write(xml_out,
"update_no", update_no);
222 QDPIO::cout <<
name <<
": Create color vectors" << std::endl;
230 write(xml_out,
"Config_info", gauge_xml);
232 push(xml_out,
"Output_version");
233 write(xml_out,
"out_version", 1);
237 MesPlq(xml_out,
"Observables",
u);
242 multi1d<LatticeColorMatrix> u_smr =
u;
247 XMLReader linktop(xml_l);
248 QDPIO::cout <<
"Link smearing type = "
255 (*linkSmearing)(u_smr);
258 QDPIO::cerr <<
name <<
": Caught Exception link smearing: "<<e<< std::endl;
263 MesPlq(xml_out,
"Smeared_Observables", u_smr);
275 XMLBufferWriter file_xml;
277 push(file_xml,
"MODMetaData");
279 write(file_xml,
"lattSize", QDP::Layout::lattSize());
281 write(file_xml,
"Config_info", gauge_xml);
284 file_str = file_xml.str();
288 XMLReader MapObjReader(xml_s);
298 catch (std::bad_cast)
300 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
305 QDPIO::cerr <<
name <<
": error creating prop: " << e << std::endl;
310 MapObject<int,EVPair<LatticeColorVector> >& color_vecs =
335 multi1d<SubsetVectorWeight_t> evals(num_vecs);
337 multi1d<LatticeColorVector> evecs(num_vecs);
340 QDPIO::cout <<
"Got here" << std::endl;
341 for(
int i(0);
i<num_vecs;
i++){
351 for(
int i=0;
i < num_vecs; ++
i)
353 QDPIO::cout <<
name <<
": Doing colorvec: "<<
i <<
" hit no: "<<hit<<std::endl;
363 for(
int k=0;
k <
i; ++
k) {
364 multi1d<DComplex> cc =
370 evecs[
i][phases.
getSet()[
t]] -= cc[
t]*evecs[
k];
375 multi1d<Double> norm2 = sumMulti(localNorm2(evecs[
i]),phases.
getSet());
378 evecs[
i][phases.
getSet()[
t]] /= sqrt(norm2[
t]);
389 multi1d< multi1d<Double> > source_corrs(evecs.size());
390 for(
int m=0;
m < source_corrs.size(); ++
m)
391 source_corrs[
m] = sumMulti(localNorm2(evecs[
m]), phases.
getSet());
392 push(xml_out,
"Source_correlators");
393 write(xml_out,
"source_corrs", source_corrs);
396 push(xml_out,
"SmearingEvals");
399 for(
int i=0;
i < num_vecs; ++
i) {
400 LatticeColorVector Svec;
403 multi1d<DComplex> cc =
409 evals[
i].weights[
t] = real(cc[
t]);
412 push(xml_out,
"Vector");
413 write(xml_out,
"VecNo",
i);
414 write(xml_out,
"Evals", evals[
i].weights);
421 for(
int i=0;
i < num_vecs;
i++) {
425 color_vecs.insert(
i, pair);
429 QDPIO::cout <<
name <<
": time for colorvec construction = "
430 << swatch.getTimeInSeconds()
431 <<
" secs" << std::endl;
438 XMLBufferWriter file_xml;
440 push(file_xml,
"LaplaceEigInfo");
441 write(file_xml,
"num_vecs", num_vecs);
443 write(file_xml,
"Config_info", gauge_xml);
446 XMLBufferWriter record_xml;
447 push(record_xml,
"SubsetVectors");
448 for(
int i(0);
i<num_vecs;
i++){
449 push(record_xml,
"EigenPair");
450 write(record_xml,
"EigenPairNumber",
i);
451 write(record_xml,
"EigenValues", evals[
i].weights);
463 QDPIO::cout <<
name <<
": total time = "
464 << snoop.getTimeInSeconds()
465 <<
" secs" << std::endl;
467 QDPIO::cout <<
name <<
": ran successfully" << std::endl;
Inline measurement factory.
Class for counted reference semantics.
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.
Fourier transform phase factor support.
int numSubsets() const
Number of subsets - length in decay direction.
const Set & getSet() const
The set to be used in sumMulti.
Class structure for fermion actions.
Gaussian smearing of color std::vector.
void klein_gord(const multi1d< LatticeColorMatrix > &u, const T &psi, T &chi, const Real &mass_sq, int j_decay)
Compute the covariant Klein-Gordon operator.
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.
void gausSmear(const multi1d< LatticeColorMatrix > &u, T &chi, const Real &width, int ItrGaus, int j_decay)
Do a covariant Gaussian smearing of a lattice field.
Construct colorvectors via power iteration of the laplacian.
All link smearing constructors.
Factory for producing link smearing objects.
Named object function std::map.
static bool registered
Local registration flag.
void write(XMLWriter &xml, const std::string &path, const Params::NamedObject_t &input)
Propagator output.
bool registerAll()
Register all the factories.
void read(XMLReader &xml, const std::string &path, Params::NamedObject_t &input)
Propagator input.
QDPSubTypeTrait< typename BinaryReturn< C1, C2, FnLocalInnerProduct >::Type_t >::Type_t localInnerProduct(const QDPSubType< T1, C1 > &l, const QDPType< T2, C2 > &r)
bool registerAll()
aggregate everything
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
static QDP_ColorVector * out
Constructor.
Print out basic info about this program.
Fourier transform phase factor support.
SubsetVectorWeight_t eigenValue