1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00

Moving the topological charge outside the HMC related routines

This commit is contained in:
Guido Cossu 2017-05-02 14:40:12 +01:00
parent de7bbfa5f9
commit 453cf2a1c6
2 changed files with 22 additions and 18 deletions

View File

@ -49,24 +49,7 @@ class TopologicalCharge : public HmcObservable<typename Impl::Field> {
GridSerialRNG &sRNG,
GridParallelRNG &pRNG) {
// 4d topological charge
// Bx = -iF(y,z), By = -iF(z,y), Bz = -iF(x,y)
GaugeLinkField Bx(U._grid), By(U._grid), Bz(U._grid);
WilsonLoops<Impl>::FieldStrength(Bx, U, Ydir, Zdir);
WilsonLoops<Impl>::FieldStrength(By, U, Zdir, Xdir);
WilsonLoops<Impl>::FieldStrength(Bz, U, Xdir, Ydir);
// Ex = -iF(t,x), Ey = -iF(t,y), Ez = -iF(t,z)
GaugeLinkField Ex(U._grid), Ey(U._grid), Ez(U._grid);
WilsonLoops<Impl>::FieldStrength(Ex, U, Tdir, Xdir);
WilsonLoops<Impl>::FieldStrength(Ey, U, Tdir, Ydir);
WilsonLoops<Impl>::FieldStrength(Ez, U, Tdir, Zdir);
double coeff = 8.0/(32.0*M_PI*M_PI);
LatticeComplex qfield = coeff*trace(Bx*Ex + By*Ey + Bz*Ez);
TComplex Tq = sum(qfield);
Real q = TensorRemove(Tq).real();
Real q = WilsonLoops<Impl>::TopologicalCharge(U);
int def_prec = std::cout.precision();

View File

@ -313,6 +313,27 @@ public:
FS = 0.25*Ta(u*v + Cshift(vu, mu, +1));
}
static Real TopologicalCharge(GaugeLorentz &U){
// 4d topological charge
assert(Nd==4);
// Bx = -iF(y,z), By = -iF(z,y), Bz = -iF(x,y)
GaugeMat Bx(U._grid), By(U._grid), Bz(U._grid);
FieldStrength(Bx, U, Ydir, Zdir);
FieldStrength(By, U, Zdir, Xdir);
FieldStrength(Bz, U, Xdir, Ydir);
// Ex = -iF(t,x), Ey = -iF(t,y), Ez = -iF(t,z)
GaugeMat Ex(U._grid), Ey(U._grid), Ez(U._grid);
FieldStrength(Ex, U, Tdir, Xdir);
FieldStrength(Ey, U, Tdir, Ydir);
FieldStrength(Ez, U, Tdir, Zdir);
double coeff = 8.0/(32.0*M_PI*M_PI);
LatticeComplex qfield = coeff*trace(Bx*Ex + By*Ey + Bz*Ez);
TComplex Tq = sum(qfield);
return TensorRemove(Tq).real();
}
//////////////////////////////////////////////////////
// Similar to above for rectangle is required