]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/eja/eja_subalgebra.py
eja: drop redundant vector->superalgebra-element conversion.
[sage.d.git] / mjo / eja / eja_subalgebra.py
index 2ceba43b9f6ad40e110aa2f2365ac45ffb69e288..cb9631df18b5a0749dda75855682c40a689cd5b3 100644 (file)
@@ -78,6 +78,9 @@ class FiniteDimensionalEuclideanJordanSubalgebraElement(FiniteDimensionalEuclide
             sage: y = A.random_element()
             sage: A(y.superalgebra_element()) == y
             True
+            sage: B = y.subalgebra_generated_by()
+            sage: B(y).superalgebra_element() == y
+            True
 
         """
         W = self.parent().vector_space()
@@ -162,19 +165,17 @@ class FiniteDimensionalEuclideanJordanSubalgebra(FiniteDimensionalEuclideanJorda
             prefix = prefixen[0]
 
         basis_vectors = [ b.to_vector() for b in basis ]
-        superalgebra_basis = [ self._superalgebra.from_vector(b)
-                               for b in basis_vectors ]
 
         # If our superalgebra is a subalgebra of something else, then
         # these vectors won't have the right coordinates for
         # V.span_of_basis() unless we use V.from_vector() on them.
         W = V.span_of_basis( V.from_vector(v) for v in basis_vectors )
 
-        n = len(superalgebra_basis)
+        n = len(basis)
         mult_table = [[W.zero() for i in range(n)] for j in range(n)]
         for i in range(n):
             for j in range(n):
-                product = superalgebra_basis[i]*superalgebra_basis[j]
+                product = basis[i]*basis[j]
                 # product.to_vector() might live in a vector subspace
                 # if our parent algebra is already a subalgebra. We
                 # use V.from_vector() to make it "the right size" in
@@ -182,8 +183,7 @@ class FiniteDimensionalEuclideanJordanSubalgebra(FiniteDimensionalEuclideanJorda
                 product_vector = V.from_vector(product.to_vector())
                 mult_table[i][j] = W.coordinate_vector(product_vector)
 
-        natural_basis = tuple( b.natural_representation()
-                               for b in superalgebra_basis )
+        natural_basis = tuple( b.natural_representation() for b in basis )
 
 
         self._vector_space = W