# 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 def hensel_lift(self, p, e): r""" Assuming that this polynomial factors modulo `p` into distinct factors, computes the Hensel lifts of these factors modulo `p^e`. We assume that self has integer coefficients. Assuming that this polynomial factors modulo `p` into distinct monic factors, computes the Hensel lifts of these factors modulo `p^e`. We assume that ``self`` has integer coefficients. Returns an empty list if this polynomial has degree less than one. sage: R((x-1)*(x+1)).hensel_lift(7, 2) [x + 1, x + 48] If the input polynomial `f` is not monic, we get a factorization of `f / lc(f)`:: sage: R(2*x^2 - 2).hensel_lift(7, 2) [x + 1, x + 48] TESTS:: sage: R. = QQ[] if n > 1: raise ArithmeticError, ("The polynomial must be square free " + "modulo p") y.append(g) y.append(self.parent()(g)) H = self._pari_().polhensellift(y, p, e) R = IntegerModRing(p**e) S = R[self.parent().variable_name()] return [S(eval(str(m.Vec().Polrev().Vec()))) for m in H] return [S(m) for m in H] def discriminant(self): r"""