13 #include "qdp_map_obj.h"
27 namespace InlinePropMatElemPtColorVecEnv
32 XMLReader inputtop(xml, path);
57 XMLReader inputtop(xml, path);
95 namespace InlinePropMatElemPtColorVecEnv
102 return new InlineMeas(Params(xml_in, path));
132 XMLReader paramtop(xml_in, path);
134 if (paramtop.count(
"Frequency") == 1)
146 if (paramtop.count(
"xml_file") != 0)
153 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
170 push(xml_out,
"PropMatElemPtColorVec");
171 write(xml_out,
"update_no", update_no);
172 write(xml_out,
"xml_file", xml_file);
175 XMLFileWriter xml(xml_file);
176 func(update_no, xml);
180 func(update_no, xml_out);
197 multi1d<LatticeColorMatrix>
u;
198 XMLBufferWriter gauge_xml;
204 catch( std::bad_cast )
206 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
211 QDPIO::cerr <<
name <<
": std::map call failed: " << e << std::endl;
215 push(xml_out,
"PropMatElemPtColorVec");
216 write(xml_out,
"update_no", update_no);
218 QDPIO::cout <<
name <<
": propagator colorstd::vector matrix element calculation" << std::endl;
226 write(xml_out,
"Config_info", gauge_xml);
228 push(xml_out,
"Output_version");
229 write(xml_out,
"out_version", 1);
233 MesPlq(xml_out,
"Observables",
u);
238 XMLReader source_file_xml, source_record_xml;
239 XMLReader prop_file_xml, prop_record_xml;
241 QDPIO::cout <<
"Snarf the source from a named buffer. Check for the prop std::map" << std::endl;
257 write(xml_out,
"Source_file_info", source_file_xml);
258 write(xml_out,
"Source_record_info", source_record_xml);
260 write(xml_out,
"Propagator_file_info", prop_file_xml);
261 write(xml_out,
"Propagator_record_info", prop_record_xml);
263 catch (std::bad_cast)
265 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
270 QDPIO::cerr <<
name <<
": error extracting source_header or prop std::map: " << e << std::endl;
275 QDP::MapObject<int,EVPair<LatticeColorVector> >&
eigen_source =
279 const LatticePropagator&
prop =
284 read(prop_record_xml,
"/Propagator/PropSource", source_header);
287 QDPIO::cout <<
"Point Propagator successfully found and parsed" << std::endl;
290 multi1d<int> source = source_header.getTSrce();
292 int decay_dir = source_header.j_decay ;
293 int t_source = source_header.t_source;
297 QDPIO::cout <<
"source = "
301 << source[3]<< std::endl;
311 multi1d<Double> source_corrs = sumMulti(localNorm2(tmpvec.
eigenVector), phases.
getSet());
313 push(xml_out,
"Source_correlators");
314 write(xml_out,
"source_corrs", source_corrs);
322 <<
" is greater than the number of available colorvectors= "
336 XMLBufferWriter file_xml;
338 push(file_xml,
"DBMetaData");
340 write(file_xml,
"lattSize", QDP::Layout::lattSize());
341 write(file_xml,
"decay_dir", decay_dir);
342 write(file_xml,
"source", source);
345 write(file_xml,
"Config_info", gauge_xml);
350 qdp_db.setMaxUserInfoLen(file_str.size());
354 qdp_db.insertUserdata(file_str);
376 const int decay_dir = decay_dir;
379 SftMom phases(0,
true, decay_dir);
382 push(xml_out,
"ColorVecMatElems");
385 QDPIO::cout <<
"t_source = " <<
t_source << std::endl;
395 for(
int spin_source=0; spin_source < Ns; ++spin_source){
396 QDPIO::cout <<
"spin_source = " << spin_source << std::endl;
397 for(
int spin_sink=0; spin_sink < Ns; ++spin_sink){
398 QDPIO::cout <<
"spin_sink = " << spin_sink << std::endl;
401 multi1d<KeyValPropElementalOperator_t> buf(phases.
numSubsets());
403 buf[
t].key.key().t_slice =
t;
405 buf[
t].key.key().spin_src = spin_source;
406 buf[
t].key.key().spin_snk = spin_sink;
408 buf[
t].val.data().mat.resize(num_vecs,Nc);
411 for(
int colorvec_source=0; colorvec_source < Nc; ++colorvec_source){
414 LatticeColorVector vec_source(peekSpin(
q, spin_sink));
416 for(
int colorvec_sink=0; colorvec_sink < num_vecs; ++colorvec_sink){
421 for(
int t=0;
t < hsum.size(); ++
t){
422 buf[
t].val.data().mat(colorvec_sink,colorvec_source) = hsum[
t];
428 QDPIO::cout <<
"insert: spin_source= " << spin_source <<
" spin_sink= " << spin_sink << std::endl;
430 qdp_db.insert(buf[
t].key, buf[
t].val);
439 QDPIO::cout <<
"Propagators computed: time= "
440 << swatch.getTimeInSeconds()
441 <<
" secs" << std::endl;
445 QDPIO::cout <<
name <<
": caught exception around contractions: " << e << std::endl;
452 QDPIO::cout <<
name <<
": total time = "
453 << snoop.getTimeInSeconds()
454 <<
" secs" << std::endl;
456 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.
Serializable value harness.
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.
void PropToFerm(const LatticePropagatorF &b, LatticeFermionF &a, int color_index, int spin_index)
Extract a LatticeFermion from a LatticePropagator.
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.
std::map< std::string, SinkPropContainer_t > prop
MODS_t & eigen_source
Eigenvectors.
Compute the matrix element of LatticeColorVector*M^-1*LatticeColorVector.
Key for propagator colorstd::vector sources.
Key for propagator colorstd::vector matrix elements.
Named object function std::map.
static bool registered
Local registration flag.
QDPSubTypeTrait< typename BinaryReturn< C1, C2, FnLocalInnerProduct >::Type_t >::Type_t localInnerProduct(const QDPSubType< T1, C1 > &l, const QDPType< T2, C2 > &r)
void write(XMLWriter &xml, const std::string &path, const InlinePropMatElemPtColorVecEnv::Params::NamedObject_t &input)
Propagator output.
void read(XMLReader &xml, const std::string &path, InlinePropMatElemPtColorVecEnv::Params::NamedObject_t &input)
Propagator input.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
multi1d< SubsetVectorWeight_t > getEigenValues(const MapObject< int, EVPair< LatticeColorVector > > &eigen_source, int num_vecs)
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
Print out basic info about this program.
Routines associated with Chroma propagator IO.
Fourier transform phase factor support.
struct Chroma::InlinePropMatElemPtColorVecEnv::Params::NamedObject_t named_obj
struct Chroma::InlinePropMatElemPtColorVecEnv::Params::Param_t param
Propagator source construction parameters.
Holds of vectors and weights.