]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: add vector_space() method for EJAs to get the ambient space.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 27 Jul 2019 13:30:08 +0000 (09:30 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 03:19:01 +0000 (23:19 -0400)
mjo/eja/euclidean_jordan_algebra.py

index 35318e8a91d370726dac0b64c461444ca6ceccc6..24ea73151e2907c8a99d97efc1a72dd32ac1838f 100644 (file)
@@ -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()) )