]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: add is_regular() method on elements.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 29 Jun 2019 14:07:19 +0000 (10:07 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 03:19:01 +0000 (23:19 -0400)
mjo/eja/euclidean_jordan_algebra.py

index 835f76337f9449612bcd113de950afd011317107..60a7ba1ede07bac242eb9aef6bcf9b722340c595 100644 (file)
@@ -126,6 +126,30 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
                 return A.element_class(A, (self.matrix()**(n-1))*self.vector())
 
 
+        def is_regular(self):
+            """
+            Return whether or not this is a regular element.
+
+            EXAMPLES:
+
+            The identity element always has degree one, but any element
+            linearly-independent from it is regular::
+
+                sage: J = eja_ln(5)
+                sage: J.one().is_regular()
+                False
+                sage: e0, e1, e2, e3, e4 = J.gens() # e0 is the identity
+                sage: for x in J.gens():
+                ....:     (J.one() + x).is_regular()
+                False
+                True
+                True
+                True
+                True
+
+            """
+            return self.degree() == self.parent().rank()
+
         def span_of_powers(self):
             """
             Return the vector space spanned by successive powers of