13 #include "qdp_map_obj_memory.h"
28 namespace InlineAnnihPropMatElemColorVecEnv
33 XMLReader inputtop(xml, path);
56 XMLReader inputtop(xml, path);
60 read(inputtop,
"dt", input.
dt);
62 read(inputtop,
"N", input.
N);
87 XMLReader inputtop(xml, path);
89 read(inputtop,
"Propagator", input.
prop);
125 namespace InlineAnnihPropMatElemColorVecEnv
132 return new InlineMeas(Params(xml_in, 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;
201 push(xml_out,
"AnnihPropMatElemColorVec");
202 write(xml_out,
"update_no", update_no);
203 write(xml_out,
"xml_file", xml_file);
206 XMLFileWriter xml(xml_file);
207 func(update_no, xml);
211 func(update_no, xml_out);
228 multi1d<LatticeColorMatrix>
u;
229 XMLBufferWriter gauge_xml;
235 catch( std::bad_cast )
237 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
242 QDPIO::cerr <<
name <<
": std::map call failed: " << e << std::endl;
246 push(xml_out,
"AnnihPropMatElemColorVec");
247 write(xml_out,
"update_no", update_no);
249 QDPIO::cout <<
name <<
": annihilation propagator matrix element calculation" << std::endl;
257 write(xml_out,
"Config_info", gauge_xml);
259 push(xml_out,
"Output_version");
260 write(xml_out,
"out_version", 1);
264 MesPlq(xml_out,
"Observables",
u);
269 XMLReader source_file_xml, source_record_xml;
271 QDPIO::cout <<
"Snarf the source from a named buffer" << std::endl;
281 write(xml_out,
"Source_file_info", source_file_xml);
282 write(xml_out,
"Source_record_info", source_record_xml);
284 catch (std::bad_cast)
286 QDPIO::cerr <<
name <<
": caught dynamic cast error" << std::endl;
291 QDPIO::cerr <<
name <<
": error extracting source_header: " << e << std::endl;
296 const QDP::MapObject<int,EVPair<LatticeColorVector> >&
eigen_source =
299 QDPIO::cout <<
"Source successfully read and parsed" << std::endl;
305 <<
" is greater than the number of available colorvectors= "
314 <<
" does not divide into lattice extent" << std::endl;
327 XMLBufferWriter file_xml;
329 push(file_xml,
"DBMetaData");
331 write(file_xml,
"lattSize", QDP::Layout::lattSize());
335 write(file_xml,
"Config_info", gauge_xml);
340 qdp_db.setMaxUserInfoLen(file_str.size());
344 qdp_db.insertUserdata(file_str);
370 QDPIO::cout <<
"Try the various factories" << std::endl;
373 typedef LatticeFermion
T;
374 typedef multi1d<LatticeColorMatrix>
P;
375 typedef multi1d<LatticeColorMatrix>
Q;
381 XMLReader fermacttop(xml_s);
395 QDPIO::cout <<
"Suitable factory found: compute all the quark props" << std::endl;
405 const int Lt = QDP::Layout::lattSize()[decay_dir];
410 SftMom phases(0,
true, decay_dir);
412 for(
int tt=0; tt < t_sources_start.size(); ++tt)
416 QDPIO::cout <<
"t_source_start = " << t_source_start << std::endl;
421 MapObjectMemory<KeyPropColorVec_t,LatticeFermion> map_obj;
424 MapObjectMemory<int,Complex> rng_map_obj;
427 multi1d<int> t_sources(num_sources);
429 for(
int nn=0; nn < t_sources.size(); ++nn)
431 int t = (t_source_start +
dt*nn + Lt) % Lt;
437 for(
int colorvec_source=0; colorvec_source < num_vecs; ++colorvec_source) {
439 QDPIO::cout <<
"colorvec_source = " << colorvec_source << std::endl;
442 LatticeColorVector vec_srce =
zero;
443 for(
int nn=0; nn < t_sources.size(); ++nn) {
444 int t = t_sources[nn];
448 Complex weight; rng_map_obj.get(
t, weight);
453 for(
int spin_source=0; spin_source < Ns; ++spin_source) {
455 QDPIO::cout <<
"spin_source = " << spin_source << std::endl;
462 LatticeFermion quark_soln =
zero;
473 map_obj.insert(key, quark_soln);
479 QDPIO::cout <<
"Propagators computed: time= "
480 << swatch.getTimeInSeconds()
481 <<
" secs" << std::endl;
494 QDPIO::cout <<
"Extract matrix elements" << std::endl;
496 for(
int spin_source=0; spin_source < Ns; ++spin_source) {
498 QDPIO::cout <<
"spin_source = " << spin_source << std::endl;
500 for(
int spin_sink=0; spin_sink < Ns; ++spin_sink) {
502 QDPIO::cout <<
"spin_sink = " << spin_sink << std::endl;
506 multi1d<KeyValPropElementalOperator_t> buf(t_sources.size());
507 for(
int nn=0; nn < t_sources.size(); ++nn)
509 int t = t_sources[nn];
511 buf[nn].key.key().t_slice =
t;
512 buf[nn].key.key().t_source =
t;
513 buf[nn].key.key().spin_src = spin_source;
514 buf[nn].key.key().spin_snk = spin_sink;
516 buf[nn].val.data().mat.resize(num_vecs,num_vecs);
519 for(
int colorvec_source=0; colorvec_source < num_vecs; ++colorvec_source)
526 LatticeColorVector vec_source;
529 QDPIO::cout <<
"MAP_OBJ LOOKUP" << std::endl << std::flush;
530 map_obj.get(key,
tmp);
531 vec_source=peekSpin(
tmp, spin_sink);
534 for(
int colorvec_sink=0; colorvec_sink < num_vecs; ++colorvec_sink)
540 for(
int nn=0; nn < t_sources.size(); ++nn)
542 int t = t_sources[nn];
543 Complex weight; rng_map_obj.get(
t,weight);
544 buf[nn].val.data().mat(colorvec_sink,colorvec_source) = conj(weight) * hsum[
t];
550 QDPIO::cout <<
"insert: spin_source= " << spin_source <<
" spin_sink= " << spin_sink << std::endl;
551 for(
int nn=0; nn < t_sources.size(); ++nn)
553 int t = t_sources[nn];
554 qdp_db.insert(buf[nn].key, buf[nn].val);
562 QDPIO::cout <<
"Matrix elements computed: time= "
563 << swatch.getTimeInSeconds()
564 <<
" secs" << std::endl;
570 QDPIO::cout <<
name <<
": caught exception around qprop: " << e << std::endl;
574 push(xml_out,
"Relaxation_Iterations");
575 write(xml_out,
"ncg_had", ncg_had);
584 QDPIO::cout <<
name <<
": total time = "
585 << snoop.getTimeInSeconds()
586 <<
" secs" << std::endl;
588 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.
Fourier transform phase factor support.
const Set & getSet() const
The set to be used in sumMulti.
Class structure for fermion actions.
Fermion action factories.
All Wilson-type fermion actions.
void CvToFerm(const LatticeColorVectorF &a, LatticeFermionF &b, int spin_index)
Convert (insert) a LatticeColorVector into a LatticeFermion.
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.
Complex zN_rng(int N)
Z(N)-rng.
Compute the annihilation diagram propagator elements M^-1 * multi1d<LatticeColorVector>
MODS_t & eigen_source
Eigenvectors.
Key for propagator colorstd::vector sources.
Key for propagator colorstd::vector matrix elements.
void savern(int iseed[4])
Named object function std::map.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
void write(XMLWriter &xml, const std::string &path, const Params::NamedObject_t &input)
Propagator output.
void read(XMLReader &xml, const std::string &path, Params::NamedObject_t &input)
Propagator input.
multi1d< LatticeColorMatrix > P
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.
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeFermion > chi(Ncb)
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)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
Print out basic info about this program.
Fourier transform phase factor support.
multi1d< int > t_sources_start
Holds return info from SystemSolver call.
Holds of vectors and weights.
Volume source of Z(N) noise.