# Ticket #11540: ec-reduction-inconsistencie.patch

File ec-reduction-inconsistencie.patch, 2.9 KB (added by mderickx, 9 years ago)
• ## sage/schemes/elliptic_curves/ell_number_field.py

```# HG changeset patch
# User Maarten Derickx <m.derickx.student@gmail.com>
# 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 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() 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)
• ## sage/schemes/elliptic_curves/ell_rational_field.py

`diff -r 8795b61c165c -r 2c2ef9772d6a sage/schemes/elliptic_curves/ell_rational_field.py`
 a .. 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: 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))