X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_algebra.py;h=9ba146bc6e8fd6dc97dcf1f7d70058cd046528a4;hb=3baadd6fb5c765caab2bd57d1d6ed764b03d53b3;hp=8005412e65da8b6192072420dffe794c7975b5d0;hpb=88e98ce65ad03a557c001b5f4cd7ba6e76164938;p=sage.d.git diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 8005412..9ba146b 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -119,11 +119,12 @@ class FiniteDimensionalEJA(CombinatorialFreeModule): # Call the superclass constructor so that we can use its from_vector() # method to build our multiplication table. n = len(basis) - super().__init__(field, - range(n), - prefix=prefix, - category=category, - bracket=False) + CombinatorialFreeModule.__init__(self, + field, + range(n), + prefix=prefix, + category=category, + bracket=False) # Now comes all of the hard work. We'll be constructing an # ambient vector space V that our (vectorized) basis lives in, @@ -3134,6 +3135,16 @@ class CartesianProductEJA(CombinatorialFreeModule_CartesianProduct, except: raise ValueError("not an element of this algebra") + def subalgebra(self, basis, **kwargs): + r""" + Create a subalgebra of this algebra from the given basis. + + This overrides the superclass method to use a special class + for Cartesian products. + """ + from mjo.eja.eja_subalgebra import CartesianProductEJASubalgebra + return CartesianProductEJASubalgebra(self, basis, **kwargs) + Element = CartesianProductEJAElement