alpha vs. x as polynomial variable in GF(q^m)? #570
-
(moved this from the issue for clarification: #569) I just started using Galois today and really liked it from the very first moment. Is that on purpose and do I do not get the math right? Should not all polynomials in the extension field be defined over Adding to that: if one takes powers of the primitive element Example:
I guess I have some twisted thought in my mind. Can you help me? Is this behavior correct/expected? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The convention I used is that if poly = galois.primitive_poly(2, 4)
assert poly.is_primitive()
GF = galois.GF(2**4, irreducible_poly=poly, repr="poly")
print(GF.primitive_element) # Primitive element is x, so we replace x with alpha
print(GF.elements)
α
[ 0 1 α α + 1
α^2 α^2 + 1 α^2 + α α^2 + α + 1
α^3 α^3 + 1 α^3 + α α^3 + α + 1
α^3 + α^2 α^3 + α^2 + 1 α^3 + α^2 + α α^3 + α^2 + α + 1] poly = [f for f in galois.irreducible_polys(2, 4) if not f.is_primitive()][0]
assert not poly.is_primitive()
GF = galois.GF(2**4, irreducible_poly=poly, repr="poly")
print(GF.primitive_element) # Primitive element is alpha = x + 1
print(GF.elements)
x + 1
[ 0 1 x x + 1
x^2 x^2 + 1 x^2 + x x^2 + x + 1
x^3 x^3 + 1 x^3 + x x^3 + x + 1
x^3 + x^2 x^3 + x^2 + 1 x^3 + x^2 + x x^3 + x^2 + x + 1] |
Beta Was this translation helpful? Give feedback.
The convention I used is that if
x
is a primitive element of the field, which happens when the irreducible polynomial is primitive, thenalpha = x
so I write the polynomial indeterminate asalpha
. The powers ofalpha
always generate the multiplicative group. Whenalpha
is more complicated thanx
, egx + 1
, I leave the polynomial indeterminate asx
. I think this is a standard convention. Here's an example.