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

Commit

Permalink
added a few sporadic distance regular graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo-Maffei committed Aug 3, 2020
1 parent 2818739 commit 89aaa5b
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/doc/en/reference/references/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5303,6 +5303,9 @@ REFERENCES:
.. [Terwilliger2011] Paul Terwilliger. *The universal Askey-Wilson algebra*.
SIGMA **7** (2011), 069, 24 pages. :arxiv:`1104.2813`.
.. [TP1994] \J. Thas, S. Payne, *Spreads and ovoids in finite generalized
quadrangles*. Geometriae Dedicata, Vol. 52, pp. 227-253, 1994.
.. [Tho2010] \T. Thongjunthug, Computing a lower bound for the canonical
height on elliptic curves over number fields, Math. Comp. 79
(2010), pages 2431-2449.
Expand Down Expand Up @@ -5396,6 +5399,9 @@ REFERENCES:
Numer. Algorithms, 3:451-462, 1992.
:doi:`10.1007/BF02141952`
.. [VDKT2016] \E. R. van Dam, J. H. Koolen, H. Tanaka, *Distance Regular graphs*
The Electronic Journal of Combinatorics. 2016
.. [Vee1978] William Veech, "Interval exchange
transformations", J. Analyse Math. 33 (1978), 222-272
Expand Down Expand Up @@ -5534,6 +5540,11 @@ REFERENCES:
tableaux*. Dissertation, Massachusetts Institute of
Technology, 1984.
.. [WPNBBAtl] \R. A. Wilson, R. A. Parker, S. Nickerson, J. N. Bray,
\T. Breuer, *AtlasRep, a GAP interface to the atlas
of group representations*.
http://www.math.rwth-aachen.de/~Thomas.Breuer/atlasrep
.. [WP-Bessel] :wikipedia:`Bessel_function`
.. [WP-Error] :wikipedia:`Error_function`
Expand Down
212 changes: 212 additions & 0 deletions src/sage/graphs/distance_regular.pyx
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
r"""
Dabase of distance regular graphs
In this module we construct several distance regular graphs
and group them in a function that maps intersection arrays
to graphs.
For a survey on distance-regular graph see [BCN1989]_ or [VDKT2016]_.
EXAMPLES::
sage: G = graphs.cocliques_HoffmannSingleton()
sage: G.is_distance_regular()
True
AUTHORS:
- Ivo Maffei (2020-07-28): initial version
"""

# ****************************************************************************
# Copyright (C) 2020 Ivo Maffei <ivomaffei@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.graphs.graph import Graph
from sage.libs.gap.libgap import libgap
from sage.modules.free_module import VectorSpace
from sage.modules.free_module_element import vector
from sage.rings.finite_rings.finite_field_constructor import GF

def cocliques_HoffmannSingleton():
r"""
Return the graph obtained from the cocliques of the Hoffmann-Singleton graph.
This is a distance-regular graph with intersecion array
`[15, 14, 10, 3; 1, 5, 12, 15]`.
EXAMPLES::
sage: G = graphs.cocliques_HoffmannSingleton()
sage: G.is_distance_regular(True)
([15, 14, 10, 3, None], [None, 1, 5, 12, 15])
REFERENCES:
The construction of this graph can be found in [BCN1989]_ p. 392.
"""
from sage.graphs.graph_generators import GraphGenerators
D = GraphGenerators.HoffmanSingletonGraph()
DC = D.complement()

cocliques = DC.cliques_maximum() # 100 of this

edges = []
for i in range(100):
sC = frozenset(cocliques[i])
for j in range(i+1,100):
if len(sC.intersection(cocliques[j])) == 8:
sC2 = frozenset(cocliques[j])
edges.append( (sC,sC2) )

G = Graph(edges,format="list_of_edges")
return G


def locally_GQ42_graph():
r"""
Return the unique amply regular graph which is locally a generalised
quadrangle.
This graph is distance-regular with intersection array
`[45, 32, 12, 1; 1, 6, 32, 45]`.
This graph is also distance-transitive.
EXAMPLES::
sage: G = graphs.locally_GQ42_graph()
sage: G.is_distance_regular(True)
([45, 32, 12, 1, None], [None, 1, 6, 32, 45])
.. NOTE::
This function needs the GAP's package AtlasRep [WPNBBAtl]_.
Install it via ``sage -i gap_packages``.
"""
H = libgap.AtlasGroup("3^2.U4(3).D8",libgap.NrMovedPoints,756)
Ns = H.NormalSubgroups()
for N in Ns:
if len(N.GeneratorsSmallest()) == 7: # there is only one
break

G = Graph(libgap.Orbit(N,[1,9],libgap.OnSets), format='list_of_edges')
G.name("locally GQ(4,2) graph")
return G


def ConwaySmith_for_3S7():
r"""
Return the Conway-Smith graph related to `3 Sym(7)`.
This is a distance-regular graph with intersection array
`[10, 6, 4, 1; 1, 2, 6, 10]`.
EXAMPLES::
sage: G = graphs.ConwaySmith_for_3S7()
sage: G.is_distance_regular(True)
([10, 6, 4, 1, None], [None, 1, 2, 6, 10])
"""
from sage.rings.number_field.number_field import CyclotomicField

F = CyclotomicField(3)
w = F.gen()

V= VectorSpace(GF(4), 6)
z2 = GF(4)('z2') # GF(4) = {0,1,z2, z2+1}

W = V.span([(0,0,1,1,1,1), (0,1,0,1,z2,z2+1), (1,0,0,1,z2+1,z2)])
# we only need the 45 vectors with 2 zero entries
# we also embed everything into CC

