edgarcosta / endomorphisms

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

SagifyDescription issue #31

Open a-kulkarn opened 4 years ago

a-kulkarn commented 4 years ago

First off, Wonderful package! I ran into the following issue after installing and trying to run:

"""
 *  Hyperelliptic examples
"""

from endomorphisms import EndomorphismData, mHyperellipticCurve, mPlaneCurve

F = QQ
R.<x> = PolynomialRing(F)
f, h = [21*x^7 + 37506*x^5 + 933261*x^3 + 5841759*x, R(0)]
f, h = [x^7 + 6*x^5 + 9*x^3 + x, R(0)]
f, h = [16*x^7 + 357*x^5 - 819*x^3 + 448*x, R(0)]
f, h = [-4*x^8 + 105*x^6 - 945*x^4 + 2100*x^2 - 5895*x + 420, x^4]
f, h = [x^7 - 14*x^6 + 210*x^5 - 658*x^4 + 245*x^3 + 588*x^2 + 637*x - 686, R(0)]
# Conductor 2^4 13^4, all twists have rational point, CM curve
f, h = [x^6 - 8*x^4 - 8*x^3 + 8*x^2 + 12*x - 8, R(0)]
X = mHyperellipticCurve(f, h, 300)

Endo = EndomorphismData(X)
#lat = Endo.lattice()
#print lat.pretty_print()

# Running Endo.lattice() causes:
"""

<...stacktrace...>
----> 1 Endo.lattice()

/home/akulkarn/.sage/local/lib/python2.7/site-packages/endomorphisms/Wrapper.pyc in lattice(self)
     33         if not hasattr(self, "_lat_list_"):
     34             self._lat_list_ = magma.HeuristicEndomorphismLattice(self.X)
---> 35             self._lat_desc_ = desc_lattice(self._lat_list_)
     36             self._lat_dict_ = dict_lattice(self._lat_list_)
     37         return pretty_print_lattice_description(self._lat_desc_, self.g)

/home/akulkarn/.sage/local/lib/python2.7/site-packages/endomorphisms/Dictionaries.pyc in desc_lattice(lattice)
     84     _index_dict_ = index_dictionary()
     85     desc = [ ]
---> 86     desc.append(desc_base(lattice[_index_dict_['base']]))
     87     desc.append(desc_entries(lattice[_index_dict_['entries']]))
     88     return desc

/home/akulkarn/.sage/local/lib/python2.7/site-packages/endomorphisms/Dictionaries.pyc in desc_base(base)
    133 def desc_base(base):
    134     _index_dict_ = index_dictionary()
--> 135     return sagify_description(base[_index_dict_['seq']])
    136 
    137 def dict_field(field):

/home/akulkarn/.sage/local/lib/python2.7/site-packages/endomorphisms/Dictionaries.pyc in sagify_description(desc_list)
     72 
     73 def sagify_description(desc_list):
---> 74     return eval(repr(magma.SagifyDescription(desc_list)))
     75 
     76 def dict_lattice(lattice):

<More stuff...>

TypeError: Error evaluating Magma code.
IN:_sage_[20]:=SagifyDescription(_sage_[19]);
OUT:
>> _sage_[20]:=SagifyDescription(_sage_[19]);
                                ^
Runtime error in 'SagifyDescription': No return statement executed in intrinsic
"""
JRSijsling commented 4 years ago

Thank you for pointing this out! The Sage interface needs to be fixed; it is no longer up-to-date because most of the functionality is now accessible purely in Magma. So while this is a cop-out, right now the best thing to do is to use the pure Magma algorithms, as in examples/Buttons.m. However, the interface will be tested and fixed ASAP.

edgarcosta commented 4 years ago

@JRSijsling do you think it is worth it to keep the Sage interface?

@a-kulkarn alternatively we recommend http://doc.sagemath.org/html/en/reference/curves/sage/schemes/riemann_surfaces/riemann_surface.html for Sage

JRSijsling commented 4 years ago

The SageMath interface has two purposes. The first is to get access to both the Magma code for finding correspondences and the l-adic upper bounds and Abel-Jacobi methods, which are in Sage. The second is to enable the manipulation of databases and the testing of pretty print routines, both in the context of the LMFDB. Especially the latter has faded out of view, but it will likely become important during the some next big LMFDB push.

Neither of these are things on which I am currently working myself. However, it may be useful to keep the connecting tissue alive for some value of alive.