From 6c7978e4803740e0e03aab687b4e03292acc2758 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 26 Jun 2019 11:17:40 -0400 Subject: [PATCH] eja: fix element matrices. The superclass matrix() method of elements sometimes computes the right-matrix acting on row vectors. Nobody wants that shit. This commit overrides it (to simply return the transpose of the superclass matrix), and thus fixes the subalgebra_idempotent() method. Some tests were added for the latter method, too. --- mjo/eja/euclidean_jordan_algebra.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/mjo/eja/euclidean_jordan_algebra.py b/mjo/eja/euclidean_jordan_algebra.py index ef5249b..835f763 100644 --- a/mjo/eja/euclidean_jordan_algebra.py +++ b/mjo/eja/euclidean_jordan_algebra.py @@ -168,6 +168,19 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): return self.span_of_powers().dimension() + def matrix(self): + """ + Return the matrix that represents left- (or right-) + multiplication by this element in the parent algebra. + + We have to override this because the superclass method + returns a matrix that acts on row vectors (that is, on + the right). + """ + fda_elt = FiniteDimensionalAlgebraElement(self.parent(), self) + return fda_elt.matrix().transpose() + + def subalgebra_generated_by(self): """ Return the associative subalgebra of the parent EJA generated @@ -351,6 +364,19 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): """ Find an idempotent in the associative subalgebra I generate using Proposition 2.3.5 in Baes. + + TESTS:: + + sage: set_random_seed() + sage: J = eja_rn(5) + sage: c = J.random_element().subalgebra_idempotent() + sage: c^2 == c + True + sage: J = eja_ln(5) + sage: c = J.random_element().subalgebra_idempotent() + sage: c^2 == c + True + """ if self.is_nilpotent(): raise ValueError("this only works with non-nilpotent elements!") -- 2.44.2