- sage: J1 = RealSymmetricEJA(2,field=QQ,orthonormalize=False)
- sage: J2 = ComplexHermitianEJA(0,field=QQ,orthonormalize=False)
- sage: J3 = JordanSpinEJA(2,field=QQ,orthonormalize=False)
- sage: J = cartesian_product([J1,J2,J3])
- sage: x = sum(J.gens())
- sage: x*J.one()
- e(0, 0) + e(0, 1) + e(0, 2) + e(2, 0) + e(2, 1)
- sage: x*x
- 2*e(0, 0) + 2*e(0, 1) + 2*e(0, 2) + 2*e(2, 0) + 2*e(2, 1)
-
- """
- factor = i[0]
- assert(j[0] == i[0])
- n = self.cartesian_factors()[factor].dimension()
-
- # 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. And of course
- # we should never be multiplying two elements from different
- # factors.
- l = n*factor + i[1]
- m = n*factor + j[1]
- super().product_on_basis(l, m)
+ def _repr_(self):
+ # Copy/pasted from CombinatorialFreeModule_CartesianProduct.
+ from sage.categories.cartesian_product import cartesian_product
+ return cartesian_product.symbol.join("%s" % factor
+ for factor in self._sets)