Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  vspcrow.tst   Sprache: unbekannt

 
#############################################################################
##
##  (The test file `vspcmat.tst' should contain the same tests,
##  applied to matrix spaces.)
##
#@local A,F,b,c,c1,c2,dims,erg,f,i,im,iter,l,lc,m,mb,n,nv,p,subsp
#@local u,uu,uuu,uuuu,v,w,ww,z,vecs,g
gap> START_TEST("vspcrow.tst");

#############################################################################
##
##  1. Construct Gaussian and non-Gaussian row spaces
##
gap> z:= LeftModuleByGenerators( GF(3), [], [ 0*Z(9) ] );
<vector space of dimension 0 over GF(3)>
gap> IsGaussianRowSpace( z );
true
gap> IsNonGaussianRowSpace( z );
false
gap> v:= LeftModuleByGenerators( GF(9), [ [ Z(3), Z(3), Z(3) ] ] );
<vector space over GF(3^2), with 1 generator>
gap> IsGaussianRowSpace( v );
true
gap> IsNonGaussianRowSpace( v );
false
gap> v = LeftModuleByGenerators( GF(9), [ [ Z(3), Z(3), Z(3) ] ], Zero( v ) );
true
gap> w:= LeftModuleByGenerators( GF(9), [ [ Z(27), Z(3), Z(3) ] ] );
<vector space over GF(3^2), with 1 generator>
gap> IsGaussianRowSpace( w );
false
gap> IsNonGaussianRowSpace( w );
true
gap> w = LeftModuleByGenerators( GF(9), [ [ Z(27), Z(3), Z(3) ] ], Zero( w ) );
true

#############################################################################
##
##  2. Methods for bases of non-Gaussian row spaces
##
gap> Dimension( w );
1
gap> n:= NiceVector( w, [ Z(27), Z(3), Z(3) ] );
[ Z(3), Z(3), Z(3^2)^3, Z(3), 0*Z(3), 0*Z(3), Z(3), 0*Z(3), 0*Z(3) ]
gap> UglyVector( w, n ) = [ Z(27), Z(3), Z(3) ];
true

#############################################################################
##
##  3. Methods for semi-echelonized bases of Gaussian row spaces
##
gap> v:= LeftModuleByGenerators( GF(9),
>     [ [ Z(3), Z(3), Z(3) ], [ Z(3), Z(3), 0*Z(3) ] ] );
<vector space over GF(3^2), with 2 generators>
gap> b:= SemiEchelonBasis( v );
SemiEchelonBasis( <vector space over GF(3^2), with 2 generators>, ... )
gap> lc:= LinearCombination( b, [ Z(3)^0, Z(3) ] );
[ Z(3)^0, Z(3)^0, 0*Z(3) ]
gap> Coefficients( b, lc );
[ Z(3)^0, Z(3) ]
gap> SiftedVector( b, [ Z(3), 0*Z(3), 0*Z(3) ] );
[ 0*Z(3), Z(3)^0, 0*Z(3) ]
gap> SiftedVector( b, [ 0*Z(3), 0*Z(3), Z(3) ] );
[ 0*Z(3), 0*Z(3), 0*Z(3) ]
gap> b:= Basis( v, [ [ Z(3), Z(3), Z(3) ] ] );
fail
gap> b:= Basis( v, [ [ Z(3), Z(3), Z(3) ], [ Z(3), Z(3), 0*Z(3) ] ] );
Basis( <vector space over GF(3^2), with 2 generators>, 
[ [ Z(3), Z(3), Z(3) ], [ Z(3), Z(3), 0*Z(3) ] ] )
gap> IsSemiEchelonized( b );
false
gap> b:= Basis( v, [ [ Z(3), Z(3), Z(3) ], [ 0*Z(3), 0*Z(3), Z(3) ] ] );
Basis( <vector space over GF(3^2), with 2 generators>, 
[ [ Z(3), Z(3), Z(3) ], [ 0*Z(3), 0*Z(3), Z(3) ] ] )
gap> IsSemiEchelonized( b );
false
gap> b:= Basis( v, [ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ Z(3)^0, Z(3)^0, 0*Z(3) ] ] );
Basis( <vector space over GF(3^2), with 2 generators>, 
[ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ Z(3)^0, Z(3)^0, 0*Z(3) ] ] )
gap> IsSemiEchelonized( b );
false
gap> b:= Basis( v, [ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] );
SemiEchelonBasis( <vector space over GF(3^2), with 2 generators>, 
[ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] )
gap> IsSemiEchelonized( b );
true
gap> vecs:= [ Vector( IsPlistVectorRep, GF(2), [ 0, 1 ] * Z(2) ) ];;
gap> v:= VectorSpace( GF(4), vecs );;
gap> b:= SemiEchelonBasis( v, vecs );;
gap> BaseDomain( b[1] );
GF(2^2)
gap> b[1] = vecs[1];
true
gap> v:= GF(2)^1;;
gap> b:= Basis( v, [ [ Z(2) ] ] );;
gap> Coefficients( b, [ Z(4) ] );
fail
gap> SiftedVector( b, [ Z(4) ] );
fail

