diff --git a/doc/ref/algebra.xml b/doc/ref/algebra.xml index 8f5a784182..a3abc0d7c4 100644 --- a/doc/ref/algebra.xml +++ b/doc/ref/algebra.xml @@ -191,6 +191,8 @@ true <#Include Label="MutableBasisOfNonassociativeAlgebra"> <#Include Label="MutableBasisOfIdealInNonassociativeAlgebra"> <#Include Label="DirectSumOfAlgebras"> +<#Include Label="Embedding:algebras"> +<#Include Label="Projection:algebras"> <#Include Label="FullMatrixAlgebraCentralizer"> <#Include Label="RadicalOfAlgebra"> <#Include Label="CentralIdempotentsOfAlgebra"> diff --git a/lib/algebra.gd b/lib/algebra.gd index d32539e7fd..34b9908d31 100644 --- a/lib/algebra.gd +++ b/lib/algebra.gd @@ -558,6 +558,7 @@ DeclareOperation( "ProductSpace", [ IsFreeLeftModule, IsFreeLeftModule ] ); ## #O DirectSumOfAlgebras( , ) #O DirectSumOfAlgebras( ) +#O DirectSumOfAlgebrasByGenerators( , ) ## ## <#GAPDoc Label="DirectSumOfAlgebras"> ## @@ -567,8 +568,10 @@ DeclareOperation( "ProductSpace", [ IsFreeLeftModule, IsFreeLeftModule ] ); ## Label="for a list of algebras"/> ## ## -## is the direct sum of the two algebras A1 and A2 -## respectively of the algebras in the list list. +## This is the direct sum of the two algebras A1 and A2 +## or of the algebras in the list list. +## In the latter case, DirectSumOfAlgebras(A1,A2,A3,...,An) +## returns (...((A_1 \oplus A_2) \oplus A3)...) \oplus A_n. ##

## If all involved algebras are associative algebras then the result is also ## known to be associative. @@ -582,15 +585,72 @@ DeclareOperation( "ProductSpace", [ IsFreeLeftModule, IsFreeLeftModule ] ); ## algebras or both are associative then the result is again a ## matrix algebra of the appropriate type. ## A:= QuaternionAlgebra( Rationals );; -## gap> DirectSumOfAlgebras( [A, A, A] ); -## +## gap> c3 := Group( (1,2,3) );; +## gap> A3 := GroupRing( Rationals, c3 );; +## gap> c5 := Group( (5,6,7,8,9) );; +## gap> A5 := GroupRing( Rationals, c5 );; +## gap> A35 := DirectSumOfAlgebras( A3, A5 ); +## +## gap> A353 := DirectSumOfAlgebras( [ A3, A5, A3 ] ); +## ## ]]> ## ## ## <#/GAPDoc> ## DeclareOperation( "DirectSumOfAlgebras", [ IsDenseList ] ); +DeclareOperation( "DirectSumOfMatrixAlgebras", [ IsAlgebra, IsAlgebra ] ); + + +############################################################################# +## +#O Embedding( , ) +## +## <#GAPDoc Label="Embedding:algebras"> +## +## +## +## +## If algebra A is the direct sum of algebras [A_1,\ldots,A_k] +## then Embedding(A,i) for 1 \leq i \leq k returns an algebra +## homomorphism mapping A_i into A. +##

+## emb1 := Embedding( A35, 1 ); +## [ (1)*(), (1)*(1,2,3), (1)*(1,3,2) ] -> [ v.1, v.2, v.3 ] +## gap> ec3 := Embedding( c3, A3 );; +## gap> ( (1,3,2)^ec3 )^emb1; +## v.3 +## ]]> +## +## +## <#/GAPDoc> + + +############################################################################# +## +#O Projection( , ) +## +## <#GAPDoc Label="Projection:algebras"> +## +## +## +## +## If algebra A is the direct sum of algebras [A_1,\ldots,A_k] +## then Projection(A,i) for 1 \leq i \leq k returns an algebra +## homomorphism mapping A onto A_i. +##

