From 73ba2d67c0850074e655b4da61aa021e6d9b6816 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 15 Oct 2019 08:27:44 -0400 Subject: [PATCH] eja: define the trace of an element in a trivial algebra. --- mjo/eja/eja_element.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index 2eb2677..bd45b17 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -1248,6 +1248,12 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): """ P = self.parent() r = P.rank() + + if r == 0: + # Special case for the trivial algebra where + # the trace is an empty sum. + return P.base_ring().zero() + p = P._charpoly_coeff(r-1) # The _charpoly_coeff function already adds the factor of # -1 to ensure that _charpoly_coeff(r-1) is really what -- 2.44.2