]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/eja/eja_subalgebra.py
eja: ensure that Sage doesn't think EJAs are associative.
[sage.d.git] / mjo / eja / eja_subalgebra.py
index 7451e47bdbbbf2d58ce598aa3bb4e17ec42d5dae..a3ad92a4f9f5acedc7a12c6c11971f0d9351c3a3 100644 (file)
@@ -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)