From: Michael Orlitzky Date: Sat, 24 Aug 2019 04:06:56 +0000 (-0400) Subject: eja: fix a bug in the charpoly fast path for complex/quaternion matrices. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=ed093213197d2ffa48849b0089ebe391b7574b93;p=sage.d.git eja: fix a bug in the charpoly fast path for complex/quaternion matrices. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 2a5e624..8ab1381 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -930,7 +930,9 @@ class MatrixEuclideanJordanAlgebra(FiniteDimensionalEuclideanJordanAlgebra): # with had entries in a nice field. return super(MatrixEuclideanJordanAlgebra, self)._charpoly_coeff(i) else: - n = self.natural_basis_space().nrows() + # If we didn't unembed first, this number would be wrong + # by a power-of-two factor for complex/quaternion matrices. + n = self.real_unembed(self.natural_basis_space().zero()).nrows() field = self.base_ring().base_ring() # yeeeeaaaahhh J = self.__class__(n, field, False) (_,x,_,_) = J._charpoly_matrix_system()