1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-12 20:27:06 +01:00

Testing different versions of the Laplacian

This commit is contained in:
Guido Cossu
2017-02-13 15:38:11 +00:00
parent 08fdf05528
commit bafb101e4f
2 changed files with 92 additions and 6 deletions

View File

@ -47,12 +47,77 @@ class LaplacianAdjointField {
}
}
void Mdiag(const GaugeLinkField& in, GaugeLinkField& out) { assert(0); }
void Mdir(const GaugeLinkField& in, GaugeLinkField& out, int dir, int disp) { assert(0); }
/*
// Operator with algebra vector inputs and outputs
void M2(const AVector& in, AVector& out) {
double kappa = 0.9;
//Reconstruct matrix
GaugeLinkField tmp(in._grid);
GaugeLinkField tmp2(in._grid);
GaugeLinkField sum(in._grid);
GaugeLinkField out_mat(in._grid);
GaugeLinkField in_mat(in._grid);
SU<Nc>::FundamentalLieAlgebraMatrix(in, in_mat);
sum = zero;
for (int mu = 0; mu < Nd; mu++) {
tmp = U[mu] * Cshift(in_mat, mu, +1) * adj(U[mu]);
tmp2 = adj(U[mu]) * in_mat * U[mu];
sum += tmp + Cshift(tmp2, mu, -1) - 2.0 * in_mat;
}
out_mat = (1.0 - kappa) * in_mat - kappa/(double(4*Nd)) * sum;
// Project
SU<Nc>::projectOnAlgebra(out, out_mat);
}
*/
void M(const GaugeLinkField& in, GaugeLinkField& out) {
double kappa = 0.999;
//Reconstruct matrix
GaugeLinkField tmp(in._grid);
GaugeLinkField tmp2(in._grid);
GaugeLinkField sum(in._grid);
sum = zero;
for (int mu = 0; mu < Nd; mu++) {
tmp = U[mu] * Cshift(in, mu, +1) * adj(U[mu]);
tmp2 = adj(U[mu]) * in * U[mu];
sum += tmp + Cshift(tmp2, mu, -1) - 2.0 * in;
}
out = (1.0 - kappa) * in - kappa/(double(4*Nd)) * sum;
}
private:
std::vector<GaugeLinkField> U;
};
template <class Impl>
class LaplacianAlgebraField {
public:
INHERIT_GIMPL_TYPES(Impl);
typedef SU<Nc>::LatticeAlgebraVector AVector;
LaplacianAlgebraField(GridBase* grid) : U(Nd, grid){};
void ImportGauge(const GaugeField& _U) {
for (int mu = 0; mu < Nd; mu++) {
U[mu] = PeekIndex<LorentzIndex>(_U, mu);
}
}
void Mdiag(const AVector& in, AVector& out) { assert(0); }
void Mdir(const AVector& in, AVector& out, int dir, int disp) { assert(0); }
// Operator with algebra vector inputs and outputs
void M(const AVector& in, AVector& out) {
double kappa = 0.99;
double kappa = 0.999;
//Reconstruct matrix
GaugeLinkField tmp(in._grid);
@ -76,6 +141,8 @@ class LaplacianAdjointField {
private:
std::vector<GaugeLinkField> U;
};
}
}