::
"""
+ 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)