Product of Elements in Group

17 views
Skip to first unread message

Babak

unread,
Jan 19, 2013, 1:41:49 AM1/19/13
to sage-a...@googlegroups.com
Hi All

I have problem with product of two element in group.
it runs for H[18] and H[6] and it has no error but it doesn't run for H[18] and H[26]. I can't figure out this problem.
I was wondering if you could help me.
Thanks in advance

Babak

D = SymmetricGroup(4)
H=D.subgroups()
A=Set(D(x*y) for x in H[18] for y in H[6])
print(A)


{(1,4,3,2), (), (1,3,4), (2,4), (1,3,2,4), (1,2,3), (1,4,2,3), (1,2)(3,4)}

D = SymmetricGroup(4)
H=D.subgroups()
A=Set(D(x*y) for x in H[18] for y in H[26])
print(A)

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_54.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("RCA9IFN5bW1ldHJpY0dyb3VwKDQpCkg9RC5zdWJncm91cHMoKQpBPVNldChEKHgqeSkgZm9yIHggaW4gSFsxOF0gZm9yIHkgaW4gSFsyNl0pCnByaW50KEEp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>

File "/private/var/folders/rp/rpRaJRnOEQyzp4ftzijESU+++TI/-Tmp-/tmpcoW8YW/___code___.py", line 5, in <module>
A=Set(D(x*y) for x in H[_sage_const_18 ] for y in H[_sage_const_26 ])
File "/Applications/sage/local/lib/python2.7/site-packages/sage/sets/set.py", line 129, in Set
return Set_object_enumerated(list(X))
File "/private/var/folders/rp/rpRaJRnOEQyzp4ftzijESU+++TI/-Tmp-/tmpcoW8YW/___code___.py", line 5, in <genexpr>
A=Set(D(x*y) for x in H[_sage_const_18 ] for y in H[_sage_const_26 ])
File "element.pyx", line 1388, in sage.structure.element.MonoidElement.__mul__ (sage/structure/element.c:11883)
File "element.pyx", line 1382, in sage.structure.element.MonoidElement.__mul__ (sage/structure/element.c:11742)
File "coerce.pyx", line 797, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7672)
TypeError: unsupported operand parent(s) for '*': 'Permutation Group with generators [(1,2)(3,4), (1,3,2,4)]' and 'Permutation Group with generators [(1,2)(3,4), (1,3)(2,4), (1,4)]'

David Roe

unread,
Jan 19, 2013, 6:44:20 AM1/19/13
to sage-a...@googlegroups.com
Quick answer that I haven't tested.  Try the following, which should work:
A = Set(D(x)*D(y) for x in H[18] for y in H[26])
print A
David

David Kohel

unread,
Jan 19, 2013, 6:46:12 AM1/19/13
to sage-algebra
Hi Babak,

Normally I would suggest posting such a question to sage-support, but
there are some
people knowledgeable on the coercion model here.

The problem is that x*y doesn't lie in either the parent of x or y, so
there is no unique
parent in which to create the result.

Instead, modify your line D(x*y) to D(x)*D(y), then the result will be
well-defined (in D).

Best,

David
Reply all
Reply to author
Forward
0 new messages