32 namespace InlineProp3ptEnv{
60 XMLReader paramtop(xml, path);
63 read(paramtop,
"p", op.
p);
64 read(paramtop,
"t", op.
t);
65 if(paramtop.count(
"factor")>0)
66 read(paramtop,
"factor", op.
f);
78 write(xml,
"factor", op.
f);
85 XMLReader paramtop(xml, path);
88 read(paramtop,
"version", version);
94 read(paramtop,
"op",param.
op);
102 QDPIO::cerr <<
"Input parameter version " << version <<
" unsupported." << std::endl;
116 write(xml,
"version", version);
120 for(
int t(0);
t<param.
chi.size();
t++){
122 xml<<param.
chi[
t].xml;
134 XMLReader inputtop(xml, path);
163 XMLReader paramtop(xml_in, path);
165 if (paramtop.count(
"Frequency") == 1)
177 if (paramtop.count(
"xml_file") != 0)
184 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
217 push(xml_out,
"propagator_3pt");
218 write(xml_out,
"update_no", update_no);
219 write(xml_out,
"xml_file", xml_file);
222 XMLFileWriter xml(xml_file);
223 func(update_no, xml);
226 func(update_no, xml_out);
245 XMLBufferWriter gauge_xml;
251 catch( std::bad_cast )
259 QDPIO::cerr <<
name <<
": std::map call failed: " << e
263 const multi1d<LatticeColorMatrix>&
u =
266 push(xml_out,
"prop_3pt");
267 write(xml_out,
"update_no", update_no);
269 QDPIO::cout <<
name <<
": Propagator for 3pt functions" << std::endl;
277 write(xml_out,
"Config_info", gauge_xml);
279 push(xml_out,
"Output_version");
280 write(xml_out,
"out_version", 1);
285 MesPlq(xml_out,
"Observables",
u);
300 multi1d< Handle< DilutionScheme<LatticeFermion> > > quarks(
N_quarks);
306 std::istringstream xml_d(dil_xml.
xml);
307 XMLReader diltop(xml_d);
308 QDPIO::cout <<
"Dilution type = " << dil_xml.
id << std::endl;
316 QDPIO::cerr <<
name <<
": Caught Exception constructing dilution scheme: " << e << std::endl;
327 if (quarks[0]->getCfgInfo() != quarks[
n]->getCfgInfo()){
328 QDPIO::cerr <<
name <<
" : Quarks do not contain the same cfg info";
329 QDPIO::cerr <<
", quark "<<
n << std::endl;
342 write(top,
"Config_info", gauge_xml);
344 XMLReader from2(from,
"/Config_info");
345 std::ostringstream os;
350 if (cfgInfo != quarks[0]->getCfgInfo()){
351 QDPIO::cerr <<
name <<
" : Quarks do not contain the same";
352 QDPIO::cerr <<
" cfg info as the gauge field." ;
353 QDPIO::cerr <<
"gauge: XX"<<cfgInfo<<
"XX quarks: XX" ;
354 QDPIO::cerr << quarks[0]->getCfgInfo()<<
"XX"<< std::endl;
360 int decay_dir = quarks[0]->getDecayDir();
365 for(
int i(0);
i<
Nd-1;
i++)
369 SftMom phases(mom2,
false, decay_dir);
373 for(
int n = 1 ;
n < quarks.size(); ++
n){
374 if(toBool(quarks[
n]->getSeed()==quarks[0]->getSeed())){
375 QDPIO::cerr <<
name <<
": error, quark seeds are the same" << std::endl;
379 if(toBool(quarks[
n]->getDecayDir()!=quarks[0]->getDecayDir())){
380 QDPIO::cerr<<
name<<
": error, quark decay dirs do not match" <<std::endl;
388 QDPIO::cout <<
"Attempt to read propagator info" << std::endl;
392 LatticePropagator& tt_prop =
397 XMLReader prop_file_xml, prop_record_xml;
404 read(prop_record_xml,
"/Propagator/PropSource", source_header);
407 catch (std::bad_cast){
408 QDPIO::cerr <<
name <<
": caught dynamic cast error" ;
409 QDPIO::cerr << std::endl;
413 QDPIO::cerr <<
name <<
": error extracting prop_header: " << e << std::endl;
416 const LatticePropagator&
prop =
419 QDPIO::cout <<
"Propagator successfully read and parsed" << std::endl;
425 catch (std::bad_cast){
426 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
430 QDPIO::cerr <<
name <<
": error creating prop: " << e << std::endl;
435 LatticePropagator& prop_3pt =
451 XMLReader from2(from,
"/tt/Operator");
452 std::ostringstream os;
453 QDPIO::cout<<
name<<
" Operator: "<<std::endl ;
455 QDPIO::cout<<os.str()<<std::endl ;
457 QDPIO::cout<<
name<<
" End Operator "<<std::endl ;
463 LatticeFermion ferm_3pt =
zero ;
464 LatticeFermion ferm ;
465 LatticeComplex phase = phases[phases.momToNum(
params.
param.
op.
p)];
467 for(
int s(0);
s<Ns;
s++)
468 for(
int c(0);
c<Nc;
c++){
469 QDPIO::cout<<
" Doing quark color and spin: "<<
c<<
" "<<
s <<std::endl ;
473 for(
int n(0);
n<quarks.size();
n++){
475 for (
int tt(0) ; tt < quarks[
n]->getNumTimeSlices() ; ++tt)
476 if(quarks[
n]->getT0(tt) ==
t0)
481 QDPIO::cout<<
" Doing quark: "<<
n <<std::endl ;
482 QDPIO::cout<<
" quark: "<<
n <<
" has "<<quarks[
n]->getDilSize(i_t0);
483 QDPIO::cout<<
" dilutions on time slice "<<
t0<<std::endl ;
484 for(
int i = 0 ;
i < quarks[
n]->getDilSize(i_t0) ; ++
i){
485 QDPIO::cout<<
" Doing dilution : "<<
i<<std::endl ;
488 ferm_3pt +=
sum(cc,phases.getSet()[
t0])*quarks[
n]->dilutedSolution(i_t0,
i);
490 QDPIO::cout<<
" Done with dilutions for quark: "<<
n <<std::endl ;
494 QDPIO::cerr<<
name<<
": error, no appropriate time slice found" <<std::endl;
500 QDPIO::cout<<
" Done with quark color and spin: "<<
c<<
" "<<
s <<std::endl ;
509 multi1d<Double> corr = sumMulti(localNorm2(prop_3pt),phases.
getSet());
511 push(xml_out,
"Prop_correlator");
512 write(xml_out,
"prop_corr", corr);
520 QDPIO::cout <<
"Start writing propagator info" << std::endl;
522 XMLBufferWriter file_xml;
523 push(file_xml,
"propagator");
527 XMLBufferWriter record_xml;
528 push(record_xml ,
"Propagator");
530 write(record_xml,
"PropSource", source_header);
531 write(record_xml,
"Config_info", gauge_xml);
539 QDPIO::cout <<
"Propagator successfully updated" << std::endl;
541 catch (std::bad_cast){
542 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
546 QDPIO::cerr <<
name <<
": error extracting prop_header: " << e << std::endl;
555 QDPIO::cout <<
name <<
": total time = "
556 << snoop.getTimeInSeconds()
557 <<
" secs" << std::endl;
559 QDPIO::cout <<
name <<
": ran successfully" << std::endl;
Inline measurement factory.
Baryon spin and projector matrices.
Factory for producing baryon operators.
Inline measurement of stochastic baryon operators.
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.
Fourier transform phase factor support.
const Set & getSet() const
The set to be used in sumMulti.
Random Z(N) source construction using dilution.
All dilution scheme factories.
Factory for dilution schemes.
Parallel transport a lattice field.
void PropToFerm(const LatticePropagatorF &b, LatticeFermionF &a, int color_index, int spin_index)
Extract a LatticeFermion from a LatticePropagator.
void FermToProp(const LatticeFermionF &a, LatticePropagatorF &b, int color_index, int spin_index)
Insert a LatticeFermion into a LatticePropagator.
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.
multi1d< GroupXML_t > readXMLArrayGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
Class for counted reference semantics.
std::map< std::string, SinkPropContainer_t > prop
ForwardProp_t prop_header
Inline measurement of stochastic 3pt functions.
void savern(int iseed[4])
Named object function std::map.
static bool registered
Local registration flag.
void read(XMLReader &xml, const std::string &path, Params::Operator_t &op)
void write(XMLWriter &xml, const std::string &path, const Params::Operator_t &op)
bool registerAll()
Register all the factories.
QDPSubTypeTrait< typename BinaryReturn< C1, C2, FnLocalInnerProduct >::Type_t >::Type_t localInnerProduct(const QDPSubType< T1, C1 > &l, const QDPType< T2, C2 > &r)
const int N_quarks
Number of quarks to be used in this construction.
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
Print out basic info about this program.
All quark smearing constructors.
Factory for producing quark smearing objects.
Fourier transform phase factor support.
All make sink constructors.
Factory for producing quark prop sinks.
Factory for producing quark smearing objects.
Hold group xml and type id.
multi1d< GroupXML_t > chi
struct Chroma::InlineProp3ptEnv::Params::Param_t param
void write(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineProp3ptEnv::Params::NamedObject_t named_obj
Propagator source construction parameters.
Volume source of Z(N) noise.