#4000: Implement QQ['x'] via Flint ZZ['x'] + denominator
------------------------------+---------------------------------------------
Reporter: malb | Owner: somebody
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.6
Component: basic arithmetic | Resolution:
Keywords: | Author: Sebastian Pancratz, Martin
Albrecht
Upstream: N/A | Reviewer: John Cremona, Martin Albrecht,
Alex Ghitza, Harald Schilly
Merged: sage-4.6.alpha1 | Work_issues:
------------------------------+---------------------------------------------
Changes (by leif):
* cc: jdemeyer (added)
Comment:
Replying to [comment:86 mpatel]:
> I get this error on sage.math and several other Sage cluster and Skynet
machines on which 4.6.alpha1 builds successfully:
{{{
sage -t -long
devel/sage/sage/rings/polynomial/polynomial_rational_flint.pyx
**********************************************************************
File "/mnt/usb1/scratch/mpatel/tmp/sage-4.6.alpha1/devel/sage-
main/sage/rings/polynomial/polynomial_rational_flint.pyx", line 1549:
sage: R((x-1)*(x+1)).hensel_lift(7, 2)
Exception raised:
Traceback (most recent call last):
File
"/mnt/usb1/scratch/mpatel/tmp/sage-4.6.alpha1/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File
"/mnt/usb1/scratch/mpatel/tmp/sage-4.6.alpha1/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File
"/mnt/usb1/scratch/mpatel/tmp/sage-4.6.alpha1/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_44[3]>", line 1, in <module>
R((x-Integer(1))*(x+Integer(1))).hensel_lift(Integer(7),
Integer(2))###line 1549:
sage: R((x-1)*(x+1)).hensel_lift(7, 2)
File "polynomial_rational_flint.pyx", line 1588, in
sage.rings.polynomial.polynomial_rational_flint.Polynomial_rational_flint.hensel_lift
(sage/rings/polynomial/polynomial_rational_flint.cpp:12625)
H = self._pari_().polhensellift(y, p, e)
File "gen.pyx", line 9460, in sage.libs.pari.gen._pari_trap
(sage/libs/pari/gen.c:45047)
PariError: (5)
}}}
> Is this easy to fix?
'''No! ''' (I wonder who decided to give such error messages.)
----
There are at least two ways to fix this, either in the Sage library:
{{{
#!diff
diff --git a/sage/libs/pari/gen.pyx b/sage/libs/pari/gen.pyx
--- a/sage/libs/pari/gen.pyx
+++ b/sage/libs/pari/gen.pyx
@@ -7025,7 +7025,7 @@
t0GEN(y)
t1GEN(p)
_sig_on
- return self.new_gen(polhensellift(self.g, t0, t1, e))
+ return self.new_gen(polhensellift(self.g, lift(t0), t1, e))
def polisirreducible(self):
"""
}}}
or "upstream" / in the PARI 2.4.3.svn-12577.* spkg (e.g. in #9876's
{{{.p6}}}, too):
{{{
#!diff
diff --git a/src/src/modules/Hensel.c b/src/src/modules/Hensel.c
--- a/src/src/modules/Hensel.c
+++ b/src/src/modules/Hensel.c
@@ -394,6 +394,7 @@
if (N < 1) pari_err(talker, "not a positive exponent in
polhensellift");
l = lg(L); L = leafcopy(L);
+ L = lift(L); /* make sure the coeffs are integers and not intmods */
for (i = 1; i < l; i++)
{
if (typ(gel(L,i)) != t_POL)
}}}
Probably someone more knowledgeable could fix this in a better way.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4000#comment:97>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.