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

Commit

Permalink
libGAPification
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpase committed May 19, 2014
1 parent 4f82fa5 commit 3ef564e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/sage/graphs/generators/families.py
Original file line number Diff line number Diff line change
Expand Up @@ -2250,18 +2250,17 @@ def AffineOrthogonalPolarGraph(d,q,sign="+"):
from sage.rings.finite_rings.constructor import FiniteField
from sage.modules.free_module import VectorSpace
from sage.matrix.constructor import Matrix
from sage.libs.gap.libgap import libgap
from itertools import combinations

m = gap("InvariantQuadraticForm(GO("+str(s)+","+str(d)+","+str(q)+")).matrix")
F = FiniteField(q,"x",conway=True)
M = Matrix(libgap.InvariantQuadraticForm(libgap.GeneralOrthogonalGroup(s,d,q))['matrix'])
F = libgap.GF(q).sage()
V = list(VectorSpace(F,d))
M = [[F(y) for y in mm] for mm in m]
M = Matrix(F,M)

G = Graph()
G.add_vertices(map(tuple,V))
for x,y in combinations(V,2):
if not (x-y)*(M*(x-y)):
if not (x-y)*M*(x-y):
G.add_edge(tuple(x),tuple(y))

G.name("Affine Polar Graph VO^"+str('+' if s == 1 else '-')+"("+str(d)+","+str(q)+")")
Expand Down

0 comments on commit 3ef564e

Please sign in to comment.