]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: allow subalgebra_idempotent() to work in trivial EJAs.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 10 Nov 2019 15:47:42 +0000 (10:47 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 10 Nov 2019 15:47:42 +0000 (10:47 -0500)
Every element is nilpotent in a trivial EJA, but we also know the only
idempotent element in such an algebra: its sole occupant. So return it.

mjo/eja/eja_element.py

index 3491b69230b0d430fdfa936b3399ebfc88259988..f44bee1c3f20d3040f0f77d8ff472b08c1bb5e9e 100644 (file)
@@ -1285,6 +1285,9 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement):
             True
 
         """
+        if self.parent().is_trivial():
+            return self
+
         if self.is_nilpotent():
             raise ValueError("this only works with non-nilpotent elements!")