Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better display of polynomials over fields with non-primitive polys #329

Open
mhostetter opened this issue Mar 31, 2022 · 0 comments
Open
Labels
poly Related to polynomials

Comments

@mhostetter
Copy link
Owner

A field with a non-primitive polynomial with display="poly" will use the polynomial indeterminate x instead of α. When creating a polynomial over that field, these indeterminates get confused.

Primitive

In [1]: import galois

In [2]: GF = galois.GF(2**8, display="poly")

In [3]: print(GF)
Galois Field:
  name: GF(2^8)
  characteristic: 2
  degree: 8
  order: 256
  irreducible_poly: x^8 + x^4 + x^3 + x^2 + 1
  is_primitive_poly: True
  primitive_element: x

In [4]: f = galois.Poly([171, 0, 0, 53], field=GF); f
Out[4]: Poly((α^7 + α^5 + α^3 + α + 1)x^3 + (α^5 + α^4 + α^2 + 1), GF(2^8))

Non-primitive

In [1]: import galois

In [2]: GF = galois.GF(2**8, irreducible_poly="x^8 + x^4 + x^3 + x + 1", display="poly")

In [3]: print(GF)
Galois Field:
  name: GF(2^8)
  characteristic: 2
  degree: 8
  order: 256
  irreducible_poly: x^8 + x^4 + x^3 + x + 1
  is_primitive_poly: False
  primitive_element: x + 1

In [4]: f = galois.Poly([171, 0, 0, 53], field=GF); f
Out[4]: Poly((x^7 + x^5 + x^3 + x + 1)x^3 + (x^5 + x^4 + x^2 + 1), GF(2^8))  # Too confusing!
@mhostetter mhostetter added the poly Related to polynomials label Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
poly Related to polynomials
Projects
None yet
Development

No branches or pull requests

1 participant