Dear Mrs. and Mr. Forum,
today 'gap-trouble' got a message about a problem with vector spaces in GAP.
Perhaps it is useful to tell this story to you, too.
Suppose you have a (row) vector space <V> and a list of vectors that form
a basis of <V>, and you want to compute the coefficients of arbitrary
vectors in <V> with respect to this basis.
In GAP-3.4 there is a solution for this, contrary to previous versions.
In GAP-3.3 only very special vector space bases were supported.
If the user wanted to define a basis for <V> this was done
by 'AddBase( <V>, <vectors> )', and if <vectors> was not a matrix in upper
triangular form then the basis could not be used for the computation of
coefficients.
In GAP-3.4 another mechanism is used to deal with bases of row spaces.
Such a basis is now a record constructed by 'Basis( <V>, <vectors> )'.
The basis knows about the space, the basis vectors, and how to compute
coefficients.
This means the basis is asked for the coefficients of a vector, not the
space.
The main differences between the mechanisms in GAP-3.3 and GAP-3.4 are
that in GAP-3.4 arbitrary row space bases can be defined, and that one
can deal with several bases for the same space.
Here is an example.
gap> # Construct the space. gap> vectors:= [ [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], > [ 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 ], > [ 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0 ], > [ 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0 ], > [ 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1 ], > [ 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1 ] ] * Z(3)^0;; gap> golay:= VectorSpace( vectors, GF(3) ); RowSpace( GF(3), [ [ Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0 ], [ Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0, Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], [ Z(3)^0, Z(3)^0, Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0, Z(3)^0, Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3) ], [ Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0, Z(3)^0, 0*Z(3), Z(3)^0, Z(3)^0, Z(3)^0, 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3), Z(3)^0, Z(3)^0, Z(3)^0, 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3), Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0, Z(3)^0, 0*Z(3), Z(3)^0, 0*Z(3), Z(3)^0, Z(3)^0, 0*Z(3), 0*Z(3), Z(3)^0 ] ] ) gap> Dimension( golay ); 6 gap> gap> # Define the basis. gap> b:= Basis( golay, golay.generators );; gap> gap> # Compute coefficients. gap> List( golay.generators, x -> Coefficients( b, x ) ); [ [ Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0, 0*Z(3) ], [ 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0 ] ] gap>
Kind regards
Thomas Breuer