sage: CP2.is_associative()
False
+ Cartesian products of Cartesian products work::
+
+ sage: J1 = JordanSpinEJA(1)
+ sage: J2 = JordanSpinEJA(1)
+ sage: J3 = JordanSpinEJA(1)
+ sage: J = cartesian_product([J1,cartesian_product([J2,J3])])
+ sage: J.multiplication_table()
+ +--------------++---------+--------------+--------------+
+ | * || e(0, 0) | e(1, (0, 0)) | e(1, (1, 0)) |
+ +==============++=========+==============+==============+
+ | e(0, 0) || e(0, 0) | 0 | 0 |
+ +--------------++---------+--------------+--------------+
+ | e(1, (0, 0)) || 0 | e(1, (0, 0)) | 0 |
+ +--------------++---------+--------------+--------------+
+ | e(1, (1, 0)) || 0 | 0 | e(1, (1, 0)) |
+ +--------------++---------+--------------+--------------+
+ sage: HadamardEJA(3).multiplication_table()
+ +----++----+----+----+
+ | * || e0 | e1 | e2 |
+ +====++====+====+====+
+ | e0 || e0 | 0 | 0 |
+ +----++----+----+----+
+ | e1 || 0 | e1 | 0 |
+ +----++----+----+----+
+ | e2 || 0 | 0 | e2 |
+ +----++----+----+----+
+
TESTS:
All factors must share the same base field::
r"""
Convert a monomial index into a generator index.
+ This is needed in product algebras because the multiplication
+ table is in terms of the generator indices.
+
SETUP::
sage: from mjo.eja.eja_algebra import random_eja
True
"""
- # 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.
+ # This works recursively so that we can handle Cartesian
+ # products of Cartesian products.
try:
+ # monomial is an ordered pair
factor = mon[0]
except TypeError: # 'int' object is not subscriptable
+ # base case where the monomials are integers
return mon
+
idx_in_factor = self._monomial_to_generator(mon[1])
offset = sum( f.dimension()