# 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,
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