edgarcosta / endomorphisms

Rigorous computation of the endomorphism ring of a Jacobian
GNU General Public License v2.0
10 stars 8 forks source link

CurveExtra precision issues over number fields #49

Closed edgarcosta closed 5 months ago

edgarcosta commented 2 years ago

There are some weird shenanigans happening when one uses CurveExtra. In particular, I'm convinced certain things are being passed by references instead of copied. I hopefully will debug this in the feature, but for the time being here are my findings: 1- Increasing precision doesn't seem to work after calling Heuristic* as it makes it internally calls CurveExtra

# magma -b                                                                                                                                                                                                                                                                                                    
> ICs := [10/3, 1/9, 4/27, 1/236196];
> C := HyperellipticCurveFromIgusaClebsch(ICs);
> HeuristicEndomorphismAlgebra(C : Geometric:=true);
Runtime error: Error in determining tangent representation: 2.8575E-100
> C2 := CurveExtra(C : prec:=2000);
> Parent(BaseRing(C2)`iota);
Complex field of precision 110
> HeuristicEndomorphismAlgebra(C2 : Geometric:=true);
Runtime error: Error in determining tangent representation: 1.5088E-99

2- increasing the precision on a sibling works before calling Heuristic*(C) despite the call not being on the sibling, I wouldn't expect this to work:

# magma -b
> ICs := [10/3, 1/9, 4/27, 1/236196];
> C := HyperellipticCurveFromIgusaClebsch(ICs);
> C2 := CurveExtra(C : prec:=2000);
> HeuristicEndomorphismAlgebra(C : Geometric:=true);
<[ <2, 1> ], [
<1, 4, [ -1, 1 ], 6, 2>
], <1, 1>, 3>
Associative Algebra of dimension 4 with base ring Rational Field
[ (1 0 0 0), (1 0 0 1), ( 1  1  0 -1), ( 0  0  1 -1) ]

but instead having to do

ICs := [10/3, 1/9, 4/27, 1/236196];
C := HyperellipticCurveFromIgusaClebsch(ICs);
C2 := CurveExtra(C : prec:=2000);
HeuristicEndomorphismAlgebra(C2 : Geometric:=true);

CC: @kimballmartin

edgarcosta commented 8 months ago

One of the common issues here is the Rationals being a global object, and thus QQ`CC = ComplexField(110), which doesn't get changed on the second call

edgarcosta commented 5 months ago

this has now been fixed