> < ^ Date: Wed, 24 Nov 1999 18:45:07 GMT
> < ^ From: Willem de Graaf <degraaf@math.uu.nl >
> < ^ Subject: Re: Semidirectproduct

Dear Jan,

At the moment a function for constructing those does not exist.
However, below is some code for this. If you encounter difficulties

Best wishes,

Willem

sem_dir_prod:= function( L, hom, rad )

# here `hom' is a homomorphsim from `L' into `Der( rad )'.
# We assume that `hom( x )' is a matrix
# and that the columns of `hom( x )' contain the coefficients of
# the images of the basis vectors of `rad'.
# The function returns the semidirect product of `L' and `rad',
# where the action of `L' on `rad' is given by `hom'.

```local   d,  n,  T,  B,  i,  j,  cf,  c,  k,  td, dlist, S;
```

dlist:= List( Basis(L), x -> Image( hom, x ) );
d:= Length( dlist );
n:= Length( dlist ) + Dimension( rad );
F:= LeftActingDomain( L );
T:= EmptySCTable( n, Zero(F), "antisymmetric" );
S:= StructureConstantsTable( Basis( L ) );
B:= Basis( VectorSpace( Rationals, dlist ), dlist );

```for i in [1..d] do
for j in [1..d] do
T[i][j]:= S[i][j];
od;
od;

td:= List( dlist, TransposedMat );
for i in [1..d] do
for j in [1..Dimension( rad ) ] do
cf:= td[i][j];
c:=[];
for k in [1..Length(cf)] do
if cf[k] <> 0 then
fi;
od;
SetEntrySCTable( T, i, j+d, c );
od;
od;

cf:= Coefficients( B, B[i]*B[j] );
c:=[];
for k in [1..Length(cf)] do
if cf[k] <> 0 then
fi;
od;
SetEntrySCTable( T, i+d, j+d, c );
od;
od;
```

return LieAlgebraByStructureConstants( F, T );
end;