From 17c1cf361b330252acae5ba18edb3a4fdf8bf9bd Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 25 Feb 2021 08:39:20 -0500 Subject: [PATCH] eja: add a doctest. --- mjo/eja/eja_algebra.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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: -- 2.44.2