15 #include "qdp_map_obj.h"
33 namespace InlineGenPropMatElemPtColorVecEnv
38 XMLReader paramtop(xml, path);
47 XMLReader paramtop(xml, path);
50 read(paramtop,
"version", version);
65 QDPIO::cerr <<
"Input parameter version " << version <<
" unsupported." << std::endl;
99 write(xml,
"version", version);
118 XMLReader inputtop(xml, path);
147 namespace InlineGenPropMatElemPtColorVecEnv
152 AbsInlineMeasurement* createMeasurement(XMLReader& xml_in,
155 return new InlineMeas(Params(xml_in, path));
182 StandardOutputStream&
operator<<(StandardOutputStream& os,
const multi1d<int>&
d)
188 for(
int i=1;
i <
d.size(); ++
i)
209 XMLReader paramtop(xml_in, path);
211 if (paramtop.count(
"Frequency") == 1)
223 if (paramtop.count(
"xml_file") != 0)
230 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
269 multi2d<ComplexD>
op;
318 param.
op.resize(
n,
n);
320 for(
int i=0;
i <
n; ++
i)
322 for(
int j=0;
j <
n; ++
j)
332 int n = param.
op.size1();
334 for(
int i=0;
i <
n; ++
i)
336 for(
int j=0;
j <
n; ++
j)
352 multi1d<int> no_disp(1); no_disp[0] = 0;
356 if (orig.size() == 1)
385 push(xml_out,
"GenPropMatElemPtColorVec");
386 write(xml_out,
"update_no", update_no);
387 write(xml_out,
"xml_file", xml_file);
390 XMLFileWriter xml(xml_file);
391 func(update_no, xml);
395 func(update_no, xml_out);
413 push(xml_out,
"GenPropMatElemPtColorVec");
414 write(xml_out,
"update_no", update_no);
416 QDPIO::cout <<
name <<
": Generalized propagator color-std::vector matrix element" << std::endl;
419 XMLBufferWriter gauge_xml;
420 XMLReader source_prop_file_xml, source_prop_record_xml;
421 XMLReader sink_prop_file_xml, sink_prop_record_xml;
438 catch( std::bad_cast )
440 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
445 QDPIO::cerr <<
name <<
": std::map call failed: " << e << std::endl;
449 const multi1d<LatticeColorMatrix>&
u =
452 const LatticePropagator& source_prop =
454 const QDP::MapObject<KeyPropColorVec_t,LatticeFermion>& sink_ferm_map =
457 push(xml_out,
"Output_version");
458 write(xml_out,
"out_version", 2);
467 write(xml_out,
"Source_prop_file_info", source_prop_file_xml);
468 write(xml_out,
"Source_prop_record_info", source_prop_record_xml);
469 write(xml_out,
"Sink_prop_file_info", sink_prop_file_xml);
470 write(xml_out,
"Sink_prop_record_info", sink_prop_record_xml);
473 write(xml_out,
"Config_info", gauge_xml);
477 MesPlq(xml_out,
"Observables",
u);
482 read(source_prop_record_xml,
"/Propagator/PropSource", source_header);
485 QDPIO::cout <<
"Point Propagator successfully found and parsed" << std::endl;
488 multi1d<int> source = source_header.
getTSrce();
490 int decay_dir = source_header.
j_decay ;
495 QDPIO::cout <<
"source = "
499 << source[3]<< std::endl;
511 multi1d<LatticeColorMatrix> u_smr =
u;
516 XMLReader linktop(xml_l);
525 (*linkSmearing)(u_smr);
529 QDPIO::cerr <<
name <<
": Caught Exception link smearing: " << e << std::endl;
533 MesPlq(xml_out,
"Smeared_Observables", u_smr);
544 XMLBufferWriter file_xml;
546 push(file_xml,
"DBMetaData");
548 write(file_xml,
"lattSize", QDP::Layout::lattSize());
549 write(file_xml,
"decay_dir", decay_dir);
553 write(file_xml,
"Source_prop_record_info", source_prop_record_xml);
554 write(file_xml,
"Sink_prop_record_info", sink_prop_record_xml);
555 write(file_xml,
"Config_info", gauge_xml);
556 write(file_xml,
"source", source);
564 qdp_db.setMaxUserInfoLen(file_str.size());
568 qdp_db.insertUserdata(file_str);
579 QDPIO::cout <<
"Building generalized propagators" << std::endl;
581 push(xml_out,
"ElementalOps");
594 if (restrict_plateau)
615 QDPIO::cout <<
"Elemental operator: op = " <<
l << std::endl;
623 int gamma_tmp = (Ns*Ns-1) ^ gamma;
625 QDPIO::cout <<
"gamma=" << gamma_tmp <<
" displacement= " << disp << std::endl;
632 for(
int mom_num = 0 ; mom_num < phases.
numMom() ; ++mom_num)
635 for(
int spin_r=0; spin_r < Ns; ++spin_r)
637 QDPIO::cout <<
"spin_r = " << spin_r << std::endl;
639 for(
int spin_l=0; spin_l < Ns; ++spin_l)
641 QDPIO::cout <<
"spin_l = " << spin_l << std::endl;
646 multi1d<KeyValGenPropElementalOperator_t> buf(phases.
numSubsets());
647 for(
int tt=t_start; tt <= t_end; ++tt)
651 buf[
t].key.key().t_slice =
t;
653 buf[
t].key.key().t_sink = t_sink;
654 buf[
t].key.key().spin_r = spin_r;
655 buf[
t].key.key().spin_l = spin_l;
657 buf[
t].key.key().mom = phases.
numToMom(mom_num);
658 buf[
t].key.key().gamma = gamma;
659 buf[
t].key.key().displacement = disp;
661 buf[
t].val.data().op.resize(num_vecs, Nc);
664 for(
int color_r = 0; color_r < Nc; ++color_r)
671 LatticeFermion shift_ferm = Gamma(gamma_tmp) *
displace(u_smr,
q,
687 LatticeFermion tmpvec_sink; sink_ferm_map.get(key_l, tmpvec_sink);
699 multi1d<ComplexD> op_sum = sumMulti(reweight * phases[mom_num] * lop, phases.
getSet());
703 for(
int tt=t_start; tt <= t_end; ++tt)
706 buf[
t].val.data().op(
i,color_r) = op_sum[
t];
711 QDPIO::cout <<
"insert: mom= " << phases.
numToMom(mom_num) <<
" displacement= " << disp << std::endl;
712 for(
int tt=t_start; tt <= t_end; ++tt)
715 qdp_db.insert(buf[
t].key, buf[
t].val);
724 QDPIO::cout <<
"GenProp operator= " <<
l
726 << swiss.getTimeInSeconds()
727 <<
" secs" << std::endl;
737 QDPIO::cout <<
name <<
": total time = "
738 << snoop.getTimeInSeconds()
739 <<
" secs" << std::endl;
741 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.
Serializable key harness.
Fourier transform phase factor support.
int numSubsets() const
Number of subsets - length in decay direction.
multi1d< int > numToMom(int mom_num) const
Convert momenta id to actual array of momenta.
int numMom() const
Number of momenta.
int multiplicity(int mom_num) const
Return the the multiplicity for this momenta id.
const Set & getSet() const
The set to be used in sumMulti.
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 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.
T displace(const multi1d< LatticeColorMatrix > &u, const T &psi, int length, int dir, const Subset &sub)
Apply a displacement operator to a lattice field.
Class for counted reference semantics.
Compute the matrix element of LatticeColorVector*M^-1*Gamma*M^-1**LatticeColorVector.
Key for propagator colorstd::vector sources.
All link smearing constructors.
Factory for producing link smearing objects.
Named object function std::map.
static bool registered
Local registration flag.
multi1d< int > normDisp(const multi1d< int > &orig)
Normalize just one displacement array.
void read(XMLReader &xml, const std::string &path, Params::Param_t::DispGamma_t ¶m)
bool registerAll()
Register all the factories.
void write(XMLWriter &xml, const std::string &path, const Params::Param_t::DispGamma_t ¶m)
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.
Asqtad Staggered-Dirac operator.
QDP::StandardOutputStream & operator<<(QDP::StandardOutputStream &s, const multi1d< int > &d)
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
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.
Generalized propagator operator.
multi1d< int > displacement
Holds key and value as temporaries.
SerialDBData< ValGenPropElementalOperator_t > val
SerialDBKey< KeyGenPropElementalOperator_t > key
std::string source_prop_id
std::string genprop_op_file
multi1d< int > displacement
multi1d< int > mom_offset
multi1d< DispGamma_t > disp_gamma_list
void writeXML(XMLWriter &xml_out, const std::string &path) const
Generalized propagator operator.
Propagator source construction parameters.
multi1d< int > getTSrce() const