<< Conversions Conversions gf_to_polynomial >>

Galois Fields >> Galois Fields > Conversions > gf_to_exponential

gf_to_exponential

Converts elements of GF(p^n) to exponential notation α^k

Syntax

k = gf_to_exponential(F, a)
k = gf_to_exponential(F, a, format)

Arguments

F

An extension field GF(p^n), n > 1, created by gf_create_field.

a

Elements: a matrix with n columns of integers in 0 .. p-1, one element per row (constant term first).

format

"e" (default) to return exponents, or "c" to return strings.

k

Column vector with one entry per row of a.

  • With "e": the integer k such that the element is α^k, in 0 .. p^n - 2, or -1 for the zero element.

  • With "c": the strings "x^k", where x stands for α, or "0" for the zero element.

Description

gf_to_exponential finds the discrete logarithm of each element to the base α, the root of the field's primitive polynomial. This turns multiplication into addition of exponents modulo p^n - 1. gf_minimal_polynomial takes its element argument in this form.

The inverse conversion is a lookup in the element table: α^k is F(4)(k + 2, :). Only extension fields (n > 1) are supported.

Examples

F = gf_create_field(2, 4);
gf_to_exponential(F, [0 1 1 0])            // 5: alpha + alpha^2 = alpha^5
gf_to_exponential(F, [0 0 0 0; 0 1 1 0], "c")   // ["0"; "x^5"]
gf_to_exponential(F, F(4))                 // -1, 0, 1, ..., 14

// Back from an exponent to coefficients
F(4)(5 + 2, :)                             // [0 1 1 0]

See also

History

VersionDescription
2.0.0

Refactoring of the function/toolbox.


Report an issue
<< Conversions Conversions gf_to_polynomial >>