| 1973 | |
| 1974 | def SymplecticGraph(d,q): |
| 1975 | r""" |
| 1976 | Returns the Symplectic graph `Sp(d,q)` |
| 1977 | |
| 1978 | The Symplectic Graph `Sp(d,q)` is built from a projective space of dimension |
| 1979 | `d-1` over a field `F_q`, and a symplectic form `f`. Two vertices `u,v` are |
| 1980 | made adjacent if `f(u,v)=0`. |
| 1981 | |
| 1982 | See the `page on symplectic graphs on Andries Brouwer's website |
| 1983 | <http://www.win.tue.nl/~aeb/graphs/Sp.html>`_. |
| 1984 | |
| 1985 | INPUT: |
| 1986 | |
| 1987 | - ``d,q`` (integers) -- note that only even values of `d` are accepted by |
| 1988 | the function. |
| 1989 | |
| 1990 | EXAMPLES:: |
| 1991 | |
| 1992 | sage: g = graphs.SymplecticGraph(6,2) |
| 1993 | sage: g.is_strongly_regular(parameters=True) |
| 1994 | (63, 30, 13, 15) |
| 1995 | sage: set(g.spectrum()) == {-5, 3, 30} |
| 1996 | True |
| 1997 | """ |
| 1998 | from sage.rings.finite_rings.constructor import FiniteField |
| 1999 | from sage.modules.free_module import VectorSpace |
| 2000 | from sage.schemes.generic.projective_space import ProjectiveSpace |
| 2001 | from sage.matrix.constructor import identity_matrix, block_matrix, zero_matrix |
| 2002 | |
| 2003 | if d < 1 or d%2 != 0: |
| 2004 | raise ValueError("d must be even and greater than 2") |
| 2005 | |
| 2006 | F = FiniteField(q,"x") |
| 2007 | M = block_matrix(F, 2, 2, |
| 2008 | [zero_matrix(F,d/2), |
| 2009 | identity_matrix(F,d/2), |
| 2010 | -identity_matrix(F,d/2), |
| 2011 | zero_matrix(F,d/2)]) |
| 2012 | |
| 2013 | V = VectorSpace(F,d) |
| 2014 | PV = list(ProjectiveSpace(d-1,F)) |
| 2015 | G = Graph([map(tuple,PV), lambda x,y:V(x)*(M*V(y)) == 0], loops = False) |
| 2016 | G.name("Symplectic Graph Sp("+str(d)+","+str(q)+")") |
| 2017 | G.relabel() |
| 2018 | return G |
| 2019 | |