K = []
for v in W:
#check zero entries
zeros = 0
for x in v:
if x == 0:
zeros += 1

if zeros == 2:
# send to F and in K
# z2 -> w
# z2+1 -> w^2
vv = [] # new vector
for x in v:
if x == z2:
vv.append(w)
elif x == z2+1:
vv.append(w**2)
else:
vv.append(int(x)) # this is weirdly needed for some reason

# now vv is the new vector in F
vv = vector(F, vv)
K.append(vv)

# we need to add other vectors
for i in range(6):
#create e_i
ei = [0]*6
ei[i] = 1
ei = vector(F, ei)

K.append(2 * ei)
K.append(2 * w * ei)
K.append(2 * w**2 * ei)
# now K is all the 63 vertices

def has_edge(u,v):
com = 0
for i in range(6):
com += u[i].conjugate() * v[i]

if com == 2:
return True
return False

G = Graph()
length = len(K)
for i in range(length):
K[i].set_immutable()
for j in range(i+1, length):
if has_edge(K[i], K[j]):
K[j].set_immutable()
G.add_edge((K[i], K[j]))

G.name("Conway-Smith graph for 3S7")
return G

def graph_3O73():
r"""
Return the graph related to the group `3 O(7,3)`.
This graph is distance-regular with intersection array
`[117, 80, 24, 1; 1, 12, 80, 117]`.
The graph is also distance transitive with "3.O(7,3)" as automorphism
group
EXAMPLES::
sage: G = graphs.graph_3O73()
sage: G.is_distance_regular(True)
([117, 80, 24, 1, None], [None, 1, 12, 80, 117])
.. NOTE::
This function needs the GAP's package AtlasRep [WPNBBAtl]_.
Install it via ``sage -i gap_packages``.
"""
group = libgap.AtlasGroup("3.O7(3)",libgap.NrMovedPoints,1134)
G = Graph(group.Orbit([1,3], libgap.OnSets), format='list_of_edges')
G.name("Distance transitive graph with automorphism group 3.O_7(3)")
return G
9 changes: 9 additions & 0 deletions src/sage/graphs/graph_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def __append_to_doc(methods):
"Cell120",
"ChvatalGraph",
"ClebschGraph",
"cocliques_HoffmannSingleton",
"ConwaySmith_for_3S7",
"CoxeterGraph",
"DesarguesGraph",
"DejterGraph",
Expand All @@ -122,6 +124,7 @@ def __append_to_doc(methods):
"GoldnerHararyGraph",
"GolombGraph",
"GossetGraph",
"graph_3O73",
"GrayGraph",
"GrotzschGraph",
"HallJankoGraph",
Expand All @@ -142,6 +145,7 @@ def __append_to_doc(methods):
"KrackhardtKiteGraph",
"Klein3RegularGraph",
"Klein7RegularGraph",
"locally_GQ42_graph",
"LocalMcLaughlinGraph",
"LjubljanaGraph",
"LivingstoneGraph",
Expand Down Expand Up @@ -1908,6 +1912,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None
# Small Graphs
###########################################################################
from .generators import smallgraphs
from sage.graphs import distance_regular
Balaban10Cage = staticmethod(smallgraphs.Balaban10Cage)
Balaban11Cage = staticmethod(smallgraphs.Balaban11Cage)
BidiakisCube = staticmethod(smallgraphs.BidiakisCube)
Expand All @@ -1922,6 +1927,8 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None
Cell120 = staticmethod(smallgraphs.Cell120)
ChvatalGraph = staticmethod(smallgraphs.ChvatalGraph)
ClebschGraph = staticmethod(smallgraphs.ClebschGraph)
cocliques_HoffmannSingleton = staticmethod(distance_regular.cocliques_HoffmannSingleton)
ConwaySmith_for_3S7 = staticmethod(distance_regular.ConwaySmith_for_3S7)
CoxeterGraph = staticmethod(smallgraphs.CoxeterGraph)
DejterGraph = staticmethod(smallgraphs.DejterGraph)
DesarguesGraph = staticmethod(smallgraphs.DesarguesGraph)
Expand All @@ -1940,6 +1947,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None
GoldnerHararyGraph = staticmethod(smallgraphs.GoldnerHararyGraph)
GolombGraph = staticmethod(smallgraphs.GolombGraph)
GossetGraph = staticmethod(smallgraphs.GossetGraph)
graph_3O73 = staticmethod(distance_regular.graph_3O73)
GrayGraph = staticmethod(smallgraphs.GrayGraph)
GrotzschGraph = staticmethod(smallgraphs.GrotzschGraph)
HallJankoGraph = staticmethod(smallgraphs.HallJankoGraph)
Expand All @@ -1961,6 +1969,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None
KrackhardtKiteGraph = staticmethod(smallgraphs.KrackhardtKiteGraph)
Klein3RegularGraph = staticmethod(smallgraphs.Klein3RegularGraph)
Klein7RegularGraph = staticmethod(smallgraphs.Klein7RegularGraph)
locally_GQ42_graph = staticmethod(distance_regular.locally_GQ42_graph)
LocalMcLaughlinGraph = staticmethod(smallgraphs.LocalMcLaughlinGraph)
LjubljanaGraph = staticmethod(smallgraphs.LjubljanaGraph)
LivingstoneGraph = staticmethod(smallgraphs.LivingstoneGraph)
Expand Down

0 comments on commit 89aaa5b

Please sign in to comment.