#############################################################################
##
##  4. Methods for row spaces
##
gap> v:= LeftModuleByGenerators( GF(9),
>     [ [ Z(3), Z(3), Z(3) ], [ Z(3), Z(3), 0*Z(3) ] ] );;
gap> m:= Z(3)^0 * [ [ 1, 1 ], [ 1, 0 ], [ 0, 0 ] ];
[ [ Z(3)^0, Z(3)^0 ], [ Z(3)^0, 0*Z(3) ], [ 0*Z(3), 0*Z(3) ] ]
gap> im:= v * m;;
gap> Print( im, "\n" );
VectorSpace( GF(3^2), [ [ Z(3)^0, Z(3) ], [ Z(3)^0, Z(3) ] ] )
gap> Dimension( im );
1
gap> im = v^m;
true
gap> im:= w * m;;
gap> Print( im, "\n" );
VectorSpace( GF(3^2), [ [ Z(3^3)^3, Z(3^3) ] ] )
gap> [] in w;
false
gap> Zero( w ) in w;
true
gap> [ 0, 0, 1 ] in w;
false
gap> Z(3) * [ 0, 1 ] in v;
false
gap> [ Z(27), Z(3), Z(3) ] in w;
true
gap> [] in v;
false
gap> Zero( v ) in v;
true
gap> [ 0, 0, 1 ] in v;
false
gap> Z(3) * [ 0, 1 ] in v;
false
gap> Z(3) * [ 0, 0, 1 ] in v;
true
gap> BasisNC( v,
>     [ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] );
SemiEchelonBasis( <vector space over GF(3^2), with 2 generators>, 
[ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] )
gap> Basis( v );
SemiEchelonBasis( <vector space over GF(3^2), with 2 generators>, 
[ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] )
gap> SemiEchelonBasis( v );
SemiEchelonBasis( <vector space over GF(3^2), with 2 generators>, 
[ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] )
gap> b:= SemiEchelonBasis( v,
>         [ [ Z(3), Z(3), Z(3) ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] );
fail
gap> b:= SemiEchelonBasis( v,
>         [ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] );
SemiEchelonBasis( <vector space over GF(3^2), with 2 generators>, 
[ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] )
gap> b:= SemiEchelonBasisNC( v,
>         [ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] );
SemiEchelonBasis( <vector space over GF(3^2), with 2 generators>, 
[ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] )
gap> c1:= CanonicalBasis( v );;
gap> Print( c1, "\n" );
CanonicalBasis( VectorSpace( GF(3^2), 
[ [ Z(3), Z(3), Z(3) ], [ Z(3), Z(3), 0*Z(3) ] ] ) )
gap> c2:= CanonicalBasis( VectorSpace( GF(3), BasisVectors( b ) ) );;
gap> Print( c2, "\n" );
CanonicalBasis( VectorSpace( GF(3), 
[ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] ) )
gap> c1 = c2;
true
gap> w:= LeftModuleByGenerators( GF(9),
>         [ [ Z(27), Z(3), Z(3) ],
>           [ Z(27), Z(3), Z(3) ],
>           [ 0*Z(3), Z(3), Z(3) ] ] );
<vector space over GF(3^2), with 3 generators>
gap> Basis( w );
Basis( <vector space over GF(3^2), with 3 generators>, ... )
gap> b:= Basis( w,
>         [ [ 0*Z(3), Z(3), Z(3) ], [ Z(27), Z(3), Z(3) ] ] );
Basis( <vector space of dimension 2 over GF(3^2)>, 
[ [ 0*Z(3), Z(3), Z(3) ], [ Z(3^3), Z(3), Z(3) ] ] )
gap> IsBasisByNiceBasis( b );
true
gap> Coefficients( b, [ Z(27), 0*Z(3), 0*Z(3) ] );
[ Z(3), Z(3)^0 ]
gap> IsZero( Zero( v ) );
true
gap> ForAny( b, IsZero );
false
gap> ww:= AsVectorSpace( GF(3), w );;
gap> Print( ww, "\n" );
VectorSpace( GF(3), [ [ Z(3^3), Z(3), Z(3) ], [ Z(3^3), Z(3), Z(3) ], 
  [ 0*Z(3), Z(3), Z(3) ], [ Z(3^6)^119, Z(3^2)^5, Z(3^2)^5 ], 
  [ Z(3^6)^119, Z(3^2)^5, Z(3^2)^5 ], [ 0*Z(3), Z(3^2)^5, Z(3^2)^5 ] ] )
gap> Dimension( ww );
4
gap> w = ww;
true
gap> AsVectorSpace( GF(27), w );
fail
gap> u:= GF( 3^6 )^4;
( GF(3^6)^4 )
gap> uu:= AsVectorSpace( GF(9), u );;
gap> Print( uu, "\n" );
VectorSpace( GF(3^2), [ [ Z(3)^0, 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), Z(3)^0, 0*Z(3) ], 
  [ 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0 ], [ Z(3^6), 0*Z(3), 0*Z(3), 0*Z(3) ], 
  [ 0*Z(3), Z(3^6), 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), Z(3^6), 0*Z(3) ], 
  [ 0*Z(3), 0*Z(3), 0*Z(3), Z(3^6) ], [ Z(3^6)^2, 0*Z(3), 0*Z(3), 0*Z(3) ], 
  [ 0*Z(3), Z(3^6)^2, 0*Z(3), 0*Z(3) ], [ 0*Z(3), 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*Z(3), 0*Z(3), Z(3^6)^93 ] ] )
