From ed093213197d2ffa48849b0089ebe391b7574b93 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 24 Aug 2019 00:06:56 -0400 Subject: [PATCH] eja: fix a bug in the charpoly fast path for complex/quaternion matrices. --- mjo/eja/eja_algebra.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() -- 2.44.2