Logging to /Users/s/tmp/pari-11.16 GPRC Done. GP/PARI CALCULATOR Version 2.13.0 (released) i386 running darwin (x86-64/GMP-6.2.0 kernel) 64-bit version compiled: Oct 31 2020, Apple clang version 12.0.0 (clang-1200.0.32.21) threading engine: single (readline v8.0 enabled, extended help enabled) Copyright (C) 2000-2020 The PARI Group PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER. Type ? for help, \q to quit. Type ?17 for how to get moral (and possibly technical) support. parisizemax = 900001792, primelimit = 1000000 (16:49) gp > factormod(polcyclo(5),2)] *** syntax error, unexpected ']', expecting $end: factormod(polcyclo(5),2)] *** ^- (16:49) gp > factormod(polcyclo(5),2) %1 = [Mod(1, 2)*x^4 + Mod(1, 2)*x^3 + Mod(1, 2)*x^2 + Mod(1, 2)*x + Mod(1, 2) 1] (16:49) gp > ?factorff factorff(x,{p},{a}): obsolete, use factormod. (16:50) gp > ??factormod factormod(f,{D},{flag = 0}): Factors the polynomial f over the finite field defined by the domain D as follows: * D = p a prime: factor over F_p; * D = [T,p] for a prime p and T(y) an irreducible polynomial over F_p: factor over F_p[y]/(T) (as usual the main variable of T must have lower priority than the main variable of f); * D a t_FFELT: factor over the attached field; * D omitted: factor over the field of definition of f, which must be a finite field. The coefficients of f must be operation-compatible with the corresponding finite field. The result is a two-column matrix, the first column being the irreducible polynomials dividing f, and the second the exponents. By convention, the 0 polynomial factors as 0^1; a nonzero constant polynomial has empty factorization, a 0 x 2 matrix. The irreducible factors are ordered by increasing degree and the result is canonical: it will not change across multiple calls or sessions. ? factormod(x^2 + 1, 3) \\ over F_3 %1 = [Mod(1, 3)*x^2 + Mod(1, 3) 1] ? liftall( factormod(x^2 + 1, [t^2+1, 3]) ) \\ over F_9 %2 = [ x + t 1] /*-- (type RETURN to continue) --*/ [x + 2*t 1] \\ same, now letting GP choose a model ? T = ffinit(3,2,'t) %3 = Mod(1, 3)*t^2 + Mod(1, 3)*t + Mod(2, 3) ? liftall( factormod(x^2 + 1, [T, 3]) ) %4 = \\ t is a root of T ! [ x + (t + 2) 1] [x + (2*t + 1) 1] ? t = ffgen(t^2+Mod(1,3)); factormod(x^2 + t^0) \\ same using t_FFELT %5 = [ x + t 1] [x + 2*t 1] ? factormod(x^2+Mod(1,3)) %6 = [Mod(1, 3)*x^2 + Mod(1, 3) 1] ? liftall( factormod(x^2 + Mod(Mod(1,3), y^2+1)) ) %7 = [ x + y 1] [x + 2*y 1] If flag is nonzero, outputs only the degrees of the irreducible polynomials (for example to compute an L-function). By convention, a constant polynomial (including the 0 /*-- (type RETURN to continue) --*/ polynomial) has empty factorization. The degrees appear in increasing order but need not correspond to the ordering with flag = 0 when multiplicities are present. ? f = x^3 + 2*x^2 + x + 2; ? factormod(f, 5) \\ (x+2)^2 * (x+3) %1 = [Mod(1, 5)*x + Mod(2, 5) 2] [Mod(1, 5)*x + Mod(3, 5) 1] ? factormod(f, 5, 1) \\ (deg 1) * (deg 1)^2 %2 = [1 1] [1 2] The library syntax is GEN factormod0(GEN f, GEN D = NULL, long flag). (16:50) gp > factormod(polcyclo(5),4) *** at top-level: factormod(polcyclo(5),4) *** ^------------------------ *** factormod: impossible inverse in Fl_inv: Mod(2, 4). *** Break loop: type 'break' to go back to GP prompt break> break (16:50) gp > liftall(factormod(polcyclo(5),[t^2+t+1,2])) %2 = [ x^2 + t*x + 1 1] [x^2 + (t + 1)*x + 1 1] (16:51) gp > polcyclo(5) %3 = x^4 + x^3 + x^2 + x + 1 (16:52) gp > liftall(factormod(polcyclo(5),[w^2+w+1,2])) %4 = [ x^2 + w*x + 1 1] [x^2 + (w + 1)*x + 1 1] (16:52) gp > %4[1] *** at top-level: %4[1] *** ^--- *** incorrect type in _[_] OCcompo1 [not a vector] (t_MAT). *** Break loop: type 'break' to go back to GP prompt break> break (16:52) gp > %4[1,1] %5 = x^2 + w*x + 1 (16:52) gp > matfrobenius(%) *** at top-level: matfrobenius(%) *** ^--------------- *** matfrobenius: incorrect type in matfrobenius (t_POL). *** Break loop: type 'break' to go back to GP prompt break> break (16:52) gp > ?matfrobenius matfrobenius(M,{flag},{v='x}): return the Frobenius form of the square matrix M. If flag is 1, return only the elementary divisors as a vector of polynomials in the variable v. If flag is 2, return a two-components vector [F,B] where F is the Frobenius form and B is the basis change so that M=B^-1*F*B. (16:52) gp > ??matfrobenius matfrobenius(M,{flag},{v = 'x}): Returns the Frobenius form of the square matrix M. If flag = 1, returns only the elementary divisors as a vector of polynomials in the variable v. If flag = 2, returns a two-components vector [F,B] where F is the Frobenius form and B is the basis change so that M = B^{-1}FB. The library syntax is GEN matfrobenius(GEN M, long flag, long v = -1) where v is a variable number. (16:54) gp > ???matfrobenius matfrobenius (16:54) gp > w=Mod(z,z^2+z+1) %6 = Mod(z, z^2 + z + 1) (16:54) gp > M=[ *** syntax error, unexpected $end: M=[ *** ^- (16:55) gp > [0,-1;1,w] %7 = [0 -1] [1 Mod(z, z^2 + z + 1)] (16:55) gp > M=[0,-1;1,w] %8 = [0 -1] [1 Mod(z, z^2 + z + 1)] (16:55) gp > charpoly(M) %9 = x^2 + Mod(-z, z^2 + z + 1)*x + Mod(1, z^2 + z + 1) (16:56) gp > lift(%) %10 = x^2 - z*x + 1 (16:56) gp > [0,-1;1,-w] %11 = [0 -1] [1 Mod(-z, z^2 + z + 1)] (16:56) gp > lift(%) %12 = [0 -1] [1 -z] (16:56) gp > M=[0,-1;1,-w] %13 = [0 -1] [1 Mod(-z, z^2 + z + 1)] (16:56) gp > charpoly(%) %14 = x^2 + Mod(z, z^2 + z + 1)*x + Mod(1, z^2 + z + 1) (16:56) gp > lift(%) %15 = x^2 + z*x + 1