15 #include "qdp_map_obj.h"
31 namespace InlineGenPropMatElemDAColorVecEnv
37 XMLReader paramtop(xml, path);
40 read(paramtop,
"version", version);
56 QDPIO::cerr <<
"Input parameter version " << version <<
" unsupported." << std::endl;
71 write(xml,
"version", version);
88 XMLReader inputtop(xml, path);
119 namespace InlineGenPropMatElemDAColorVecEnv
124 AbsInlineMeasurement* createMeasurement(XMLReader& xml_in,
127 return new InlineMeas(Params(xml_in, path));
154 StandardOutputStream&
operator<<(StandardOutputStream& os,
const multi1d<int>&
d)
160 for(
int i=1;
i <
d.size(); ++
i)
181 XMLReader paramtop(xml_in, path);
183 if (paramtop.count(
"Frequency") == 1)
195 if (paramtop.count(
"xml_file") != 0)
202 QDPIO::cerr << __func__ <<
": Caught Exception reading XML: " << e << std::endl;
241 multi2d<ComplexD>
op;
290 param.
op.resize(
n,
n);
292 for(
int i=0;
i <
n; ++
i)
294 for(
int j=0;
j <
n; ++
j)
304 int n = param.
op.size1();
306 for(
int i=0;
i <
n; ++
i)
308 for(
int j=0;
j <
n; ++
j)
324 multi1d<int> no_disp(1); no_disp[0] = 0;
328 if (orig.size() == 1)
357 push(xml_out,
"GenPropMatElemDAColorVec");
358 write(xml_out,
"update_no", update_no);
359 write(xml_out,
"xml_file", xml_file);
362 XMLFileWriter xml(xml_file);
363 func(update_no, xml);
367 func(update_no, xml_out);
385 push(xml_out,
"GenPropMatElemDAColorVec");
386 write(xml_out,
"update_no", update_no);
388 QDPIO::cout <<
name <<
": Generalized propagator color-std::vector matrix element" << std::endl;
391 XMLBufferWriter gauge_xml, sm_gauge_xml;
392 XMLReader source_prop_file_xml, source_prop_record_xml;
393 XMLReader sink_prop_file_xml, sink_prop_record_xml;
414 catch( std::bad_cast )
416 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
421 QDPIO::cerr <<
name <<
": std::map call failed: " << e << std::endl;
425 const multi1d<LatticeColorMatrix>&
u =
429 const multi1d<LatticeColorMatrix>& u_smr =
432 QDP::MapObject<KeyPropColorVec_t,LatticeFermion>& source_ferm_map =
435 QDP::MapObject<KeyPropColorVec_t,LatticeFermion>& sink_ferm_map =
438 push(xml_out,
"Output_version");
439 write(xml_out,
"out_version", 2);
448 write(xml_out,
"Source_prop_file_info", source_prop_file_xml);
449 write(xml_out,
"Source_prop_record_info", source_prop_record_xml);
450 write(xml_out,
"Sink_prop_file_info", sink_prop_file_xml);
451 write(xml_out,
"Sink_prop_record_info", sink_prop_record_xml);
454 write(xml_out,
"Config_info", gauge_xml);
455 write(xml_out,
"Smeared_Config_info", sm_gauge_xml);
459 MesPlq(xml_out,
"Observables",
u);
460 MesPlq(xml_out,
"Smeared_Observables", u_smr);
465 multi1d<int> origin_offset(
Nd);
467 multi1d<int> mom_offset(
Nd);
480 XMLBufferWriter file_xml;
482 push(file_xml,
"DBMetaData");
484 write(file_xml,
"lattSize", QDP::Layout::lattSize());
489 write(file_xml,
"Source_prop_record_info", source_prop_record_xml);
490 write(file_xml,
"Sink_prop_record_info", sink_prop_record_xml);
491 write(file_xml,
"Config_info", gauge_xml);
499 qdp_db.setMaxUserInfoLen(file_str.size());
503 qdp_db.insertUserdata(file_str);
514 QDPIO::cout <<
"Building generalized propagators" << std::endl;
516 push(xml_out,
"ElementalOps");
534 if (restrict_plateau)
554 multi1d<int> mom(3); mom=0 ; mom[z_dir]=
p;
555 Double phi = (6.28318530717958647696*
p)/toDouble(Layout::lattSize()[z_dir]);
556 QDPIO::cout <<
"Boost Momentum: p = " <<
p << std::endl;
562 for(
int spin_r=0; spin_r < Ns; ++spin_r){
563 QDPIO::cout <<
"spin_r = " << spin_r << std::endl;
564 for(
int spin_l=0; spin_l < Ns; ++spin_l){
565 QDPIO::cout <<
"spin_l = " << spin_l << std::endl;
572 multi2d<KeyValGenPropElementalOperator_t> buf(Layout::lattSize()[z_dir],phases.
numSubsets());
573 for(
int z(0);
z<Layout::lattSize()[z_dir];
z++){
574 multi1d<int> disp(
Nd-1); disp=0 ; disp[z_dir]=
z;
575 for(
int tt=t_start; tt <= t_end; ++tt){
578 buf(
z,
t).key.key().t_slice =
t;
580 buf(
z,
t).key.key().t_sink = t_sink;
581 buf(
z,
t).key.key().spin_r = spin_r;
582 buf(
z,
t).key.key().spin_l = spin_l;
584 buf(
z,
t).key.key().mom = mom;
585 buf(
z,
t).key.key().gamma = gamma;
586 buf(
z,
t).key.key().displacement = disp;
587 buf(
z,
t).val.data().op.resize(num_vecs, num_vecs);
598 LatticeFermion shift_ferm;
599 LatticeFermion src_ferm; source_ferm_map.get(key_r, src_ferm);
600 for(
int z(0);
z<Layout::lattSize()[z_dir];
z++){
601 multi1d<int> disp(
Nd-1); disp=0 ; disp[z_dir]=
z;
603 shift_ferm=src_ferm ;
605 LatticeFermion tt = shift(shift_ferm,
BACKWARD,z_dir);
606 shift_ferm=u_smr[z_dir]*tt;
619 LatticeFermion tt; sink_ferm_map.get(key_l, tt);
623 LatticeFermion snk=Gamma(
Nd*
Nd-1)*tt;
625 LatticeReal foo =
phi*Layout::latticeCoordinate(z_dir);
626 LatticeComplex phase = cmplx(cos(foo),sin(foo));
628 multi1d<ComplexD> op_sum=sumMulti(phase*lop,phases.
getSet());
630 for(
int tt=t_start; tt <= t_end; ++tt){
633 buf(
z,
t).val.data().op(
i,
j) = op_sum[
t];
638 QDPIO::cout <<
"insert: mom= " << mom << std::endl ;
639 for(
int z(0);
z<Layout::lattSize()[z_dir];
z++){
640 for(
int tt=t_start; tt <= t_end; ++tt){
643 qdp_db.insert(buf(
z,
t).key, buf(
z,
t).val);
649 QDPIO::cout <<
"GenProp mom= "<<
p
651 << swiss.getTimeInSeconds()
652 <<
" secs" << std::endl;
662 QDPIO::cout <<
name <<
": total time = "
663 << snoop.getTimeInSeconds()
664 <<
" secs" << std::endl;
666 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.
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.
Class for counted reference semantics.
Compute the matrix element of LatticeColorVector*M^-1*Gamma*displace*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 ¶m)
void read(XMLReader &xml, const std::string &path, Params::Param_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)
FloatingPoint< double > Double
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 genprop_op_file
std::string source_prop_id
void writeXML(XMLWriter &xml_out, const std::string &path) const
Generalized propagator operator.