22 #define COLORVEC_MATELEM_TYPE_ZERO 0
23 #define COLORVEC_MATELEM_TYPE_ONE 1
24 #define COLORVEC_MATELEM_TYPE_MONE -1
25 #define COLORVEC_MATELEM_TYPE_GENERIC 10
34 namespace InlineMesonMatElemColorVecEnv
39 XMLReader paramtop(xml, path);
42 read(paramtop,
"version", version);
67 QDPIO::cerr <<
"Input parameter version " << version <<
" unsupported." << std::endl;
89 write(xml,
"version", version);
106 XMLReader inputtop(xml, path);
133 namespace InlineMesonMatElemColorVecEnv
138 AbsInlineMeasurement* createMeasurement(XMLReader& xml_in,
141 return new InlineMeas(Params(xml_in, path));
168 StandardOutputStream&
operator<<(StandardOutputStream& os,
const multi1d<int>&
d)
174 for(
int i=1;
i <
d.size(); ++
i)
197 XMLReader paramtop(xml_in, path);
199 if (paramtop.count(
"Frequency") == 1)
211 if (paramtop.count(
"xml_file") != 0)
218 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
252 multi2d<ComplexD>
op;
285 XMLReader paramtop(xml, path);
289 read(paramtop,
"mom", param.
mom);
313 param.
op.resize(
n,
n);
315 for(
int i=0;
i <
n; ++
i)
317 for(
int j=0;
j <
n; ++
j)
329 int n = param.
op.size1();
331 for(
int i=0;
i <
n; ++
i)
333 for(
int j=0;
j <
n; ++
j)
349 multi1d<int> no_disp(1); no_disp[0] = 0;
353 if (orig.size() == 1)
382 push(xml_out,
"MesonMatElemColorVec");
383 write(xml_out,
"update_no", update_no);
384 write(xml_out,
"xml_file", xml_file);
387 XMLFileWriter xml(xml_file);
388 func(update_no, xml);
392 func(update_no, xml_out);
412 XMLBufferWriter gauge_xml;
421 catch( std::bad_cast )
423 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
428 QDPIO::cerr <<
name <<
": std::map call failed: " << e << std::endl;
433 const multi1d<LatticeColorMatrix>&
u =
436 const MapObject<int,EVPair<LatticeColorVector> >&
eigen_source =
442 QDPIO::cerr <<
name <<
": number of available eigenvectors is too small\n";
446 push(xml_out,
"MesonMatElemColorVec");
447 write(xml_out,
"update_no", update_no);
449 QDPIO::cout <<
name <<
": Meson color-std::vector matrix element" << std::endl;
457 write(xml_out,
"Config_info", gauge_xml);
459 push(xml_out,
"Output_version");
460 write(xml_out,
"out_version", 1);
465 MesPlq(xml_out,
"Observables",
u);
479 multi2d<int> moms(num_mom,mom_size);
480 for(
int i = 0;
i < num_mom;
i++)
485 phases = temp_phases;
492 multi1d<LatticeColorMatrix> u_smr =
u;
497 XMLReader linktop(xml_l);
506 (*linkSmearing)(u_smr);
510 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());
536 write(file_xml,
"Config_info", gauge_xml);
541 qdp_db.setMaxUserInfoLen(file_str.size());
545 qdp_db.insertUserdata(file_str);
554 multi1d<int> no_displacement;
555 multi1d<int> zero_mom(3); zero_mom = 0;
563 QDPIO::cout <<
"Building meson operators" << std::endl;
565 push(xml_out,
"ElementalOps");
576 QDPIO::cout <<
"Elemental operator: op = " <<
l << std::endl;
581 QDPIO::cout <<
"displacement = " << disp << std::endl;
588 for(
int mom_num = 0 ; mom_num < phases.
numMom() ; ++mom_num)
595 multi1d<KeyValMesonElementalOperator_t> buf(phases.
numSubsets());
598 buf[
t].key.key().t_slice =
t;
599 buf[
t].key.key().mom = phases.
numToMom(mom_num);
600 buf[
t].key.key().displacement = disp;
604 (phases.
numToMom(mom_num)) == zero_mom &&
605 (disp == no_displacement) )
619 LatticeColorVector shift_vec = phases[mom_num] *
displace(u_smr,
635 multi1d<ComplexD> op_sum = sumMulti(lop, phases.
getSet());
639 for(
int t=0;
t < op_sum.size(); ++
t)
641 buf[
t].val.data().op(
i,
j) = op_sum[
t];
648 QDPIO::cout <<
"insert: mom= " << phases.
numToMom(mom_num) <<
" displacement= " << disp << std::endl;
651 qdp_db.insert(buf[
t].key, buf[
t].val);
658 QDPIO::cout <<
"Meson operator= " <<
l
660 << swiss.getTimeInSeconds()
661 <<
" secs" << std::endl;
671 QDPIO::cout <<
name <<
": total time = "
672 << snoop.getTimeInSeconds()
673 <<
" secs" << std::endl;
675 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.
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.
MODS_t & eigen_source
Eigenvectors.
#define COLORVEC_MATELEM_TYPE_GENERIC
#define COLORVEC_MATELEM_TYPE_ONE
Inline measurement of meson operators via colorstd::vector matrix elements.
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.
bool registerAll()
Register all the factories.
void write(XMLWriter &xml, const std::string &path, const InlineMesonMatElemColorVecEnv::Params::Param_t ¶m)
void read(XMLReader &xml, const std::string &path, InlineMesonMatElemColorVecEnv::Params::Param_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")
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.
multi1d< int > displacement
Holds key and value as temporaries.
SerialDBData< ValMesonElementalOperator_t > val
SerialDBKey< KeyMesonElementalOperator_t > key
std::string meson_op_file
multi1d< multi1d< int > > displacement_list
multi1d< multi1d< int > > mom_list
void writeXML(XMLWriter &xml_out, const std::string &path) const
Holds of vectors and weights.