<< gf_primitive_polynomial Primitive and minimal polynomials Element arithmetic >>

Galois Fields >> Galois Fields > Primitive and minimal polynomials > gf_primitive_polynomials

gf_primitive_polynomials

All monic primitive polynomials of a given degree over GF(p)

Syntax

P = gf_primitive_polynomials(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.

P

Matrix with one polynomial per row, each with n + 1 coefficients, constant term first. There are φ(p^n - 1)/n rows.

Description

gf_primitive_polynomials lists every monic primitive polynomial of degree n over GF(p). Any of them can be passed to gf_create_field.

All p^n candidates are tested, so the time grows with p^n; the function is meant for small fields.

Examples

gf_primitive_polynomials(2, 4)   // [1 1 0 0 1; 1 0 0 1 1]
gf_primitive_polynomials(7, 1)   // [4 1; 2 1]: x - 3 and x - 5
size(gf_primitive_polynomials(3, 3), "r")   // 4

See also

History

VersionDescription
2.0.0

Refactoring of the function/toolbox.


Report an issue
<< gf_primitive_polynomial Primitive and minimal polynomials Element arithmetic >>