From 220806a8c2d8f72a164e7b0c1ba4451999e0fce5 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 10 Nov 2020 08:39:25 -0500 Subject: [PATCH] eja: fix base ring of fast _charpoly_coefficients(). --- mjo/eja/eja_algebra.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 1fc3618..e288c6c 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -1049,6 +1049,26 @@ class RationalBasisEuclideanJordanAlgebra(FiniteDimensionalEuclideanJordanAlgebr r""" Override the parent method with something that tries to compute over a faster (non-extension) field. + + SETUP:: + + sage: from mjo.eja.eja_algebra import JordanSpinEJA + + EXAMPLES: + + The base ring of the resulting polynomial coefficients is what + it should be, and not the rationals (unless the algebra was + already over the rationals):: + + sage: J = JordanSpinEJA(3) + sage: J._charpoly_coefficients() + (X1^2 - X2^2 - X3^2, -2*X1) + sage: a0 = J._charpoly_coefficients()[0] + sage: J.base_ring() + Algebraic Real Field + sage: a0.base_ring() + Algebraic Real Field + """ if self.base_ring() is QQ: # There's no need to construct *another* algebra over the @@ -1068,7 +1088,8 @@ class RationalBasisEuclideanJordanAlgebra(FiniteDimensionalEuclideanJordanAlgebr mult_table, check_field=False, check_axioms=False) - return J._charpoly_coefficients() + a = J._charpoly_coefficients() + return tuple(map(lambda x: x.change_ring(self.base_ring()), a)) class MatrixEuclideanJordanAlgebra(FiniteDimensionalEuclideanJordanAlgebra): -- 2.44.2