return self.span_of_powers().dimension()
+ def matrix(self):
+ """
+ Return the matrix that represents left- (or right-)
+ multiplication by this element in the parent algebra.
+
+ We have to override this because the superclass method
+ returns a matrix that acts on row vectors (that is, on
+ the right).
+ """
+ fda_elt = FiniteDimensionalAlgebraElement(self.parent(), self)
+ return fda_elt.matrix().transpose()
+
+
def subalgebra_generated_by(self):
"""
Return the associative subalgebra of the parent EJA generated
"""
Find an idempotent in the associative subalgebra I generate
using Proposition 2.3.5 in Baes.
+
+ TESTS::
+
+ sage: set_random_seed()
+ sage: J = eja_rn(5)
+ sage: c = J.random_element().subalgebra_idempotent()
+ sage: c^2 == c
+ True
+ sage: J = eja_ln(5)
+ sage: c = J.random_element().subalgebra_idempotent()
+ sage: c^2 == c
+ True
+
"""
if self.is_nilpotent():
raise ValueError("this only works with non-nilpotent elements!")