- sa_coords = self.vector_space().coordinate_vector(sa_one)
- return self.from_vector(sa_coords)
-
-
- def natural_basis_space(self):
- """
- Return the natural basis space of this algebra, which is identical
- to that of its superalgebra.
-
- This is correct "by definition," and avoids a mismatch when the
- subalgebra is trivial (with no natural basis to infer anything
- from) and the parent is not.
- """
- return self.superalgebra().natural_basis_space()
-
-
- def superalgebra(self):
- """
- Return the superalgebra that this algebra was generated from.
- """
- return self._superalgebra
-
-
- def vector_space(self):
- """
- SETUP::
-
- sage: from mjo.eja.eja_algebra import RealSymmetricEJA
- sage: from mjo.eja.eja_element_subalgebra import FiniteDimensionalEuclideanJordanElementSubalgebra
-
- EXAMPLES::
-
- sage: J = RealSymmetricEJA(3)
- sage: x = J.monomial(0) + 2*J.monomial(2) + 5*J.monomial(5)
- sage: K = FiniteDimensionalEuclideanJordanElementSubalgebra(x,False)
- sage: K.vector_space()
- Vector space of degree 6 and dimension 3 over...
- User basis matrix:
- [ 1 0 1 0 0 1]
- [ 1 0 2 0 0 5]
- [ 1 0 4 0 0 25]
- sage: (x^0).to_vector()
- (1, 0, 1, 0, 0, 1)
- sage: (x^1).to_vector()
- (1, 0, 2, 0, 0, 5)
- sage: (x^2).to_vector()
- (1, 0, 4, 0, 0, 25)
-
- """
- return self._vector_space
+ # The extra hackery is because foo.to_vector() might not
+ # live in foo.parent().vector_space()!
+ coords = sum( a*b for (a,b)
+ in zip(sa_one,
+ self.superalgebra().vector_space().basis()) )
+ return self.from_vector(self.vector_space().coordinate_vector(coords))