mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Think this should move to the algorithms directory
This commit is contained in:
parent
b460cd3ef1
commit
75f3062a80
@ -1,4 +1,4 @@
|
|||||||
/*************************************************************************************
|
/*************************************************************************************
|
||||||
|
|
||||||
Grid physics library, www.github.com/paboyle/Grid
|
Grid physics library, www.github.com/paboyle/Grid
|
||||||
|
|
||||||
@ -24,32 +24,32 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
|||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
See the full license in the file "LICENSE" in the top level distribution directory
|
See the full license in the file "LICENSE" in the top level distribution directory
|
||||||
*************************************************************************************/
|
*************************************************************************************/
|
||||||
/* END LEGAL */
|
/* END LEGAL */
|
||||||
#ifndef _SCHUR_DIAG_TWO_KAPPA_H
|
#ifndef _SCHUR_DIAG_TWO_KAPPA_H
|
||||||
#define _SCHUR_DIAG_TWO_KAPPA_H
|
#define _SCHUR_DIAG_TWO_KAPPA_H
|
||||||
|
|
||||||
namespace Grid {
|
NAMESPACE_BEGIN(Grid);
|
||||||
|
|
||||||
// This is specific to (Z)mobius fermions
|
// This is specific to (Z)mobius fermions
|
||||||
template<class Matrix, class Field>
|
template<class Matrix, class Field>
|
||||||
class KappaSimilarityTransform {
|
class KappaSimilarityTransform {
|
||||||
public:
|
public:
|
||||||
INHERIT_IMPL_TYPES(Matrix);
|
INHERIT_IMPL_TYPES(Matrix);
|
||||||
std::vector<Coeff_t> kappa, kappaDag, kappaInv, kappaInvDag;
|
std::vector<Coeff_t> kappa, kappaDag, kappaInv, kappaInvDag;
|
||||||
|
|
||||||
KappaSimilarityTransform (Matrix &zmob) {
|
KappaSimilarityTransform (Matrix &zmob) {
|
||||||
for (int i=0;i<(int)zmob.bs.size();i++) {
|
for (int i=0;i<(int)zmob.bs.size();i++) {
|
||||||
Coeff_t k = 1.0 / ( 2.0 * (zmob.bs[i] *(4 - zmob.M5) + 1.0) );
|
Coeff_t k = 1.0 / ( 2.0 * (zmob.bs[i] *(4 - zmob.M5) + 1.0) );
|
||||||
kappa.push_back( k );
|
kappa.push_back( k );
|
||||||
kappaDag.push_back( conj(k) );
|
kappaDag.push_back( conj(k) );
|
||||||
kappaInv.push_back( 1.0 / k );
|
kappaInv.push_back( 1.0 / k );
|
||||||
kappaInvDag.push_back( 1.0 / conj(k) );
|
kappaInvDag.push_back( 1.0 / conj(k) );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<typename vobj>
|
template<typename vobj>
|
||||||
void sscale(const Lattice<vobj>& in, Lattice<vobj>& out, Coeff_t* s) {
|
void sscale(const Lattice<vobj>& in, Lattice<vobj>& out, Coeff_t* s) {
|
||||||
GridBase *grid=out._grid;
|
GridBase *grid=out._grid;
|
||||||
out.checkerboard = in.checkerboard;
|
out.checkerboard = in.checkerboard;
|
||||||
assert(grid->_simd_layout[0] == 1); // should be fine for ZMobius for now
|
assert(grid->_simd_layout[0] == 1); // should be fine for ZMobius for now
|
||||||
@ -70,33 +70,33 @@ namespace Grid {
|
|||||||
virtual RealD MInv (const Field& in, Field& out) { return sscale_norm(in,out,&kappaInv[0]);}
|
virtual RealD MInv (const Field& in, Field& out) { return sscale_norm(in,out,&kappaInv[0]);}
|
||||||
virtual RealD MInvDag (const Field& in, Field& out) { return sscale_norm(in,out,&kappaInvDag[0]);}
|
virtual RealD MInvDag (const Field& in, Field& out) { return sscale_norm(in,out,&kappaInvDag[0]);}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class Matrix,class Field>
|
template<class Matrix,class Field>
|
||||||
class SchurDiagTwoKappaOperator : public SchurOperatorBase<Field> {
|
class SchurDiagTwoKappaOperator : public SchurOperatorBase<Field> {
|
||||||
public:
|
public:
|
||||||
KappaSimilarityTransform<Matrix, Field> _S;
|
KappaSimilarityTransform<Matrix, Field> _S;
|
||||||
SchurDiagTwoOperator<Matrix, Field> _Mat;
|
SchurDiagTwoOperator<Matrix, Field> _Mat;
|
||||||
|
|
||||||
SchurDiagTwoKappaOperator (Matrix &Mat): _S(Mat), _Mat(Mat) {};
|
SchurDiagTwoKappaOperator (Matrix &Mat): _S(Mat), _Mat(Mat) {};
|
||||||
|
|
||||||
virtual RealD Mpc (const Field &in, Field &out) {
|
virtual RealD Mpc (const Field &in, Field &out) {
|
||||||
Field tmp(in._grid);
|
Field tmp(in._grid);
|
||||||
|
|
||||||
_S.MInv(in,out);
|
_S.MInv(in,out);
|
||||||
_Mat.Mpc(out,tmp);
|
_Mat.Mpc(out,tmp);
|
||||||
return _S.M(tmp,out);
|
return _S.M(tmp,out);
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual RealD MpcDag (const Field &in, Field &out){
|
virtual RealD MpcDag (const Field &in, Field &out){
|
||||||
Field tmp(in._grid);
|
Field tmp(in._grid);
|
||||||
|
|
||||||
_S.MDag(in,out);
|
_S.MDag(in,out);
|
||||||
_Mat.MpcDag(out,tmp);
|
_Mat.MpcDag(out,tmp);
|
||||||
return _S.MInvDag(tmp,out);
|
return _S.MInvDag(tmp,out);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
NAMESPACE_END(Grid);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user