Ask Your Question
0

Product of Elements in Group

asked 2013-01-19 01:34:05 +0200

Babgen gravatar image

updated 2013-01-19 20:28:07 +0200

kcrisman gravatar image

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)


{(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)]'
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-01-19 04:45:05 +0200

achrzesz gravatar image

updated 2013-01-20 00:11:08 +0200

Use D(x)*D(y) instead of D(x*y):

sage: D = SymmetricGroup(4)
sage: H=D.subgroups()
sage: A=Set(D(x)*D(y) for x in H[18] for y in H[6])
sage: 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)}
sage: A=Set(D(x)*D(y) for x in H[18] for y in H[26])
sage: print(A)
{(1,4), (1,3)(2,4), (1,3,4,2), (2,3), (3,4), (1,4,2,3), (), (2,3,4), (1,3,2,4), (1,4)(2,3), (1,4,3), (1,2,4), (1,2), (1,2)(3,4), (1,3,2), (1,2,4,3)}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-01-19 01:34:05 +0200

Seen: 230 times

Last updated: Jan 20 '13