12 #include "qdp_map_obj.h"
24 namespace InlinePropMatElemColorVecEnv
29 XMLReader inputtop(xml, path);
54 XMLReader inputtop(xml, path);
101 return new InlineMeas(Params(xml_in, path));
131 XMLReader paramtop(xml_in, path);
133 if (paramtop.count(
"Frequency") == 1)
145 if (paramtop.count(
"xml_file") != 0)
152 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
169 push(xml_out,
"PropMatElemColorVec");
170 write(xml_out,
"update_no", update_no);
171 write(xml_out,
"xml_file", xml_file);
174 XMLFileWriter xml(xml_file);
175 func(update_no, xml);
179 func(update_no, xml_out);
196 multi1d<LatticeColorMatrix>
u;
197 XMLBufferWriter gauge_xml;
203 catch( std::bad_cast )
205 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
210 QDPIO::cerr <<
name <<
": std::map call failed: " << e << std::endl;
214 push(xml_out,
"PropMatElemColorVec");
215 write(xml_out,
"update_no", update_no);
217 QDPIO::cout <<
name <<
": propagator colorstd::vector matrix element calculation" << std::endl;
225 write(xml_out,
"Config_info", gauge_xml);
227 push(xml_out,
"Output_version");
228 write(xml_out,
"out_version", 1);
232 MesPlq(xml_out,
"Observables",
u);
237 XMLReader source_file_xml, source_record_xml;
239 QDPIO::cout <<
"Snarf the source from a named buffer. Check for the prop std::map" << std::endl;
251 write(xml_out,
"Source_file_info", source_file_xml);
252 write(xml_out,
"Source_record_info", source_record_xml);
254 catch (std::bad_cast)
256 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
261 QDPIO::cerr <<
name <<
": error extracting source_header or prop std::map: " << e << std::endl;
266 const QDP::MapObject<int,EVPair<LatticeColorVector> >&
eigen_source =
270 const QDP::MapObject<KeyPropColorVec_t,LatticeFermion>& prop_obj =
273 QDPIO::cout <<
"Source and prop std::map successfully found and parsed" << std::endl;
282 multi1d<Double> source_corrs = sumMulti(localNorm2(tmpvec.
eigenVector), phases.
getSet());
284 push(xml_out,
"Source_correlators");
285 write(xml_out,
"source_corrs", source_corrs);
293 <<
" is greater than the number of available colorvectors= "
307 XMLBufferWriter file_xml;
309 push(file_xml,
"DBMetaData");
311 write(file_xml,
"lattSize", QDP::Layout::lattSize());
315 write(file_xml,
"Config_info", gauge_xml);
320 qdp_db.setMaxUserInfoLen(file_str.size());
324 qdp_db.insertUserdata(file_str);
353 SftMom phases(0,
true, decay_dir);
356 push(xml_out,
"ColorVecMatElems");
359 for(
int tt=0; tt < t_sources.size(); ++tt)
362 QDPIO::cout <<
"t_source = " <<
t_source << std::endl;
377 for(
int spin_source=0; spin_source < Ns; ++spin_source)
379 QDPIO::cout <<
"spin_source = " << spin_source << std::endl;
384 multi2d<KeyValPropElementalOperator_t> buf(phases.
numSubsets(),Ns);
385 for(
int spin_sink=0; spin_sink < Ns; ++spin_sink)
389 buf(
t,spin_sink).key.key().t_slice =
t;
390 buf(
t,spin_sink).key.key().t_source =
t_source;
391 buf(
t,spin_sink).key.key().spin_src = spin_source;
392 buf(
t,spin_sink).key.key().spin_snk = spin_sink;
394 buf(
t,spin_sink).val.data().mat.resize(num_vecs,num_vecs);
398 for(
int colorvec_source=0; colorvec_source < num_vecs; ++colorvec_source)
405 multi1d<LatticeColorVector> vec_source(Ns);
407 LatticeFermion
tmp; prop_obj.get(key,
tmp);
408 for(
int spin_sink=0; spin_sink < Ns; ++spin_sink)
410 vec_source[spin_sink] = peekSpin(
tmp, spin_sink);
414 for(
int colorvec_sink=0; colorvec_sink < num_vecs; ++colorvec_sink)
418 for(
int spin_sink=0; spin_sink < Ns; ++spin_sink)
422 for(
int t=0;
t < hsum.size(); ++
t)
424 buf(
t,spin_sink).val.data().mat(colorvec_sink,colorvec_source) = hsum[
t];
431 for(
int spin_sink=0; spin_sink < Ns; ++spin_sink)
433 QDPIO::cout <<
"insert: spin_source= " << spin_source <<
" spin_sink= " << spin_sink << std::endl;
436 qdp_db.insert(buf(
t,spin_sink).key, buf(
t,spin_sink).val);
446 QDPIO::cout <<
"Propagators computed: time= "
447 << swatch.getTimeInSeconds()
448 <<
" secs" << std::endl;
452 QDPIO::cout <<
name <<
": caught exception around qprop: " << e << std::endl;
456 push(xml_out,
"Relaxation_Iterations");
457 write(xml_out,
"ncg_had", ncg_had);
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 operator()(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
void func(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 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.
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)
bool registerAll()
Register all the factories.
void read(XMLReader &xml, const std::string &path, Params::NamedObject_t &input)
Propagator input.
void write(XMLWriter &xml, const std::string &path, const Params::NamedObject_t &input)
Propagator output.
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.
Fourier transform phase factor support.
struct Chroma::InlinePropMatElemColorVecEnv::Params::NamedObject_t named_obj
struct Chroma::InlinePropMatElemColorVecEnv::Params::Param_t param
Holds of vectors and weights.