From 49cacb9b214c5a94bb8c95c5e78804d36340dd98 Mon Sep 17 00:00:00 2001 From: TDQuering <60886133+TDQuering@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:25:15 -0600 Subject: [PATCH] Update _calculate.py to fix square root computations. --- src/galois/_domains/_calculate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/galois/_domains/_calculate.py b/src/galois/_domains/_calculate.py index c93cd68cd..ae156cace 100644 --- a/src/galois/_domains/_calculate.py +++ b/src/galois/_domains/_calculate.py @@ -783,11 +783,12 @@ def implementation(self, a: Array) -> Array: ) p = self.field.characteristic + q = self.field.order - if p % 4 == 3: + if q % 4 == 3: roots = a ** ((self.field.order + 1) // 4) - elif p % 8 == 5: + elif q % 8 == 5: d = a ** ((self.field.order - 1) // 4) roots = self.field.Zeros(a.shape)