Opened 5 months ago

Last modified 4 months ago

## #27881 new defect

# allow creation of PermutationGroupElement with 0 in domain

Reported by: | dimpase | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | |

Component: | group theory | Keywords: | |

Cc: | dcoudert, stumpc5 | Merged in: | |

Authors: | Reviewers: | ||

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

one can create `PermutationGroup_generic_with_category`

acting on a domain with 0, but creating its individual elements (moving 0) is broken.

sage: p=graphs.PetersenGraph() sage: a=p.automorphism_group(); a Permutation Group with generators [(3,7)(4,5)(8,9), (2,6)(3,8)(4,5)(7,9), (1,4,5)(2,3,8,6,9,7), (0,1)(2,4,6,5)(3,9,8,7)] sage: a.domain() {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} sage: map(type, a.gens()) [<type 'sage.groups.perm_gps.permgroup_element.PermutationGroupElement'>, <type 'sage.groups.perm_gps.permgroup_element.PermutationGroupElement'>, <type 'sage.groups.perm_gps.permgroup_element.PermutationGroupElement'>, <type 'sage.groups.perm_gps.permgroup_element.PermutationGroupElement'>] sage: PermutationGroupElement("(0,2)") --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-15-fa3d3058e13a> in <module>() ----> 1 PermutationGroupElement("(0,2)") /home/dimpase/Sage/sagetrac-mirror/local/lib/python2.7/site-packages/sage/groups/perm_gps/permgroup_element.pyx in sage.groups.perm_gps.permgroup_element.PermutationGroupElement.__init__ (build/cythonized/sage/groups/perm_gps/permgroup_element.c:5852)() 502 503 degree = max([1] + [max(cycle+(1,)) for cycle in v]) --> 504 v = from_cycles(degree, v) 505 506 self.__gap = 'PermList({})'.format(list(v)) # Make sure it is a list /home/dimpase/Sage/sagetrac-mirror/local/lib/python2.7/site-packages/sage/combinat/permutation.pyc in from_cycles(n, cycles, parent) 7041 # Only positive elements 7042 if int(flattened_and_sorted[0]) < 1: -> 7043 raise ValueError("All elements should be strictly positive " 7044 "integers, and I just found a non-positive one.") 7045 ValueError: All elements should be strictly positive integers, and I just found a non-positive one.

**Note:**See TracTickets for help on using tickets.

As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).