# HG changeset patch
# User Maarten Derickx
# Date 1308872676 -7200
# Node ID 2c2ef9772d6a362552b5e77147c586a21a911af6
# Parent 8795b61c165c9dfe7e6c2e5753f2ac5a4f54d092
#11540 Make elliptic curve reduction consistent with has_good_reduction
diff -r 8795b61c165c -r 2c2ef9772d6a sage/schemes/elliptic_curves/ell_number_field.py
--- a/sage/schemes/elliptic_curves/ell_number_field.py Fri Jun 24 00:43:12 2011 +0200
+++ b/sage/schemes/elliptic_curves/ell_number_field.py Fri Jun 24 01:44:36 2011 +0200
@@ -1330,6 +1330,10 @@
Traceback (most recent call last):
...
ValueError: The ideal must be prime.
+ sage: K=QQ.extension(x^2+x+1,"a")
+ sage: E=EllipticCurve([1024*K.0,1024*K.0])
+ sage: E.reduction(2*K)
+ Elliptic Curve defined by y^2 + (abar+1)*y = x^3 over Residue field in abar of Fractional ideal (2)
"""
K = self.base_field()
OK = K.ring_of_integers()
@@ -1341,6 +1345,10 @@
raise ValueError, "The ideal must be prime."
disc = self.discriminant()
if not K.ideal(disc).valuation(place) == 0:
+ local_data=self.local_data(place)
+ if local_data.has_good_reduction():
+ Fv = OK.residue_field(place)
+ return local_data.minimal_model().change_ring(Fv)
raise ValueError, "The curve must have good reduction at the place."
Fv = OK.residue_field(place)
return self.change_ring(Fv)
diff -r 8795b61c165c -r 2c2ef9772d6a sage/schemes/elliptic_curves/ell_rational_field.py
--- a/sage/schemes/elliptic_curves/ell_rational_field.py Fri Jun 24 00:43:12 2011 +0200
+++ b/sage/schemes/elliptic_curves/ell_rational_field.py Fri Jun 24 01:44:36 2011 +0200
@@ -3324,8 +3324,9 @@
.. note::
- All is done in ``self.change_ring(GF(p))``; all we do is
- check that p is prime and does not divide the discriminant.
+ The actual reduction is done in ``self.change_ring(GF(p))``;
+ the reduction is performed after changing to a model which
+ is minimal at p.
INPUT:
@@ -3351,12 +3352,18 @@
Traceback (most recent call last):
...
AttributeError: The curve must have good reduction at p.
+ sage: E=EllipticCurve([5^4,5^6])
+ sage: E.reduction(5)
+ Elliptic Curve defined by y^2 = x^3 + x + 1 over Finite Field of size 5
"""
p = rings.Integer(p)
if not p.is_prime():
raise AttributeError, "p must be prime."
disc = self.discriminant()
if not disc.valuation(p) == 0:
+ local_data=self.local_data(p)
+ if local_data.has_good_reduction():
+ return local_data.minimal_model().change_ring(rings.GF(p))
raise AttributeError, "The curve must have good reduction at p."
return self.change_ring(rings.GF(p))