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

HMC for Adjoint fermions works

Accepts and reproduces known results

Check initial instability of inverters
when starting from hot configurations
This commit is contained in:
Guido Cossu
2016-08-30 11:31:25 +01:00
parent 9c2e8d5e28
commit b512ccbee6
8 changed files with 45 additions and 57 deletions

View File

@ -160,8 +160,9 @@ class SU {
else
generatorSigmaX(su2Index, ta);
}
template <class cplx>
static void generatorSigmaX(int su2Index, iSUnMatrix<cplx> &ta) {
static void generatorSigmaY(int su2Index, iSUnMatrix<cplx> &ta) {
ta = zero;
int i1, i2;
su2SubGroupIndex(i1, i2, su2Index);
@ -170,15 +171,16 @@ class SU {
ta = ta * 0.5;
}
template <class cplx>
static void generatorSigmaY(int su2Index, iSUnMatrix<cplx> &ta) {
static void generatorSigmaX(int su2Index, iSUnMatrix<cplx> &ta) {
ta = zero;
cplx i(0.0, 1.0);
int i1, i2;
su2SubGroupIndex(i1, i2, su2Index);
ta()()(i1, i2) = -i;
ta()()(i2, i1) = i;
ta()()(i1, i2) = i;
ta()()(i2, i1) = -i;
ta = ta * 0.5;
}
template <class cplx>
static void generatorDiagonal(int diagIndex, iSUnMatrix<cplx> &ta) {
// diag ({1, 1, ..., 1}(k-times), -k, 0, 0, ...)
@ -651,9 +653,10 @@ class SU {
for (int a = 0; a < AdjointDimension; a++) {
gaussian(pRNG, ca);
generator(a, ta);
la = toComplex(ca) * ci * ta;
la = toComplex(ca) * ta;
out += la;
}
out *= ci;
}
static void FundamentalLieAlgebraMatrix(const LatticeAlgebraVector &h,
@ -684,7 +687,6 @@ class SU {
auto tmp = - 2.0 * (trace(timesI(Ta) * in)) * scale;// 2.0 for the normalization of the trace in the fundamental rep
pokeColour(h_out, tmp, a);
}
std::cout << "h_out " << h_out << std::endl;
}

View File

@ -75,7 +75,8 @@ class SU_Adjoint : public SU<ncolour> {
typename SU<ncolour>::template iSUnMatrix<cplx> tmp1 =
2.0 * tmp * ta[b]; // 2.0 from the normalization
Complex iTr = TensorRemove(timesI(trace(tmp1)));
iAdjTa()()(b, a) = iTr;
//iAdjTa()()(b, a) = iTr;
iAdjTa()()(a, b) = iTr;
}
}
}
@ -121,9 +122,10 @@ class SU_Adjoint : public SU<ncolour> {
out = zero;
for (int a = 0; a < Dimension; a++) {
generator(a, iTa);
la = peekColour(h, a) * iTa * scale;
la = peekColour(h, a) * iTa;
out += la;
}
out *= scale;
}
// Projects the algebra components a lattice matrix (of dimension ncol*ncol -1 )
@ -131,16 +133,16 @@ class SU_Adjoint : public SU<ncolour> {
conformable(h_out, in);
h_out = zero;
AMatrix iTa;
Real coefficient = - 1.0/(ncolour) * scale;// 1/Nc for the normalization of the trace in the adj rep
for (int a = 0; a < Dimension; a++) {
generator(a, iTa);
auto tmp = - 1.0/(ncolour) * (trace(iTa * in)) * scale;// 1/Nc for the normalization of the trace in the adj rep
auto tmp = real(trace(iTa * in)) * coefficient;
pokeColour(h_out, tmp, a);
}
//std::cout << "h_out " << h_out << std::endl;
}
// a projector that keeps the generators stored to avoid the overhead of recomputing.
// a projector that keeps the generators stored to avoid the overhead of recomputing them
static void projector(typename SU<ncolour>::LatticeAlgebraVector &h_out, const LatticeAdjMatrix &in, Real scale = 1.0) {
conformable(h_out, in);
static std::vector<AMatrix> iTa(Dimension); // to store the generators
@ -151,8 +153,11 @@ class SU_Adjoint : public SU<ncolour> {
for (int a = 0; a < Dimension; a++) generator(a, iTa[a]);
}
Real coefficient = -1.0 / (ncolour)*scale; // 1/Nc for the normalization of
// the trace in the adj rep
for (int a = 0; a < Dimension; a++) {
auto tmp = - 1.0/(ncolour) * (trace(iTa[a] * in)) * scale;
auto tmp = real(trace(iTa[a] * in)) * coefficient;
pokeColour(h_out, tmp, a);
}
}