]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: tweak a zero test.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 22 Nov 2020 15:23:18 +0000 (10:23 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 22 Nov 2020 15:23:18 +0000 (10:23 -0500)
mjo/eja/eja_algebra.py

index 8219c5b4ff32b7acdb55de21aac53f657a11b20f..ec692e4f93b8f015f8813eb2653e70a053b66dff 100644 (file)
@@ -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)