56 Vector Spaces

Vector spaces are free left modules over a field.

Sections

  1. Constructing Vector Spaces
  2. Categories and Properties for Vector Spaces
  3. Operations and Attributes for Vector Spaces
  4. Bases of Vector Spaces
  5. Mutable Bases
  6. Vector Space Homomorphisms

56.1 Constructing Vector Spaces

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

    is the vector space over the field F spanned by the elements in gens. The optional argument zero can be used to specify the null element of the space. The argument "basis" can be used if the generators in gens are known to form a basis of the vector space (i.e., if they are known to be linearly independent).

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

  • Subspace( V, gens ) F
  • Subspace( V, gens, "basis" ) F

    is the subspace of the vector space V spanned by the collection gens. If the elements of gens are known to be linearly independent, then the optional argument "basis" may be added. In this case the dimension of the subspace is immediately set; it is not checked whether gens really are linearly independent and whether all in gens lie in V.

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

  • SubspaceNC( V, gens ) F
  • SubspaceNC( V, gens, "basis" ) F

    SubspaceNC does the same as Subspace, except that it does not check whether all in gens lie in V.

    gap> vecs:= [ [ 1, 2, 3 ], [ 1, 1, 1 ] ];;
    gap> V:= VectorSpace( Rationals, vecs );;
    VectorSpace( Rationals, [ [ 0, 1, 2 ] ] )
    

  • FullRowSpace( F, n ) F

    Is the n-dimensional vector space Fn.

    gap> FullRowSpace( GF( 9 ), 3 );  
    ( GF(3^2)^3 )
    

    56.2 Categories and Properties for Vector Spaces

  • IsLeftVectorSpace( D ) C
  • IsVectorSpace( D ) C

    A (left) vector space in GAP is an additive group that is acted on by a division ring from the left such that this action and the addition are left and right distributive.

    (Vector spaces in GAP are always left vector spaces.)

  • IsGaussianSpace( V ) C

    A vector space is Gaussian if it allows Gaussian elimination; this is used for row vector spaces and matrix vector spaces.

    gap> mats:= [ [[1,1],[2,2]], [[3,4],[0,1]] ];;
    gap> V:= VectorSpace( Rationals, mats );;
    gap> IsGaussianSpace( V );
    true
    

  • IsSubspacesVectorSpace( D ) C

    The domain of all subspaces of a (finite) vector space lies in the category IsSubspacesVectorSpace.

    gap> V:= VectorSpace( GF(2^2), [ [ Z(2)^0, 0*Z(2) ], [ 0*Z(2), Z(2)^0 ] ] );;
    gap> D:= SubspacesDim( V, 1 );
    Subspaces( VectorSpace( GF(2^2), [ [ Z(2)^0, 0*Z(2) ], [ 0*Z(2), Z(2)^0 ] 
     ] ), 1 )
    gap> IsSubspacesVectorSpace( D );
    true
    

    56.3 Operations and Attributes for Vector Spaces

  • GeneratorsOfLeftVectorSpace( V ) A
  • GeneratorsOfVectorSpace( V ) A

    returns a set of elements of V that spans V.

    gap> vecs:= [ [ 1, 2, 3 ], [ 1, 1, 1 ], [ 1, 1, 1 ] ];;
    gap> V:= VectorSpace( Rationals, vecs );;
    gap> GeneratorsOfVectorSpace( V );
    [ [ 1, 2, 3 ], [ 1, 1, 1 ], [ 1, 1, 1 ] ]
    

  • NormedRowVectors( V ) A

    returns a list of those vectors in the row space V that have a one in the first nonzero component and are not equal to zero. (This function makes sense only for finite Gaussian vector spaces.)

    gap> V:= GF(3)^2;;
    gap> NormedRowVectors( V );
    [ [ 0*Z(3), Z(3)^0 ], [ Z(3)^0, 0*Z(3) ], [ Z(3)^0, Z(3)^0 ], 
      [ Z(3)^0, Z(3) ] ]
    

  • TrivialSubspace( V ) A

    returns the subspace of V generated by the zero vector of V

    gap> V:= GF(3)^3;;                    
    gap> TrivialSubspace( V );
    <vector space over GF(3), with 0 generators>
    

  • AsSubspace( V, U ) O

    If the vector space U happens to be contained in the vector space V, then it can be viewed as subspace of V. This function returns that subspace.

    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
    

  • AsVectorSpace( F, D ) O

    returns the domain D viewed as vector space over F.

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

  • SubspacesDim( V, dim ) O
  • SubspacesAll( V ) A

    returns a domain of subspaces of V. In the first form this domain contains all subspaces of dimension dim. In the second form this domain contains all subspaces of V. These functions only make sense for finite vector spaces.

  • Subspaces( V ) F
  • Subspaces( V, k ) F

    is the domain of (k-dimensional) subspaces of the finite vector space V.

    gap> W:= FullRowSpace( GF( 3 ), 3 );;
    gap> Subspaces( W );
    Subspaces( ( GF(3)^3 ), "all" )
    

    56.4 Bases of Vector Spaces

    A basis of a free left F-module V of dimension n, say, is an ordered list of vectors B = [ v1, v2, ¼, vn ] in V such that V is generated as a left module by these vectors. In GAP bases behave like lists, i.e., their elements can be accessed via [ ], and they have a length:

    gap> V:= Rationals^3;
    ( Rationals^3 )
    gap> B:= Basis( V );
    CanonicalBasis( ( Rationals^3 ) )
    gap> B[1];
    [ 1, 0, 0 ]
    gap> Length( B );
    3
    

    The basic operations for bases are Coefficients and LinearCombination.

    GAP supports three types of bases, namely

    1.
    relative bases that delegate the work to another basis of the same left module (via a basechange matrix),

    2.
    bases handled by nice bases that delegate the work to a basis of an isomorphic left module over the same left acting domain, and

    3.
    bases that really do the work.

    Constructors for bases are RelativeBasis resp. RelativeBasisNC in the case of relative bases, and NewBasis in the other cases. Note that the left module knows whether its bases use nice bases or bases that do the work, so appropriate methods of NewBasis can be installed. RelativeBasis does only need one method.

    Examples:

    -
    In the case of Gaussian row and matrix spaces, Basis( V ) computes a semi-echelonized basis that uses Gaussian elimination. A basis constructed with user supplied vectors is either semi-echelonized or is a relative basis.

    -
    In the case of handling by nice bases, no basechange matrix is used (the nice basis, however, is allowed to use a basechange matrix).

    -
    Non-Gaussian row and matrix spaces are handled via nice bases.

    -
    Field element spaces occur in two situations. For the fields themselves and subfields special bases are used. For a subspace of a field the nice basis is constructed relative to a basis of the enveloping field.

  • Basis( V ) A
  • Basis( V, vectors ) O
  • BasisNC( V, vectors ) O

    Called with a free left module V as the only argument, Basis returns an arbitrary basis of V.

    If additionally a list vectors of vectors in V is given that forms a basis of V then Basis returns this basis; if vectors are not linearly independent or do not generate V as a free left module over the left acting domain of V then fail is returned.

    BasisNC does the same as Basis for two arguments, except that it is not checked whether vectors form a basis.

    gap> V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;
    gap> Basis( V );
    SemiEchelonBasis( <vector space over Rationals, with 2 generators>,... )
    gap> B:= Basis( V, [ [ 1, 2, 7 ], [ 3, 2, 30 ] ] );
    Basis( <vector space over Rationals, with 2 generators>,
    [ [ 1, 2, 7 ], [ 3, 2, 30 ] ] )
    gap> BasisVectors( B );
    [ [ 1, 2, 7 ], [ 3, 2, 30 ] ]
    

  • SemiEchelonBasis( V ) A
  • SemiEchelonBasis( V, vectors ) O
  • SemiEchelonBasisNC( V, vectors ) O

    Let V be a Gaussian row or matrix vector space over the field F. A basis of V is called semi-echelonized if its basis vectors form a semi-echelonized matrix (see SemiEchelonMat).

    Called with V as the only argument, SemiEchelonBasis returns an arbitrary semi-echelonized basis of V.

    If additionally a list vectors of vectors in V is given that forms a semi-echelonized basis of V then SemiEchelonBasis returns this basis; if vectors do not form a basis of V then fail is returned.

    SemiEchelonBasisNC does the same as SemiEchelonBasis for two arguments, except that it is not checked whether vectors form a semi-echelonized basis.

    gap> V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;
    gap> SemiEchelonBasis( V );
    SemiEchelonBasis( <vector space over Rationals, with 2 generators>,...)
    gap> B:= SemiEchelonBasis( V, [ [1,2,7],[0,1,-9/4] ] );
    SemiEchelonBasis( <vector space over Rationals, with 2 generators>,
      [ [1,2,7],[0,1,-9/4] ] )
    

  • CanonicalBasis( V ) A

    Returns a "triangular" basis of V (i.e., the i-th basis vector of this basis has zero's until position i).

    gap> vecs:= [ [ 1, 2, 3 ], [ 1, 1, 1 ], [ 1, 1, 1 ] ];;
    gap> V:= VectorSpace( Rationals, vecs );;
    gap> B:= CanonicalBasis( V );
    CanonicalBasis(<vector space over Rationals, with 3 generators>)
    gap> BasisVectors( B );
    [ [ 1, 0, -1 ], [ 0, 1, 2 ] ]
    

  • IsBasis( obj ) C

    A basis of a free left module is an object that knows how to compute coefficients w.r.t. its basis vectors. A basis is an immutable list, the i-th entry being the i-th basis vector.

    (See IsMutableBasis (ref:ismutablebasis) for mutable bases.)

    gap> V:= FullRowSpace( GF(2), 6 );;
    gap> B:= Basis( V );;
    gap> IsBasis( B );
    true
    

  • IsCanonicalBasis( B ) P

    If the underlying free left module V of the basis B supports a canonical basis (see CanonicalBasis) then IsCanonicalBasis returns true if B is equal to the canonical basis of V, and false otherwise.

  • IsCanonicalBasisFullRowModule( B ) P

    is true if the underlying free left module of the basis B is a full row module and B is equal to its canonical basis, and false otherwise.

  • IsCanonicalBasisFullMatrixModule( B ) P

    is true if the underlying free left module of the basis B is a full matrix module and B is equal to its canonical basis, and false otherwise.

  • IsIntegralBasis( B ) P

    is true if B is a basis for the ring of integers in the underlying left module of B, which must be a field.

    gap> F:= GaussianRationals;;
    gap> B:= Basis( F );;                                             
    gap> IsIntegralBasis(B);
    true
    

  • IsNormalBasis( B ) P

    is true if B is invariant under the Galois group of the underlying left module of B, which must be a field.

  • IsSemiEchelonized( B ) P

    is used for Gaussian row and matrix vector spaces. A basis is semi-echelonized if its basis vectors form an upper triangular matrix with 1-s on the diagonal.

    gap> V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;
    gap> B:= Basis( V, [ [1,2,7],[0,1,-9/4] ] );;           
    gap> IsSemiEchelonized(B);
    true
    

  • BasisVectors( B ) A

    is the (immutable) list of basis vectors of the basis B.

    gap> V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;
    gap> B:= Basis( V, [ [ 1, 2, 7 ], [ 0, 1, -9/4 ] ] );;
    gap> BasisVectors( B ); 
    [ [ 1, 2, 7 ], [ 0, 1, -9/4 ] ]
    

  • StructureConstantsTable( B ) A

    is defined only if the underlying left module of the basis B is also a ring.

    In this case StructureConstantsTable returns a structure constants table T in sparse representation, as used for structure constants algebras (see Section tut:algebras of the user's tutorial).

    The coefficients of the product bi bj of basis vectors are stored in T[i][j] as a list of length 2; its first entry is the list of positions of nonzero coefficients, the second entry is the list of the coefficients themselves.

    The multiplication in an algebra A with vector space basis B with basis vectors ( v1, ¼, vn ) is determined by the so-called structure matrices Mk = [ mijk ]ij, 1 £ i £ n. The Mk are defined by vi vj = åk mi,j,k vk. Let a = [ a1, ¼, an ], b = [ b1, ¼, bn ]. Then

    (
    å
    i 
    ai vi ) (
    å
    j 
    bj vj ) =
    å
    i,j 
    ai bj ( vi vj ) =
    å
    k 
    (
    å
    j 
    (
    å
    i 
    ai mi,j,k ) bj ) vk =
    å
    k 
    ( a Mk btr ) vk  .

    gap> A:= QuaternionAlgebra( Rationals );;
    gap> StructureConstantsTable( Basis( A ) );
    [ [ [ [ 1 ], [ 1 ] ], [ [ 2 ], [ 1 ] ], [ [ 3 ], [ 1 ] ], [ [ 4 ], [ 1 ] ] ], 
      [ [ [ 2 ], [ 1 ] ], [ [ 1 ], [ -1 ] ], [ [ 4 ], [ 1 ] ], [ [ 3 ], [ -1 ] ] ], 
      [ [ [ 3 ], [ 1 ] ], [ [ 4 ], [ -1 ] ], [ [ 1 ], [ -1 ] ], [ [ 2 ], [ 1 ] ] ], 
      [ [ [ 4 ], [ 1 ] ], [ [ 3 ], [ 1 ] ], [ [ 2 ], [ -1 ] ], [ [ 1 ], [ -1 ] ] ]
        , 0, 0 ]
    

  • UnderlyingLeftModule( B ) A

    Is the left module of which B is a basis.

    gap> V:= FullRowSpace( GF(2), 6 );;                                  
    gap> B:= Basis( V );;                                            
    gap> UnderlyingLeftModule( B );
    ( GF(2)^6 )
    

  • Coefficients( B, v ) O

    Let V be the underlying left module of the basis B, and v a vector such that the family of v is the elements family of the family of V. Then Coefficients( B, v ) is the list of coefficients of v w.r.t. B if v lies in V, and fail otherwise.

    gap> V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;
    gap> B:= Basis( V, [ [ 1, 2, 7 ], [ 0, 1, -9/4 ] ] );;
    gap> Coefficients( B, [ 1/2, 1/3, 5 ] );
    [ 1/2, -2/3 ]
    

  • LinearCombination( B, coeff ) O
  • LinearCombination( vectors, coeff ) O

    is the vector åi = 1n coeff [i] \* BasisVectors( B )[i].

    gap> V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;
    gap> B:= Basis( V, [ [ 1, 2, 7 ], [ 0, 1, -9/4 ] ] );;
    gap> LinearCombination( B, [ 1/2, -2/3 ] );
    [ 1/2, 1/3, 5 ]
    

  • SiftedVector( B, v ) O

    Is the residuum of the vector v with respect to the basis B. So SiftedVector( B, v ) = 0 if and only if v lies in the underlying left module of B. This operation is defined only for semi-echelonized bases (or mutable bases) of Gaussian row and matrix vector spaces. If the scalars in the vector v are not all contained in the base field of the underlying left module of B then fail is returned.

    gap> V:= VectorSpace( Rationals, [ [ 1, 2, 7 ], [ 1/2, 1/3, 5 ] ] );;
    gap> B:= Basis( V );;
    gap> SiftedVector( B, [ 1, 2, 8 ] );                    
    [ 0, 0, 1 ]
    

  • EnumeratorByBasis( B ) A

    is an enumerator for the underlying left module of the basis B w.r.t. this basis.

    gap> V:= Rationals^3;;
    gap> EnumeratorByBasis( Basis( V ) );
    <enumerator of ( Rationals^3 )>
    

  • IteratorByBasis( B ) O

    is an iterator for the underlying left module of the basis B w.r.t. this basis.

    gap> V:= Rationals^3;;
    gap> IteratorByBasis( Basis( V ) );       
    <iterator>
    

    56.5 Mutable Bases

    It is useful to have a mutable basis of a free module when successively closures with new vectors are formed, since one does not want to create a new module and a corresponding basis for each step.

    Note that the situation here is different from the situation with stabilizer chains, which are (mutable or immutable) records that do not need to know about the groups they describe. There are several reasons to store the underlying module in an immutable basis.

    -
    One cannot have bases without vectors if the module is not stored. (The call BasisOfDomain( V ) may return such a basis.)

    -
    In some cases it is cheaper to compute coefficients only after a (positive) membership test, which is a question to the module. This occurs for example for finite fields and cyclotomic fields, of course it is not allowed where Coefficients is used to implement the membership test.

    So immutable bases and mutable bases are different categories of objects. The only thing they have in common is that one can ask both for their basis vectors and for the coefficients of a given vector.

    Since Immutable produces an immutable copy of any GAP object, it would in principle be possible to construct a mutable basis that is in fact immutable. In the sequel, we will deal only with mutable bases that are in fact mutable GAP objects.

    A mutable basis of a free left module is

    -
    an object in IsMutable (hence unable to store attributes and properties)

    -
    that is constructed by MutableBasis,

    -
    that can be asked for the number of basis vectors by NrBasisVectors,

    -
    that can be asked for membership of an element by IsContainedInSpan,

    -
    that can be first argument of Coefficients and BasisVectors,

    -
    that can be modified by CloseMutableBasis (whose methods have to guarantee consistency),

    -
    for which one can eventually get an immutable basis with same basis vectors by ImmutableBasis,

    -
    and for which ShallowCopy returns a mutable plain list containing the current basis vectors.

    Since mutable bases do not admit arbitrary changes of their lists of basis vectors, a mutable basis is not a list. It is, however, a collection, more precisely its family is the family of its collection of basis vectors.

    Similar to the situation with bases, GAP supports three types of mutable bases, namely

    1.
    mutable bases that store an immutable basis; this is the default of MutableBasis,

    2.
    mutable bases that store a mutable basis for a nicer module; this works if we have access to the mechanism of computing nice vectors, and requires the construction with MutableBasisViaNiceMutableBasisMethod2 or MutableBasisViaNiceMutableBasisMethod3; note that this is meaningful only if the mechanism of taking nice/ugly vectors is invariant under closures of the basis, which is the case for example if the vectors are elements of structure constants algebras, matrices, or Lie objects,

    3.
    mutable bases that use special information to perform their tasks; examples are mutable bases of Gaussian row and matrix spaces.

    The constructor for mutable bases is MutableBasis.

  • IsMutableBasis( obj ) C

    is true if obj is a mutable basis.

  • MutableBasis( R, vectors ) O
  • MutableBasis( R, vectors, zero ) O

    is a mutable basis for the R-free module generated by the vectors in the list vectors. The optional argument zero is the zero vector of the module.

    Note that vectors will in general not be the basis vectors of the mutable basis!

    gap> MB:= MutableBasis( Rationals, [ [ 1, 2, 3 ], [ 0, 1, 0 ] ] );
    <mutable basis over Rationals, 2 vectors>
    

  • NrBasisVectors( MB ) O

    Is the number of basis vectors of MB.

    gap> MB:= MutableBasis( Rationals, [ [ 1, 1], [ 2, 2 ] ] );;       
    gap> NrBasisVectors( MB );
    1
    

  • ImmutableBasis( MB ) O
  • ImmutableBasis( MB, V ) O

    ImmutableBasis returns the immutable basis B with the same basis vectors as in the mutable basis MB. If the second argument V is present then V is the underlying module of B.

    gap> MB:= MutableBasis( Rationals, [ [ 1, 1], [ 2, 2 ] ] );;
    gap> B:= ImmutableBasis( MB );
    SemiEchelonBasis( <vector space of dimension 1 over Rationals>, [ [ 1, 1 ] ] )
    gap> UnderlyingLeftModule( B );
    <vector space of dimension 1 over Rationals>
    

  • IsContainedInSpan( MB, v ) O

    is true if the element v is contained in the module described by the mutable basis MB, and false otherwise.

    gap> MB:= MutableBasis( Rationals, [ [ 1, 1, 3 ], [ 2, 2, 1 ] ] );;
    gap> IsContainedInSpan( MB, [ 1, 1, 1 ] );
    true
    gap> IsContainedInSpan( MB, [ 1, 0, 0 ] );
    false
    

  • CloseMutableBasis( MB, v ) O

    changes the mutable basis MB such that afterwards it describes the span of the old basis vectors together with v.

    Note that this does in general not mean that v is added to the basis vectors of MB if v enlarges the dimension. Usually some transformations are applied to keep the basis echelonized.

    gap> MB:= MutableBasis( Rationals, [ [ 1, 1, 3 ], [ 2, 2, 1 ] ] ); 
    <mutable basis over Rationals, 2 vectors>
    gap> IsContainedInSpan( MB, [ 1, 0, 0 ] );
    false
    gap> CloseMutableBasis( MB, [ 1, 0, 0 ] );
    gap> MB;
    <mutable basis over Rationals, 3 vectors>
    

    56.6 Vector Space Homomorphisms

  • LeftModuleGeneralMappingByImages( V, W, gens, imgs ) O

    is a general mapping from the left R-module V to the left R-module W. This general mapping is defined by mapping the entries in the list gens (elements of V) to the entries in the list imgs (elements of W), and taking the R-linear closure.

    gens need not generate V as a left R-module, and if the specification does not define a linear mapping then the result will be multivalued. Hence, in general it is not a mapping.

    gap> V:= FullRowSpace( Rationals, 2 );;
    gap> W:= VectorSpace( Rationals, [ [1,2,3], [1,0,1] ] );;
    gap> f:= LeftModuleGeneralMappingByImages( V, W, 
    >                                [[1,0],[2,0]], [[1,0,1],[1,0,1] ] );
    [ [ 1, 0 ], [ 2, 0 ] ] -> [ [ 1, 0, 1 ], [ 1, 0, 1 ] ]
    gap> IsMapping( f );
    false
    

  • LeftModuleHomomorphismByImages( S, R, gens, imgs ) F

    LeftModuleHomomorphismByImages returns the left module homomorphism with source S and range R that is defined by mapping the list gens of generators of S to the list imgs of images in R.

    If gens does not generate S or if the homomorphism does not exist (i.e., if mapping the generators describes only a multi-valued mapping) then fail is returned.

    One can avoid the checks by calling LeftModuleHomomorphismByImagesNC, and one can construct multi-valued mappings with LeftModuleGeneralMappingByImages.

    gap> V:=FullRowSpace( Rationals, 2 );;
    gap> W:=VectorSpace( Rationals, [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );;
    gap> f:=LeftModuleHomomorphismByImages( V, W,                                 
    > [ [ 1, 0 ], [ 0, 1 ] ], [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );
    [ [ 1, 0 ], [ 0, 1 ] ] -> [ [ 1, 0, 1 ], [ 1, 2, 3 ] ]
    gap> Image( f, [1,1] );
    [ 2, 2, 4 ]
    

  • LeftModuleHomomorphismByImagesNC( S, R, gens, imgs ) O

    LeftModuleHomomorphismByImagesNC is the operation that is called by the function LeftModuleHomomorphismByImages. Its methods may assume that gens generates S and that the mapping of gens to imgs defines a left module homomorphism. Results are unpredictable if these conditions do not hold.

    For creating a possibly multi-valued mapping from A to B that respects addition, multiplication, and scalar multiplication, LeftModuleGeneralMappingByImages can be used.

    gap> V:=FullRowSpace( Rationals, 2 );;
    gap> W:=VectorSpace( Rationals, [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );;
    gap> f:= LeftModuleHomomorphismByImagesNC( V, W,
    > [ [ 1, 0 ], [ 0, 1 ] ], [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );
    [ [ 1, 0 ], [ 0, 1 ] ] -> [ [ 1, 0, 1 ], [ 1, 2, 3 ] ]
    

  • LeftModuleHomomorphismByMatrix( BS, matrix, BR ) O

    is the total and single-valued linear general mapping with BS a basis of the source and BR a basis of the range, and the rows of the matrix matrix being the coefficients vectors of the images of BS w.r.t. BR.

    gap> V:= FullRowSpace( Rationals, 2 );;
    gap> W:= VectorSpace( Rationals, [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );;
    gap> f:= LeftModuleHomomorphismByMatrix( Basis( V ), 
    > [ [ 1, 2 ], [ 3, 1 ] ], Basis( W ) );
    <linear mapping by matrix, ( Rationals^2 ) -> VectorSpace( Rationals, 
    [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] )>
    

  • NaturalHomomorphismBySubspace( V, W ) O

    For a vector space V and a subspace W of V, this function returns the natural projection of V onto V/W.

    gap> V:= FullRowSpace( Rationals, 3 );;
    gap> W:= VectorSpace( Rationals, [ [ 1, 1, 1 ] ] );;                   
    gap> f:= NaturalHomomorphismBySubspace( V, W );
    <linear mapping by matrix, ( Rationals^3 ) -> ( Rationals^2 )>
    

  • Hom( F, V, W ) O

    is the left module HomF(V,W).

    gap> V:= FullRowSpace( Rationals, 2 );;
    gap> W:= VectorSpace( Rationals, [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );;
    gap> H:= Hom( Rationals, V, W );
    Hom( Rationals, ( Rationals^2 ), VectorSpace( Rationals, 
    [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] ) )
    gap> Dimension( H );
    4
    

  • End( F, V ) O

    is the left module EndF(V).

    gap> V:= FullRowSpace( Rationals, 2 );;
    gap> A:= End( Rationals, V );
    End( Rationals, ( Rationals^2 ) )
    gap> Dimension( A );
    4
    

  • IsFullHomModule( M ) P

    A full hom module is a module HomR(V,W), for a ring R and two left modules V, W.

    gap> V:= FullRowSpace( Rationals, 2 );;
    gap> W:= VectorSpace( Rationals, [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );;
    gap> H:= Hom( Rationals, V, W );;
    gap> IsFullHomModule( H );
    true
    

  • IsPseudoCanonicalBasisFullHomModule( B ) P

    A basis of a full hom module is called pseudo canonical basis if the matrices of its basis vectors w.r.t. the stored bases of source and range contain exactly one identity entry and otherwise zeros.

    Note that this is not canonical because it depends on the stored bases of source and range.

    gap> V:= FullRowSpace( Rationals, 2 );;
    gap> W:= VectorSpace( Rationals, [ [ 1, 0, 1 ], [ 1, 2, 3 ] ] );;
    gap> H:= Hom( Rationals, V, W );; B:= Basis( H );;
    gap> IsPseudoCanonicalBasisFullHomModule( B );
    true
    

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

    GAP 4 manual
    July 1999