| 1 | initial version |
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.
| 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.
| 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.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.