Galois Fields

This section contains classes and functions for creating Galois field arrays.

Galois field classes

Class factory functions

GF(order[, irreducible_poly, ...])

Creates a FieldArray subclass for \(\mathrm{GF}(p^m)\).

Field(order[, irreducible_poly, ...])

Alias of GF().

Abstract base classes

FieldArray(x[, dtype, copy, order, ndmin])

A ndarray subclass over \(\mathrm{GF}(p^m)\).

Pre-made FieldArray subclasses

GF2(x[, dtype, copy, order, ndmin])

A ndarray subclass over \(\mathrm{GF}(2)\).

Prime field functions

Primitive roots

primitive_root(n[, start, stop, method])

Finds a primitive root modulo \(n\) in the range [start, stop).

primitive_roots(n[, start, stop, reverse])

Iterates through all primitive roots modulo \(n\) in the range [start, stop).

is_primitive_root(g, n)

Determines if \(g\) is a primitive root modulo \(n\).

Extension field functions

Irreducible polynomials

irreducible_poly(order, degree[, method])

Returns a monic irreducible polynomial \(f(x)\) over \(\mathrm{GF}(q)\) with degree \(m\).

irreducible_polys(order, degree[, reverse])

Iterates through all monic irreducible polynomials \(f(x)\) over \(\mathrm{GF}(q)\) with degree \(m\).

Primitive polynomials

primitive_poly(order, degree[, method])

Returns a monic primitive polynomial \(f(x)\) over \(\mathrm{GF}(q)\) with degree \(m\).

primitive_polys(order, degree[, reverse])

Iterates through all monic primitive polynomials \(f(x)\) over \(\mathrm{GF}(q)\) with degree \(m\).

conway_poly(characteristic, degree)

Returns the Conway polynomial \(C_{p,m}(x)\) over \(\mathrm{GF}(p)\) with degree \(m\).

matlab_primitive_poly(characteristic, degree)

Returns Matlab's default primitive polynomial \(f(x)\) over \(\mathrm{GF}(p)\) with degree \(m\).

Primitive elements

primitive_element(irreducible_poly[, method])

Finds a primitive element \(g\) of the Galois field \(\mathrm{GF}(q^m)\) with degree-\(m\) irreducible polynomial \(f(x)\) over \(\mathrm{GF}(q)\).

primitive_elements(irreducible_poly)

Finds all primitive elements \(g\) of the Galois field \(\mathrm{GF}(q^m)\) with degree-\(m\) irreducible polynomial \(f(x)\) over \(\mathrm{GF}(q)\).

is_primitive_element(element, irreducible_poly)

Determines if \(g\) is a primitive element of the Galois field \(\mathrm{GF}(q^m)\) with degree-\(m\) irreducible polynomial \(f(x)\) over \(\mathrm{GF}(q)\).


Last update: May 18, 2022