Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fix all but one doctest on #25399
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpase committed May 22, 2018
1 parent b4a14f9 commit 3983db1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 34 deletions.
7 changes: 3 additions & 4 deletions src/sage/geometry/fan_isomorphism.py
Expand Up @@ -81,12 +81,11 @@ def fan_isomorphism_generator(fan1, fan2):
sage: fan = toric_varieties.P2().fan()
sage: from sage.geometry.fan_isomorphism import fan_isomorphism_generator
sage: tuple( fan_isomorphism_generator(fan, fan) )
sage: tuple(set(fan_isomorphism_generator(fan, fan)))
(
[1 0] [0 1] [ 1 0] [ 0 1] [-1 -1] [-1 -1]
[0 1], [1 0], [-1 -1], [-1 -1], [ 1 0], [ 0 1]
[1 0] [ 0 1] [ 1 0] [0 1] [-1 -1] [-1 -1]
[0 1], [-1 -1], [-1 -1], [1 0], [ 1 0], [ 0 1]
)
sage: m1 = matrix([(1, 0), (0, -5), (-3, 4)])
sage: m2 = matrix([(3, 0), (1, 0), (-2, 1)])
sage: m1.elementary_divisors() == m2.elementary_divisors() == [1,1,0]
Expand Down
25 changes: 9 additions & 16 deletions src/sage/geometry/polyhedron/base.py
Expand Up @@ -5744,28 +5744,21 @@ def restricted_automorphism_group(self, output="abstract"):
EXAMPLES::
sage: P = polytopes.cross_polytope(3)
sage: P.restricted_automorphism_group()
Permutation Group with generators [(3,4), (2,3)(4,5), (2,5), (1,2)(5,6), (1,6)]
sage: P.restricted_automorphism_group(output="permutation")
Permutation Group with generators [(2,3), (1,2)(3,4), (1,4), (0,1)(4,5), (0,5)]
sage: P.restricted_automorphism_group(output="matrix")
Matrix group over Rational Field with 5 generators (
[ 1 0 0 0] [1 0 0 0] [ 1 0 0 0] [0 1 0 0] [-1 0 0 0]
[ 0 1 0 0] [0 0 1 0] [ 0 -1 0 0] [1 0 0 0] [ 0 1 0 0]
[ 0 0 -1 0] [0 1 0 0] [ 0 0 1 0] [0 0 1 0] [ 0 0 1 0]
[ 0 0 0 1], [0 0 0 1], [ 0 0 0 1], [0 0 0 1], [ 0 0 0 1]
)
::
sage: P.restricted_automorphism_group() == PermutationGroup([[(3,4)], [(2,3),(4,5)],[(2,5)],[(1,2),(5,6)],[(1,6)]])
True
sage: P.restricted_automorphism_group(output="permutation") == PermutationGroup([[(2,3)],[(1,2),(3,4)],[(1,4)],[(0,1),(4,5)],[(0,5)]])
True
sage: mgens = [[[1,0,0,0],[0,1,0,0],[0,0,-1,0],[0,0,0,1]], [[1,0,0,0],[0,0,1,0],[0,1,0,0],[0,0,0,1]], [[0,1,0,0],[1,0,0,0],[0,0,1,0],[0,0,0,1]]]
sage: P.restricted_automorphism_group(output="matrix") == MatrixGroup(map(lambda t: matrix(QQ,t), mgens))
True
sage: P24 = polytopes.twenty_four_cell()
sage: AutP24 = P24.restricted_automorphism_group()
sage: PermutationGroup([
....: '(1,20,2,24,5,23)(3,18,10,19,4,14)(6,21,11,22,7,15)(8,12,16,17,13,9)',
....: '(1,21,8,24,4,17)(2,11,6,15,9,13)(3,20)(5,22)(10,16,12,23,14,19)'
....: ]) == AutP24
....: ]).is_isomorphic(AutP24)
True
sage: len(AutP24)
sage: AutP24.order()
1152
Here is the quadrant example mentioned in the beginning::
Expand Down
22 changes: 11 additions & 11 deletions src/sage/geometry/polyhedron/ppl_lattice_polytope.py
Expand Up @@ -982,16 +982,15 @@ def restricted_automorphism_group(self, vertex_labels=None):
sage: from sage.geometry.polyhedron.ppl_lattice_polytope import LatticePolytope_PPL
sage: Z3square = LatticePolytope_PPL((0,0), (1,2), (2,1), (3,3))
sage: Z3square.restricted_automorphism_group(vertex_labels=(1,2,3,4))
Permutation Group with generators [(2,3), (1,2)(3,4), (1,4)]
sage: G = Z3square.restricted_automorphism_group(); G
Permutation Group with generators [((1,2),(2,1)),
((0,0),(1,2))((2,1),(3,3)), ((0,0),(3,3))]
sage: tuple(G.domain()) == Z3square.vertices()
sage: Z3square.restricted_automorphism_group(vertex_labels=(1,2,3,4)) == PermutationGroup([[(2,3)],[(1,2),(3,4)]])
True
sage: G = Z3square.restricted_automorphism_group()
sage: G == PermutationGroup([[((1,2),(2,1))],[((0,0),(1,2)),((2,1),(3,3))],[((0,0),(3,3))]])
True
sage: set(G.domain()) == set(Z3square.vertices())
True
sage: set(map(tuple,G.orbit(Z3square.vertices()[0]))) == set([(0, 0), (1, 2), (3, 3), (2, 1)])
True
sage: G.orbit(Z3square.vertices()[0])
((0, 0), (1, 2), (3, 3), (2, 1))
sage: cell24 = LatticePolytope_PPL(
....: (1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1),(1,-1,-1,1),(0,0,-1,1),
....: (0,-1,0,1),(-1,0,0,1),(1,0,0,-1),(0,1,0,-1),(0,0,1,-1),(-1,1,1,-1),
Expand Down Expand Up @@ -1060,8 +1059,9 @@ def lattice_automorphism_group(self, points=None, point_labels=None):
sage: G1.cardinality()
4
sage: G2 = Z3square.restricted_automorphism_group(vertex_labels=(1,2,3,4)); G2
Permutation Group with generators [(2,3), (1,2)(3,4), (1,4)]
sage: G2 = Z3square.restricted_automorphism_group(vertex_labels=(1,2,3,4))
sage: G2 == PermutationGroup([[(2,3)], [(1,2),(3,4)], [(1,4)]])
True
sage: G2.cardinality()
8
Expand Down
7 changes: 4 additions & 3 deletions src/sage/geometry/triangulation/point_configuration.py
Expand Up @@ -1152,9 +1152,10 @@ def restricted_automorphism_group(self):
EXAMPLES::
sage: pyramid = PointConfiguration([[1,0,0],[0,1,1],[0,1,-1],[0,-1,-1],[0,-1,1]])
sage: pyramid.restricted_automorphism_group()
Permutation Group with generators [(3,5), (2,3)(4,5), (2,4)]
sage: DihedralGroup(4).is_isomorphic(_)
sage: G = pyramid.restricted_automorphism_group()
sage: G == PermutationGroup([[(3,5)], [(2,3),(4,5)], [(2,4)]])
True
sage: DihedralGroup(4).is_isomorphic(G)
True
The square with an off-center point in the middle. Note that
Expand Down

0 comments on commit 3983db1

Please sign in to comment.