From: Michael Orlitzky Date: Sat, 27 Jul 2019 13:30:08 +0000 (-0400) Subject: eja: add vector_space() method for EJAs to get the ambient space. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=b30ae468277bc48a79cbba58417c7e20f96b1b29;p=sage.d.git eja: add vector_space() method for EJAs to get the ambient space. --- diff --git a/mjo/eja/euclidean_jordan_algebra.py b/mjo/eja/euclidean_jordan_algebra.py index 35318e8..24ea731 100644 --- a/mjo/eja/euclidean_jordan_algebra.py +++ b/mjo/eja/euclidean_jordan_algebra.py @@ -515,7 +515,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): 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) @@ -740,6 +740,19 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): 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): """ @@ -1624,7 +1637,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): # # 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()) )