X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;ds=inline;f=mjo%2Feja%2Feja_element.py;h=f44bee1c3f20d3040f0f77d8ff472b08c1bb5e9e;hb=9f91faac758f0ef3a1ea7b1ad1cb506e73735d89;hp=575c2a4754ae261f284c53de4d423011c9bf5418;hpb=c16c11d5b4cd015b6d7516a175a92f46e03bd2d7;p=sage.d.git diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index 575c2a4..f44bee1 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -9,7 +9,7 @@ from sage.modules.with_basis.indexed_element import IndexedFreeModuleElement # TODO: make this unnecessary somehow. from sage.misc.lazy_import import lazy_import lazy_import('mjo.eja.eja_algebra', 'FiniteDimensionalEuclideanJordanAlgebra') -lazy_import('mjo.eja.eja_subalgebra', +lazy_import('mjo.eja.eja_element_subalgebra', 'FiniteDimensionalEuclideanJordanElementSubalgebra') from mjo.eja.eja_operator import FiniteDimensionalEuclideanJordanAlgebraOperator from mjo.eja.eja_utils import _mat2vec @@ -1270,10 +1270,13 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): sage: from mjo.eja.eja_algebra import random_eja - TESTS:: + TESTS: + + Ensure that we can find an idempotent in a non-trivial algebra + where there are non-nilpotent elements:: sage: set_random_seed() - sage: J = random_eja() + sage: J = random_eja(nontrivial=True) sage: x = J.random_element() sage: while x.is_nilpotent(): ....: x = J.random_element() @@ -1282,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!")