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

Commit

Permalink
fixed typos and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo-Maffei committed Aug 3, 2020
1 parent 2f8ca0f commit 7a906b1
Showing 1 changed file with 19 additions and 26 deletions.
45 changes: 19 additions & 26 deletions src/sage/graphs/generators/distance_regular.pyx
@@ -1,5 +1,5 @@
r"""
Dabase of distance regular graphs
Database of distance regular graphs
In this module we construct several distance regular graphs
and group them in a function that maps intersection arrays
Expand Down Expand Up @@ -39,7 +39,7 @@ 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
This is a distance-regular graph with intersection array
`[15, 14, 10, 3; 1, 5, 12, 15]`.
EXAMPLES::
Expand All @@ -61,15 +61,13 @@ def cocliques_HoffmannSingleton():
edges = []
for i in range(100):
sC = frozenset(cocliques[i])
for j in range(i+1,100):
for j in range(i + 1, 100):
if len(sC.intersection(cocliques[j])) == 8:
sC2 = frozenset(cocliques[j])
edges.append( (sC,sC2) )
edges.append((sC, frozenset(cocliques[j])))

G = Graph(edges,format="list_of_edges")
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
Expand All @@ -91,13 +89,13 @@ def locally_GQ42_graph():
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)
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 = Graph(libgap.Orbit(N, [1, 9], libgap.OnSets), format='list_of_edges')
G.name("locally GQ(4,2) graph")
return G

Expand All @@ -121,18 +119,18 @@ def ConwaySmith_for_3S7():
w = F.gen()

V= VectorSpace(GF(4), 6)
z2 = GF(4)('z2') # GF(4) = {0,1,z2, z2+1}
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
# check zero entries
zeros = 0
for x in v:
if x == 0:
if x.is_zero():
zeros += 1

if zeros == 2:
Expand All @@ -143,7 +141,7 @@ def ConwaySmith_for_3S7():
for x in v:
if x == z2:
vv.append(w)
elif x == z2+1:
elif x == z2 + 1:
vv.append(w**2)
else:
vv.append(int(x)) # this is weirdly needed for some reason
Expand All @@ -154,8 +152,8 @@ def ConwaySmith_for_3S7():

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

Expand All @@ -164,22 +162,17 @@ def ConwaySmith_for_3S7():
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]
for v in K:
v.set_immutable()

if com == 2:
return True
return False
def has_edge(u, v):
return sum(u[i].conjugate() * v[i] for i in range(6)) == 2

G = Graph()
length = len(K)
for i in range(length):
K[i].set_immutable()
for j in range(i+1, length):
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")
Expand All @@ -206,7 +199,7 @@ def graph_3O73():
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)
group = libgap.AtlasGroup("3.O7(3)", libgap.NrMovedPoints, 1134)
G = Graph(libgap.Orbit(group, [1, 3], libgap.OnSets), format='list_of_edges')
G.name("Distance transitive graph with automorphism group 3.O_7(3)")
return G

0 comments on commit 7a906b1

Please sign in to comment.