TESTS:
Ensure that we can find an idempotent in a non-trivial algebra
- where there are non-nilpotent elements::
+ where there are non-nilpotent elements, or that we get the dumb
+ solution in the trivial algebra::
sage: set_random_seed()
- sage: J = random_eja(nontrivial=True)
+ sage: J = random_eja()
sage: x = J.random_element()
- sage: while x.is_nilpotent():
+ sage: while x.is_nilpotent() and not J.is_trivial():
....: x = J.random_element()
sage: c = x.subalgebra_idempotent()
sage: c^2 == c