mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-12 20:27:06 +01:00
Conjugate residual added
This commit is contained in:
@ -65,36 +65,9 @@
|
||||
#include <qcd/action/fermion/OverlapWilsonPartialFractionTanhFermion.h>
|
||||
#include <qcd/action/fermion/OverlapWilsonPartialFractionZolotarevFermion.h>
|
||||
|
||||
|
||||
// Chroma interface defining FermionAction
|
||||
/*
|
||||
template<typename T, typename P, typename Q> class FermAct4D : public FermionAction<T,P,Q>
|
||||
virtual LinearOperator<T>* linOp(Handle< FermState<T,P,Q> > state) const = 0;
|
||||
virtual LinearOperator<T>* lMdagM(Handle< FermState<T,P,Q> > state) const = 0;
|
||||
virtual LinOpSystemSolver<T>* invLinOp(Handle< FermState<T,P,Q> > state,
|
||||
virtual MdagMSystemSolver<T>* invMdagM(Handle< FermState<T,P,Q> > state,
|
||||
virtual LinOpMultiSystemSolver<T>* mInvLinOp(Handle< FermState<T,P,Q> > state,
|
||||
virtual MdagMMultiSystemSolver<T>* mInvMdagM(Handle< FermState<T,P,Q> > state,
|
||||
virtual MdagMMultiSystemSolverAccumulate<T>* mInvMdagMAcc(Handle< FermState<T,P,Q> > state,
|
||||
virtual SystemSolver<T>* qprop(Handle< FermState<T,P,Q> > state,
|
||||
class DiffFermAct4D : public FermAct4D<T,P,Q>
|
||||
virtual DiffLinearOperator<T,Q,P>* linOp(Handle< FermState<T,P,Q> > state) const = 0;
|
||||
virtual DiffLinearOperator<T,Q,P>* lMdagM(Handle< FermState<T,P,Q> > state) const = 0;
|
||||
*/
|
||||
|
||||
|
||||
// Chroma interface defining GaugeAction
|
||||
/*
|
||||
template<typename P, typename Q> class GaugeAction
|
||||
virtual const CreateGaugeState<P,Q>& getCreateState() const = 0;
|
||||
virtual GaugeState<P,Q>* createState(const Q& q) const
|
||||
virtual const GaugeBC<P,Q>& getGaugeBC() const
|
||||
virtual const Set& getSet(void) const = 0;
|
||||
virtual void deriv(P& result, const Handle< GaugeState<P,Q> >& state) const
|
||||
virtual Double S(const Handle< GaugeState<P,Q> >& state) const = 0;
|
||||
|
||||
class LinearGaugeAction : public GaugeAction< multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >
|
||||
typedef multi1d<LatticeColorMatrix> P;
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// G5 herm -- this has to live in QCD since dirac matrix is not in the broader sector of code
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#include <qcd/action/fermion/g5HermitianLinop.h>
|
||||
|
||||
#endif
|
||||
|
38
lib/qcd/action/fermion/g5HermitianLinop.h
Normal file
38
lib/qcd/action/fermion/g5HermitianLinop.h
Normal file
@ -0,0 +1,38 @@
|
||||
#ifndef G5_HERMITIAN_LINOP
|
||||
#define G5_HERMITIAN_LINOP
|
||||
namespace Grid {
|
||||
namespace QCD {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Wrap an already herm matrix
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class Matrix,class Field>
|
||||
class Gamma5HermitianLinearOperator : public LinearOperatorBase<Field> {
|
||||
Matrix &_Mat;
|
||||
public:
|
||||
Gamma5HermitianLinearOperator(Matrix &Mat): _Mat(Mat){};
|
||||
void Op (const Field &in, Field &out){
|
||||
_Mat.M(in,out);
|
||||
}
|
||||
void AdjOp (const Field &in, Field &out){
|
||||
_Mat.M(in,out);
|
||||
}
|
||||
void HermOpAndNorm(const Field &in, Field &out,RealD &n1,RealD &n2){
|
||||
|
||||
HermOp(in,out);
|
||||
|
||||
ComplexD dot;
|
||||
dot= innerProduct(in,out);
|
||||
n1=real(dot);
|
||||
|
||||
dot = innerProduct(out,out);
|
||||
n2=real(dot);
|
||||
}
|
||||
void HermOp(const Field &in, Field &out){
|
||||
Field tmp(in._grid);
|
||||
_Mat.M(in,tmp);
|
||||
G5R5(out,tmp);
|
||||
}
|
||||
};
|
||||
|
||||
}}
|
||||
#endif
|
Reference in New Issue
Block a user