14 #include "qdp_map_obj.h"
30 namespace InlineGenPropMatElemColorVecEnv
35 XMLReader paramtop(xml, path);
44 XMLReader paramtop(xml, path);
47 read(paramtop,
"version", version);
62 QDPIO::cerr <<
"Input parameter version " << version <<
" unsupported." << std::endl;
98 write(xml,
"version", version);
119 XMLReader inputtop(xml, path);
148 namespace InlineGenPropMatElemColorVecEnv
153 AbsInlineMeasurement* createMeasurement(XMLReader& xml_in,
156 return new InlineMeas(Params(xml_in, path));
183 StandardOutputStream&
operator<<(StandardOutputStream& os,
const multi1d<int>&
d)
189 for(
int i=1;
i <
d.size(); ++
i)
210 XMLReader paramtop(xml_in, path);
212 if (paramtop.count(
"Frequency") == 1)
224 if (paramtop.count(
"xml_file") != 0)
231 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
270 multi2d<ComplexD>
op;
319 param.
op.resize(
n,
n);
321 for(
int i=0;
i <
n; ++
i)
323 for(
int j=0;
j <
n; ++
j)
333 int n = param.
op.size1();
335 for(
int i=0;
i <
n; ++
i)
337 for(
int j=0;
j <
n; ++
j)
353 multi1d<int> no_disp(1); no_disp[0] = 0;
357 if (orig.size() == 1)
386 push(xml_out,
"GenPropMatElemColorVec");
387 write(xml_out,
"update_no", update_no);
388 write(xml_out,
"xml_file", xml_file);
391 XMLFileWriter xml(xml_file);
392 func(update_no, xml);
396 func(update_no, xml_out);
414 push(xml_out,
"GenPropMatElemColorVec");
415 write(xml_out,
"update_no", update_no);
417 QDPIO::cout <<
name <<
": Generalized propagator color-std::vector matrix element" << std::endl;
420 XMLBufferWriter gauge_xml;
421 XMLReader source_prop_file_xml, source_prop_record_xml;
422 XMLReader sink_prop_file_xml, sink_prop_record_xml;
440 catch( std::bad_cast )
442 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
447 QDPIO::cerr <<
name <<
": std::map call failed: " << e << std::endl;
451 const multi1d<LatticeColorMatrix>&
u =
454 QDP::MapObject<KeyPropColorVec_t,LatticeFermion>& source_ferm_map =
457 QDP::MapObject<KeyPropColorVec_t,LatticeFermion>& sink_ferm_map =
460 push(xml_out,
"Output_version");
461 write(xml_out,
"out_version", 2);
470 write(xml_out,
"Source_prop_file_info", source_prop_file_xml);
471 write(xml_out,
"Source_prop_record_info", source_prop_record_xml);
472 write(xml_out,
"Sink_prop_file_info", sink_prop_file_xml);
473 write(xml_out,
"Sink_prop_record_info", sink_prop_record_xml);
476 write(xml_out,
"Config_info", gauge_xml);
480 MesPlq(xml_out,
"Observables",
u);
485 multi1d<int> origin_offset(
Nd);
493 multi1d<LatticeColorMatrix> u_smr =
u;
498 XMLReader linktop(xml_l);
507 (*linkSmearing)(u_smr);
511 QDPIO::cerr <<
name <<
": Caught Exception link smearing: " << e << std::endl;
515 MesPlq(xml_out,
"Smeared_Observables", u_smr);
526 XMLBufferWriter file_xml;
528 push(file_xml,
"DBMetaData");
530 write(file_xml,
"lattSize", QDP::Layout::lattSize());
535 write(file_xml,
"Source_prop_record_info", source_prop_record_xml);
536 write(file_xml,
"Sink_prop_record_info", sink_prop_record_xml);
537 write(file_xml,
"Config_info", gauge_xml);
545 qdp_db.setMaxUserInfoLen(file_str.size());
549 qdp_db.insertUserdata(file_str);
560 QDPIO::cout <<
"Building generalized propagators" << std::endl;
562 push(xml_out,
"ElementalOps");
577 if (restrict_plateau)
598 QDPIO::cout <<
"Elemental operator: op = " <<
l << std::endl;
606 int gamma_tmp = (Ns*Ns-1) ^ gamma;
608 QDPIO::cout <<
"gamma=" << gamma_tmp <<
" displacement= " << disp << std::endl;
615 for(
int mom_num = 0 ; mom_num < phases.
numMom() ; ++mom_num)
618 for(
int spin_r=0; spin_r < Ns; ++spin_r)
620 QDPIO::cout <<
"spin_r = " << spin_r << std::endl;
622 for(
int spin_l=0; spin_l < Ns; ++spin_l)
624 QDPIO::cout <<
"spin_l = " << spin_l << std::endl;
629 multi1d<KeyValGenPropElementalOperator_t> buf(phases.
numSubsets());
630 for(
int tt=t_start; tt <= t_end; ++tt)
634 buf[
t].key.key().t_slice =
t;
636 buf[
t].key.key().t_sink = t_sink;
637 buf[
t].key.key().spin_r = spin_r;
638 buf[
t].key.key().spin_l = spin_l;
640 buf[
t].key.key().mom = phases.
numToMom(mom_num);
641 buf[
t].key.key().gamma = gamma;
642 buf[
t].key.key().displacement = disp;
644 buf[
t].val.data().op.resize(num_vecs, num_vecs);
656 LatticeFermion shift_ferm;
658 LatticeFermion tmpvec; source_ferm_map.get(key_r, tmpvec);
660 shift_ferm = Gamma(gamma_tmp) *
displace(u_smr,
678 LatticeFermion tmpvec_sink; sink_ferm_map.get(key_l, tmpvec_sink);
690 multi1d<ComplexD> op_sum = sumMulti(reweight * phases[mom_num] * lop, phases.
getSet());
694 for(
int tt=t_start; tt <= t_end; ++tt)
697 buf[
t].val.data().op(
i,
j) = op_sum[
t];
702 QDPIO::cout <<
"insert: mom= " << phases.
numToMom(mom_num) <<
" displacement= " << disp << std::endl;
703 for(
int tt=t_start; tt <= t_end; ++tt)
706 qdp_db.insert(buf[
t].key, buf[
t].val);
715 QDPIO::cout <<
"GenProp operator= " <<
l
717 << swiss.getTimeInSeconds()
718 <<
" secs" << std::endl;
728 QDPIO::cout <<
name <<
": total time = "
729 << snoop.getTimeInSeconds()
730 <<
" secs" << std::endl;
732 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.
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 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 write(XMLWriter &xml, const std::string &path, const Params::Param_t::DispGamma_t ¶m)
void read(XMLReader &xml, const std::string &path, Params::Param_t::DispGamma_t ¶m)
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)
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.
Fourier transform phase factor support.
Generalized propagator operator.
multi1d< int > displacement
Holds key and value as temporaries.
SerialDBKey< KeyGenPropElementalOperator_t > key
SerialDBData< ValGenPropElementalOperator_t > val
std::string source_prop_id
std::string genprop_op_file
multi1d< int > displacement
multi1d< DispGamma_t > disp_gamma_list
multi1d< int > mom_offset
void writeXML(XMLWriter &xml_out, const std::string &path) const
Generalized propagator operator.