From 6957e7f70a89c4ddcc5d9148e1833188ccd7353d Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 29 Jan 2023 16:38:45 -0500 Subject: [PATCH] eja: write the ALGORITHM block for the degree of an element. --- mjo/eja/eja_element.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index e1ea609..ef63704 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -795,7 +795,23 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): ALGORITHM: - ......... + First we handle the special cases where the algebra is + trivial, this element is zero, or the dimension of the algebra + is one and this element is not zero. With those out of the + way, we may assume that ``self`` is nonzero, the algebra is + nontrivial, and that the dimension of the algebra is at least + two. + + Beginning with the algebra's unit element (power zero), we add + successive (basis representations of) powers of this element + to a matrix, row-reducing at each step. After row-reducing, we + check the rank of the matrix. If adding a row and row-reducing + does not increase the rank of the matrix at any point, the row + we've just added lives in the span of the previous ones; thus + the corresponding power of ``self`` lives in the span of its + lesser powers. When that happens, the degree of the minimal + polynomial is the rank of the matrix; if it never happens, the + degree must be the dimension of the entire space. SETUP:: @@ -838,7 +854,6 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): sage: x = random_eja().random_element() sage: x.degree() == x.minimal_polynomial().degree() True - """ n = self.parent().dimension() -- 2.43.2