25 namespace EvenOddPrecOvExtFermActArrayEnv
29 multi1d<LatticeColorMatrix>,
40 multi1d<LatticeColorMatrix>,
74 XMLReader paramtop(xml, path);
91 XMLReader tuning_strategy_reader(paramtop,
"TuningStrategy");
92 std::ostringstream os;
93 tuning_strategy_reader.print(os);
97 QDPIO::cout <<
"Caught Exception while reading XML: " << e << std::endl;
113 write(xml,
"OverMass",
p.OverMass);
116 write(xml,
"Mass",
p.Mass);
117 write(xml,
"RatPolyDeg",
p.RatPolyDeg);
118 write(xml,
"ApproximationType",
p.approximation_type);
120 write(xml,
"ApproxMin",
p.ApproxMin);
121 write(xml,
"ApproxMax",
p.ApproxMax);
125 QDP::write(xml,
"TuningStrategy",
p.tuning_strategy_xml);
134 cfs(cfs_), param(param_)
138 XMLReader tuning_xml(ts_is);
141 read(tuning_xml,
"/TuningStrategy/Name", strategy_name);
144 QDPIO::cerr <<
"Caught exception processing TuningStrategy: " << e << std::endl;
172 multi1d<Real>& rootQ)
const
180 zolotarev_data *rdata ;
209 QDPIO::cout <<
"Initing Linop with Zolotarev Coefficients" << std::endl;
232 QDPIO::cerr <<
"Failed to get Zolo Coeffs" << std::endl;
240 scale_fac = Real(1) ;
243 QDPIO::cout <<
"Initing Linop with Unscaled Higham Rep tanh Coefficients" << std::endl;
269 maxerr = (Real)(rdata -> Delta);
270 QDPIO::cout <<
"Maxerr " << maxerr << std::flush << std::endl;
274 Npoles = rdata -> dd;
277 QDPIO::cout <<
"Oops. 2Npoles+1 = " << (2*Npoles+1)
279 <<
" this is inconsitent" << std::endl;
285 rootQ.resize(Npoles);
293 coeffP = rdata ->
alpha[rdata -> da - 1] * scale_fac;
296 Real
t = Real(1) / (scale_fac * scale_fac);
297 for(
int n=0;
n < Npoles; ++
n) {
299 resP[Npoles-1-
n] = rdata ->
alpha[
n] / scale_fac;
300 rootQ[Npoles-1-
n] = rdata -> ap[
n];
301 rootQ[Npoles-1-
n] = -(rootQ[Npoles-1-
n] *
t);
305 <<
" scale=" << scale_fac
309 QDPIO::cout <<
"Approximation on [-1,-eps] U [eps,1] with eps = " <<
eps <<
311 QDPIO::cout <<
"Maximum error |R(x) - sqn(x)| <= " << maxerr << std::endl;
315 QDPIO::cout <<
"Coefficients from Zolotarev" << std::endl;
318 QDPIO::cout <<
"Approximation type " << type <<
" with R(0) = 0"
322 QDPIO::cout <<
"Approximation type " << type <<
" with R(0) = infinity" << std::endl;
328 QDPIO::cout <<
"Coefficients from Unscaled Higham Tanh representation" << std::endl;
337 QDPIO::cout <<
"Number of poles= " << Npoles << std::endl;
338 QDPIO::cout <<
"Overall Factor= " << coeffP << std::endl;
339 QDPIO::cout <<
"Numerator coefficients:" << std::endl;
340 for(
int n=0;
n < Npoles;
n++) {
341 QDPIO::cout <<
" resP[" <<
n <<
"]= " << resP[
n] << std::endl;
343 QDPIO::cout <<
"Denominator roots: " << std::endl;
344 for(
int n=0;
n < Npoles;
n++) {
345 QDPIO::cout <<
" rootQ[" <<
n<<
"]= " << rootQ[
n] << std::endl;
360 multi1d<LatticeColorMatrix>,
361 multi1d<LatticeColorMatrix> >*
371 init(Npoles, coeffP, resP, rootQ);
373 multi1d<Real>
beta(Npoles);
395 template<
typename T,
typename P,
typename Q>
414 const Subset&
subset()
const {
return all;}
427 const int N5 =
A->size();
437 multi1d<T> tmp5_1(
N5);
439 multi1d<T> tmp5_2(
N5);
440 multi1d<T> tmp5_3(
N5);
449 A->evenEvenInvLinOp(tmp5_2, psi5,
PLUS);
450 A->oddEvenLinOp(tmp5_3, tmp5_2,
PLUS);
455 for(
int i=0;
i <
N5;
i++) {
456 chi5[
i][rb[0]] = psi5[
i];
457 chi5[
i][rb[1]] = psi5[
i] - tmp5_3[
i];
463 (*A)(tmp5_1, chi5,
MINUS);
466 psi5[
N5-1][rb[1]] =
psi;
479 multi1d<T> tmp5_2(
N5);
480 multi1d<T> tmp5_3(
N5);
483 A->evenOddLinOp(tmp5_2, psi5,
PLUS);
484 for(
int i=0;
i <
N5;
i++) {
488 tmp5_3[
i][rb[0]] = chi5[
i] - tmp5_2[
i];
493 A->evenEvenInvLinOp(tmp5_1, tmp5_3,
PLUS);
496 for(
int i=0;
i <
N5;
i++) {
497 psi5[
i][rb[0]] = tmp5_1[
i];
519 (*D_denum)(tmp4, psi5[
N5-1],
PLUS);
526 psi5[
N5-1] *= Real(2)/(Real(1)-
Mass);
562 std::istringstream is(invParam.
xml);
563 XMLReader paramtop(is);
Primary include file for CHROMA library code.
Create a fermion connection state.
Even-odd preconditioned linear operator including derivatives for arrays.
EvenOddPreconditioned Extended-Overlap (N&N) linear operator.
void init(int &Npoles, Real &coeffP, multi1d< Real > &resP, multi1d< Real > &rootQ) const
Get the rational approximation coefficients.
SystemSolver< LatticeFermion > * qprop(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Compute quark propagator over base type.
EvenOddPrecOvExtFermActArray()
Default constructor.
EvenOddPrecOvExtFermActArrayParams param
int getN5FromRatPolyDeg(const int &RatPolyDeg) const
Part of initializer.
Handle< AbsOvExtTuningStrategy > theTuningStrategy
EvenOddPrecConstDetLinearOperatorArray< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
EvenOddPreconditioned Extended-Overlap (N&N) linear operator.
Support class for fermion actions and linear operators.
Base class for quadratic matter actions (e.g., fermions)
Class for counted reference semantics.
Propagator of an un-preconditioned Extended-Overlap linear operator.
SystemSolverResults_t operator()(T &psi, const T &chi) const
Solver the linear system.
Handle< LinearOperator< T > > D_denum
Handle< EvenOddPrecConstDetLinearOperatorArray< T, P, Q > > A
PrecOvExt5DQprop(Handle< EvenOddPrecConstDetLinearOperatorArray< T, P, Q > > A_, Handle< LinearOperator< T > > D_denum_, const Real &Mass_, const SysSolverCGParams &invParam_)
Constructor.
const Subset & subset() const
Return the subset on which the operator acts.
~PrecOvExt5DQprop()
Destructor is automatic.
SysSolverCGParams invParam
Operator to apply the denominator.
Unpreconditioned Wilson-Dirac operator.
Wilson-like fermion actions.
Unpreconditioned extended-Overlap (5D) (Naryanan&Neuberger) action.
Unpreconditioned extended-Overlap (5D) (Naryanan&Neuberger) linear operator.
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.
const std::string name
Name to be used.
FermionAction< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct(XMLReader &xml_in, const std::string &path)
Callback function.
bool registerAll()
Register all the factories.
static bool registered
Local registration flag.
WilsonTypeFermAct5D< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct5D(XMLReader &xml_in, const std::string &path)
Callback function.
static const LatticeInteger & beta(const int dim)
static const LatticeInteger & alpha(const int dim)
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
multi1d< LatticeFermion > chi(Ncb)
void write(XMLWriter &xml, const std::string &path, const EvenOddPrecOvExtFermActArrayParams &p)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
CoeffType approximation_type
EvenOddPrecOvExtFermActArrayParams()
std::string tuning_strategy_xml
Hold group xml and type id.
Holds return info from SystemSolver call.
Unpreconditioned Wilson fermion 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)