+## pro2 := Projection( A35, 2 ); +## [ v.1, v.2, v.3, v.4, v.5, v.6, v.7, v.8 ] -> [ of ..., of ..., +## of ..., (1)*(), (1)*(5,6,7,8,9), (1)*(5,7,9,6,8), (1)*(5,8,6,9,7), +## (1)*(5,9,8,7,6) ] +## ]]> +## +## +## <#/GAPDoc> ############################################################################# diff --git a/lib/algebra.gi b/lib/algebra.gi index 09c4e754f4..35826f6161 100644 --- a/lib/algebra.gi +++ b/lib/algebra.gi @@ -3012,22 +3012,19 @@ InstallMethod( GeneratorsOfLeftOperatorRingWithOne, ## Construct a s.c. algebra. ## (There are special methods for the sum of appropriate matrix algebras.) ## -#T embeddings/projections should be provided! -## InstallOtherMethod( DirectSumOfAlgebras, "for two algebras", [ IsAlgebra, IsAlgebra ], function( A1, A2 ) - local n, # The dimension of the resulting algebra. + local n1, # The dimension of A1. + n2, # The dimension of A2. + n, # The dimension of the resulting algebra. i,j, # Loop variables. T, # The table of structure constants of the direct sum. - scT, # - n1, # The dimension of A1. - n2, # The dimension of A2. - ll, # A list of structure constants. + scT,ll,# A list of structure constants. L, # result. - sym, # if both products are (anti)symmetric, then the result - # will have the same property. + sym, # if both products are (anti)symmetric, + # then the result will have the same property. R1,R2, # Root systems of A1,A2. f1,f2, # Embeddings of A1,A2 in L. R, # Root system of L. @@ -3062,7 +3059,6 @@ InstallOtherMethod( DirectSumOfAlgebras, od; od; - # Set the (anti)symmetric flag if scT[n2 + 1] = sym then T[n + 1] := sym; @@ -3072,9 +3068,14 @@ InstallOtherMethod( DirectSumOfAlgebras, T[n + 1] := 1; fi; - L:= AlgebraByStructureConstants( LeftActingDomain( A1 ), T ); + SetDirectSumInfo( L, rec( algebras := [A1,A2], + first := [0,n1,n1+n2], + type := "basis vectors", + embeddings := [], + projections := [] ) ); + # Maintain useful information. if HasIsLieAlgebra( A1 ) and HasIsLieAlgebra( A2 ) and IsLieAlgebra( A1 ) and IsLieAlgebra( A2 ) then @@ -3186,6 +3187,9 @@ InstallOtherMethod( DirectSumOfAlgebras, and IsAssociative( A1 ) and IsAssociative( A2 ) then SetIsAssociative( L, true ); fi; + if HasName( A1 ) and HasName( A2 ) then + SetName( L, Concatenation( Name(A1), "(+)", Name(A2 ) ) ); + fi; # Return the result. return L; @@ -3222,6 +3226,90 @@ InstallMethod( DirectSumOfAlgebras, end ); +############################################################################# +## +#A Embedding +## +InstallMethod( Embedding, "algebra direct sum and integer", + [ IsAlgebra and HasDirectSumInfo, IsPosInt ], + function( D, i ) + local info, type, first, A, gens, imgs, map; + + # check + info := DirectSumInfo( D ); + if IsBound( info.embeddings[i] ) then + return info.embeddings[i]; + fi; + type := info.type; + first := info.first; + if not ( i < Length(first) ) then + Error( "value of second parameter is too large" ); + fi; + # compute embedding + A := info.algebras[i]; + if ( type = "basis vectors" ) then + gens := BasisVectors( Basis( A ) ); + imgs := BasisVectors( Basis( D ) ){[first[i]+1 .. first[i+1]]}; + elif ( type = "generators" ) then + gens := GeneratorsOfAlgebra( A ); + imgs := GeneratorsOfAlgebra( D ){[first[i]+1 .. first[i+1]]}; + else + Error( "unknown type" ); + fi; + map := AlgebraHomomorphismByImagesNC( A, D, gens, imgs ); + SetIsInjective( map, true ); + SetIsTotal( map, true ); + SetIsSingleValued( map, true ); + + # store information + info.embeddings[i] := map; + return map; +end ); + +############################################################################# +## +#A Projection +## +InstallMethod( Projection, "algebra direct sum and integer", + [ IsAlgebra and HasDirectSumInfo, IsPosInt ], + function( D, i ) + local infoD, type, first, len, A, zA, genA, genD, imgs, j, k, map; + + # check + infoD := DirectSumInfo( D ); + if IsBound( infoD.projections[i] ) then + return infoD.projections[i]; + fi; + type := infoD.type; + first := infoD.first; + len := Length( first ); + if not ( i < len ) then + Error( "value of second parameter is too large" ); + fi; + # compute projection + A := infoD.algebras[i]; + zA := Zero( A ); + if ( type = "basis vectors" ) then + genA := BasisVectors( Basis( A ) ); + genD := BasisVectors( Basis( D ) ); + elif ( type = "generators" ) then + genA := GeneratorsOfAlgebra( A ); + genD := GeneratorsOfAlgebra( D ); + else + Error( "unknown type" ); + fi; + imgs := ListWithIdenticalEntries( first[len], zA ); + j := first[i]; + for k in [j+1..first[i+1]] do + imgs[k] := genA[k-j]; + od; + map := AlgebraHomomorphismByImagesNC( D, A, genD, imgs ); + + # store information + infoD.projections[i] := map; + return map; +end ); + ############################################################################# ## #O IsCentral( , ) . . . . . . . . test if is centralized by diff --git a/lib/algmat.gi b/lib/algmat.gi index 374f27ee02..9432893ae7 100644 --- a/lib/algmat.gi +++ b/lib/algmat.gi @@ -1312,25 +1312,24 @@ end ); ############################################################################# ## -#M DirectSumOfAlgebras( , ) . . for two associative matrix FLMLORs -## -## Construct an associative matrix FLMLOR. +#M DirectSumOfMatrixAlgebras( , ) ## -#T embeddings/projections should be provided! +## this is the special method for sirect sum used for matrix algebras ## -InstallOtherMethod( DirectSumOfAlgebras, - "for two associative matrix FLMLORs", +InstallMethod( DirectSumOfMatrixAlgebras, + "for two matrix algebras", IsIdenticalObj, - [ IsMatrixFLMLOR and IsAssociative, - IsMatrixFLMLOR and IsAssociative ], 0, + [ IsAlgebra, IsAlgebra ], function( A1, A2 ) - local b1, # Basis vectors of `A1'. - b2, # Basis vectors of `A2'. + local b1, # Generators of `A1'. + d1, # Length of `b1'. + b2, # Generators of `A2'. + d2, # Length of `b2'. p1, # Length of the matrices of `b1'. p2, # Length of the matrices of `b2'. B, # A basis of `A1 \oplus A2'. - i, # Loop variable. + i,j, # Loop variables. Q, # A matrix. A; # result @@ -1338,17 +1337,10 @@ InstallOtherMethod( DirectSumOfAlgebras, Error( " and must be written over the same domain" ); fi; - # We do not really need a basis for the arguments - # but if we have one then we use it. -#T Do we really have so many algebra generators? (distinguish from basis?) - if HasBasis( A1 ) and HasBasis( A2 ) then - b1:= BasisVectors( Basis( A1 ) ); - b2:= BasisVectors( Basis( A2 ) ); - else - b1:= GeneratorsOfAlgebra( A1 ); - b2:= GeneratorsOfAlgebra( A2 ); - fi; - + b1:= GeneratorsOfAlgebra( A1 ); + b2:= GeneratorsOfAlgebra( A2 ); + d1:= Length( b1 ); + d2:= Length( b2 ); p1:= DimensionOfVectors( A1 )[1]; p2:= DimensionOfVectors( A2 )[1]; @@ -1368,10 +1360,32 @@ InstallOtherMethod( DirectSumOfAlgebras, if HasBasis( A1 ) and HasBasis( A2 ) then UseBasis( A, B ); fi; + SetDirectSumInfo( A, rec( algebras := [A1,A2], + first := [0,d1,d1+d2], + type := "generators", + embeddings := [], + projections := [] ) ); + return A; + end ); - SetIsAssociative( A, true ); -#T nec. ? +############################################################################# +## +#M DirectSumOfAlgebras( , ) . . for two associative matrix FLMLORs +## +## Construct an associative matrix FLMLOR. +## +InstallOtherMethod( DirectSumOfAlgebras, + "for two associative matrix FLMLORs", + IsIdenticalObj, + [ IsMatrixFLMLOR and IsAssociative, + IsMatrixFLMLOR and IsAssociative ], 0, + function( A1, A2 ) + + local A; # result + + A := DirectSumOfMatrixAlgebras( A1, A2 ); + SetIsAssociative( A, true ); return A; end ); @@ -1382,8 +1396,6 @@ InstallOtherMethod( DirectSumOfAlgebras, ## ## Construct a matrix Lie FLMLOR. ## -#T embeddings/projections should be provided! -## InstallOtherMethod( DirectSumOfAlgebras, "for two matrix Lie FLMLORs", IsIdenticalObj, @@ -1391,51 +1403,10 @@ InstallOtherMethod( DirectSumOfAlgebras, IsMatrixFLMLOR and IsLieAlgebra ], 0, function( A1, A2 ) - local b1, # Basis vectors of `A1'. - b2, # Basis vectors of `A2'. - p1, # Length of the matrices of `b1'. - p2, # Length of the matrices of `b2'. - B, # A basis of `A1 \oplus A2'. - i, # Loop variable. - Q, # A matrix. - A; # result - - if LeftActingDomain( A1 ) <> LeftActingDomain( A2 ) then - Error( " and must be written over the same domain" ); - fi; - - # We do not really need a basis for the arguments - # but if we have one then we use it. -#T Do we really have so many algebra generators? (distinguish from basis?) - if HasBasis( A1 ) and HasBasis( A2 ) then - b1:= BasisVectors( Basis( A1 ) ); - b2:= BasisVectors( Basis( A2 ) ); - else - b1:= GeneratorsOfAlgebra( A1 ); - b2:= GeneratorsOfAlgebra( A2 ); - fi; - - p1:= DimensionOfVectors( A1 )[1]; - p2:= DimensionOfVectors( A2 )[1]; + local A; # result - B:= []; - for i in b1 do - Q:= NullMat( p1+p2, p1+p2, LeftActingDomain( A1 ) ); - Q{ [ 1 .. p1 ] }{ [ 1 .. p1 ] }:= i; - Add( B, LieObject( Q ) ); - od; - for i in b2 do - Q:= NullMat( p1+p2, p1+p2, LeftActingDomain( A1 ) ); - Q{ [ p1+1 .. p1+p2 ] }{ [ p1+1 .. p1+p2 ] }:= i; - Add( B, LieObject( Q ) ); - od; - - A:= AlgebraByGenerators( LeftActingDomain( A1 ), B ); - if HasBasis( A1 ) and HasBasis( A2 ) then - UseBasis( A, B ); - fi; + A := DirectSumOfMatrixAlgebras( A1, A2 ); SetIsLieAlgebra( A, true ); - return A; end ); diff --git a/lib/ringsc.gd b/lib/ringsc.gd index 0a3660e480..e614ec0f0e 100644 --- a/lib/ringsc.gd +++ b/lib/ringsc.gd @@ -207,6 +207,31 @@ DeclareGlobalFunction("SmallRing"); ## DeclareGlobalFunction( "DirectSum" ); DeclareOperation( "DirectSumOp", [ IsList, IsRing ] ); + +############################################################################# +## +#A DirectSumInfo( ) +## +## <#GAPDoc Label="DirectSumInfo:rings"> +## +## +## +## +## A direct sum of rings comes equipped with an information record +## having fields rings; first; +## embeddings and projections. +##

