27 namespace EvenOddPrecOvlapContFrac5DFermActArrayEnv
31 multi1d<LatticeColorMatrix>,
42 multi1d<LatticeColorMatrix>,
74 XMLReader
in(xml, path);
82 if(
in.count(
"ApproximationType") == 1 )
103 QDPIO::cerr <<
"Caught Exception reading prec ContFrac Fermact params: " << e << std::endl;
118 push( xml_out, path);
121 write(xml_out,
"Mass",
p.Mass);
122 write(xml_out,
"OverMass",
p.OverMass);
123 write(xml_out,
"RatPolyDeg",
p.RatPolyDeg);
124 write(xml_out,
"ApproximationType",
p.approximation_type);
125 write(xml_out,
"ApproxMin",
p.ApproxMin);
126 write(xml_out,
"ApproxMax",
p.ApproxMax);
141 cfs(cfs_a_),
params(params_)
150 if( isEvenRatPolyDeg ) {
163 multi1d<Real>&
alpha,
164 multi1d<Real>&
beta)
const
167 zolotarev_data *rdata;
176 epsilon = approxMin / approxMax;
177 QDPIO::cout <<
"Initing Linop with Zolotarev Coefficients: epsilon = " <<
epsilon << std::endl;
179 scale_fac = Real(1) / approxMax;
184 QDPIO::cout <<
"Initing Linop with Higham Rep tanh Coefficients" << std::endl;
197 Real maxerr = (Real)(rdata->Delta);
200 if(
N5 != rdata->db ) {
201 QDPIO::cerr <<
"Mismatch between N5 and N5 from Coefficient Code" << std::endl;
202 QDPIO::cerr <<
"N5 = " <<
N5 <<
" rdata->db=" << rdata->db << std::endl;
209 for(
int i = 0;
i <
N5;
i++) {
214 for(
int i=0;
i <
N5-1;
i++) {
226 multi1d<Real> gamma(
N5-1);
227 for(
int i=0;
i <
N5-1;
i++) {
228 gamma[
i] = Real(1)/ sqrt(
beta[
i] );
235 for(
int i=0;
i <
N5-1;
i++) {
242 for(
int i=0;
i <
N5-2;
i++) {
247 QDPIO::cout <<
"EvenOddPrecOvlapContfrac5d: " << std::endl
249 <<
" N5=" <<
N5 <<
" scale=" << scale_fac
254 QDPIO::cout <<
"Approximation on [-1,eps] U [eps,1] with eps = " <<
epsilon <<std::endl;
256 QDPIO::cout <<
"Maximum error | R(x) - sgn(x) | <= Delta = " << maxerr << std::endl;
268 QDPIO::cout <<
"Coefficients from Zolotarev" << std::endl;
271 QDPIO::cout <<
"Approximation type " << type <<
" with R(0) = 0"
275 QDPIO::cout <<
"Approximation type " << type <<
" with R(0) = infinity" << std::endl;
280 QDPIO::cout <<
"Coefficients from Higham Tanh representation" << std::endl;
283 QDPIO::cout <<
"Coefficients from Unscaled Higham Tanh representation" << std::endl;
301 multi1d<LatticeColorMatrix>,
302 multi1d<LatticeColorMatrix> >*
329 multi1d<LatticeColorMatrix>,
330 multi1d<LatticeColorMatrix> >*
357 template<
typename T,
typename P,
typename Q>
375 const Subset&
subset()
const {
return all;}
388 const int N5 =
A->size();
398 multi1d<T> tmp5_1(
N5);
400 multi1d<T> tmp5_2(
N5);
401 multi1d<T> tmp5_3(
N5);
413 A->evenEvenInvLinOp(tmp5_2, tmp5_1,
PLUS);
414 A->oddEvenLinOp(tmp5_3, tmp5_2,
PLUS);
419 for(
int i=0;
i <
N5;
i++) {
420 chi5[
i][rb[0]] = tmp5_1[
i];
421 chi5[
i][rb[1]] = tmp5_1[
i] - tmp5_3[
i];
425 psi5[
N5-1][rb[1]] =
psi;
426 (*A)(tmp5_1, chi5,
MINUS);
440 multi1d<T> tmp5_2(
N5);
441 multi1d<T> tmp5_3(
N5);
444 A->evenOddLinOp(tmp5_2, psi5,
PLUS);
445 for(
int i=0;
i <
N5;
i++) {
449 tmp5_3[
i][rb[0]] = chi5[
i] - tmp5_2[
i];
454 A->evenEvenInvLinOp(tmp5_1, tmp5_3,
PLUS);
457 for(
int i=0;
i <
N5;
i++) {
458 psi5[
i][rb[0]] = tmp5_1[
i];
475 A->unprecLinOp(
r, psi5,
PLUS);
479 res.
resid = sqrt(norm2(
r));
487 psi5[
N5-1] *= Real(2)/(Real(1)-
Mass);
516 std::istringstream is(invParam.
xml);
517 XMLReader paramtop(is);
Primary include file for CHROMA library code.
Propagator of an un-preconditioned Extended-Overlap linear operator.
ContFrac5DQprop(Handle< EvenOddPrecConstDetLinearOperatorArray< T, P, Q > > A_, const Real &Mass_, const SysSolverCGParams &invParam_)
Constructor.
Handle< EvenOddPrecConstDetLinearOperatorArray< T, P, Q > > A
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.
~ContFrac5DQprop()
Destructor is automatic.
SysSolverCGParams invParam
Create a fermion connection state.
Even-odd preconditioned linear operator including derivatives for arrays.
5D continued fraction overlap action (Borici,Wenger, Edwards)
EvenOddPrecOvlapContFrac5DFermActParams params
Real getQuarkMass() const
Return the quark mass.
void init(Real &scale_fac, multi1d< Real > &alpha, multi1d< Real > &beta) const
Helper in construction.
EvenOddPrecConstDetLinearOperatorArray< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
SystemSolver< LatticeFermion > * qprop(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Compute quark propagator over base type.
EvenOddPrecConstDetLinearOperatorArray< T, P, Q > * linOpPV(Handle< FermState< T, P, Q > > state) const
Produce a Pauli-Villars linear operator for this action.
EvenOddPrecOvlapContFrac5DFermActArray()
Even-odd preconditioned Pauli-Villars Continued Fraction 5D.
Support class for fermion actions and linear operators.
Base class for quadratic matter actions (e.g., fermions)
Class for counted reference semantics.
Wilson-like fermion actions.
Even-odd preconditioned Continued Fraction 5D.
Even-odd preconditioned Pauli-Villars Continued Fraction 5D.
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 bool registered
Local registration flag.
const std::string name
Name to be used.
bool registerAll()
Register all the factories.
WilsonTypeFermAct5D< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct5D(XMLReader &xml_in, const std::string &path)
Callback function.
FermionAction< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct(XMLReader &xml_in, const std::string &path)
Callback function.
int epsilon(int i, int j, int k)
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
QDPEvenOddPrecOvlapContFrac5DLinOpArray EvenOddPrecOvlapContFrac5DLinOpArray
multi1d< LatticeFermion > chi(Ncb)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
static QDP_ColorVector * in
Include possibly optimized partfrac5d.
Params for 5D overlap ferm acts.
Real ApproxMin
Approximate min eigenvalue of H_T.
int RatPolyDeg
Degree of the Rational Poly.
Real ApproxMax
Approximate max eigenvalue of H_T.
Real OverMass
Mass of auxiliary Wilson action.
EvenOddPrecOvlapContFrac5DFermActParams()
Default empty construction.
CoeffType approximation_type
ZOLOTAREV | TANH | Other approximation coeffs.
Hold group xml and type id.
Holds return info from SystemSolver call.
Unpreconditioned Wilson fermion action.
void zolotarev_free(ZOLOTAREV_DATA *f)
ZOLOTAREV_DATA * higham(PRECISION epsilon, int n)
ZOLOTAREV_DATA * zolotarev(PRECISION epsilon, int n, int type)