From 93e7b502538bd416c11a81cd0b8f47c24e934691 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 21 Nov 2020 08:16:09 -0500 Subject: [PATCH] eja: drop cached superalgebra basis from subalgebras. --- mjo/eja/eja_element.py | 2 +- mjo/eja/eja_subalgebra.py | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index 2bf7aa2..c5f0e77 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -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) diff --git a/mjo/eja/eja_subalgebra.py b/mjo/eja/eja_subalgebra.py index 85ada07..2ceba43 100644 --- a/mjo/eja/eja_subalgebra.py +++ b/mjo/eja/eja_subalgebra.py @@ -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, -- 2.44.2