galois.Poly(coeffs: ArrayLike, field: type[Array] | None = None, order: 'desc' | 'asc' = 'desc')

Creates a polynomial f(x) over GF(pm).

The polynomial f(x)=adxd+ad1xd1++a1x+a0 with degree d has coefficients {ad,ad1,,a1,a0} in GF(pm).

Parameters:
coeffs: ArrayLike

The polynomial coefficients {ad,ad1,,a1,a0}.

field: type[Array] | None = None

The Galois field GF(pm) the polynomial is over.

  • None (default): If the coefficients are an Array, they won’t be modified. If the coefficients are not explicitly in a Galois field, they are assumed to be from GF(2) and are converted using galois.GF2(coeffs).

  • Array subclass: The coefficients are explicitly converted to this Galois field using field(coeffs).

order: 'desc' | 'asc' = 'desc'

The interpretation of the coefficient degrees.

  • "desc" (default): The first element of coeffs is the highest degree coefficient, i.e. {ad,ad1,,a1,a0}.

  • "asc": The first element of coeffs is the lowest degree coefficient, i.e. {a0,a1,,ad1,ad}.