- sage: from mjo.eja.eja_algebra import random_eja()
-
- TESTS::
-
- sage: J1 = random_eja(field=QQ, orthonormalize=False)
- sage: J2 = random_eja(field=QQ, orthonormalize=False)
- sage: J = cartesian_product([J1,J2])
- sage: all( J.monomial(m)
- ....: ==
- ....: J.gens()[J._monomial_to_generator(m)]
- ....: for m in J.basis().keys() )
-
- """
- # The superclass method indexes into a matrix, so we have to
- # turn the tuples i and j into integers. This is easy enough
- # given that the first coordinate of i and j corresponds to
- # the factor, and the second coordinate corresponds to the
- # index of the generator within that factor.
- factor = mon[0]
- idx_in_factor = mon[1]
-
- offset = sum( f.dimension()
- for f in self.cartesian_factors()[:factor] )
- return offset + idx_in_factor
-
- def product_on_basis(self, i, j):
- r"""
- Return the product of the monomials indexed by ``i`` and ``j``.
-
- This overrides the superclass method because here, both ``i``
- and ``j`` will be ordered pairs.
-
- SETUP::
-
- sage: from mjo.eja.eja_algebra import (QuaternionHermitianEJA,
- ....: RealSymmetricEJA)
-
- TESTS::
-
- sage: J1 = RealSymmetricEJA(1,field=QQ)
- sage: J2 = QuaternionHermitianEJA(1,field=QQ)
- sage: J = cartesian_product([J1,J2])
- sage: x = sum(J.gens())
- sage: x == J.one()
- True
- sage: x*x == x
- True
-
- """
- l = self._monomial_to_generator(i)
- m = self._monomial_to_generator(j)
- return FiniteDimensionalEJA.product_on_basis(self, l, m)