gap> uuuu:= AsVectorSpace( GF(3^6), uu );;
gap> Print( uuuu, "\n" );
VectorSpace( GF(3^6), [ [ Z(3)^0, 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), Z(3)^0, 0*Z(3) ], 
  [ 0*Z(3), 0*Z(3), 0*Z(3), Z(3)^0 ], [ Z(3^6), 0*Z(3), 0*Z(3), 0*Z(3) ], 
  [ 0*Z(3), Z(3^6), 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), Z(3^6), 0*Z(3) ], 
  [ 0*Z(3), 0*Z(3), 0*Z(3), Z(3^6) ], [ Z(3^6)^2, 0*Z(3), 0*Z(3), 0*Z(3) ], 
  [ 0*Z(3), Z(3^6)^2, 0*Z(3), 0*Z(3) ], [ 0*Z(3), 0*Z(3), Z(3^6)^2, 0*Z(3) ], 
  [ 0*Z(3), 0*Z(3), 0*Z(3), Z(3^6)^2 ] ] )
gap> u = uuu;
true
gap> c:= VectorSpace( GF(9), [ [ Z(3)^0, 0*Z(3), 0*Z(3) ] ] );
<vector space over GF(3^2), with 1 generator>
gap> f:= v + c;;
gap> Print( f, "\n" );
VectorSpace( GF(3^2), 
[ [ Z(3)^0, Z(3)^0, Z(3)^0 ], [ 0*Z(3), Z(3)^0, 0*Z(3) ], 
  [ 0*Z(3), 0*Z(3), Z(3)^0 ] ] )
