<< Primitive and minimal polynomials Primitive and minimal polynomials gf_is_primitive_polynomial >>

Galois Fields >> Galois Fields > Primitive and minimal polynomials > gf_default_primitive_polynomial

gf_default_primitive_polynomial

Default primitive polynomial of a given degree over GF(p)

Syntax

f = gf_default_primitive_polynomial(p, n)

Arguments

p

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

n

Degree: an integer from 1 to 20, with p^n ≤ 2^20.

f

The primitive polynomial: a row of n + 1 coefficients, constant term first.

Description

This is the polynomial that gf_create_field uses when no primitive polynomial is given.

Examples

gf_default_primitive_polynomial(2, 4)   // [1 1 0 0 1]: 1 + x + x^4
gf_default_primitive_polynomial(2, 8)   // [1 0 1 1 1 0 0 0 1]
gf_default_primitive_polynomial(3, 2)   // [2 1 1]: 2 + x + x^2
gf_default_primitive_polynomial(7, 1)   // [4 1]: x - 3, 3 being the smallest primitive root mod 7

See also

History

VersionDescription
2.0.0

Refactoring of the function/toolbox. Now available for any degree n.


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