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

Commit

Permalink
Projective Plane designs constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanncohen committed Sep 1, 2013
1 parent c7903c0 commit ee6d412
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 9 deletions.
90 changes: 81 additions & 9 deletions src/sage/combinat/designs/block_design.py
Expand Up @@ -84,21 +84,29 @@ def tdesign_params(t, v, k, L):

def ProjectiveGeometryDesign(n, d, F, algorithm=None):
"""
Returns a projective geometry design.
A projective geometry design of parameters `n,d,F` has for points the lines
of `F^{n+1}`, and for blocks the `d+1`-dimensional subspaces of `F^{n+1}`,
each of which contains `\frac {|F|^{d+1}-1} {|F|-1}` lines.
INPUT:
- ``n`` is the projective dimension
- ``v`` is the number of points `PPn(GF(q))`
- ``d`` is the dimension of the subspaces of `P = PPn(F)` which
make up the blocks.
- ``d`` is the dimension of the subspaces of `P = PPn(GF(q))` which
make up the blocks
- ``algorithm`` -- set to ``None`` by default, which results in using Sage's
own implementation. In order to use GAP's implementation instead (i.e. its
``PGPointFlatBlockDesign`` function) set ``algorithm="gap"``. Note that
GAP's "design" package must be available in this case.
- ``b`` is the number of `d`-dimensional subspaces of `P`
EXAMPLES:
Wraps GAP Design's PGPointFlatBlockDesign. Does *not* require
GAP's Design.
EXAMPLES::
The points of the following design are the `\frac {2^{2+1}-1} {2-1}=7` lines
of `\mathbb{Z}_2^{2+1}`. It has `7` blocks, corresponding to each
2-dimensional subspace of `\mathbb{Z}_2^{2+1}`.
sage: designs.ProjectiveGeometryDesign(2, 1, GF(2))
Incidence structure with 7 points and 7 blocks
Expand All @@ -109,7 +117,7 @@ def ProjectiveGeometryDesign(n, d, F, algorithm=None):
q = F.order()
from sage.interfaces.gap import gap, GapElement
from sage.sets.set import Set
if algorithm == None:
if algorithm is None:
V = VectorSpace(F, n+1)
points = list(V.subspaces(1))
flats = list(V.subspaces(d+1))
Expand All @@ -132,6 +140,70 @@ def ProjectiveGeometryDesign(n, d, F, algorithm=None):
gB.append([x-1 for x in b])
return BlockDesign(v, gB, name="ProjectiveGeometryDesign")

def ProjectivePlaneDesign(n):
r"""
Returns a projective plane of order `n`.
A finite projective plane is a 2-design with `n^2+n+1` lines (or blocks) and
`n^2+n+1` points. For more information on finite projective planes, see the
:wikipedia:`Projective_plane#Finite_projective_planes`.
INPUT:
- ``n`` -- the finite projective plane's order
OUTPUT:
A finite projective plane obtained by considering the 1- and 2- dimensional
spaces of `F_n^3`.
.. SEEALSO::
:meth:`ProjectiveGeometryDesign`
EXAMPLES::
sage: designs.ProjectivePlaneDesign(2)
Incidence structure with 7 points and 7 blocks
Non-existent ones::
sage: designs.ProjectivePlaneDesign(10)
Traceback (most recent call last):
...
ValueError: No projective plane design of order 10 exists.
sage: designs.ProjectivePlaneDesign(14)
Traceback (most recent call last):
...
ValueError: By the Bruck-Ryser-Chowla theorem, no projective plane of order 14 exists.
An unknown one::
sage: designs.ProjectivePlaneDesign(12)
Traceback (most recent call last):
...
ValueError: If such a projective plane exists, we do not know how to build it.
"""
from sage.rings.finite_rings.constructor import FiniteField
from sage.rings.arith import two_squares

try:
F = FiniteField(n, 'x')
except ValueError:
if n == 10:
raise ValueError("No projective plane design of order 10 exists.")
try:
if (n%4) in [1,2]:
two_squares(n)
except ValueError:
raise ValueError("By the Bruck-Ryser-Chowla theorem, no projective"
" plane of order "+str(n)+" exists.")

raise ValueError("If such a projective plane exists, "
"we do not know how to build it.")

return ProjectiveGeometryDesign(2,1,F)

def AffineGeometryDesign(n, d, F):
r"""
INPUT:
Expand Down
2 changes: 2 additions & 0 deletions src/sage/combinat/designs/design_catalog.py
Expand Up @@ -39,6 +39,7 @@
:delim: |
:meth:`~sage.combinat.designs.block_design.ProjectiveGeometryDesign`
:meth:`~sage.combinat.designs.block_design.ProjectivePlaneDesign`
:meth:`~sage.combinat.designs.block_design.AffineGeometryDesign`
:meth:`~sage.combinat.designs.block_design.WittDesign`
:meth:`~sage.combinat.designs.block_design.HadamardDesign`
Expand All @@ -59,6 +60,7 @@
http://www.ccrwest.org/cover.html
"""
from sage.combinat.designs.block_design import (ProjectiveGeometryDesign,
ProjectivePlaneDesign,
AffineGeometryDesign,
WittDesign,
HadamardDesign,
Expand Down

0 comments on commit ee6d412

Please sign in to comment.