From: Michael Orlitzky Date: Mon, 5 Aug 2019 17:08:18 +0000 (-0400) Subject: Revert "eja: store the multiplication table as a matrix." X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=78b54b562e1eedbb919dc442b2b3f6996440a1a2;p=sage.d.git Revert "eja: store the multiplication table as a matrix." This reverts commit 98c3ab3a9df8c634a0fbb05ed6ad22abf41118f3. Will be needed if we want to un-make our algebra a ring. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index d4ee9b0..28e86c2 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -64,10 +64,8 @@ class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule): # long run to have the multiplication table be in terms of # algebra elements. We do this after calling the superclass # constructor so that from_vector() knows what to do. - self._multiplication_table = matrix( - [ map(lambda x: self.from_vector(x), ls) - for ls in mult_table ] ) - self._multiplication_table.set_immutable() + self._multiplication_table = [ map(lambda x: self.from_vector(x), ls) + for ls in mult_table ] def _element_constructor_(self, elt): @@ -155,7 +153,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule): return fmt.format(self.dimension(), self.base_ring()) def product_on_basis(self, i, j): - return self._multiplication_table[i,j] + return self._multiplication_table[i][j] def _a_regular_element(self): """ @@ -251,9 +249,8 @@ class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule): R = PolynomialRing(self.base_ring(), names) # Hack around the fact that our multiplication table is in terms of # algebra elements but the constructor wants it in terms of vectors. - vmt = [ tuple([ self._multiplication_table[i,j].to_vector() - for j in range(self._multiplication_table.nrows()) ]) - for i in range(self._multiplication_table.ncols()) ] + vmt = [ tuple(map(lambda x: x.to_vector(), ls)) + for ls in self._multiplication_table ] J = FiniteDimensionalEuclideanJordanAlgebra(R, tuple(vmt), r) idmat = matrix.identity(J.base_ring(), n) @@ -414,7 +411,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule): [e2 0 e0] """ - return self._multiplication_table + return matrix(self._multiplication_table) def natural_basis(self):