28 namespace UnprecHTContFrac5DFermActArrayEnv
32 multi1d<LatticeColorMatrix>,
43 multi1d<LatticeColorMatrix>,
74 XMLReader
in(xml, path);
82 if(
in.count(
"ApproximationType") == 1 )
102 int count_b5 =
in.count(
"b5");
103 int count_c5 =
in.count(
"c5");
105 if( count_b5 == 0 && count_c5 == 0 )
107 QDPIO::cout <<
"b5 and c5 not specified. Using Shamir values: b5=1 c5=0" << std::endl;
118 QDPIO::cerr <<
"Caught Exception reading Unprec HT ContFrac Fermact params: " << e << std::endl;
135 push( xml_out, path);
138 write(xml_out,
"OverMass",
p.OverMass);
139 write(xml_out,
"Mass",
p.Mass);
140 write(xml_out,
"RatPolyDeg",
p.RatPolyDeg);
141 write(xml_out,
"ApproximationType",
p.approximation_type);
142 write(xml_out,
"b5",
p.b5);
143 write(xml_out,
"c5",
p.c5);
144 write(xml_out,
"ApproxMin",
p.ApproxMin);
145 write(xml_out,
"ApproxMax",
p.ApproxMax);
161 cfs(cfs_a_),
params(params_)
169 if( isEvenRatPolyDeg )
184 multi1d<Real>&
beta)
const
188 zolotarev_data *rdata;
196 QDPIO::cout <<
"Initing Linop with Zolotarev Coefficients: epsilon = " <<
epsilon << std::endl;
203 QDPIO::cout <<
"Initing Linop with Higham Rep tanh Coefficients" << std::endl;
216 Real maxerr = (Real)(rdata->Delta);
219 if(
N5 != rdata->db ) {
220 QDPIO::cerr <<
"Mismatch between N5 and N5 from Coefficient Code" << std::endl;
221 QDPIO::cerr <<
"N5 = " <<
N5 <<
" rdata->db=" << rdata->db << std::endl;
227 for(
int i = 0;
i <
N5;
i++) {
232 for(
int i=0;
i <
N5-1;
i++) {
244 multi1d<Real> gamma(
N5-1);
245 for(
int i=0;
i <
N5-1;
i++) {
246 gamma[
i] = Real(1)/ sqrt(
beta[
i] );
253 for(
int i=0;
i <
N5-1;
i++) {
260 for(
int i=0;
i <
N5-2;
i++) {
267 for(
int i=0;
i <
beta.size();
i++) {
268 beta[
i] *= scale_fac;
271 QDPIO::cout <<
"UnprecHTContfrac5d:" << std::endl
273 <<
" N5=" <<
N5 <<
" scale=" << scale_fac
275 QDPIO::cout <<
"Approximation on [-1,eps] U [eps,1] with eps = " <<
epsilon <<std::endl;
277 QDPIO::cout <<
"Maximum error | R(x) - sgn(x) | <= Delta = " << maxerr << std::endl;
289 QDPIO::cout <<
"Coefficients from Zolotarev" << std::endl;
292 QDPIO::cout <<
"Approximation type " << type <<
" with R(0) = 0"
296 QDPIO::cout <<
"Approximation type " << type <<
" with R(0) = infinity"
302 QDPIO::cout <<
"Coefficients from Higham Tanh representation" << std::endl;
305 QDPIO::cout <<
"Coefficients from Unscaled Higham Tanh representation" << std::endl;
327 multi1d<LatticeColorMatrix>,
328 multi1d<LatticeColorMatrix> >*
374 const Subset&
subset()
const {
return all;}
387 const int N5 =
A->size();
392 multi1d<LatticeFermion> chi5(
N5);
393 multi1d<LatticeFermion> psi5(
N5);
405 multi1d<LatticeFermion> tmp5(
N5);
408 for(
int i=0;
i <
N5;
i++) {
422 (*A)(tmp5, chi5,
MINUS);
443 res.
resid = sqrt(norm2(
r));
451 psi5[
N5-1] *= Real(2)/(Real(1)-
Mass);
487 std::istringstream is(invParam.
xml);
488 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 unpreconditioned H_T kernel continued fraction (5D) operator.
SystemSolverResults_t operator()(T &psi, const T &chi) const
Solver the linear system.
OvHTCFZ5DQprop(Handle< LinearOperatorArray< T > > 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.
SysSolverCGParams invParam
Handle< LinearOperatorArray< T > > A
Handle< LinearOperator< T > > D_denum
~OvHTCFZ5DQprop()
Destructor is automatic.
Operator to apply the denominator.
5D continued fraction overlap action using H_T kernel
SystemSolver< LatticeFermion > * qprop(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Compute quark propagator over base type.
void init(multi1d< Real > &alpha, multi1d< Real > &beta) const
Helper in construction.
UnprecHTContFrac5DFermActParams params
Real getQuarkMass() const
Return the quark mass.
UnprecHTContFrac5DFermActArray()
UnprecLinearOperatorArray< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
Unpreconditioned H_T kernel continued fraction (5D) operator.
Unpreconditioned linear operator including derivatives.
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.
int epsilon(int i, int j, int k)
static const LatticeInteger & beta(const int dim)
static const LatticeInteger & alpha(const int dim)
bool registerAll()
Register all the factories.
FermionAction< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct(XMLReader &xml_in, const std::string &path)
Callback function.
static bool registered
Local registration flag.
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
multi1d< LatticeFermion > chi(Ncb)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
static QDP_ColorVector * in
Hold group xml and type id.
Holds return info from SystemSolver call.
Params for 5D overlap ferm acts.
Real OverMass
Wilson-operator mass.
Real ApproxMin
Approximate min eigenvalue of H_T.
int RatPolyDeg
Degree of the Rational Poly.
CoeffType approximation_type
ZOLOTAREV | TANH | Other approximation coeffs.
UnprecHTContFrac5DFermActParams()
Default empty construction.
Real ApproxMax
Approximate max eigenvalue of H_T.
Unpreconditioned Wilson fermion linear operator.
Unpreconditioned H_T kernel continued fraction (5D) action.
Unpreconditioned H_T kernel continued fraction (5D) operator.
Unpreconditioned Wilson fermion action.
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)