Coefficients( V, v )
Coefficients
computes the coefficients that have to be used to write
v as a linear combination in the base of V.
To make sure that this function produces the correct result, v has to be an element of V. If v does not lie in V the result is unpredictable.
The result of Coefficients
is returned as a list of elements of the
field over which the vector space V is written. Of course, the length
of this list equals the dimension of V.
gap> f := GF( 3^4 ); GF(3^4) gap> f.base; [ Z(3)^0, Z(3^4), Z(3^4)^2, Z(3^4)^3 ] gap> V := VectorSpace( f.base, GF( 3 ) ); VectorSpace( [ Z(3)^0, Z(3^4), Z(3^4)^2, Z(3^4)^3 ], GF(3) ) gap> Dimension( V ); 4 gap> Coefficients( V, f.root ^ 16 ); [ Z(3), Z(3)^0, Z(3), 0*Z(3) ]
GAP 3.4.4