determinant).
"""
z = self._a_regular_element()
- V = z.vector().parent().ambient_vector_space()
+ V = self.vector_space()
V1 = V.span_of_basis( (z**k).vector() for k in range(self.rank()) )
b = (V1.basis() + V1.complement().basis())
return V.span_of_basis(b)
else:
return self._rank
+ def vector_space(self):
+ """
+ Return the vector space that underlies this algebra.
+
+ EXAMPLES::
+
+ sage: J = RealSymmetricEJA(2)
+ sage: J.vector_space()
+ Vector space of dimension 3 over Rational Field
+
+ """
+ return self.zero().vector().parent().ambient_vector_space()
+
class Element(FiniteDimensionalAlgebraElement):
"""
#
# We do the extra ambient_vector_space() in case we're messing
# with polynomials and the direct parent is a module.
- V = self.vector().parent().ambient_vector_space()
+ V = self.parent().vector_space()
return V.span( (self**d).vector() for d in xrange(V.dimension()) )