<< gf_order Fields Primitive and minimal polynomials >>

Galois Fields >> Galois Fields > Fields > gf_primitive_elements

gf_primitive_elements

Primitive elements (generators of the multiplicative group) of a finite field

Syntax

g = gf_primitive_elements(F)

Arguments

F

A field created by gf_create_field.

g

The primitive elements.

  • For n = 1: a row of integers in increasing order (the primitive roots modulo p).

  • For n > 1: a matrix with one element per row: α^k for every k in 1 .. p^n - 2 coprime to p^n - 1, in increasing order of k.

Description

An element is primitive when its powers give every non-zero element of the field, that is, when its multiplicative order is p^n - 1. A field of order q has φ(q - 1) primitive elements, φ being Euler's totient function.

For n > 1, α (a root of the primitive polynomial) is primitive, and α^k is primitive exactly when gcd(k, q - 1) = 1. For n = 1, the primitive elements are the powers r^k of the root r of the field's degree-1 polynomial, for the same values of k.

Examples

// Primitive roots modulo 7
gf_primitive_elements(gf_create_field(7, 1))   // [3 5]

// GF(16): 8 primitive elements, alpha^k for k coprime to 15
F = gf_create_field(2, 4);
g = gf_primitive_elements(F);
gf_to_exponential(F, g)'   // [1 2 4 7 8 11 13 14]

See also

History

VersionDescription
2.0.0

Refactoring of the function/toolbox. The p ≤ 107 limit for prime fields was removed.


Report an issue
<< gf_order Fields Primitive and minimal polynomials >>