X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_algebra.py;h=af7d059631b1706227e59d54952cfec552ddabb1;hb=47671d4a72c9eaed822c066f05a26f63c7301526;hp=48421e357544ef2b5c5613bf9e222827e9a20fec;hpb=5b1f16399286eba471884a1cfe45247b3a0a7693;p=sage.d.git diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 48421e3..af7d059 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -178,7 +178,8 @@ class FiniteDimensionalEJA(CombinatorialFreeModule): category = MagmaticAlgebras(field).FiniteDimensional() - category = category.WithBasis().Unital() + category = category.WithBasis().Unital().Commutative() + if associative: # Element subalgebras can take advantage of this. category = category.Associative() @@ -422,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 @@ -429,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. """