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

Commit

Permalink
some code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo-Maffei committed Aug 7, 2020
1 parent e410f11 commit efa9340
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/sage/graphs/generators/distance_regular.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -589,18 +589,19 @@ def UstimenkoGraph(const int m, const int q):
"""
from sage.graphs.graph_generators import graphs

G = graphs.SymplecticDualPolarGraph(2*m-2,q)
G = graphs.SymplecticDualPolarGraph(2*m - 2, q)

edgesToAdd = []
for v in G.vertices(sort=False):
for w in G.neighbors(v):
for u in G.neighbors(w):
if u != v and not G.has_edge(u,v):
for v in G:
for w in G.neighbor_iterator(v):
for u in G.neighbor_iterator(w):
sig_check()
if u != v and not G.has_edge(u, v):
# then u,v are at distance 2
edgesToAdd.append((u, v))

G.add_edges(edgesToAdd)
G.name(f"Ustimenko graph ({m},{q})")
G.name(f"Ustimenko graph ({m}, {q})")
return G

def DualPolarOrthogonalGraph(const int e, const int d, const int q):
Expand Down Expand Up @@ -688,15 +689,15 @@ def DualPolarOrthogonalGraph(const int e, const int d, const int q):
# check if we can add it to K
found = True
for w in isotropicBasis:
if w*M*v+v*M*w != 0:
if w*M*v + v*M*w != 0:
found = False
break
# here we found a valid point
isotropicBasis.append(v)

# remove new points of K
newVectors = map(hashable,
[k+l*v for k in K for l in nonZeroScalars])
[k + l*v for k in K for l in nonZeroScalars])
candidates.difference(newVectors)
K = V.span(isotropicBasis)

Expand All @@ -721,7 +722,7 @@ def DualPolarOrthogonalGraph(const int e, const int d, const int q):
allIsoSubspaces = libgap.Orbit(permutation, isoSPointsInt, libgap.OnSets)

# number of projective points in a (d-1)-subspace
intersection_size = (q**(d - 1) - 1) / (q-1)
intersection_size = (q**(d-1) - 1) / (q-1)

edges = []
n = len(allIsoSubspaces)
Expand All @@ -732,5 +733,5 @@ def DualPolarOrthogonalGraph(const int e, const int d, const int q):
edges.append((i, j))

G = Graph(edges, format="list_of_edges")
G.name("Dual Polar Graph on Orthogonal group (%d,%d,%d)"%(e,m,q))
G.name("Dual Polar Graph on Orthogonal group (%d, %d, %d)"%(e, m, q))
return G

0 comments on commit efa9340

Please sign in to comment.