From: Michael Orlitzky Date: Sun, 22 Nov 2020 15:23:18 +0000 (-0500) Subject: eja: tweak a zero test. X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=452398e489e1e45cd06ce010878eeb07c3e72dd5;p=sage.d.git eja: tweak a zero test. --- 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)