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

Error in calculating multiplication order #532

Closed
hhucchenyixiao opened this issue Jan 29, 2024 · 2 comments
Closed

Error in calculating multiplication order #532

hhucchenyixiao opened this issue Jan 29, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@hhucchenyixiao
Copy link

Hello,
I'm using galois 0.3.7 and ran into the following error when trying to find the multiplicative order of an element in GF(2**64-59)

gf_p = galois.GF(2**64-59)
gf_p(1).multiplicative_order()

This results in a ValueError:

File "f:\project\spinal_project\Ntt\sw\get_zeta.py", line 19, in <module>
  gf_p(1).multiplicative_order()
File "D:\software\miniconda\lib\site-packages\galois\_fields\_array.py", line 1048, in multiplicative_order
  y = np.power.outer(x, d)  # x^d -- the first divisor d for which x^d == 1 is the order of x
File "D:\software\miniconda\lib\site-packages\galois\_domains\_ufunc.py", line 682, in __array_ufunc__
  return getattr(field, field._OVERRIDDEN_UFUNCS[ufunc])(ufunc, method, inputs, kwargs, meta)
File "D:\software\miniconda\lib\site-packages\galois\_domains\_ufunc.py", line 481, in __call__
  self._verify_operands_first_field_second_int(ufunc, inputs, meta)
File "D:\software\miniconda\lib\site-packages\galois\_domains\_ufunc.py", line 251, in _verify_operands_first_field_second_int
  raise ValueError(
ValueError: Operation 'power' requires operands with type np.ndarray to have integer dtype, not float64.
@mhostetter mhostetter added the bug Something isn't working label Jan 29, 2024
@mhostetter
Copy link
Owner

Thanks for the report. I can reproduce. I'll investigate.

@mhostetter
Copy link
Owner

The fix will be released in v0.3.8. For now, you can install the fix this way:

python3 -m pip install git+https://github.com/mhostetter/galois.git@release/0.3.x

Feel free to re-open if you still have issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants