mhostetter/galois ? reverse-engineered prompt
Reverse engineered prompt
Build me a Python library that lets me work with finite fields like they were normal NumPy arrays.
I want to be able to create a field with something like GF = galois.GF(3**5) and then make arrays from it, do addition, multiplication, division, powers, and matrix style operations, all inside that field instead of regular real numbers. It should feel natural with NumPy, so basic array functions and linear algebra still work.
Also include helpers for finite field polynomials, finding irreducible and primitive polynomials, and a few number theory tools like prime tests and factorization. If it’s not too much, add support for BCH and Reed Solomon style error correction examples too.
Please make it fast and practical, using modern Python tools, and set it up so the package has tests and docs. If you need to look up current NumPy or Numba details online, go ahead.