# Defining Polynomial Basis and Generic Polynomials

Given a Extension Field , say GF(2*4) with modulus polynomial f(x), I would like to a) Define a polynomial basis [1,x,x^2,x^3] for its elements. b) Define a general polynomial as a0 + a1x + a2*x^2 +a^3. Currently for part (a) I am defining the basis as a tuple, but I have an inkling that it is the worst possible fix. Kindly suggest a better alternative and a solution for part (b).

edit retag close merge delete

Sort by » oldest newest most voted

Its kind of boring to do it in a univariate polynomial ring. This is what you want:

sage: R.<x,y,z> = PolynomialRing(GF(2*4, 'a'))
sage: I = R.ideal(x^2+y^2+z^2-4, x^2+2*y^2-5, x*z-1)
sage: I.vector_space_dimension()
4
sage: I.normal_basis()
[y*z, z, y, 1]

more

This gives an excellent pointer to go about part (a) of the problem. Regarding the second part, if I use the predefined function var to instantiate variables as : var(varname, domain = Fieldname) and then try something like varname * field_generator, sage returns the following error : Unsupported operand parent(s) for '*': 'Symbolic Ring' and 'Multiivariate Quotient Polynomial Ring. Any pointers as to how to proceed with defining a polynomial would be helpful. Thanks.