39 typedef LatticeFermion
T;
40 typedef multi1d<LatticeColorMatrix>
P;
41 typedef multi1d<LatticeColorMatrix>
Q;
57 const Subset&
subset()
const {
return all;}
70 Real
mass =
S_f->getQuarkMass();
111 QDPIO::cout <<
"OvQprop || chi - D psi ||/||chi|| = "
112 << sqrt(norm2(Mpsi))/sqrt(norm2(
chi))
113 <<
" n_count = " << res.
n_count <<
" iters" << std::endl;
116 else if (invType ==
"REL_CG_INVERTER")
145 QDPIO::cout <<
"OvQprop || chi - D psi ||/||chi|| = "
146 << sqrt(norm2(Mpsi))/sqrt(norm2(
chi))
147 <<
" n_count = " << res.
n_count <<
" iters" << std::endl;
151 else if (invType ==
"MR_INVERTER")
156 else if (invType ==
"BICG_INVERTER")
162 else if (invType ==
"SUMR_INVERTER")
172 Real
mu =
S_f->getQuarkMass();
173 Complex zeta = cmplx(( Real(1) +
mu ) / (Real(1) -
mu),0);
181 Real fact = Real(2)/(Real(1) -
mu);
191 QDPIO::cout <<
"OvQprop || chi - D psi || = "
192 << sqrt(norm2(Dpsi))/sqrt(norm2(
chi))
193 <<
" n_count = " << res.
n_count <<
" iters" << std::endl;
195 else if (invType ==
"REL_SUMR_INVERTER")
205 Real
mu =
S_f->getQuarkMass();
206 Complex zeta = cmplx(( Real(1) +
mu ) / (Real(1) -
mu),0);
210 Real fact = Real(2)/(Real(1) -
mu);
227 QDPIO::cout <<
"OvQprop || chi - D psi || = "
228 << sqrt(norm2(Dpsi)) / sqrt(norm2(
chi))
229 <<
" n_count = " << res.
n_count <<
" iters" << std::endl;
231 else if (invType ==
"REL_GMRESR_SUMR_INVERTER")
241 Real
mu =
S_f->getQuarkMass();
242 Complex zeta = cmplx(( Real(1) +
mu ) / (Real(1) -
mu),0);
249 Real fact = Real(2)/(Real(1) -
mu);
252 InvRelGMRESR_SUMR(*PrecU, zeta, rho, *UnprecU,
chi,
psi,
invParam.
RsdCG,
invParam.RsdCGPrec,
invParam.
MaxCG,
invParam.MaxCGPrec, res.
n_count);
267 QDPIO::cout <<
"OvQprop || chi - D psi || = "
268 << sqrt(norm2(Dpsi))/sqrt(norm2(
chi))
269 <<
" n_count = " << res.
n_count <<
" iters" << std::endl;
271 else if (invType ==
"REL_GMRESR_GG_INVERTER")
306 QDPIO::cout <<
"OvQprop || chi - D psi ||/||chi|| = "
307 << sqrt(norm2(Mpsi)) / sqrt(norm2(
chi))
308 <<
" n_count = " << res.
n_count <<
" iters" << std::endl;
312 QDPIO::cerr <<
"Zolotarev4DFermActBj::qprop Solver Type not implemented" << std::endl;
328 res.
resid = sqrt(norm2(
r));
332 Real ftmp = Real(1) / ( Real(1) -
mass );
358 std::istringstream is(invParam.
xml);
359 XMLReader paramtop(is);
388 const multi1d<Real>& masses,
397 QDP_error_exit(
"Multi Mass Qprop only works if action has mass = 0 (strictly)");
400 std::istringstream is(invParam_.
xml);
401 XMLReader paramtop(is);
407 multi1d<enum PlusMinus> isign_set(2);
413 isign_set[0] =
MINUS;
423 isign_set[0] =
MINUS;
437 const int n_mass = masses.size();
440 for(
int n=0;
n < n_mass;
n++) {
458 multi1d<Real> shifted_masses(n_mass);
460 for(
int i = 0;
i < n_mass;
i++) {
461 shifted_masses[
i] = ( Real(1) + masses[
i] )/( Real(1) - masses[
i] );
462 shifted_masses[
i] += ( Real(1) / shifted_masses[
i] );
463 shifted_masses[
i] -= Real(2);
526 for(
int i = 0;
i < n_mass;
i++) {
527 psi[
i] *= Real(4) / ( Real(1) - masses[
i]*masses[
i] );
533 for(
int i = 0 ;
i < n_mass;
i++) {
540 for(
int iset=0; iset < nsets; iset++) {
541 for(
int i=0;
i < n_mass;
i++) {
542 int j =
i+iset*n_mass;
563 (*M_scaled)(tmp1,
psi[
j], isign_set[iset]);
565 ftmp = (Real(1) + masses[
i])/(Real(1) - masses[
i]) - Real(1);
569 tmp1 *= Real(2)/(Real(1) + masses[
i]);
576 ftmp = Real(1) / ( Real(1) - masses[
i] );
583 QDP_error_exit(
"This value of n_soln is not known about %d\n", n_soln);
590 case REL_CG_INVERTER:
601 multi1d<Real> shifted_masses(n_mass);
603 for(
int i = 0;
i < n_mass;
i++) {
604 shifted_masses[
i] = ( Real(1) + masses[
i] )/( Real(1) - masses[
i] );
605 shifted_masses[
i] += ( Real(1) / shifted_masses[
i] );
606 shifted_masses[
i] -= Real(2);
672 for(
int i = 0;
i < n_mass;
i++) {
673 psi[
i] *= Real(4) / ( Real(1) - masses[
i]*masses[
i] );
679 for(
int i = 0 ;
i < n_mass;
i++) {
686 for(
int iset=0; iset < nsets; iset++) {
687 for(
int i=0;
i < n_mass;
i++) {
688 int j =
i+iset*n_mass;
709 (*M_scaled)(tmp1,
psi[
j], isign_set[iset]);
711 ftmp = (Real(1) + masses[
i])/(Real(1) - masses[
i]) - Real(1);
715 tmp1 *= Real(2)/(Real(1) + masses[
i]);
722 ftmp = Real(1) / ( Real(1) - masses[
i] );
729 QDP_error_exit(
"This value of n_soln is not known about %d\n", n_soln);
745 multi1d<Complex> shifted_masses(n_mass);
748 for(
int i=0;
i < n_mass; ++
i) {
749 shifted_masses[
i] = (Real(1) + masses[
i]) / ( Real(1) - masses[
i] );
753 multi1d<Real> rho(n_mass);
756 multi1d<Real> scaledRsdCG(n_mass);
757 for(
int i=0;
i < n_mass;
i++) {
758 scaledRsdCG[
i] =
RsdCG[
i]*(Real(1) - masses[
i])/Real(2);
765 for(
int s=0;
s < n_mass;
s++) {
771 r += shifted_masses[
s]*
psi[
s];
776 QDPIO::cout <<
"Check: shift="<<
s<<
" || r ||/||b|| = " <<
r_norm <<
" RsdCG = " <<
RsdCG[
s] << std::endl;
782 for(
int i=0;
i < n_mass; ++
i) {
785 ftmp = Real(2) / ( Real(1) - masses[
i] );
792 ftmp = Real(1) / ( Real(1) - masses[
i] );
798 case REL_SUMR_INVERTER:
808 multi1d<Complex> shifted_masses(n_mass);
811 for(
int i=0;
i < n_mass; ++
i) {
812 shifted_masses[
i] = (Real(1) + masses[
i]) / ( Real(1) - masses[
i] );
816 multi1d<Real> rho(n_mass);
826 multi1d<Real> scaledRsdCG(n_mass);
827 for(
int i=0;
i < n_mass;
i++) {
828 scaledRsdCG[
i] =
RsdCG[
i]*(1-masses[
i])/Real(2);
835 for(
int s=0;
s < n_mass;
s++) {
841 r += shifted_masses[
s]*
psi[
s];
845 QDPIO::cout <<
"Check: shift="<<
s<<
" || r ||/||b|| = " <<
r_norm <<
" RsdCG = " <<
RsdCG[
s] << std::endl;
852 for(
int i=0;
i < n_mass; ++
i) {
855 ftmp = Real(2) / ( Real(1) - masses[
i] );
862 ftmp = Real(1) / ( Real(1) - masses[
i] );
878 multi1d<Real> shifted_masses(n_mass);
879 for(
int i=0;
i < n_mass; ++
i) {
880 shifted_masses[
i] = (Real(1) + masses[
i]) / ( Real(1) - masses[
i] ) - 1;
890 for(
i=0;
i < n_mass; ++
i) {
893 ftmp = Real(2) / ( Real(1) - masses[
i] );
900 ftmp = Real(1) / ( Real(1) - masses[
i] );
Primary include file for CHROMA library code.
Support class for fermion actions and linear operators.
Class for counted reference semantics.
virtual LinearOperator< T > * lgamma5epsH(Handle< FermState< T, P, Q > > state) const =0
Produce a linear operator that gives back gamma_5 eps(H)
void multiQprop(multi1d< T > &psi, const multi1d< Real > &masses, Handle< FermState< T, P, Q > > state, const T &chi, const GroupXML_t &invParam, const int n_soln, int &ncg_had) const
Define a multi mass qprop.
virtual UnprecLinearOperator< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Override to produce a DWF-link unprec. linear operator for this action.
virtual DiffLinearOperator< T, P, Q > * lMdagM(Handle< FermState< T, P, Q > > state) const =0
virtual OverlapFermActBase * clone() const =0
Virtual copy constructor.
virtual Real getQuarkMass() const =0
Return the quark mass.
virtual bool isChiral() const =0
Does this object really satisfy the Ginsparg-Wilson relation?
SystemSolver< T > * qprop(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Redefine quark propagator routine for 4D fermions.
~Ovlap4DQprop()
Destructor is automatic.
multi1d< LatticeColorMatrix > P
SystemSolverResults_t operator()(LatticeFermion &psi, const LatticeFermion &chi) const
Solver the linear system.
Handle< FermState< T, P, Q > > state
const SysSolverCGParams invParam
const Subset & subset() const
Return the subset on which the operator acts.
Handle< OverlapFermActBase > S_f
Ovlap4DQprop(Handle< OverlapFermActBase > S_f_, Handle< FermState< T, P, Q > > state_, const SysSolverCGParams &invParam_)
Constructor.
multi1d< LatticeColorMatrix > Q
void MInvCG(const LinearOperator< LatticeFermion > &M, const LatticeFermion &chi, multi1d< LatticeFermion > &psi, const multi1d< Real > &shifts, const multi1d< Real > &RsdCG, int MaxCG, int &n_count)
SystemSolverResults_t InvCG1(const LinearOperator< LatticeFermion > &A, const LatticeFermion &chi, LatticeFermion &psi, const Real &RsdCG, int MaxCG, int MinCG)
Conjugate-Gradient (CGNE) algorithm for a generic Linear Operator.
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.
void InvRelCG2(const LinearOperator< LatticeFermion > &M, const LatticeFermion &chi, LatticeFermion &psi, const Real &RsdCG, int MaxCG, int &n_count)
Relaxed Conjugate-Gradient (CGNE) algorithm for a generic Linear Operator.
void InvRelCG1(const LinearOperator< LatticeFermion > &A, const LatticeFermion &chi, LatticeFermion &psi, const Real &RsdCG, int MaxCG, int &n_count)
Conjugate-Gradient (CGNE) algorithm for a generic Linear Operator.
SystemSolverResults_t InvMR(const LinearOperator< LatticeFermion > &M, const LatticeFermion &chi, LatticeFermion &psi, const Real &MRovpar, const Real &RsdMR, int MaxMR, enum PlusMinus isign)
Minimal-residual (MR) algorithm for a generic Linear Operator.
void MInvMR(const LinearOperator< LatticeFermion > &M, const LatticeFermion &chi, multi1d< LatticeFermion > &psi, const multi1d< Real > &shifts, const multi1d< Real > &RsdMR, int MaxMR, int &n_count)
Multishift Conjugate-Gradient (CG1) algorithm for a Linear Operator.
Conjugate-Gradient algorithm for a generic Linear Operator.
Conjugate-Gradient algorithm for a generic Linear Operator.
Relaxed GMRESR algorithm of the Wuppertal Group.
Relaxed GMRESR algorithm of the Wuppertal Group.
Conjugate-Gradient algorithm for a generic Linear Operator.
Conjugate-Gradient algorithm for a generic Linear Operator.
Conjugate-Gradient algorithm for a generic Linear Operator.
Conjugate-Gradient algorithm for a generic Linear Operator.
Conjugate-Gradient algorithm for a generic Linear Operator.
Multishift Conjugate-Gradient algorithm for a Linear Operator.
Conjugate-Gradient algorithm for a generic Linear Operator.
Asqtad Staggered-Dirac operator.
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > & RsdCG
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)
void MInvSUMR(const LinearOperator< LatticeFermion > &U, const LatticeFermion &b, multi1d< LatticeFermion > &x, const multi1d< Complex > &zeta, const multi1d< Real > &rho, const multi1d< Real > &epsilon, int MaxSUMR, int &n_count)
void InvRelGMRESR_SUMR(const LinearOperator< LatticeFermion > &PrecU, const Complex &zeta, const Real &rho, const LinearOperator< LatticeFermion > &UnprecU, const LatticeFermion &b, LatticeFermion &x, const Real &epsilon, const Real &epsilon_prec, int MaxGMRESR, int MaxGMRESRPrec, int &n_count)
void InvRelSUMR(const LinearOperator< LatticeFermion > &U, const LatticeFermion &b, LatticeFermion &x, const Complex &zeta, const Real &rho, const Real &epsilon, int MaxSUMR, int &n_count)
Chirality isChiralVector(const LatticeFermion &chi)
multi1d< LatticeFermion > chi(Ncb)
void InvRelGMRESR_CG(const LinearOperator< LatticeFermion > &PrecMM, const LinearOperator< LatticeFermion > &UnprecMM, const LatticeFermion &b, LatticeFermion &x, const Real &epsilon, const Real &epsilon_prec, int MaxGMRESR, int MaxGMRESRPrec, int &n_count)
void MInvRelSUMR(const LinearOperator< LatticeFermion > &U, const LatticeFermion &b, multi1d< LatticeFermion > &x, const multi1d< Complex > &zeta, const multi1d< Real > &rho, const multi1d< Real > &epsilon, int MaxSUMR, int &n_count)
void MInvRelCG(const LinearOperator< LatticeFermion > &M, const LatticeFermion &chi, multi1d< LatticeFermion > &psi, const multi1d< Real > &shifts, const multi1d< Real > &RsdCG, int MaxCG, int &n_count)
void InvSUMR(const LinearOperator< LatticeFermion > &U, const LatticeFermion &b, LatticeFermion &x, const Complex &zeta, const Real &rho, const Real &epsilon, int MaxSUMR, int &n_count)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
Base class for unpreconditioned overlap-like fermion actions.
Hold group xml and type id.
Holds return info from SystemSolver call.
multi1d< LatticeColorMatrix > U