gap> Intersection( v, c );
<vector space of dimension 0 over GF(3^2)>
gap> Intersection( v, f ) = v;
true
gap> nv:= NormedRowVectors( v );;
gap> Print( nv{ [ 1 .. 5 ] }, "\n" );
[ [ 0*Z(3), 0*Z(3), Z(3)^0 ], [ Z(3)^0, Z(3)^0, 0*Z(3) ], 
  [ 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^2) ] ]

#############################################################################
##
##  5. Methods for full row spaces
##
gap> IsFullRowModule( v );
false
gap> IsFullRowModule( f );
true
gap> c:= CanonicalBasis( f );
CanonicalBasis( ( GF(3^2)^3 ) )
gap> BasisVectors( c ) = IdentityMat( Length( c ), GF(3) );
true

#############################################################################
##
##  6. Methods for collections of subspaces of full row spaces
##
gap> subsp:= Subspaces( f, 2 );
Subspaces( ( GF(3^2)^3 ), 2 )
gap> Size( subsp );
91
gap> iter:= Iterator( subsp );;
gap> for i in [ 1 .. 6 ] do
>      NextIterator( iter );
>    od;
gap> IsDoneIterator( iter );
false
gap> Print( NextIterator( iter ), "\n" );
VectorSpace( GF(3^2), 
[ [ Z(3)^0, 0*Z(3), 0*Z(3) ], [ 0*Z(3), Z(3)^0, Z(3^2)^5 ] ] )
gap> subsp:= Subspaces( f );
Subspaces( ( GF(3^2)^3 ) )
gap> Size( subsp );
184
gap> iter:= Iterator( subsp );;
gap> for i in [ 1 .. 6 ] do
>      NextIterator( iter );
>    od;
gap> IsDoneIterator( iter );
false
gap> Print( NextIterator( iter ), "\n" );
VectorSpace( GF(3^2), [ [ Z(3)^0, 0*Z(3), Z(3^2)^3 ] ] )

#############################################################################
##
##  7. Methods for mutable bases of Gaussian row spaces
##
gap> mb:= MutableBasis( Rationals,
>          [ [ 1, 1, 1, 1 ], [ 0, 1, 1, 1 ], [ 1, 1, 1, 1 ] ] );
<mutable basis over Rationals, 2 vectors>
gap> IsMutableBasisOfGaussianRowSpaceRep( mb );
true
gap> CloseMutableBasis( mb, [ E(4), 0, 0, 0 ] );
true
gap> IsMutableBasisOfGaussianRowSpaceRep( mb );
false
gap> BasisVectors( mb );
[ [ 1, 1, 1, 1 ], [ 0, 1, 1, 1 ], [ E(4), 0, 0, 0 ] ]
gap> mb:= MutableBasis( Rationals,
>          [ [ 1, 1, 1, 1 ], [ 0, 1, 1, 1 ], [ 1, 1, 1, 1 ] ] );
<mutable basis over Rationals, 2 vectors>
gap> CloseMutableBasis( mb, [ 1, 2, 3, 4 ] );
true
gap> CloseMutableBasis( mb, [ 1, 2, 3, 5 ] );
true
gap> CloseMutableBasis( mb, [ 0, 0, 0, 7 ] );
false
gap> IsMutableBasisOfGaussianRowSpaceRep( mb );
true
gap> BasisVectors( mb );
[ [ 1, 1, 1, 1 ], [ 0, 1, 1, 1 ], [ 0, 0, 1, 2 ], [ 0, 0, 0, 1 ] ]
gap> ImmutableBasis( mb );
SemiEchelonBasis( <vector space of dimension 4 over Rationals>, 
[ [ 1, 1, 1, 1 ], [ 0, 1, 1, 1 ], [ 0, 0, 1, 2 ], [ 0, 0, 0, 1 ] ] )
gap> mb:= MutableBasis( Rationals, [], [ 0, 0, 0, 0 ] );
<mutable basis over Rationals, 0 vectors>
gap> CloseMutableBasis( mb, [ 1, 2, 3, 4 ] );
true
gap> CloseMutableBasis( mb, [ 1, 2, 3, 5 ] );
true
gap> CloseMutableBasis( mb, [ 0, 0, 0, 7 ] );
false
gap> IsMutableBasisOfGaussianRowSpaceRep( mb );
true
gap> BasisVectors( mb );
[ [ 1, 2, 3, 4 ], [ 0, 0, 0, 1 ] ]
gap> ImmutableBasis( mb );
SemiEchelonBasis( <vector space of dimension 2 over Rationals>, 
[ [ 1, 2, 3, 4 ], [ 0, 0, 0, 1 ] ] )

