]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: fix a rank test to work on trivial algebras.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 15 Oct 2019 12:15:43 +0000 (08:15 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 15 Oct 2019 12:15:43 +0000 (08:15 -0400)
mjo/eja/eja_algebra.py

index 658957556cf382a62d0d252359ce735019996973..56be0fa327c83d56bd6d9b2f4283b144ee47806f 100644 (file)
@@ -686,11 +686,15 @@ class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule):
         TESTS:
 
         Ensure that every EJA that we know how to construct has a
-        positive integer rank::
+        positive integer rank, unless the algebra is trivial in
+        which case its rank will be zero::
 
             sage: set_random_seed()
-            sage: r = random_eja().rank()
-            sage: r in ZZ and r > 0
+            sage: J = random_eja()
+            sage: r = J.rank()
+            sage: r in ZZ
+            True
+            sage: r > 0 or (r == 0 and J.is_trivial())
             True
 
         """