michaelmusty / Belyi

MIT License
2 stars 5 forks source link

Precision #6

Closed jvoight closed 3 years ago

jvoight commented 3 years ago
AttachSpec("spec");
sigma := [Sym(4) | (1,2,3,4), (1,3,4,2), (1,3,4)];
Gamma := TriangleSubgroup(sigma);
SetVerbose("Shimura", true);
FundamentalDomain(Gamma : Precision := 70);
X, phi := BelyiMap(Gamma);

The above code fails, but works if you delete the FundamentalDomain line. Something is wrong when it computes the elliptic curve periods, and it's a precision issue (the imaginary parts are 10^-30, and should be zero). [And if you replace the last line with BelyiMap(Gamma : Precision := 30), it works again.]

SamSchiavone commented 3 years ago

I think the problem is line 66 in genusone.m.

 64   CC<I> := BaseRing(Parent(Sk1[1]));
 65   prec := Precision(CC);
 66   eps := 10^(-prec+2);

The precision is 70, so the epsilon is only 10^-68. Probably both the precision and the numerical epsilon should be pulled from Gamma with Gamma'TriangleNumericalPrecision and Gamma'TriangleNumericalEpsilon. But even then, Gamma'TriangleNumericalEpsilon seems to just be 10^(-prec/2):

 > Gamma`TriangleNumericalEpsilon;                                             
1.00000000000000000000000000000E-35

so it might still cause problems in this example.

jvoight commented 3 years ago

Thanks for the tip, Sam! It helped me to find the culprit: for a GrpPSL2Elt, there is a MatrixD attribute that saves the matrix of the element acting on the unit disc--we obviously want to cache this. But when the unit disc changes, it has to be updated. The fix is easy enough: we need to override '*' not just for SpcHypElts but also SpcHydElts.