classmethod galois.Poly.Degrees(degrees: , coeffs: = None, field: = None) Self

Constructs a polynomial over $$\mathrm{GF}(p^m)$$ from its non-zero degrees.

Parameters:
degrees:

The polynomial degrees with non-zero coefficients.

coeffs: = None

The corresponding non-zero polynomial coefficients. The default is None which corresponds to all ones.

field: = None

The Galois field $$\mathrm{GF}(p^m)$$ 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 $$\mathrm{GF}(2)$$ and are converted using galois.GF2(coeffs).

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

Returns:

The polynomial $$f(x)$$.

Examples

Construct a polynomial over $$\mathrm{GF}(2)$$ by specifying the degrees with non-zero coefficients.

In : galois.Poly.Degrees([3, 1, 0])
Out: Poly(x^3 + x + 1, GF(2))


Construct a polynomial over $$\mathrm{GF}(3^5)$$ by specifying the degrees with non-zero coefficients and their coefficient values.

In : GF = galois.GF(3**5)

In : galois.Poly.Degrees([3, 1, 0], coeffs=[214, 73, 185], field=GF)
Out: Poly(214x^3 + 73x + 185, GF(3^5))