On 10/07/16 12:54, John Cremona wrote:
On 2 July 2016 at 11:11, Jeroen Sijsling <sijsl...@gmail.com> wrote:
Hello,

In Sage 7.2 I get the following error:

R.<x> = PolynomialRing(QQ)
pol_rep = [1, -12, 70, -264, 757, -1872, 4258, -8796, 15922, -24900, 33886,
-40608, 43117, -40608, 33886, -24900, 15922, -8796, 4258, -1872,   757,
-264, 70, -12, 1]
K.<r> = NumberField(R(pol_rep))
print K.subfield(K(1))

[...]
ValueError: 1 is not a root of the defining polynomial of Number Field in r0
with defining polynomial x

Replace the last line by print K.subfield(K(0)) and I get

[...]
SignalError: Segmentation fault

Replace pol_rep by [1, 1, 0, 1] and everything is fine though.

Best,
Jeroen

Looking at the subfield() code reveals more basic problems:

one = K(1)
one.minpoly()
x
one.charpoly()
x^24
# but
one.charpoly(algorithm='sage').factor()
(x - 1)^24

so there is a problem in getting the char poly of some number field
elements via pari.  This is serious!

This is about the Sage<->pari interface

sage: pari(K.one())
Mod(1, y^24 - 12*y^23 + 70*y^22 - 264*y^21 + 757*y^20 - 1872*y^19 + 4258*y^18 - 8796*y^17 + 15922*y^16 - 24900*y^15 + 33886*y^14 - 40608*y^13 + 43117*y^12 - 40608*y^11 + 33886*y^10 - 24900*y^9 + 15922*y^8 - 8796*y^7 + 4258*y^6 - 1872*y^5 + 757*y^4 - 264*y^3 + 70*y^2 - 12*y + 1)
sage: pari(K.one()).charpoly()
x^24
sage: pari(K.one()).minpoly()
x

Curiously, it is perfectly fine in a gp console

? a = Mod(1, y^24 - 12*y^23 + 70*y^22 - 264*y^21 + 757*y^20 - 1872*y^19 + 4258*y^18 - 8796*y^17 + 15922*y^16 - 24900*y^15 + 33886*y^14 - 40608*y^13 + 43117*y^12 - 40608*y^11 + 33886*y^10 - 24900*y^9 + 15922*y^8 - 8796*y^7 + 4258*y^6 - 1872*y^5 + 757*y^4 - 264*y^3 + 70*y^2 - 12*y + 1);
? charpoly(a)
%1 = x^24 - 24*x^23 + 276*x^22 - 2024*x^21 + 10626*x^20 - 42504*x^19 + 134596*x^18 - 346104*x^17 + 735471*x^16 - 1307504*x^15 + 1961256*x^14 - 2496144*x^13 + 2704156*x^12 - 2496144*x^11 + 1961256*x^10 - 1307504*x^9 + 735471*x^8 - 346104*x^7 + 134596*x^6 - 42504*x^5 + 10626*x^4 - 2024*x^3 + 276*x^2 - 24*x + 1
? minpoly(a)
%2 = x - 1

Vincent

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to