0

There is trouble with PARI/GP. Does anyone know to operate the right function/command in PARI/GP, for fining the minimal polynomial of

[y = x^2-x+1 (mod x^6+x^5+x^4+x^3+x^2+x+1)]

PARI/GP gives this error:

gp > minpoly(x^6+x^5+x^4+x^3+x^2+x+1,{v=x^2-x+1})
  ***   at top-level: ...(x^6+x^5+x^4+x^3+x^2+x+1,v=x^2-x+1)
  ***                                             ^----------
  ***   incorrect type in evaluator [variable name expected] (t_INT).

Thanks for helping.

I also try:

(11:36) gp > elt = Mod(x^2-x+1, x^6+x^5+x^4+x^3+x^2+x+1)
%52 = Mod(43, 39991)
(11:36) gp > poly = minpoly(elt, v='y)
%53 = Mod(1, 39991)*y + Mod(39948, 39991)
(11:36) gp > subst(poly, variable(poly), elt)
%54 = Mod(0, 39991)
(11:36) gp >

Is this supposed to be a script?

Piotr Semenov
  • 1,761
  • 16
  • 24
J. Linne
  • 275
  • 4
  • 15

1 Answers1

2

In fact, you want the following call:

elt = Mod('x^2-'x+1, 'x^6+'x^5+'x^4+'x^3+'x^2+'x+1)
poly = minpoly(elt, v='y)
gp > y^6 - 6*y^5 + 15*y^4 - 20*y^3 + 22*y^2 - 6*y + 1

Just to verify:

subst(poly, variable(poly), elt)
gp > 0

Parameter v for minpoly just stands for the variable name, not the modulo.

Piotr Semenov
  • 1,761
  • 16
  • 24
  • So, it the code a script? I posted more info to the question, but I don't have the same result you came up with. – J. Linne Feb 19 '17 at 19:38
  • It seems that `x` is not a polynomial variable but is an integer in your PARI/GP session. You can `kill(x)` or just type `'x` everywhere you want a polynomial variable. So I fixed my answer, now it should work in case if `x` is a user-defined variable. – Piotr Semenov Feb 19 '17 at 19:45
  • @J.Linne If my answer works for you, please kindly accept :) – Piotr Semenov Feb 19 '17 at 21:03
  • Thanks, @Piotr Semenov yes the answer works. The polynomials aren't how I expected them to be like, but that's nothing to do with the coding. Everything works fine. – J. Linne Feb 20 '17 at 02:39
  • @J.Linne By the way, do you want the polynomials over real numbers? If not, I can help you with polynomials over finite fields in PARI/GP. – Piotr Semenov Feb 20 '17 at 07:33
  • The polynomials should not be equivalent for any two values, see here: https://www.dropbox.com/s/t2kx4twbeux6vva/polynomials%20in%20fields.txt?dl=0 We are looking at Method B, NOT Method A. Also, we want the polynomials to "share" the same root properties (for any polynomial we are trying to find another one defining the same field). – J. Linne Feb 22 '17 at 08:19