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 b  
    13301330           Traceback (most recent call last):
    13311331           ... 
    13321332           ValueError: The ideal must be prime.
     1333           sage: K=QQ.extension(x^2+x+1,"a")
     1334           sage: E=EllipticCurve([1024*K.0,1024*K.0])
     1335           sage: E.reduction(2*K)
     1336           Elliptic Curve defined by y^2 + (abar+1)*y = x^3 over Residue field in abar of Fractional ideal (2)
    13331337       """
    13341338       K = self.base_field()
    13351339       OK = K.ring_of_integers()
     
    13411345           raise ValueError, "The ideal must be prime."
    13421346       disc = self.discriminant()
    13431347       if not K.ideal(disc).valuation(place) == 0:
     1348           local_data=self.local_data(place)
     1349           if local_data.has_good_reduction():
     1350               Fv = OK.residue_field(place)
     1351               return local_data.minimal_model().change_ring(Fv)
    13441352           raise ValueError, "The curve must have good reduction at the place."
    13451353       Fv = OK.residue_field(place)
    13461354       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 b  
    33243324       
    33253325       .. note::
    33263326
    3327           All is done in ``self.change_ring(GF(p))``; all we do is
    3328           check that p is prime and does not divide the discriminant.
     3327          The actual reduction is done in ``self.change_ring(GF(p))``;
     3328          the reduction is performed after changing to a model which
     3329          is minimal at p.
    33293330       
    33303331       INPUT:
    33313332       
     
    33513352           Traceback (most recent call last):
    33523353           ...
    33533354           AttributeError: The curve must have good reduction at p.
     3355           sage: E=EllipticCurve([5^4,5^6])
     3356           sage: E.reduction(5)
     3357           Elliptic Curve defined by y^2 = x^3 + x + 1 over Finite Field of size 5
    33543358       """
    33553359       p = rings.Integer(p)
    33563360       if not p.is_prime():
    33573361           raise AttributeError, "p must be prime."
    33583362       disc = self.discriminant()
    33593363       if not disc.valuation(p) == 0:
     3364           local_data=self.local_data(p)
     3365           if local_data.has_good_reduction():
     3366               return local_data.minimal_model().change_ring(rings.GF(p))
    33603367           raise AttributeError, "The curve must have good reduction at p."
    33613368       return self.change_ring(rings.GF(p))
    33623369