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

Support multivariate polynomials #457

Open
mjcrock opened this issue Dec 25, 2022 · 0 comments
Open

Support multivariate polynomials #457

mjcrock opened this issue Dec 25, 2022 · 0 comments
Labels
feature-request New feature or request poly Related to polynomials

Comments

@mjcrock
Copy link

mjcrock commented Dec 25, 2022

The galois.Poly class currently supports univariate polynomials, but not multivariate polynomials, over $GF(p^m)$. I would like to propose supporting this functionality in galois.

The following code snippet demonstrates how to generate a random univariate polynomial which we may evaluate on scalars, arrays, or square matrices:

from galois import GF, Poly

# specify desired polynomial parameters
field, degree = GF(3**5), 4

# randomly generate a univariate polynomial, e.g.
# Poly(41x^4 + 16x^3 + 147x^2 + 232x + 202, GF(3^5))
f_uni = Poly.Random(degree, field)

By contrast, the following pseudo-code demonstrates how one might generate a random multivariate polynomial which we may evaluate on arrays of shape (..., n_variables) only:

from galois import GF, Poly

# specify desired polynomial parameters
field, n_variables, degree = GF(3**5), 2, 2

# randomly generate a multivariate polynomial, e.g.
# Poly(241x_1^2 + 207x_0^2 + 36x_1x_0 + 5x_1 + 19x_1 + 112, GF(3^5))
f_multi = Poly.Random(degree, n_variables, field)

I look forward to hearing any thoughts and suggestions!

@mhostetter mhostetter added feature-request New feature or request poly Related to polynomials labels Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request poly Related to polynomials
Projects
None yet
Development

No branches or pull requests

2 participants