Primitive elements (generators of the multiplicative group) of a finite field
g = gf_primitive_elements(F)
A field created by gf_create_field.
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.
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.
| Version | Description |
| 2.0.0 | Refactoring of the function/toolbox. The p ≤ 107 limit for prime fields was removed. |