From 47671d4a72c9eaed822c066f05a26f63c7301526 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 25 Feb 2021 18:25:18 -0500 Subject: [PATCH] Revert "eja: drop custom _is_commutative() in favor of is_commutative()." This reverts commit fe4405d4c4e5eec48f1924fc75e6aedd08f5c938. Now that all EJAs are commutative, we need the custom method that actually checks it rather than the category method that always returns True. --- mjo/eja/eja_algebra.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index e79b0e8..af7d059 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -423,6 +423,18 @@ class FiniteDimensionalEJA(CombinatorialFreeModule): """ return "Associative" in self.category().axioms() + def _is_commutative(self): + r""" + Whether or not this algebra's multiplication table is commutative. + + This method should of course always return ``True``, unless + this algebra was constructed with ``check_axioms=False`` and + passed an invalid multiplication table. + """ + return all( self.product_on_basis(i,j) == self.product_on_basis(i,j) + for i in range(self.dimension()) + for j in range(self.dimension()) ) + def _is_jordanian(self): r""" Whether or not this algebra's multiplication table respects the @@ -430,7 +442,7 @@ class FiniteDimensionalEJA(CombinatorialFreeModule): We only check one arrangement of `x` and `y`, so for a ``True`` result to be truly true, you should also check - :meth:`is_commutative`. This method should of course always + :meth:`_is_commutative`. This method should of course always return ``True``, unless this algebra was constructed with ``check_axioms=False`` and passed an invalid multiplication table. """ -- 2.44.2