25 namespace EvenOddPrecHtContFrac5DFermActArrayEnv
29 multi1d<LatticeColorMatrix>,
40 multi1d<LatticeColorMatrix>,
73 XMLReader
in(xml, path);
81 if(
in.count(
"ApproximationType") == 1 )
101 int count_b5 =
in.count(
"b5");
102 int count_c5 =
in.count(
"c5");
104 if( count_b5 == 0 && count_c5 == 0 )
106 QDPIO::cout <<
"b5 and c5 not specified. Using Shamir values: b5=1 c5=0" << std::endl;
116 QDPIO::cerr <<
"Caught Exception reading HT ContFrac Fermact params: " << e << std::endl;
132 push( xml_out, path);
135 write(xml_out,
"Mass",
p.Mass);
136 write(xml_out,
"OverMass",
p.OverMass);
137 write(xml_out,
"RatPolyDeg",
p.RatPolyDeg);
138 write(xml_out,
"ApproximationType",
p.approximation_type);
139 write(xml_out,
"b5",
p.b5);
140 write(xml_out,
"c5",
p.c5);
141 write(xml_out,
"ApproxMin",
p.ApproxMin);
142 write(xml_out,
"ApproxMax",
p.ApproxMax);
158 fs(fs_a_),
params(params_)
167 if( isEvenRatPolyDeg ) {
180 multi1d<Real>&
alpha,
181 multi1d<Real>&
beta)
const
184 zolotarev_data *rdata;
193 epsilon = approxMin / approxMax;
194 QDPIO::cout <<
"Initing Linop with Zolotarev Coefficients: epsilon = " <<
epsilon << std::endl;
196 scale_fac = Real(1) / approxMax;
201 QDPIO::cout <<
"Initing Linop with Higham Rep tanh Coefficients" << std::endl;
214 Real maxerr = (Real)(rdata->Delta);
217 if(
N5 != rdata->db ) {
218 QDPIO::cerr <<
"Mismatch between N5 and N5 from Coefficient Code" << std::endl;
219 QDPIO::cerr <<
"N5 = " <<
N5 <<
" rdata->db=" << rdata->db << std::endl;
225 for(
int i = 0;
i <
N5;
i++) {
230 for(
int i=0;
i <
N5-1;
i++) {
242 multi1d<Real> gamma(
N5-1);
243 for(
int i=0;
i <
N5-1;
i++) {
244 gamma[
i] = Real(1)/ sqrt(
beta[
i] );
251 for(
int i=0;
i <
N5-1;
i++) {
258 for(
int i=0;
i <
N5-2;
i++) {
263 QDPIO::cout <<
"EvenOddPrecHtContfrac5d: " << std::endl
265 <<
" N5=" <<
N5 <<
" scale=" << scale_fac
270 QDPIO::cout <<
"Approximation on [-1,eps] U [eps,1] with eps = " <<
epsilon <<std::endl;
272 QDPIO::cout <<
"Maximum error | R(x) - sgn(x) | <= Delta = " << maxerr << std::endl;
284 QDPIO::cout <<
"Coefficients from Zolotarev" << std::endl;
287 QDPIO::cout <<
"Approximation type " << type <<
" with R(0) = 0"
291 QDPIO::cout <<
"Approximation type " << type <<
" with R(0) = infinity" << std::endl;
296 QDPIO::cout <<
"Coefficients from Higham Tanh representation" << std::endl;
299 QDPIO::cout <<
"Coefficients from Unscaled Higham Tanh representation" << std::endl;
317 multi1d<LatticeColorMatrix>,
318 multi1d<LatticeColorMatrix> >*
347 multi1d<LatticeColorMatrix>,
348 multi1d<LatticeColorMatrix> >*
359 return new EvenOddPrecHtContFrac5DPVLinOpArray(state_,
369 QDPIO::cerr <<
"Not yet implemented PV stuff for prec_ht_contfrac" << std::endl;
383 template<
typename T,
typename P,
typename Q>
402 const Subset&
subset()
const {
return all;}
415 const int N5 =
A->size();
425 multi1d<T> tmp5_1(
N5);
427 multi1d<T> tmp5_2(
N5);
428 multi1d<T> tmp5_3(
N5);
436 LatticeFermion tmp4 = Gamma(
G5)*
chi;
437 (*D_denum)(tmp5_1[
N5-1], tmp4,
MINUS);
440 A->evenEvenInvLinOp(tmp5_2, tmp5_1,
PLUS);
441 A->oddEvenLinOp(tmp5_3, tmp5_2,
PLUS);
446 for(
int i=0;
i <
N5;
i++) {
447 chi5[
i][rb[0]] = tmp5_1[
i];
448 chi5[
i][rb[1]] = tmp5_1[
i] - tmp5_3[
i];
452 psi5[
N5-1][rb[1]] =
psi;
453 (*A)(tmp5_1, chi5,
MINUS);
467 multi1d<T> tmp5_2(
N5);
468 multi1d<T> tmp5_3(
N5);
471 A->evenOddLinOp(tmp5_2, psi5,
PLUS);
472 for(
int i=0;
i <
N5;
i++) {
476 tmp5_3[
i][rb[0]] = chi5[
i] - tmp5_2[
i];
481 A->evenEvenInvLinOp(tmp5_1, tmp5_3,
PLUS);
484 for(
int i=0;
i <
N5;
i++) {
485 psi5[
i][rb[0]] = tmp5_1[
i];
503 A->unprecLinOp(
r, psi5,
PLUS);
505 res.
resid = sqrt(norm2(
r));
516 psi5[
N5-1] *= Real(2)/(Real(1)-
Mass);
551 std::istringstream is(invParam.
xml);
552 XMLReader paramtop(is);
Primary include file for CHROMA library code.
Create a fermion connection state.
Even-odd preconditioned linear operator including derivatives for arrays.
5D continued fraction overlap action (Borici,Wenger, Edwards)
SystemSolver< LatticeFermion > * qprop(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Compute quark propagator over base type.
EvenOddPrecConstDetLinearOperatorArray< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
void init(Real &scale_fac, multi1d< Real > &alpha, multi1d< Real > &beta) const
Helper in construction.
EvenOddPrecConstDetLinearOperatorArray< T, P, Q > * linOpPV(Handle< FermState< T, P, Q > > state) const
Produce a Pauli-Villars linear operator for this action.
Real getQuarkMass() const
Return the quark mass.
EvenOddPrecHtContFrac5DFermActArray()
EvenOddPrecHtContFrac5DFermActParams params
Even odd preconditioned Continued Fraction with H=H_t (Shamir Kernel)
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.
const Subset & subset() const
Return the subset on which the operator acts.
const SysSolverCGParams invParam
HtContFrac5DQprop(Handle< EvenOddPrecConstDetLinearOperatorArray< T, P, Q > > A_, Handle< LinearOperator< T > > D_denum_, const Real &Mass_, const SysSolverCGParams &invParam_)
Constructor.
~HtContFrac5DQprop()
Destructor is automatic.
Handle< LinearOperator< T > > D_denum
Handle< EvenOddPrecConstDetLinearOperatorArray< T, P, Q > > A
SystemSolverResults_t operator()(T &psi, const T &chi) const
Solver the linear system.
Operator to apply the denominator.
Unpreconditioned Wilson-Dirac operator.
Wilson-like fermion actions.
Even-odd preconditioned Continued Fraction 5D.
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.
WilsonTypeFermAct5D< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createFermAct5D(XMLReader &xml_in, const std::string &path)
Callback function.
static bool registered
Local registration flag.
bool registerAll()
Register all the factories.
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
multi1d< LatticeFermion > chi(Ncb)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
static QDP_ColorVector * in
Params for 5D overlap ferm acts.
int RatPolyDeg
Degree of the Rational Poly.
Real c5
c5 Moebius parameter
EvenOddPrecHtContFrac5DFermActParams()
Default empty construction.
CoeffType approximation_type
ZOLOTAREV | TANH | Other approximation coeffs.
Real b5
b5 Moebius parameter
Real ApproxMax
Approximate max eigenvalue of H_T.
Real ApproxMin
Approximate min eigenvalue of H_T.
Real OverMass
Mass of auxiliary Wilson action.
Hold group xml and type id.
Holds return info from SystemSolver call.
Unpreconditioned Wilson fermion linear 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)