From 452398e489e1e45cd06ce010878eeb07c3e72dd5 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 22 Nov 2020 10:23:18 -0500 Subject: [PATCH] eja: tweak a zero test. --- mjo/eja/eja_algebra.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 8219c5b..ec692e4 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -2201,9 +2201,8 @@ class BilinearFormEJA(RationalBasisEuclideanJordanAlgebra): Return a random instance of this algebra. """ n = ZZ.random_element(cls._max_random_instance_size() + 1) - if n == 0: - # Special case needed since we use (n-1) below. - B = matrix.identity(field, 0) + if n.is_zero(): + B = matrix.identity(field, n) return cls(B, field, **kwargs) B11 = matrix.identity(field,1) -- 2.44.2