From: Michael Orlitzky Date: Thu, 25 Feb 2021 13:39:20 +0000 (-0500) Subject: eja: add a doctest. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=17c1cf361b330252acae5ba18edb3a4fdf8bf9bd;p=sage.d.git eja: add a doctest. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 3a832c1..a8e16ec 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -257,6 +257,35 @@ class FiniteDimensionalEJA(CombinatorialFreeModule): def product_on_basis(self, i, j): + r""" + Returns the Jordan product of the `i` and `j`th basis elements. + + This completely defines the Jordan product on the algebra, and + is used direclty by our superclass machinery to implement + :meth:`product`. + + SETUP:: + + sage: from mjo.eja.eja_algebra import random_eja + + TESTS:: + + sage: set_random_seed() + sage: J = random_eja() + sage: n = J.dimension() + sage: ei = J.zero() + sage: ej = J.zero() + sage: ei_ej = J.zero()*J.zero() + sage: if n > 0: + ....: i = ZZ.random_element(n) + ....: j = ZZ.random_element(n) + ....: ei = J.gens()[i] + ....: ej = J.gens()[j] + ....: ei_ej = J.product_on_basis(i,j) + sage: ei*ej == ei_ej + True + + """ # We only stored the lower-triangular portion of the # multiplication table. if j <= i: