24 namespace UnprecOvExtFermActArrayEnv
28 multi1d<LatticeColorMatrix>,
39 multi1d<LatticeColorMatrix>,
73 XMLReader paramtop(xml, path);
90 XMLReader tuning_strategy_reader(paramtop,
"TuningStrategy");
91 std::ostringstream os;
92 tuning_strategy_reader.print(os);
96 QDPIO::cout <<
"Caught Exception while reading XML: " << e << std::endl;
111 write(xml,
"OverMass",
p.OverMass);
114 write(xml,
"Mass",
p.Mass);
115 write(xml,
"RatPolyDeg",
p.RatPolyDeg);
116 write(xml,
"ApproximationType",
p.approximation_type);
118 write(xml,
"ApproxMin",
p.ApproxMin);
119 write(xml,
"ApproxMax",
p.ApproxMax);
123 QDP::write(xml,
"TuningStrategy",
p.tuning_strategy_xml);
131 cfs(cfs_), param(param_)
136 XMLReader tuning_xml(ts_is);
139 read(tuning_xml,
"/TuningStrategy/Name", strategy_name);
142 QDPIO::cerr <<
"Caught exception processing TuningStrategy: " << e << std::endl;
169 multi1d<Real>& rootQ)
const
178 zolotarev_data *rdata ;
207 QDPIO::cout <<
"Initing Linop with Zolotarev Coefficients" << std::endl;
230 QDPIO::cerr <<
"Failed to get Zolo Coeffs" << std::endl;
238 scale_fac = Real(1) ;
241 QDPIO::cout <<
"Initing Linop with Unscaled Higham Rep tanh Coefficients" << std::endl;
267 maxerr = (Real)(rdata -> Delta);
268 QDPIO::cout <<
"Maxerr " << maxerr << std::flush << std::endl;
272 Npoles = rdata -> dd;
275 QDPIO::cout <<
"Oops. 2Npoles+1 = " << (2*Npoles+1)
277 <<
" this is inconsitent" << std::endl;
283 rootQ.resize(Npoles);
291 coeffP = rdata ->
alpha[rdata -> da - 1] * scale_fac;
294 Real
t = Real(1) / (scale_fac * scale_fac);
295 for(
int n=0;
n < Npoles; ++
n) {
297 resP[Npoles-1-
n] = rdata ->
alpha[
n] / scale_fac;
298 rootQ[Npoles-1-
n] = rdata -> ap[
n];
299 rootQ[Npoles-1-
n] = -(rootQ[Npoles-1-
n] *
t);
303 <<
" scale=" << scale_fac
307 QDPIO::cout <<
"Approximation on [-1,-eps] U [eps,1] with eps = " <<
eps <<
309 QDPIO::cout <<
"Maximum error |R(x) - sqn(x)| <= " << maxerr << std::endl;
313 QDPIO::cout <<
"Coefficients from Zolotarev" << std::endl;
316 QDPIO::cout <<
"Approximation type " << type <<
" with R(0) = 0"
320 QDPIO::cout <<
"Approximation type " << type <<
" with R(0) = infinity" << std::endl;
326 QDPIO::cout <<
"Coefficients from Unscaled Higham Tanh representation" << std::endl;
335 QDPIO::cout <<
"Number of poles= " << Npoles << std::endl;
336 QDPIO::cout <<
"Overall Factor= " << coeffP << std::endl;
337 QDPIO::cout <<
"Numerator coefficients:" << std::endl;
338 for(
int n=0;
n < Npoles;
n++) {
339 QDPIO::cout <<
" resP[" <<
n <<
"]= " << resP[
n] << std::endl;
341 QDPIO::cout <<
"Denominator roots: " << std::endl;
342 for(
int n=0;
n < Npoles;
n++) {
343 QDPIO::cout <<
" rootQ[" <<
n<<
"]= " << rootQ[
n] << std::endl;
358 multi1d<LatticeColorMatrix>,
359 multi1d<LatticeColorMatrix> >*
369 init(Npoles, coeffP, resP, rootQ);
374 XMLReader tuning_xml(ts_is);
377 read(tuning_xml,
"/TuningStrategy/Name", strategy_name);
380 QDPIO::cerr <<
"Caught exception processing TuningStrategy: " << e << std::endl;
386 multi1d<Real>
beta(Npoles);
429 const Subset&
subset()
const {
return all;}
442 const int N5 =
A->size();
447 multi1d<LatticeFermion> chi5(
N5);
448 multi1d<LatticeFermion> psi5(
N5);
455 (*A)(chi5, psi5,
MINUS);
478 res.
resid = sqrt(norm2(
r));
483 (*Dw)(chi5[0], psi5[
N5-1],
PLUS);
484 psi5[
N5-1] *= Real(2);
485 psi5[
N5-1] +=
a5*chi5[0];
490 psi5[
N5-1] *= Real(2)/(Real(1)-
Mass);
524 std::istringstream is(invParam.
xml);
525 XMLReader paramtop(is);
Primary include file for CHROMA library code.
Create a fermion connection state.
Support class for fermion actions and linear operators.
Base class for quadratic matter actions (e.g., fermions)
Class for counted reference semantics.
Linear Operator to arrays.
Propagator of an un-preconditioned Extended-Overlap linear operator.
OvExt5DQprop(Handle< LinearOperatorArray< T > > A_, Handle< LinearOperator< T > > Dw_, const Real &Mass_, const Real &a5_, const SysSolverCGParams &invParam_)
Constructor.
~OvExt5DQprop()
Destructor is automatic.
Handle< LinearOperator< T > > Dw
const Subset & subset() const
Return the subset on which the operator acts.
SystemSolverResults_t operator()(T &psi, const T &chi) const
Solver the linear system.
SysSolverCGParams invParam
Handle< LinearOperatorArray< T > > A
Unpreconditioned linear operator including derivatives.
Unpreconditioned Extended-Overlap (N&N) linear operator.
UnprecOvExtFermActArrayParams param
int getN5FromRatPolyDeg(const int &RatPolyDeg) const
Initializer.
UnprecLinearOperatorArray< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
Real getQuarkMass() const
Return the quark mass.
void init(int &Npoles, Real &coeffP, multi1d< Real > &resP, multi1d< Real > &rootQ) const
Get the rational approximation coefficients.
Handle< AbsOvExtTuningStrategy > theTuningStrategy
UnprecOvExtFermActArray()
SystemSolver< LatticeFermion > * qprop(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Compute quark propagator over base type.
Unpreconditioned Extended-Overlap (N&N) linear operator.
Unpreconditioned Wilson-Dirac operator.
Wilson-like fermion actions.
All ferm create-state method.
Fermion action factories.
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.
SystemSolverResults_t InvCG2(const LinearOperator< LatticeFermionF > &M, const LatticeFermionF &chi, LatticeFermionF &psi, const Real &RsdCG, int MaxCG)
Conjugate-Gradient (CGNE) algorithm for a generic Linear Operator.
@ COEFF_TYPE_TANH_UNSCALED
Conjugate-Gradient algorithm for a generic Linear Operator.
Handle< CreateFermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the CreateFermState readers.
static const LatticeInteger & beta(const int dim)
static const LatticeInteger & alpha(const int dim)
FermionAction< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct(XMLReader &xml_in, const std::string &path)
Callback function.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
WilsonTypeFermAct5D< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct5D(XMLReader &xml_in, const std::string &path)
Callback function.
const std::string name
Name to be used.
Asqtad Staggered-Dirac operator.
QDP_error_exit("too many BiCG iterations", n_count, rsd_sq, cp, c, re_rvr, im_rvr, re_a, im_a, re_b, im_b)
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
void write(XMLWriter &xml, const std::string &path, const UnprecOvExtFermActArrayParams &p)
multi1d< LatticeFermion > chi(Ncb)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Hold group xml and type id.
Holds return info from SystemSolver call.
UnprecOvExtFermActArrayParams()
std::string tuning_strategy_xml
CoeffType approximation_type
Unpreconditioned extended-Overlap (5D) (Naryanan&Neuberger) action.
Unpreconditioned extended-Overlap (5D) (Naryanan&Neuberger) linear operator.
Unpreconditioned Wilson fermion linear operator.
void zolotarev_free(ZOLOTAREV_DATA *f)
ZOLOTAREV_DATA * higham(PRECISION epsilon, int n)
ZOLOTAREV_DATA * zolotarev(PRECISION epsilon, int n, int type)