From 6be3d860b5c77c7f57b8c0b9e7c51e3f6ee6a9cd Mon Sep 17 00:00:00 2001 From: mhostetter Date: Fri, 6 Dec 2024 15:23:37 -0500 Subject: [PATCH] Add unit test for #573 --- tests/fields/test_squares.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/fields/test_squares.py b/tests/fields/test_squares.py index 3655daddd..dcfbae297 100644 --- a/tests/fields/test_squares.py +++ b/tests/fields/test_squares.py @@ -255,3 +255,15 @@ def test_prime_extension_field_3(): b = x.is_square() assert np.array_equal(b, [True, True, True, True, True, False, True, False, True, False, False, True, True, False, False, False, False, False, True, True, False, False, True, False, True]) # fmt: skip assert isinstance(b, np.ndarray) + + +def test_issue_573(): + """ + https://github.com/mhostetter/galois/issues/573 + """ + GF = galois.GF(11**2) + squares = GF.squares + square_roots = np.sqrt(squares) + + assert np.array_equal(square_roots**2, squares) + assert type(square_roots) is GF