<< gf_is_primitive_polynomial Primitive and minimal polynomials gf_primitive_polynomial >>

Galois Fields >> Galois Fields > Primitive and minimal polynomials > gf_minimal_polynomial

gf_minimal_polynomial

Minimal polynomial over GF(p) of a field element

Syntax

m = gf_minimal_polynomial(F, e)
m = gf_minimal_polynomial(p, n, e)

Arguments

F

A field created by gf_create_field.

p

Prime number: the characteristic of the field, at most 2^20.

n

Degree of the field: an integer from 1 to 20, with p^n ≤ 2^20. With this syntax, the field uses the primitive polynomial returned by gf_default_primitive_polynomial.

e

The element, as an integer.

  • For n = 1: the element itself, in 0 .. p-1.

  • For n > 1: the exponent k of α^k, in -1 .. p^n - 2. Use -1 for the zero element. gf_to_exponential converts an element given by its coefficients to this form.

m

The minimal polynomial: a row of n + 1 coefficients, constant term first. Its degree d divides n; when d < n, the row is padded with zeros on the right.

Description

The minimal polynomial of an element β of GF(p^n) is the monic polynomial of lowest degree with coefficients in GF(p) that has β as a root. It is the product of (x - γ) over the distinct conjugates γ = β, β^p, β^(p²), ... of β.

Some particular cases:

Examples

F = gf_create_field(2, 4);        // 1 + x + x^4
gf_minimal_polynomial(F, 1)       // [1 1 0 0 1]: alpha has the field's polynomial
gf_minimal_polynomial(F, 3)       // [1 1 1 1 1]
gf_minimal_polynomial(F, 5)       // [1 1 1 0 0]: alpha^5 lies in the subfield GF(4)
gf_minimal_polynomial(F, 0)       // [1 1 0 0 0]: 1 + x for the element 1
gf_minimal_polynomial(F, -1)      // [0 1 0 0 0]: x for the element 0

// Element given by its coefficients
k = gf_to_exponential(F, [1 1 0 1]);
gf_minimal_polynomial(F, k)

// Without creating the field first
gf_minimal_polynomial(7, 1, 3)    // [4 1]: x - 3

See also

History

VersionDescription
2.0.0

Refactoring of the function/toolbox.


Report an issue
<< gf_is_primitive_polynomial Primitive and minimal polynomials gf_primitive_polynomial >>