From: Michael Orlitzky Date: Tue, 24 Nov 2020 16:24:15 +0000 (-0500) Subject: eja: fix inclusions/projections with trivial algebras. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=39d8d3190b721ea21e0e86618d774437bc1eeb35;p=sage.d.git eja: fix inclusions/projections with trivial algebras. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 7857190..6252cc2 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -2524,10 +2524,14 @@ class DirectSumEJA(FiniteDimensionalEuclideanJordanAlgebra): """ (J1,J2) = self.factors() - n = J1.dimension() + m = J1.dimension() + n = J2.dimension() V_basis = self.vector_space().basis() - P1 = matrix(self.base_ring(), V_basis[:n]) - P2 = matrix(self.base_ring(), V_basis[n:]) + # Need to specify the dimensions explicitly so that we don't + # wind up with a zero-by-zero matrix when we want e.g. a + # zero-by-two matrix (important for composing things). + P1 = matrix(self.base_ring(), m, m+n, V_basis[:m]) + P2 = matrix(self.base_ring(), n, m+n, V_basis[m:]) pi_left = FiniteDimensionalEuclideanJordanAlgebraOperator(self,J1,P1) pi_right = FiniteDimensionalEuclideanJordanAlgebraOperator(self,J2,P2) return (pi_left, pi_right) @@ -2587,10 +2591,14 @@ class DirectSumEJA(FiniteDimensionalEuclideanJordanAlgebra): """ (J1,J2) = self.factors() - n = J1.dimension() + m = J1.dimension() + n = J2.dimension() V_basis = self.vector_space().basis() - I1 = matrix.column(self.base_ring(), V_basis[:n]) - I2 = matrix.column(self.base_ring(), V_basis[n:]) + # Need to specify the dimensions explicitly so that we don't + # wind up with a zero-by-zero matrix when we want e.g. a + # two-by-zero matrix (important for composing things). + I1 = matrix.column(self.base_ring(), m, m+n, V_basis[:m]) + I2 = matrix.column(self.base_ring(), n, m+n, V_basis[m:]) iota_left = FiniteDimensionalEuclideanJordanAlgebraOperator(J1,self,I1) iota_right = FiniteDimensionalEuclideanJordanAlgebraOperator(J2,self,I2) return (iota_left, iota_right)