> < ^ Date: Tue, 23 Jul 1996 13:21:00 +0100 (MET)
> < ^ From: Thomas Breuer <Thomas.Breuer@Math.RWTH-Aachen.DE >
< ^ Subject: Re: Coefficients reverses base

Dear GAP-Forum,

Akihiro Munemasa wrote

I am not sure this is a designed feature or a bug....

If 'Base' is executed before 'Coefficients', then the (linearly
independent) generator used to define V becomes the (ordered) basis of V:

gap> V:=VectorSpace([Z(2)^0,Z(4)],GF(2));Base(V);Coefficients(V,Z(4));
VectorSpace( [ Z(2)^0, Z(2^2) ], GF(2) )
[ Z(2)^0, Z(2^2) ]
[ 0*Z(2), Z(2)^0 ]

However, if 'Coefficients' is executed before 'Base', then gap first
reversed the order of the generators of V to construct the (ordered)
basis of V:

gap> V:=VectorSpace([Z(2)^0,Z(4)],GF(2));Coefficients(V,Z(4));Base(V);
VectorSpace( [ Z(2)^0, Z(2^2) ], GF(2) )
[ Z(2)^0, 0*Z(2) ]
[ Z(2^2), Z(2)^0 ]

I would call this a bug, although it is consistent with the design of
vector spaces in GAP, and the GAP manual does not claim that linearly
independent generators of a vector space are taken as basis.

When 'Base' is called for a vector space, any convenient list of basis
vectors may be returned.
'Coefficients' uses then the basis stored in the component 'base' of
the vector space.
A user who wants to prescribe a specific basis can do this by calling

Of course this is not satisfactory, and in the next version of GAP it
will be changed.
(Note that this was announced already in the first line of the manual
chapter about vector spaces.)
The fundamental mistake is that the first argument of 'Coefficients' is
the vector space and not the basis itself with respect to that the
coefficients shall be computed.
GAP-4 will allow a much more flexible handling of vector spaces and their

Sorry for the inconveniences
Thomas Breuer

> < [top]