Ticket #4000: 4000_fix_hensel_lift.patch

File 4000_fix_hensel_lift.patch, 1.9 KB (added by jdemeyer, 8 years ago)

Fixes issue with hensel_lift()

  • sage/rings/polynomial/polynomial_rational_flint.pyx

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1284839883 -7200
    # Node ID 0ccac25fd82fb088e24412aed8d6a2741889501f
    # Parent  61f9d3d455ee83e7c977d4f70628f268b6ea5fea
    #4000: Fix PARI error in hensel_lift()
    
    diff -r 61f9d3d455ee -r 0ccac25fd82f sage/rings/polynomial/polynomial_rational_flint.pyx
    a b  
    15281528   
    15291529    def hensel_lift(self, p, e):
    15301530        r"""
    1531         Assuming that this polynomial factors modulo `p` into distinct 
    1532         factors, computes the Hensel lifts of these factors modulo `p^e`.
    1533         We assume that self has integer coefficients.
     1531        Assuming that this polynomial factors modulo `p` into distinct
     1532        monic factors, computes the Hensel lifts of these factors modulo
     1533        `p^e`. We assume that ``self`` has integer coefficients.
    15341534       
    15351535        Returns an empty list if this polynomial has degree less than one.
    15361536       
     
    15491549            sage: R((x-1)*(x+1)).hensel_lift(7, 2)
    15501550            [x + 1, x + 48]
    15511551       
     1552        If the input polynomial `f` is not monic, we get a factorization of
     1553        `f / lc(f)`::
     1554       
     1555            sage: R(2*x^2 - 2).hensel_lift(7, 2)
     1556            [x + 1, x + 48]
     1557       
    15521558        TESTS::
    15531559       
    15541560            sage: R.<x> = QQ[]
     
    15841590            if n > 1:
    15851591                raise ArithmeticError, ("The polynomial must be square free " +
    15861592                    "modulo p")
    1587             y.append(g)
     1593            y.append(self.parent()(g))
    15881594        H = self._pari_().polhensellift(y, p, e)
    15891595        R = IntegerModRing(p**e)
    15901596        S = R[self.parent().variable_name()]
    1591         return [S(eval(str(m.Vec().Polrev().Vec()))) for m in H]
     1597        return [S(m) for m in H]
    15921598   
    15931599    def discriminant(self):
    15941600        r"""