True
"""
+ if not self.is_invertible():
+ raise ValueError("element not invertible")
+
if self.parent().is_associative():
elt = FiniteDimensionalAlgebraElement(self.parent(), self)
- return elt.inverse()
-
- # TODO: we can do better once the call to is_invertible()
- # doesn't crash on irregular elements.
- #if not self.is_invertible():
- # raise ValueError('element is not invertible')
+ # elt is in the right coordinates, but has the wrong class.
+ return self.parent()(elt.inverse().vector())
# We do this a little different than the usual recursive
# call to a finite-dimensional algebra element, because we