58.1 Constructing Vector Spaces

  • VectorSpace( F, gens[, zero][, "basis"] ) F

    For a field F and a collection gens of vectors, VectorSpace returns the F-vector space spanned by the elements in gens.

    The optional argument zero can be used to specify the zero element of the space; zero must be given if gens is empty. The optional argument "basis" indicates that gens is known to be linearly independent over F; note that Basis (see Basis) need not return the basis formed by gens if the argument "basis" is given.

    gap> V:= VectorSpace( Rationals, [ [ 1, 2, 3 ], [ 1, 1, 1 ] ] );
    <vector space over Rationals, with 2 generators>
    

  • Subspace( V, gens[, "basis"] ) F
  • SubspaceNC( V, gens[, "basis"] ) F

    For an F-vector space V and a list or collection gens that is a subset of V, Subspace returns the F-vector space spanned by gens; if gens is empty then the trivial subspace (see TrivialSubspace) of V is returned. The parent (see Parents) of the returned vector space is set to V.

    SubspaceNC does the same as Subspace, except that it omits the check whether gens is a subset of V.

    The optional argument "basis" indicates that gens is known to be linearly independent over F. In this case the dimension of the subspace is immediately set, and it is not checked (also by Subspace) whether gens really is linearly independent and whether gens is a subset of V.

    gap> V:= VectorSpace( Rationals, [ [ 1, 2, 3 ], [ 1, 1, 1 ] ] );;
    gap> W:= Subspace( V, [ [ 0, 1, 2 ] ] );
    <vector space over Rationals, with 1 generators>
    

  • AsVectorSpace( F, D ) O

    Let F be a division ring and D a domain. If the elements in D form an F-vector space then AsVectorSpace returns this F-vector space, otherwise fail is returned.

    AsVectorSpace can be used for example to view a given vector space as a vector space over a smaller or larger division ring.

    gap> V:= GF( 27 )^3;
    ( GF(3^3)^3 )
    gap> Dimension( V );  LeftActingDomain( V );
    3
    GF(3^3)
    gap> W:= AsVectorSpace( GF( 3 ), V );
    <vector space over GF(3), with 9 generators>
    gap> Dimension( W );  LeftActingDomain( W );
    9
    GF(3)
    gap> AsVectorSpace( GF( 9 ), V );
    fail
    

  • AsSubspace( V, U ) O

    Let V be an F-vector space, and U a collection. If U is a subset of V such that the elements of U form an F-vector space then AsSubspace returns this vector space, with parent set to V (see AsVectorSpace). Otherwise fail is returned.

    gap> V:= VectorSpace( Rationals, [ [ 1, 2, 3 ], [ 1, 1, 1 ] ] );;
    gap> W:= VectorSpace( Rationals, [ [ 1/2, 1/2, 1/2 ] ] );;
    gap> U:= AsSubspace( V, W );
    <vector space over Rationals, with 1 generators>
    gap> Parent( U ) = V;
    true
    gap> AsSubspace( V, [ [ 1, 1, 1 ] ] );
    fail
    

    [Top] [Up] [Next] [Index]

    GAP 4 manual
    February 2000