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

Commit

Permalink
trac #18779: polytopes.gosset_3_21 and graphs.GossetGraph
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanncohen committed Jul 7, 2015
1 parent 6bc31bd commit 4a4ee0c
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/sage/geometry/polyhedron/library.py
Expand Up @@ -808,6 +808,31 @@ def six_hundred_cell(self, exact=False):
verts.extend(p(x) for x in pts)
return Polyhedron(vertices=verts, base_ring=base_ring)

def gosset_3_21(self):
r"""
Return the Gosset `3_{21}` polytope.
The Gosset `3_{21}` polytope is a uniform 7-polytope. It has 56
vertices, and 702 facets: `126` `3_{11}` and `576` `6`-simplex. For more
information, see the :wikipedia:`3_21_polytope`.
EXAMPLES::
sage: g = polytopes.gosset_3_21(); g
A 7-dimensional polyhedron in ZZ^8 defined as the convex hull of 56 vertices
sage: g.f_vector() # not tested (~16s)
(1, 120, 720, 1200, 600, 1)
"""
from itertools import combinations
verts = []
for i,j in combinations(range(8),2):
x = [1]*8
x[i] = x[j] = -3
verts.append(x)
verts.append([-xx for xx in x])

return Polyhedron(vertices=verts, base_ring=ZZ)

@rename_keyword(deprecation=18213, points_n='n', dim_n='dim')
def cyclic_polytope(self, dim, n, base_ring=QQ):
"""
Expand Down
39 changes: 39 additions & 0 deletions src/sage/graphs/generators/smallgraphs.py
Expand Up @@ -1488,6 +1488,45 @@ def BuckyBall():

return g

def GossetGraph():
r"""
Return the Gosset graph.
The Gosset graph is the skeleton of the
:meth:`~sage.geometry.polyhedron.library.polytopes.gosset_3_21` polytope. It
has with 56 vertices and degree 27. For more information, see the
:wikipedia:`Gosset_graph`.
EXAMPLE::
sage: g = graphs.GossetGraph(); g
Gosset Graph: Graph on 56 vertices
sage: g.order(), g.size()
(56, 756)
TESTS::
sage: g.is_isomorphic(polytopes.gosset_3_21().graph()) # not tested (~16s)
True
"""
string = ('w~~~~rt{~Z\\ZxnvYZYmlfrb}|hDuhLlcmmMNf_^zzQGNYcP\\kcRZbaJjoNBx{'+
'?N~o^}?A`}F_Kbbm_[QZ\\_]Cj\\oN_dm{BzB{?]WIMM@tPQRYBYRPIuAyJgQv?'+
'|Bxb_M[kWIR@jTQcciDjShXCkFMgpwqBKxeKoS`TYqdTCcKtkdKwWQXrbEZ@OdU'+
'mITZ@_e[{KXn?YPABzvY?IcO`zvYg@caC\\zlf?BaGR]zb{?@wOjv`~w??N_n_~'+
'~w???^_^~~{')

G = Graph(string,name="Gosset Graph")

ordering = [0, 2, 4, 6, 43, 23, 50, 18, 28, 9, 8, 7, 44, 3, 26, 35, 16, 14,
33, 15, 54, 30, 17, 21, 10, 13, 36, 31, 55, 53, 51, 49, 12, 32,
5, 37, 27, 46, 47, 48, 11, 52, 29, 20, 39, 41, 22, 40, 1, 25, 38,
34, 45, 42, 19, 24]

_circle_embedding(G,ordering)

return G

def DoubleStarSnark():
r"""
Returns the double star snark.
Expand Down
2 changes: 2 additions & 0 deletions src/sage/graphs/graph_generators.py
Expand Up @@ -111,6 +111,7 @@ def __append_to_doc(methods):
"FranklinGraph",
"FruchtGraph",
"GoldnerHararyGraph",
"GossetGraph",
"GrayGraph",
"GrotzschGraph",
"HallJankoGraph",
Expand Down Expand Up @@ -1859,6 +1860,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None
FranklinGraph = staticmethod(sage.graphs.generators.smallgraphs.FranklinGraph)
FruchtGraph = staticmethod(sage.graphs.generators.smallgraphs.FruchtGraph)
GoldnerHararyGraph = staticmethod(sage.graphs.generators.smallgraphs.GoldnerHararyGraph)
GossetGraph = staticmethod(sage.graphs.generators.smallgraphs.GossetGraph)
GrayGraph = staticmethod(sage.graphs.generators.smallgraphs.GrayGraph)
GrotzschGraph = staticmethod(sage.graphs.generators.smallgraphs.GrotzschGraph)
HallJankoGraph = staticmethod(sage.graphs.generators.smallgraphs.HallJankoGraph)
Expand Down

0 comments on commit 4a4ee0c

Please sign in to comment.