21 namespace InlineEigBndsMdagMEnv
56 XMLReader paramtop(xml, path);
60 if( paramtop.count(
"RsdRHi") == 0 ) {
66 if( paramtop.count(
"RsdAHi") == 0 ) {
77 if( paramtop.count(
"Neig")==1 ) {
100 if( param.
Neig != 1 ) {
121 XMLReader inputtop(xml, path);
137 XMLReader paramtop(xml_in, path);
142 if (paramtop.count(
"usePV") == 1)
153 if (paramtop.count(
"xml_file") != 0)
160 QDPIO::cerr <<
"Caught Exception reading XML: " << e << std::endl;
188 XMLReader fermact_reader(is);
198 QDPIO::cerr << __func__ <<
": caught exception constructing fermact: " <<
s << std::endl;
207 unsigned long update_no,
210 QDPIO::cout <<
"4D eig bnds" << std::endl;
212 push(xml_out,
"EigBndsMdagM");
213 write(xml_out,
"update_no", update_no);
217 multi1d<Real> lambda(n_eig);
218 multi1d<Real> check_norm(n_eig);
219 multi1d<LatticeFermion>
psi(n_eig);
222 for(
int i =0;
i < n_eig;
i++)
225 QDPIO::cout <<
"Look for lowest ev" << std::endl;
227 push(xml_out,
"LowestEv");
243 QDPIO::cout <<
"Look for highest ev" << std::endl;
249 lambda.resize(n_eig);
250 for(
int i =0;
i < n_eig;
i++)
253 push(xml_out,
"HighestEv");
277 unsigned long update_no,
280 QDPIO::cout <<
"5D eig bnds" << std::endl;
282 push(xml_out,
"EigBndsMdagM");
283 write(xml_out,
"update_no", update_no);
287 const int N5 = MM->size();
288 multi1d<Real> lambda(n_eig);
289 multi1d<Real> check_norm(n_eig);
290 multi2d<LatticeFermion>
psi(n_eig,
N5);
293 for(
int i=0;
i < n_eig;
i++)
294 for(
int n=0;
n <
N5;
n++)
297 QDPIO::cout <<
"Look for lowest ev" << std::endl;
299 push(xml_out,
"LowestEv");
316 multi1d<Double> prof(
N5);
317 for(
int n=0;
n <
N5;
n++)
318 prof[
n] = norm2(
psi[0][
n], MM->subset());
320 write(xml_out,
"EigenVectorProfile", prof);
322 for(
int n=0;
n <
N5;
n++)
323 prof[
n] = innerProductReal(
psi[0][
n], chiralProjectPlus(
psi[0][
n]), MM->subset());
325 write(xml_out,
"EigenVectorProfilePlus", prof);
327 for(
int n=0;
n <
N5;
n++)
328 prof[
n] = innerProductReal(
psi[0][
n], chiralProjectMinus(
psi[0][
n]), MM->subset());
330 write(xml_out,
"EigenVectorProfileMinus", prof);
333 QDPIO::cout <<
"Look for highest ev" << std::endl;
337 for(
int i=0;
i < n_eig;
i++)
338 for(
int n=0;
n <
N5;
n++)
341 push(xml_out,
"HighestEv");
372 push(xml_out,
"EigBndsMdagM");
373 write(xml_out,
"update_no", update_no);
374 write(xml_out,
"xml_file", xml_file);
377 XMLFileWriter xml(xml_file);
378 func(update_no, xml);
382 func(update_no, xml_out);
402 typedef LatticeFermion
T;
403 typedef multi1d<LatticeColorMatrix>
P;
404 typedef multi1d<LatticeColorMatrix>
Q;
416 multi1d<LatticeColorMatrix>
u;
422 catch (std::bad_cast)
441 this->
do4d(MM, update_no, xml_out);
449 this->
do5d(MM, update_no, xml_out);
457 this->
do5d(MM, update_no, xml_out);
468 << snoop.getTimeInSeconds()
469 <<
" secs" << std::endl;
Inline measurement factory.
Base class for quadratic matter actions (e.g., fermions)
virtual LinearOperator< T > * lMdagM(Handle< FermState< T, P, Q > > state) const =0
Produce a linear operator M^dag.M for this action.
Base class of quadratic matter actions (e.g., fermions) living in an extra dimension.
Class for counted reference semantics.
Inline measurement of eigenvalue bounds of M^dag*M.
InlineEigBndsMdagM(const InlineEigBndsMdagMParams &p)
void do4d(Handle< LinearOperator< LatticeFermion > > MM, unsigned long update_no, XMLWriter &xml_out)
4D
InlineEigBndsMdagMParams params
void do5d(Handle< LinearOperatorArray< LatticeFermion > > MM, unsigned long update_no, XMLWriter &xml_out)
5D
void func(const unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
Handle< FermionAction< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > fermact
void operator()(unsigned long update_no, XMLWriter &xml_out)
Do the measurement.
Linear Operator to arrays.
M^dag.M linear operator over arrays.
Partial specialization of scaled M operator over arrays.
Fermion action factories.
void EigSpecRitzCG(const LinearOperator< LatticeFermion > &M, multi1d< Real > &lambda_H, multi1d< LatticeFermion > &psi, int n_eig, int n_renorm, int n_min, int MaxCG, const Real &Rsd_r, const Real &Rsd_a, const Real &zero_cutoff, const bool ProjApsiP, int &n_cg_tot, XMLWriter &xml_out)
Compute low lying eigenvalues of the hermitian H.
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.
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.
Inline measurements for eigenvalue bounds.
Named object function std::map.
static bool registered
Local registration flag.
multi1d< LatticeColorMatrix > P
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 write(XMLWriter &xml, const std::string &path, const InlineEigBndsMdagMParams::NamedObject_t &input)
Object buffer.
multi1d< LatticeFermion > s(Ncb)
Struct for parameters needed for a Ritz type solve.
struct Chroma::InlineEigBndsMdagMParams::RitzParams_t ritz
InlineEigBndsMdagMParams()
struct Chroma::InlineEigBndsMdagMParams::NamedObject_t named_obj
void write(XMLWriter &xml_in, const std::string &path)