Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/ref/algebra.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
70 changes: 65 additions & 5 deletions lib/algebra.gd
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ DeclareOperation( "ProductSpace", [ IsFreeLeftModule, IsFreeLeftModule ] );
##
#O DirectSumOfAlgebras( <A1>, <A2> )
#O DirectSumOfAlgebras( <list> )
#O DirectSumOfAlgebrasByGenerators( <A1>, <A2> )
##
## <#GAPDoc Label="DirectSumOfAlgebras">
## <ManSection>
Expand All @@ -567,8 +568,10 @@ DeclareOperation( "ProductSpace", [ IsFreeLeftModule, IsFreeLeftModule ] );
## Label="for a list of algebras"/>
##
## <Description>
## is the direct sum of the two algebras <A>A1</A> and <A>A2</A>
## respectively of the algebras in the list <A>list</A>.
## This is the direct sum of the two algebras <A>A1</A> and <A>A2</A>
## or of the algebras in the list <A>list</A>.
## In the latter case, <C>DirectSumOfAlgebras(A1,A2,A3,...,An)</C>
## returns <M>(...((A_1 \oplus A_2) \oplus A3)...) \oplus A_n</M>.
## <P/>
## If all involved algebras are associative algebras then the result is also
## known to be associative.
Expand All @@ -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.
## <Example><![CDATA[
## gap> A:= QuaternionAlgebra( Rationals );;
## gap> DirectSumOfAlgebras( [A, A, A] );
## <algebra of dimension 12 over Rationals>
## 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 );
## <algebra of dimension 8 over Rationals>
## gap> A353 := DirectSumOfAlgebras( [ A3, A5, A3 ] );
## <algebra of dimension 11 over Rationals>
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareOperation( "DirectSumOfAlgebras", [ IsDenseList ] );
DeclareOperation( "DirectSumOfMatrixAlgebras", [ IsAlgebra, IsAlgebra ] );


#############################################################################
##
#O Embedding( <A>, <i> )
##
## <#GAPDoc Label="Embedding:algebras">
## <ManSection>
## <Oper Name="Embedding" Arg='A, i'
## Label="for a direct sum of algebras and a positive integer"/>
##
## <Description>
## If algebra <A>A</A> is the direct sum of algebras <M>[A_1,\ldots,A_k]</M>
## then <C>Embedding(A,i)</C> for <M>1 \leq i \leq k</M> returns an algebra
## homomorphism mapping <M>A_i</M> into <A>A</A>.
## <P/>
## <Example><![CDATA[
## gap> 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
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>


#############################################################################
##
#O Projection( <A>, <i> )
##
## <#GAPDoc Label="Projection:algebras">
## <ManSection>
## <Oper Name="Projection" Arg='A, i'
## Label="for a direct sum of algebras and a positive integer"/>
##
## <Description>
## If algebra <A>A</A> is the direct sum of algebras <M>[A_1,\ldots,A_k]</M>
## then <C>Projection(A,i)</C> for <M>1 \leq i \leq k</M> returns an algebra
## homomorphism mapping <A>A</A> onto <M>A_i</M>.
## <P/>
## <Example><![CDATA[
## gap> pro2 := Projection( A35, 2 );
## [ v.1, v.2, v.3, v.4, v.5, v.6, v.7, v.8 ] -> [ <zero> of ..., <zero> of ...,
## <zero> 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) ]
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>


#############################################################################
Expand Down
110 changes: 99 additions & 11 deletions lib/algebra.gi
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -3062,7 +3059,6 @@ InstallOtherMethod( DirectSumOfAlgebras,
od;
od;


# Set the (anti)symmetric flag
if scT[n2 + 1] = sym then
T[n + 1] := sym;
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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( <A>, <U> ) . . . . . . . . test if <U> is centralized by <A>
Expand Down
Loading
Loading