X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_subalgebra.py;h=a3ad92a4f9f5acedc7a12c6c11971f0d9351c3a3;hb=13a49fd59d57cf34b026460ace004ddbd60d4b68;hp=7451e47bdbbbf2d58ce598aa3bb4e17ec42d5dae;hpb=ec7dbfb6ce0054f55280412e43870b4019abc40c;p=sage.d.git diff --git a/mjo/eja/eja_subalgebra.py b/mjo/eja/eja_subalgebra.py index 7451e47..a3ad92a 100644 --- a/mjo/eja/eja_subalgebra.py +++ b/mjo/eja/eja_subalgebra.py @@ -157,6 +157,12 @@ class FiniteDimensionalEuclideanJordanElementSubalgebra(FiniteDimensionalEuclide :: """ + if elt == 0: + # Just as in the superalgebra class, we need to hack + # this special case to ensure that random_element() can + # coerce a ring zero into the algebra. + return self.zero() + if elt in self.superalgebra(): coords = self.vector_space().coordinate_vector(elt.to_vector()) return self.from_vector(coords)