############################################################################
##
##  8. Methods for mutable bases of non-Gaussian row spaces
##
gap> mb:= MutableBasis( Rationals, [ [ E(4) ] ] );
<mutable basis over Rationals, 1 vector>
gap> CloseMutableBasis( mb, [ E(3) ] );
true
gap> CloseMutableBasis( mb, [ E(3)+E(4) ] );
false

#############################################################################
##
##  9. Enumerations
##
gap> erg:= [];;  i:= 0;;
gap> dims:= [ 1,4,27,28,29,31,32,33,63,64,65,92,127,128,129,384 ];;
gap> p := fail;; for p in [ 2,3,7,19,53,101 ] do
>      for i in dims do
>        v:= BasisVectors( CanonicalBasis( GF(p)^i ) );
>        l:= List( v, x -> NumberFFVector( x, p ) );
>        AddSet( erg, l = List( [ 1 .. i ], j -> p^(i-j) ) );
>      od;
>    od;
gap> erg;
[ true ]

#############################################################################
##
##  10. Arithmetic
##
gap> A := [ [ Z(2^2)^2, 0*Z(2), Z(2^2), 0*Z(2), 0*Z(2), 0*Z(2) ], 
>   [ Z(2^2)^2, 0*Z(2), Z(2^2)^2, Z(2)^0, Z(2^2)^2, Z(2)^0 ], 
>   [ 0*Z(2), Z(2)^0, 0*Z(2), Z(2^2)^2, 0*Z(2), Z(2^2)^2 ], 
>   [ 0*Z(2), Z(2^2), Z(2^2), Z(2^2), Z(2^2)^2, 0*Z(2) ], 
>   [ Z(2^2)^2, Z(2^2)^2, Z(2^2)^2, 0*Z(2), 0*Z(2), 0*Z(2) ], 
>   [ Z(2)^0, Z(2)^0, 0*Z(2), Z(2^2), 0*Z(2), Z(2^2)^2 ] ];;
gap> F := GF(4);;
gap> MinimalPolynomial(F, A);
x_1^6+Z(2^2)*x_1^5+x_1^4+Z(2^2)^2*x_1^3+x_1^2+Z(2^2)*x_1+Z(2)^0
gap> MinimalPolynomial(F, A);
x_1^6+Z(2^2)*x_1^5+x_1^4+Z(2^2)^2*x_1^3+x_1^2+Z(2^2)*x_1+Z(2)^0

#############################################################################
##
##  11. Action of matrices on subspaces
##
gap> v:= TrivialSubspace( GF(3)^2 );;
gap> g:=GL(2,3).1;;
gap> v^g = v;
true
gap> v*g = v;
true

##
gap> STOP_TEST( "vspcrow.tst" );

[ Dauer der Verarbeitung: 0.19 Sekunden  (vorverarbeitet)  ]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge