]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: drop cached superalgebra basis from subalgebras.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 21 Nov 2020 13:16:09 +0000 (08:16 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 21 Nov 2020 13:16:09 +0000 (08:16 -0500)
mjo/eja/eja_element.py
mjo/eja/eja_subalgebra.py

index 2bf7aa2743d1fefc6952e521d17cb1f3d22fa276..c5f0e77599e821ba153726c519b9f8dc9f9c8532 100644 (file)
@@ -1253,7 +1253,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement):
             sage: (J0, J5, J1) = J.peirce_decomposition(c1)
             sage: (f0, f1, f2) = J1.gens()
             sage: f0.spectral_decomposition()
-            [(0, 1.000000000000000?*f2), (1, 1.000000000000000?*f0)]
+            [(0, f2), (1, f0)]
 
         """
         A = self.subalgebra_generated_by(orthonormalize_basis=True)
index 85ada0705fe8073fa80500d4719c38a5ea16a576..2ceba43b9f6ad40e110aa2f2365ac45ffb69e288 100644 (file)
@@ -56,6 +56,14 @@ class FiniteDimensionalEuclideanJordanSubalgebraElement(FiniteDimensionalEuclide
             f1
             sage: A(x).superalgebra_element()
             e0 + e1 + e2 + e3 + e4 + e5
+            sage: y = sum(A.gens())
+            sage: y
+            f0 + f1
+            sage: B = y.subalgebra_generated_by()
+            sage: B(y)
+            g1
+            sage: B(y).superalgebra_element()
+            f0 + f1
 
         TESTS:
 
@@ -72,8 +80,12 @@ class FiniteDimensionalEuclideanJordanSubalgebraElement(FiniteDimensionalEuclide
             True
 
         """
-        return self.parent().superalgebra().linear_combination(
-          zip(self.parent()._superalgebra_basis, self.to_vector()) )
+        W = self.parent().vector_space()
+        V = self.parent().superalgebra().vector_space()
+        A = W.basis_matrix().transpose()
+        W_coords = A*self.to_vector()
+        V_coords = V.coordinate_vector(W_coords)
+        return self.parent().superalgebra().from_vector(V_coords)
 
 
 
@@ -175,8 +187,6 @@ class FiniteDimensionalEuclideanJordanSubalgebra(FiniteDimensionalEuclideanJorda
 
 
         self._vector_space = W
-        self._superalgebra_basis = superalgebra_basis
-
 
         fdeja = super(FiniteDimensionalEuclideanJordanSubalgebra, self)
         fdeja.__init__(field,