+## As embeddings and projections are created (see below) +## they are stored in the fields embeddings and projections. +##

+## DirectSumInfo( R57 ); +## rec( embeddings := [ ], first := [ 0, 1, 2 ], projections := [ ], +## rings := [ R5, R7 ] ) +## ]]> +## +## +## <#/GAPDoc> DeclareAttribute( "DirectSumInfo", IsRing, "mutable" ); ############################################################################# diff --git a/lib/ringsc.gi b/lib/ringsc.gi index 42c82b2f28..05f9881b49 100644 --- a/lib/ringsc.gi +++ b/lib/ringsc.gi @@ -1232,7 +1232,6 @@ InstallMethod( Embedding, "ring direct sum and integer", imgs := GeneratorsOfRing( D ){[first[i]+1 .. first[i+1]]}; map := RingHomomorphismByImages( R, D, gens, imgs ); SetIsInjective( map, true ); - # store information info.embeddings[i] := map; return map; diff --git a/tst/testinstall/alg-dsum.tst b/tst/testinstall/alg-dsum.tst new file mode 100644 index 0000000000..ab21cc2c6f --- /dev/null +++ b/tst/testinstall/alg-dsum.tst @@ -0,0 +1,148 @@ +gap> START_TEST("alg-dsum.tst"); +gap> # direct sums of type "basis vectors" +gap> genc5 := [ (5,6,7,8,9) ];; +gap> c5 := Group( genc5 );; +gap> SetName( c5, "c5" );; +gap> A5 := GroupRing( Rationals, c5 );; +gap> SetName( A5, "A5" );; +gap> embc5 := Embedding( c5, A5 );; +gap> BasisVectors( Basis( A5 ) ); +[ (1)*(), (1)*(5,6,7,8,9), (1)*(5,7,9,6,8), (1)*(5,8,6,9,7), (1)*(5,9,8,7,6) ] +gap> gens3 := [ (1,2), (2,3) ];; +gap> s3 := Group( gens3 );; +gap> SetName( s3, "s3" );; +gap> A6 := GroupRing( Rationals, s3 );; +gap> SetName( A6, "A6" );; +gap> embs3 := Embedding( s3, A6 );; +gap> BasisVectors( Basis( A6 ) ); +[ (1)*(), (1)*(2,3), (1)*(1,2), (1)*(1,2,3), (1)*(1,3,2), (1)*(1,3) ] +gap> A56 := DirectSumOfAlgebras( A5, A6 );; +gap> info56 := DirectSumInfo( A56 ); +rec( algebras := [ A5, A6 ], embeddings := [ ], first := [ 0, 5, 11 ], + projections := [ ], type := "basis vectors" ) +gap> SetName( A56, "A56" ); +gap> emb5 := Embedding( A56, 1 ); +[ (1)*(), (1)*(5,6,7,8,9), (1)*(5,7,9,6,8), (1)*(5,8,6,9,7), (1)*(5,9,8,7,6) + ] -> [ v.1, v.2, v.3, v.4, v.5 ] +gap> g := ImageElm( embc5, (5,7,9,6,8) ); +(1)*(5,7,9,6,8) +gap> ImageElm( emb5, g ); +v.3 +gap> pro6 := Projection( A56, 2 ); +[ v.1, v.2, v.3, v.4, v.5, v.6, v.7, v.8, v.9, v.10, v.11 ] -> +[ of ..., of ..., of ..., of ..., of ..., + (1)*(), (1)*(2,3), (1)*(1,2), (1)*(1,2,3), (1)*(1,3,2), (1)*(1,3) ] +gap> bas56 := BasisVectors( Basis( A56 ) ); +[ v.1, v.2, v.3, v.4, v.5, v.6, v.7, v.8, v.9, v.10, v.11 ] +gap> ImageElm( pro6, bas56[9] ); +(1)*(1,2,3) +gap> # direct sums of type "generators" +gap> m1 := [ [0,1,0,0], [0,0,1,0], [0,0,0,1], [1,0,0,0] ];; +gap> A1 := Algebra( Rationals, [m1] );; +gap> SetName( A1, "A1" );; +gap> GeneratorsOfAlgebra( A1 ); +[ [ [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ], [ 1, 0, 0, 0 ] ] ] +gap> m2 := [ [0,1,1], [0,0,1], [0,0,0] ];; +gap> m3 := [ [-1,0,0], [0,0,0], [0,0,-1] ];; +gap> m4 := [ [0,0,0], [1,0,0], [1,1,0] ];; +gap> A2 := Algebra( Rationals, [m2,m3,m4] );; +gap> SetName( A2, "A2" );; +gap> GeneratorsOfAlgebra( A2 ); +[ [ [ 0, 1, 1 ], [ 0, 0, 1 ], [ 0, 0, 0 ] ], + [ [ -1, 0, 0 ], [ 0, 0, 0 ], [ 0, 0, -1 ] ], + [ [ 0, 0, 0 ], [ 1, 0, 0 ], [ 1, 1, 0 ] ] ] +gap> A12 := DirectSumOfAlgebras( A1, A2 );; +gap> info12 := DirectSumInfo( A12 ); +rec( algebras := [ A1, A2 ], embeddings := [ ], first := [ 0, 1, 4 ], + projections := [ ], type := "generators" ) +gap> SetName( A12, "A12" ); +gap> emb1 := Embedding( A12, 1 ); +[ [ [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ], [ 1, 0, 0, 0 ] ] ] -> +[ + [ [ 0, 1, 0, 0, 0, 0, 0 ], [ 0, 0, 1, 0, 0, 0, 0 ], [ 0, 0, 0, 1, 0, 0, 0 ], + [ 1, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ], + [ 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ] ] ] +gap> m1^3; +[ [ 0, 0, 0, 1 ], [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ] ] +gap> ImageElm( emb1, m1^3 ); +[ [ 0, 0, 0, 1, 0, 0, 0 ], [ 1, 0, 0, 0, 0, 0, 0 ], [ 0, 1, 0, 0, 0, 0, 0 ], + [ 0, 0, 1, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ], + [ 0, 0, 0, 0, 0, 0, 0 ] ] +gap> pro2 := Projection( A12, 2 );; +gap> m0 := GeneratorsOfAlgebra( A12 )[2]; +[ [ 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ], + [ 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 1, 1 ], [ 0, 0, 0, 0, 0, 0, 1 ], + [ 0, 0, 0, 0, 0, 0, 0 ] ] +gap> ImageElm( pro2, m0 ); +[ [ 0, 1, 1 ], [ 0, 0, 1 ], [ 0, 0, 0 ] ] +gap> # mix the two types together +gap> # A56 has type "basis vectors" and A12 has type "generators" +gap> # so A5612 has type "basis vectors" +gap> A5612 := DirectSumOfAlgebras( A56, A12 );; +gap> info5612 := DirectSumInfo( A5612 ); +rec( algebras := [ A5(+)A6, A12 ], embeddings := [ ], first := [ 0, 11, 24 ], + projections := [ ], type := "basis vectors" ) +gap> A51 := DirectSumOfAlgebras( A5, A1 );; +gap> info51 := DirectSumInfo( A51 ); +rec( algebras := [ A5, A1 ], embeddings := [ ], first := [ 0, 5, 9 ], + projections := [ ], type := "basis vectors" ) +gap> Embedding( A51, 2 ); +[ [ [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ], [ 1, 0, 0, 0 ] ], + [ [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ], [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ] ], + [ [ 0, 0, 0, 1 ], [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ] ], + [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ] ] -> +[ v.6, v.7, v.8, v.9 ] +gap> Embedding( A51, 1 ); +[ (1)*(), (1)*(5,6,7,8,9), (1)*(5,7,9,6,8), (1)*(5,8,6,9,7), (1)*(5,9,8,7,6) + ] -> [ v.1, v.2, v.3, v.4, v.5 ] +gap> Projection( A51, 1 ); +[ v.1, v.2, v.3, v.4, v.5, v.6, v.7, v.8, v.9 ] -> +[ (1)*(), (1)*(5,6,7,8,9), (1)*(5,7,9,6,8), (1)*(5,8,6,9,7), (1)*(5,9,8,7,6), + of ..., of ..., of ..., of ... ] +gap> Projection( A51, 2 ); +[ v.1, v.2, v.3, v.4, v.5, v.6, v.7, v.8, v.9 ] -> +[ [ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ], [ 1, 0, 0, 0 ] ], + [ [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ], [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ] ], + [ [ 0, 0, 0, 1 ], [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ] ], + [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ] ] +gap> A26 := DirectSumOfAlgebras( A2, A6 );; +gap> e := Embedding( A26, 1 );; p := Projection( A26, 1 );; +gap> ForAll( BasisVectors( Basis( A2 ) ), x -> ( x ^ e ) ^ p = x ); +true +gap> ForAll( BasisVectors( Basis( A6 ) ), y -> IsZero( ( y ^ Embedding( A26, 2 ) ) ^ p ) ); +true +gap> ## the following fails because internal DirectSumOfAlgebras( A1, A2 ) +gap> ## has a basis with 4 matrices instead of 12 (which A12 has) +gap> A125 := DirectSumOfAlgebras( [ A1, A2, A5 ] );; +Error, the module of the basis must be closed under multiplication +gap> ## Lie algebra example +gap> L := FullMatrixLieAlgebra( Rationals, 2 ); + +gap> SetName( L, "L" ); +gap> L2 := DirectSumOfAlgebras( L, L ); + +gap> DirectSumInfo(L2); +rec( algebras := [ L, L ], embeddings := [ ], first := [ 0, 3, 6 ], + projections := [ ], type := "generators" ) +gap> Embedding( L2, 1 ); +[ LieObject( [ [ 1, 0 ], [ 0, 0 ] ] ), LieObject( [ [ 0, 1 ], [ 0, 0 ] ] ), + LieObject( [ [ 0, 0 ], [ 1, 0 ] ] ) ] -> +[ [ [ 1, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 1, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 0, 0, 0 ], [ 1, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ] ] +gap> Projection( L2, 2 ); +[ [ [ 1, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 1, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 0, 0, 0 ], [ 1, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 1 ], [ 0, 0, 0, 0 ] ], + [ [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 1, 0 ] ] ] -> +[ LieObject( [ [ 0, 0 ], [ 0, 0 ] ] ), LieObject( [ [ 0, 0 ], [ 0, 0 ] ] ), + LieObject( [ [ 0, 0 ], [ 0, 0 ] ] ), LieObject( [ [ 1, 0 ], [ 0, 0 ] ] ), + LieObject( [ [ 0, 1 ], [ 0, 0 ] ] ), LieObject( [ [ 0, 0 ], [ 1, 0 ] ] ) ] +gap> STOP_TEST("alg-dsum.tst");