[GAP Forum] Running through subspaces over finite field

Frank Lübeck Frank.Luebeck at math.rwth-aachen.de
Tue Jun 12 16:52:09 BST 2007


On Mon, Jun 11, 2007 at 02:27:58PM -0500, Arturo Magidin wrote:
> over the subspaces of dimension 8 of the space of dimension 10 over 
> GF(3) (there are about 74 million such subspaces).
> 
> After defining
> 
> gap> V:=GF(3)^10;
> gap> subspaces:=Subspaces(V,8);
> 
> I defined an iterator,
> 
> gap> iter:=Iterator(subspaces);
[...]
> My question is whether there is an easy way to acces the nth subspace 
> produced by the iterator other than to iterate it a step at a time.

Dear Arturo Magidin, dear Forum,

You are looking for what is called an 'Enumerator' in GAP. But in this 
case there is no efficient Enumerator implemented.

Some remarks:

- You can say Enumerator(subspaces) in GAP but it would just use
  the Iterator to produce a list of all subspaces and therefore run out of
  memory (on most machines).

- You don't need to call Iterator explicitly, but can also use a loop like
    for u in subspaces do 
      myfunc(u);
    od;
  (but this uses the iterator internally)
 
- It seems that in your example you are looking for a not too large set
  of subspaces. So, in your loop you could just store all of them in a list:
    interesting := [];
    for u in subspaces do
      if IsInterestingForMe(u) then
        Add(interesting, u);
      fi;
    od;

- The iterator for these subspaces works by running through matrices in
  (Hermite) normal form of the right rank. It wouldn't be too difficult to 
  implement an efficient Enumerator as well.

Best regards,

   Frank Lübeck
-- 
///  Dr. Frank Lübeck, Lehrstuhl D für Mathematik, Templergraben 64,  ///
\\\                    52062 Aachen, Germany                          \\\
///  E-mail: Frank.Luebeck at Math.RWTH-Aachen.De                        ///
\\\  WWW:    http://www.math.rwth-aachen.de/~Frank.Luebeck/           \\\



More information about the Forum mailing list