]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: add a doctest.
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 25 Feb 2021 13:39:20 +0000 (08:39 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 25 Feb 2021 13:39:20 +0000 (08:39 -0500)
mjo/eja/eja_algebra.py

index 3a832c1051694dc8e19d6c8dfb002ceda1203279..a8e16ec94aaa628f26533f654f33468f6a3eace4 100644 (file)
@@ -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: