+ from mjo.eja.eja_operator import EJAOperator
+ mm = self._module_morphism(lambda j: self.superalgebra()(self.monomial(j).to_matrix()),
+ codomain=self.superalgebra())
+ return EJAOperator(self,
+ self.superalgebra(),
+ mm.matrix())
+
+
+
+ Element = EJASubalgebraElement
+
+
+
+class CartesianProductEJASubalgebraElement(EJASubalgebraElement,
+ CartesianProductParentEJAElement):
+ r"""
+ The class for elements that both belong to a subalgebra and
+ have a Cartesian product algebra as their parent. By inheriting
+ :class:`CartesianProductParentEJAElement` in addition to
+ :class:`EJASubalgebraElement`, we allow the
+ ``to_matrix()`` method to be overridden with the version that
+ works on Cartesian products.
+
+ SETUP::
+
+ sage: from mjo.eja.eja_algebra import (HadamardEJA,
+ ....: RealSymmetricEJA)