23 namespace InlineMresEnv
57 XMLReader inputtop(xml, path);
59 if (inputtop.count(
"FermionAction") != 0)
69 QDPIO::cout <<
"write mresparams: fermact=XX" << input.
fermact.
xml <<
"XX\n";
81 XMLReader inputtop(xml, path);
103 XMLReader inputtop(xml, path);
112 if( inputtop.count(
"StateInfo") == 1 ) {
113 XMLReader xml_state_info(inputtop,
"StateInfo");
114 std::ostringstream os;
115 xml_state_info.print(os);
119 XMLBufferWriter s_i_xml;
120 push(s_i_xml,
"StateInfo");
129 if (inputtop.count(
"xml_file") != 0)
136 QDPIO::cerr <<
"Error reading data: " << e << std::endl;
150 XMLReader xml_header(header_is);
170 push(xml_out,
"mres");
171 write(xml_out,
"update_no", update_no);
172 write(xml_out,
"xml_file", xml_file);
175 XMLFileWriter xml(xml_file);
176 func(update_no, xml);
180 func(update_no, xml_out);
197 XMLBufferWriter gauge_xml;
203 catch( std::bad_cast )
215 const multi1d<LatticeColorMatrix>&
u =
218 push(xml_out,
"mres");
219 write(xml_out,
"update_no", update_no);
221 QDPIO::cout <<
" MRES" << std::endl;
226 LatticePropagator quark_propagator;
230 XMLReader prop_file_xml, prop_record_xml;
239 XMLReader prop_file_xml, prop_record_xml;
247 read(prop_record_xml,
"/Propagator/PropSource", source_header);
250 if( prop_record_xml.count(
"/Propagator/StateInfo") == 1 )
252 XMLReader xml_state_info(prop_record_xml,
"/Propagator/StateInfo");
253 std::ostringstream os;
254 xml_state_info.print(os);
255 stateInfo = os.str();
264 catch( std::bad_cast )
283 write(xml_out,
"Config_info", gauge_xml);
286 write(xml_out,
"Propagator_file_info", prop_file_xml);
287 write(xml_out,
"Propagator_record_info", prop_record_xml);
289 push(xml_out,
"Output_version");
290 write(xml_out,
"out_version", 1);
294 MesPlq(xml_out,
"Observables",
u);
303 multi1d<Double> forward_prop_corr = sumMulti(localNorm2(quark_propagator),
306 push(xml_out,
"Forward_prop_correlator");
307 write(xml_out,
"forward_prop_corr", forward_prop_corr);
321 std::istringstream xml_s(ferm_act_str);
322 XMLReader fermacttop(xml_s);
328 read(fermacttop, fermact_path +
"/FermAct", fermact);
332 QDPIO::cerr <<
"Error reading fermact: " << e << std::endl;
336 QDPIO::cout <<
"FermAct = " << fermact << std::endl;
339 std::istringstream state_info_is(stateInfo);
340 XMLReader state_info_xml(state_info_is);
345 LatticePropagator delta_prop;
346 LatticePropagator deltaSq_prop;
351 QDPIO::cout <<
"Try generic WilsonTypeFermAct actions" << std::endl;
354 typedef LatticeFermion
T;
355 typedef multi1d<LatticeColorMatrix>
P;
356 typedef multi1d<LatticeColorMatrix>
Q;
387 for(
int col = 0; col < Nc; col++)
389 for(
int spin = 0; spin < Ns; spin++)
391 LatticeFermion tmp1,
tmp2;
394 PropToFerm(quark_propagator, tmp1, col, spin);
410 catch(std::bad_cast) {
411 QDPIO::cout <<
InlineMresEnv::name <<
": Action entered is not suitable to be cast to DWF " << std::endl;
416 multi1d<Double> pseudo_prop_corr = sumMulti(localNorm2(quark_propagator),
419 multi1d<DComplex> delta_prop_corr = sumMulti(trace(adj(quark_propagator)*delta_prop),
422 multi1d<DComplex> deltaSq_prop_corr = sumMulti(trace(adj(delta_prop)*delta_prop),
425 int length = pseudo_prop_corr.size();
426 multi1d<Real> shifted_pseudo(length);
427 multi1d<Real> shifted_delta(length);
428 multi1d<Real> shifted_deltaSq(length);
430 for(
int t=0;
t<length;
t++)
432 int t_eff( (
t -
t0 + length) % length ) ;
433 shifted_pseudo[t_eff] = real(pseudo_prop_corr[
t]);
434 shifted_delta[t_eff] = real(delta_prop_corr[
t]);
435 shifted_deltaSq[t_eff]= real(deltaSq_prop_corr[
t]);
438 push(xml_out,
"DeltaProp_correlator");
439 write(xml_out,
"delta_prop_corr", shifted_delta);
442 push(xml_out,
"DeltaSqProp_correlator");
443 write(xml_out,
"delta_sq_prop_corr", shifted_deltaSq);
446 push(xml_out,
"PsuedoPseudo_correlator");
447 write(xml_out,
"pseudo_prop_corr", shifted_pseudo);
454 << snoop.getTimeInSeconds()
455 <<
" secs" << std::endl;
Inline measurement factory.
Base class for quadratic matter actions (e.g., fermions)
Class for counted reference semantics.
Inline measurement of chiral fermion residual mass.
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.
Base class for unpreconditioned overlap-like fermion actions.
Fourier transform phase factor support.
const Set & getSet() const
The set to be used in sumMulti.
Wilson-like fermion actions.
virtual LinearOperator< T > * DeltaLs(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const =0
Produce a DeltaLs = 1-epsilon^2(H) operator.
Class structure for fermion actions.
Fermion action factories.
All Wilson-type fermion actions.
void PropToFerm(const LatticePropagatorF &b, LatticeFermionF &a, int color_index, int spin_index)
Extract a LatticeFermion from a LatticePropagator.
void FermToProp(const LatticeFermionF &a, LatticePropagatorF &b, int color_index, int spin_index)
Insert a LatticeFermion into a LatticePropagator.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams ¶m)
Writer parameters.
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.
ForwardProp_t prop_header
Inline mres calculations.
Named object function std::map.
static bool registered
Local registration flag.
multi1d< LatticeColorMatrix > P
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
void write(XMLWriter &xml, const std::string &path, const InlineMresParams::NamedObject_t &input)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
Base class for unpreconditioned overlap-like fermion actions.
Print out basic info about this program.
Routines associated with Chroma propagator IO.
Fourier transform phase factor support.
void write(XMLWriter &xml_out, const std::string &path)
struct Chroma::InlineMresParams::Param_t param
struct Chroma::InlineMresParams::NamedObject_t named_obj
Propagator source construction parameters.