Ticket #9266: trac_9266.patch

File trac_9266.patch, 1.6 KB (added by wuthrich, 12 years ago)

exported against 4.4.4.alpha0

  • sage/schemes/elliptic_curves/ell_number_field.py

    # HG changeset patch
    # User Chris Wuthrich <christian.wuthrich@gmail.com>
    # Date 1277248576 -3600
    # Node ID ed02c64247e94be84329782e4e130ecc81fa76ca
    # Parent  556bb66e4c6dbb92a4ee37c1750d82a5c6298eeb
    trac 9266: bug in global_integral_model
    
    diff -r 556bb66e4c6d -r ed02c64247e9 sage/schemes/elliptic_curves/ell_number_field.py
    a b  
     1# -*- coding: utf-8 -*-
    12r"""
    23Elliptic curves over number fields.
    34
     
    366367            sage: E.global_integral_model()
    367368            Elliptic Curve defined by y^2 = x^3 + 1444*a*x + 27436 over Number Field in a with defining polynomial x^2 - 38
    368369
     370        trac #9266::
     371   
     372            sage: K.<s> = NumberField(x^2-5)
     373            sage: w = (1+s)/2
     374            sage: E = EllipticCurve(K,[2,w])
     375            sage: E.global_integral_model()
     376            Elliptic Curve defined by y^2 = x^3 + 2*x + (1/2*s+1/2) over Number Field in s with defining polynomial x^2 - 5
     377
    369378        """
    370379        K = self.base_field()
    371380        ai = self.a_invariants()
     
    376385                   e  = min([(ai[i].valuation(P)/[1,2,3,4,6][i]) for i in range(5)]).floor()
    377386                   ai = [ai[i]/pi**(e*[1,2,3,4,6][i]) for i in range(5)]
    378387        for z in ai:
    379             assert z.denominator() == 1, "bug in global_integral_model: %s" % ai
     388            assert z.is_integral(), "bug in global_integral_model: %s" % list(ai)
    380389        return EllipticCurve(list(ai))
    381390
    382391    integral_model = global_integral_model