Ask Your Question

Revision history [back]

I am affraid cartesian products do not work well with group structures (and their actions) right now in Sage.

sage: G = SymmetricGroup(4)
sage: H = CartesianProduct(G,G)
sage: H
Cartesian product of Symmetric group of order 4! as a permutation group, Symmetric group of order 4! as a permutation group
sage: H.random_element()
[(1,2,4), (1,2)]
sage: s = H.random_element() ; s
[(1,3)(2,4), (1,3)(2,4)]
sage: s.parent()
AttributeError: 'list' object has no attribute 'parent'

sage: H = G.cartesian_product(G)
sage: H
The cartesian product of (Symmetric group of order 4! as a permutation group, Symmetric group of order 4! as a permutation group)
sage: s = H.an_element() ; s
((1,2,3,4), (1,2,3,4))
sage: s([1,2])
TypeError: 'CartesianProduct_with_category.element_class' object is not callable
sage: s[2,3]
TypeError: 'CartesianProduct_with_category.element_class' object has no attribute '__getitem__'

You can follow and have a look at the links given in this trac ticket.