Aleksandr Lenin on Wed, 18 Mar 2020 16:08:29 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Tower field extensions in libPARI


Hello,

I am trying to build a 12-th degree extension of a prime finite field as
a degree-6 extension of degree-2 extension of F_p.

I seem to get a working solution in libPARI (working = doesn't crash nor
overflow the stack), but the results I get are somewhat unexpected. Let
me describe what I am doing in libPARI step-by step.

Let p = 11, hence F_11 is the base field.

In libPARI, it translates into the following lines of code:

GEN p = stoi(11);
GEN T = mkpoln(3,gen_1,gen_0,gen_1);  // T = x^2 + 1


Now that I have p and T, I can reduce any polynomials in Z[X] to
F_11[X]/(x^2+1). In example, x^2+1 is 0 in F_11^2, and the following
code works fine, the results are consistent.

FpXQ_red(mkpoln(3,gen_1,gen_0,gen_1),T,p);   // x^2 + 1 ---> 0
FpXQ_red(mkpoln(3,gen_1,gen_1,gen_1),T,p);   // x^2 + x + 1 ---> x
FpXQ_red(mkpoln(3,gen_1,gen_0,gen_0),T,p);   // x^2 ---> 10

So far so good. Next, I build a degree 6 extension of F_11^2 to obtain
F_11^12 = (F_11[X]/(x^2+1))[Y]/(y^6 + x + 3). First, I need to represent
polynomial y^6 + x + 3 as a polynomial in variable y, with the
coefficients being polynomials in F_11[X]/(x^2+1). I achieve this with
the following lines of code.

long var_y = fetch_user_var("y");   // activate variable y
// U = y^6 + (x + 3)
GEN U = mkpoln(7, pol_1(0), pol_0(0), pol_0(0), pol_0(0),
                  pol_0(0), pol_0(0), mkpoln(2,gen_1,stoi(3)));
setvarn(U,var_y);  // polynomial U in variable 'y'

Reading the libPARI manual I made an assumption that the classes of
functions to work with these polynomials are Fq_ or FpXQX_, I used the
latter, but tried Fq_ as well, the results are the same.

The call to FpXQX_nbfact(U,T,p) returns 1, which means that u^6 + x + 3
is irreducible over F_11^2.

Now, I would expect that U maps to 0 in F_11^2^6, but it appears it is
not the case in libPARI. The call to FpXQX_red(U,U,p) returns U instead
of 0.

The same happens with y^6, FpXQX_red() returns y^6, while I was
expecting to get 10x + 8.

// W = y^6
GEN W = mkpoln(7, pol_1(0), pol_0(0), pol_0(0), pol_0(0),
                  pol_0(0), pol_0(0), pol_0(0));
setvarn(W,var_y);

FpXQX_red(W,U,p);  // returns W

I need an advice here - am I using the wrong set of functions, or is
there anything I might be missing?

-- 
Aleksandr