return self.monomial(1)
- def _element_constructor_(self, elt):
- """
- Construct an element of this subalgebra from the given one.
- The only valid arguments are elements of the parent algebra
- that happen to live in this subalgebra.
-
- 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 = sum( i*J.gens()[i] for i in range(6) )
- sage: K = FiniteDimensionalEuclideanJordanElementSubalgebra(x,False)
- sage: [ K(x^k) for k in range(J.rank()) ]
- [f0, f1, f2]
-
- ::
-
- """
- 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)
-
-
-
def one(self):
"""
Return the multiplicative identity element of this algebra.
sa_one = self.superalgebra().one().to_vector()
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
-