Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Product of Elements in Group

I have written program but I have problem with it. 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.

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(xy) 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(xy) 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)]'

Product of Elements in Group

I have written program but I have problem with it. product of two elements. 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.

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(xy) 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(xy) 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)]'

click to hide/show revision 3
No.3 Revision

Product of Elements in Group

I have problem with product of two elements. 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.

D = SymmetricGroup(4)

H=D.subgroups()

A=Set(D(x*y) for x in H[18] for y in H[6])

print(A)

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)

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" -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("RCA9IFN5bW1ldHJpY0dyb3VwKDQpCkg9RC5zdWJncm91cHMoKQpBPVNldChEKHgqeSkgZm9yIHggaW4gSFsxOF0gZm9yIHkgaW4gSFsyNl0pCnByaW50KEEp"),globals())+"\n"); _support_.preparse_worksheet_cell(base64.b64decode("RCA9IFN5bW1ldHJpY0dyb3VwKDQpCkg9RC5zdWJncm91cHMoKQpBPVNldChEKHgqeSkgZm9yIHggaW4gSFsxOF0gZm9yIHkgaW4gSFsyNl0pCnByaW50KEEp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in <module>

<module> File "/private/var/folders/rp/rpRaJRnOEQyzp4ftzijESU+++TI/-Tmp-/tmpcoW8YW/___code___.py", line 5, in <module> A=Set(D(xy) 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(xy) 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)]'

(1,4)]'