"""
Return whether or not some power of this element is zero.
- The superclass method won't work unless we're in an
- associative algebra, and we aren't. However, we generate
- an assocoative subalgebra and we're nilpotent there if and
- only if we're nilpotent here (probably).
+ ALGORITHM:
+
+ We use Theorem 5 in Chapter III of Koecher, which says that
+ an element ``x`` is nilpotent if and only if ``x.operator()``
+ is nilpotent. And it is a basic fact of linear algebra that
+ an operator on an `n`-dimensional space is nilpotent if and
+ only if, when raised to the `n`th power, it equals the zero
+ operator (for example, see Axler Corollary 8.8).
SETUP::
- sage: from mjo.eja.eja_algebra import random_eja
+ sage: from mjo.eja.eja_algebra import (JordanSpinEJA,
+ ....: random_eja)
+
+ EXAMPLES::
+
+ sage: J = JordanSpinEJA(3)
+ sage: x = sum(J.gens())
+ sage: x.is_nilpotent()
+ False
TESTS:
True
"""
- # The element we're going to call "is_nilpotent()" on.
- # Either myself, interpreted as an element of a finite-
- # dimensional algebra, or an element of an associative
- # subalgebra.
- elt = None
-
- if self.parent().is_associative():
- elt = FiniteDimensionalAlgebraElement(self.parent(), self)
- else:
- V = self.span_of_powers()
- assoc_subalg = self.subalgebra_generated_by()
- # Mis-design warning: the basis used for span_of_powers()
- # and subalgebra_generated_by() must be the same, and in
- # the same order!
- elt = assoc_subalg(V.coordinates(self.vector()))
-
- # Recursive call, but should work since elt lives in an
- # associative algebra.
- return elt.is_nilpotent()
+ P = self.parent()
+ zero_operator = P.zero().operator()
+ return self.operator()**P.dimension() == zero_operator
def is_regular(self):