mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-04 19:25:56 +01:00
g5 and g5R5 hermitian are now differentiated
This commit is contained in:
parent
c86c15f95f
commit
c133974d67
@ -6,10 +6,10 @@ namespace Grid {
|
|||||||
// Wrap an already herm matrix
|
// Wrap an already herm matrix
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
template<class Matrix,class Field>
|
template<class Matrix,class Field>
|
||||||
class Gamma5HermitianLinearOperator : public LinearOperatorBase<Field> {
|
class Gamma5R5HermitianLinearOperator : public LinearOperatorBase<Field> {
|
||||||
Matrix &_Mat;
|
Matrix &_Mat;
|
||||||
public:
|
public:
|
||||||
Gamma5HermitianLinearOperator(Matrix &Mat): _Mat(Mat){};
|
Gamma5R5HermitianLinearOperator(Matrix &Mat): _Mat(Mat){};
|
||||||
void Op (const Field &in, Field &out){
|
void Op (const Field &in, Field &out){
|
||||||
HermOp(in,out);
|
HermOp(in,out);
|
||||||
}
|
}
|
||||||
@ -45,5 +45,48 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template<class Matrix,class Field>
|
||||||
|
class Gamma5HermitianLinearOperator : public LinearOperatorBase<Field> {
|
||||||
|
Matrix &_Mat;
|
||||||
|
Gamma g5;
|
||||||
|
public:
|
||||||
|
Gamma5HermitianLinearOperator(Matrix &Mat): _Mat(Mat), g5(Gamma::Gamma5) {};
|
||||||
|
void Op (const Field &in, Field &out){
|
||||||
|
HermOp(in,out);
|
||||||
|
}
|
||||||
|
void AdjOp (const Field &in, Field &out){
|
||||||
|
HermOp(in,out);
|
||||||
|
}
|
||||||
|
void OpDiag (const Field &in, Field &out) {
|
||||||
|
Field tmp(in._grid);
|
||||||
|
_Mat.Mdiag(in,tmp);
|
||||||
|
out=g5*tmp;
|
||||||
|
}
|
||||||
|
void OpDir (const Field &in, Field &out,int dir,int disp) {
|
||||||
|
Field tmp(in._grid);
|
||||||
|
_Mat.Mdir(in,tmp,dir,disp);
|
||||||
|
out=g5*tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
out=g5*tmp;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
}}
|
}}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user