From 6ff6a06261330d2e11aa862e1c59ac2c632a8da1 Mon Sep 17 00:00:00 2001 From: Nathann Cohen Date: Fri, 10 Jan 2014 12:27:28 +0100 Subject: [PATCH] trac #15285: Doc of AffineGeometryDesign --- src/sage/combinat/designs/block_design.py | 28 +++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/sage/combinat/designs/block_design.py b/src/sage/combinat/designs/block_design.py index 82c00a13e09..6916bdb4d86 100644 --- a/src/sage/combinat/designs/block_design.py +++ b/src/sage/combinat/designs/block_design.py @@ -219,14 +219,18 @@ def ProjectivePlaneDesign(n, type="Desarguesian"): def AffineGeometryDesign(n, d, F): r""" + Returns an Affine Geometry Design. + INPUT: - - ``n`` is the Euclidean dimension, so the number of points is + - `n` (integer) -- the Euclidean dimension. The number of points is + `v=|F^n|`. - - ``v`` is the number of points `v = |F^n|` (`F = GF(q)`, some `q`) + - `d` (integer) -- the dimension of the (affine) subspaces of `P = GF(q)^n` + which make up the blocks. - - `d` is the dimension of the (affine) subspaces of `P = GF(q)^n` which make - up the blocks. + - `F` -- a Finite Field (i.e. ``FiniteField(17)``), or a prime power + (i.e. an integer) `AG_{n,d} (F)`, as it is sometimes denoted, is a `2` - `(v, k, \lambda)` design of points and `d`- flats (cosets of dimension `n`) in the affine @@ -237,8 +241,8 @@ def AffineGeometryDesign(n, d, F): v = q^n,\ k = q^d , \lambda =\frac{(q^{n-1}-1) \cdots (q^{n+1-d}-1)}{(q^{n-1}-1) \cdots (q-1)}. - Wraps some functions used in GAP Design's PGPointFlatBlockDesign. - Does *not* require GAP's Design. + Wraps some functions used in GAP Design's ``PGPointFlatBlockDesign``. Does + *not* require GAP's Design package. EXAMPLES:: @@ -252,8 +256,18 @@ def AffineGeometryDesign(n, d, F): (2, 8, 4, 3) sage: BD.is_block_design() (True, [3, 8, 4, 1]) + + With an integer instead of a Finite Field:: + + sage: BD = designs.AffineGeometryDesign(3, 2, 4) + sage: BD.parameters() + (2, 64, 16, 5) """ - q = F.order() + try: + q = int(F) + except TypeError: + q = F.order() + from sage.interfaces.gap import gap, GapElement from sage.sets.set import Set gap.eval("V:=GaloisField(%s)^%s"%(q,n))