1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-10 06:00:45 +01:00

Debugged set_fj,

to be fixed: BUG in imag()
This commit is contained in:
Guido Cossu 2016-07-01 16:06:20 +01:00
parent 565e9329ba
commit 092fa0d8da
5 changed files with 233 additions and 228 deletions

View File

@ -63,7 +63,6 @@ namespace Grid {
colour["WHITE"] ="\033[37m"; colour["WHITE"] ="\033[37m";
colour["NORMAL"] ="\033[0;39m"; colour["NORMAL"] ="\033[0;39m";
} else { } else {
std::cout << "Switching off colours\n";
colour["BLACK"] =""; colour["BLACK"] ="";
colour["RED"] =""; colour["RED"] ="";
colour["GREEN"] =""; colour["GREEN"] ="";

View File

@ -66,6 +66,8 @@ namespace Grid {
// Reference // Reference
// Morningstar, Peardon, Phys.Rev.D69,054501(2004) // Morningstar, Peardon, Phys.Rev.D69,054501(2004)
// Equation 75 // Equation 75
// Computing Sigma_mu, derivative of S[fat links] with respect to the thin links
// Output SigmaTerm
GridBase *grid = U._grid; GridBase *grid = U._grid;
int vol = U._grid->gSites(); int vol = U._grid->gSites();

View File

@ -49,6 +49,7 @@ namespace Grid {
StoutSmearing.smear(SmearedSet[smearLvl],previous_u); StoutSmearing.smear(SmearedSet[smearLvl],previous_u);
previous_u = SmearedSet[smearLvl]; previous_u = SmearedSet[smearLvl];
// For debug purposes
RealD impl_plaq = WilsonLoops<Gimpl>::avgPlaquette(previous_u); RealD impl_plaq = WilsonLoops<Gimpl>::avgPlaquette(previous_u);
std::cout<< GridLogDebug << "[SmearedConfiguration] Plaq: " << impl_plaq<< std::endl; std::cout<< GridLogDebug << "[SmearedConfiguration] Plaq: " << impl_plaq<< std::endl;
@ -103,9 +104,9 @@ namespace Grid {
LatticeComplex r01(grid), r11(grid), r21(grid), r02(grid), r12(grid); LatticeComplex r01(grid), r11(grid), r21(grid), r02(grid), r12(grid);
LatticeComplex r22(grid), tr1(grid), tr2(grid); LatticeComplex r22(grid), tr1(grid), tr2(grid);
LatticeComplex b10(grid), b11(grid), b12(grid), b20(grid), b21(grid), b22(grid); LatticeComplex b10(grid), b11(grid), b12(grid), b20(grid), b21(grid), b22(grid);
LatticeReal unitReal(grid); LatticeReal LatticeUnitReal(grid);
unitReal = 1.0; LatticeUnitReal = 1.0;
// Exponential // Exponential
iQ2 = iQ * iQ; iQ2 = iQ * iQ;
@ -128,11 +129,11 @@ namespace Grid {
+ emiu * (toComplex(16.0*u*cosw + 2.0*u*(3.0*u2+w2)*xi0) + + emiu * (toComplex(16.0*u*cosw + 2.0*u*(3.0*u2+w2)*xi0) +
timesI(toComplex(-8.0*u2*cosw + 2.0*(9.0*u2+w2)*xi0))); timesI(toComplex(-8.0*u2*cosw + 2.0*(9.0*u2+w2)*xi0)));
r11 = (toComplex(2.0*unitReal) + timesI(toComplex(4.0*u)))* e2iu r11 = (toComplex(2.0*LatticeUnitReal) + timesI(toComplex(4.0*u)))* e2iu
+ emiu * (toComplex(-2.0*cosw + (3.0*u2-w2)*xi0) + + emiu * (toComplex(-2.0*cosw + (3.0*u2-w2)*xi0) +
timesI(toComplex(2.0*u*cosw + 6.0*u*xi0))); timesI(toComplex(2.0*u*cosw + 6.0*u*xi0)));
r21 = timesI(toComplex(2.0*unitReal)) * e2iu r21 = 2.0*timesI(e2iu)
+ emiu * (toComplex(-3.0*u*xi0) + timesI(toComplex(cosw - 3.0*xi0))); + emiu * (toComplex(-3.0*u*xi0) + timesI(toComplex(cosw - 3.0*xi0)));

View File

@ -99,7 +99,8 @@ namespace Grid {
LatticeReal c0(grid), c1(grid), tmp(grid), c0max(grid), theta(grid); LatticeReal c0(grid), c1(grid), tmp(grid), c0max(grid), theta(grid);
// sign in c0 from the conventions on the Ta // sign in c0 from the conventions on the Ta
c0 = - toReal(imag(trace(iQ3))) * one_over_three; // c0 = - toReal(imag(trace(iQ3))) * one_over_three;
c0 = - toReal(real(timesMinusI(trace(iQ3)))) * one_over_three; //temporary, FIX the bug in imag
c1 = - toReal(real(trace(iQ2))) * one_over_two; c1 = - toReal(real(trace(iQ2))) * one_over_two;
tmp = c1 * one_over_three; tmp = c1 * one_over_three;
c0max = 2.0 * pow(tmp, 1.5); c0max = 2.0 * pow(tmp, 1.5);
@ -107,6 +108,7 @@ namespace Grid {
theta = acos(c0/c0max); theta = acos(c0/c0max);
u = sqrt(tmp) * cos( theta * one_over_three); u = sqrt(tmp) * cos( theta * one_over_three);
w = sqrt(c1) * sin( theta * one_over_three); w = sqrt(c1) * sin( theta * one_over_three);
} }
void set_fj(LatticeComplex& f0, LatticeComplex& f1, LatticeComplex& f2, void set_fj(LatticeComplex& f0, LatticeComplex& f1, LatticeComplex& f2,
@ -124,8 +126,8 @@ namespace Grid {
cosw = cos(w); cosw = cos(w);
ixi0 = timesI(toComplex(xi0)); ixi0 = timesI(toComplex(xi0));
emiu = toComplex(cos(u)) - timesI(toComplex(u)); emiu = toComplex(cos(u)) - timesI(toComplex(sin(u)));
e2iu = toComplex(cos(2.0*u)) + timesI(toComplex(2.0*u)); e2iu = toComplex(cos(2.0*u)) + timesI(toComplex(sin(2.0*u)));
h0 = e2iu * toComplex(u2 - w2) + emiu *( toComplex(8.0*u2*cosw) + h0 = e2iu * toComplex(u2 - w2) + emiu *( toComplex(8.0*u2*cosw) +
toComplex(2.0*u*(3.0*u2 + w2))*ixi0); toComplex(2.0*u*(3.0*u2 + w2))*ixi0);
@ -135,12 +137,13 @@ namespace Grid {
h2 = e2iu - emiu * (toComplex(cosw) + toComplex(3.0*u)*ixi0); h2 = e2iu - emiu * (toComplex(cosw) + toComplex(3.0*u)*ixi0);
tmp = 9.0*u2 - w2; tmp = 9.0*u2 - w2;
fden = toComplex(pow(tmp, -1.0)); fden = toComplex(pow(tmp, -1.0));
f0 = h0 * fden; f0 = h0 * fden;
f1 = h1 * fden; f1 = h1 * fden;
f2 = h2 * fden; f2 = h2 * fden;
} }