First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 0 years ago

Max Alekseyev gravatar image

First off, on a minor note, in for el in G.list(): ... calling .list() is not needed and bears unnecessary overhead. You can simply state for el in G: ....

Now, about the errors you see. Inpermutation.from_cycles(len(hL),t), t is a tuple of PermutationGroupElement's, which confuses `permutation.from_cycles() function. If you want to fix just this call, you can use permutation.from_cycles(len(hL),eval(str(t))) instead.

However, it's unclear why you convert elements of G into tuples at first place.

verticesL = G.list()

and then

permutation.from_cycles(len(hL), t.cycle_tuples())

seems to be more natural here.

click to hide/show revision 2
No.2 Revision

First off, on a minor note, in for el in G.list(): ... calling .list() is not needed and bears unnecessary overhead. You can simply state for el in G: ....

Now, about the errors you see. Inpermutation.from_cycles(len(hL),t), t is a tuple of PermutationGroupElement's, which confuses `permutation.from_cycles() function. If you want to fix just this call, you can use permutation.from_cycles(len(hL),eval(str(t))) instead.

However, it's unclear why you convert elements of G into tuples at first place.

verticesL = G.list()

and then

permutation.from_cycles(len(hL), t.cycle_tuples())

seems to be more natural here.

click to hide/show revision 3
No.3 Revision

First off, on a minor note, in for el in G.list(): ... calling .list() is not needed and bears unnecessary overhead. You can simply state for el in G: ....

Now, about the errors you see. Inpermutation.from_cycles(len(hL),t), t is a tuple of PermutationGroupElement's, which confuses permutation.from_cycles() function. If you want to fix just this call, you can use permutation.from_cycles(len(hL),eval(str(t))) instead.

However, it's unclear why you convert elements of G into tuples at first place.

verticesL = G.list()

and then

test = permutation.from_cycles(len(hL), t.cycle_tuples())

or even simply

test = Permutation(t)

seems to be more natural here.