Skip to content

Commit

Permalink
Fix cocycle and coboundary computation for trivial algebra modules
Browse files Browse the repository at this point in the history
Reported by Rudolf Tange
  • Loading branch information
fingolfin committed Jan 4, 2018
1 parent 105d625 commit 9ad2283
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/lierep.gi
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ InstallMethod( CochainSpace,
r:= Dimension( V );
F:= LeftActingDomain( L );

if r = 0 then
if s = 0 then
return VectorSpace( F, [], Cochain( V, 0, Zero(V) ), "basis" );
else
return VectorSpace( F, [], Cochain( V, s, [] ), "basis" );
fi;
fi;

if s = 0 then
bas:= List( BasisVectors( Basis( V ) ), x -> Cochain( V, s, x ) );
return VectorSpace( F, bas, "basis" );
Expand Down Expand Up @@ -623,7 +631,7 @@ InstallMethod( Coboundaries,

if s = 0 then
return VectorSpace( LeftActingDomain(V),
[ Cochain( V, 0, Zero(V) ) ] );
[ ], Cochain( V, 0, Zero(V) ), "basis" );
fi;

# The s-coboundaries are the images of the (s-1)-cochains under
Expand All @@ -632,7 +640,10 @@ InstallMethod( Coboundaries,
Csm1:= CochainSpace( V, s-1 );
gens:= List( GeneratorsOfLeftModule( Csm1 ), x ->
LieCoboundaryOperator(x) );

if Length(gens) = 0 then
return VectorSpace( LeftActingDomain(V),
[ ], Cochain( V, s, [] ), "basis" );
fi;
return VectorSpace( LeftActingDomain(V), gens );

end );
Expand All @@ -649,6 +660,7 @@ InstallMethod( Cocycles,
# when restricted to the space of s-cochains.

Cs:= CochainSpace( V, s );
if IsTrivial(Cs) then return Cs; fi;
gens:= List( GeneratorsOfLeftModule( Cs ), x ->
LieCoboundaryOperator(x) );

Expand Down
61 changes: 61 additions & 0 deletions tst/testinstall/algrep.tst
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,66 @@ gap> Dimension(S1);
gap> S1:=SubAlgebraModule(S,bas,"basis");
<16-dimensional left-module over <Lie algebra of dimension 4 over GF(3)>>

#
#
# cocycles etc.
#

# for zero module
gap> CochainSpace(S0,0);
<vector space of dimension 0 over GF(3)>
gap> CochainSpace(S0,1);
<vector space of dimension 0 over GF(3)>
gap> CochainSpace(S0,2);
<vector space of dimension 0 over GF(3)>
gap> Cocycles(S0,0);
<vector space of dimension 0 over GF(3)>
gap> Cocycles(S0,1);
<vector space of dimension 0 over GF(3)>
gap> Cocycles(S0,2);
<vector space of dimension 0 over GF(3)>
gap> Coboundaries(S0,0);
<vector space of dimension 0 over GF(3)>
gap> Coboundaries(S0,1);
<vector space of dimension 0 over GF(3)>
gap> Coboundaries(S0,2);
<vector space of dimension 0 over GF(3)>

# for proper submodule
gap> CochainSpace(S1,0);
<vector space of dimension 16 over GF(3)>
gap> CochainSpace(S1,1);
<vector space of dimension 64 over GF(3)>
gap> CochainSpace(S1,2);
<vector space of dimension 96 over GF(3)>
gap> Cocycles(S1,0);
<vector space of dimension 4 over GF(3)>
gap> Cocycles(S1,1);
<vector space of dimension 16 over GF(3)>
gap> Cocycles(S1,2);
<vector space of dimension 48 over GF(3)>
gap> tmp:=Coboundaries(S1,0);; Dimension(tmp);; tmp;
<vector space of dimension 0 over GF(3)>
gap> tmp:=Coboundaries(S1,1);; Dimension(tmp);; tmp;
<vector space of dimension 12 over GF(3)>
gap> tmp:=Coboundaries(S1,2);; Dimension(tmp);; tmp;
<vector space of dimension 48 over GF(3)>

# for full module
gap> CochainSpace(S,0);
<vector space of dimension 35 over GF(3)>
gap> CochainSpace(S,1);
<vector space of dimension 140 over GF(3)>
gap> CochainSpace(S,2);
<vector space of dimension 210 over GF(3)>
gap> Cocycles(S,0);
<vector space of dimension 6 over GF(3)>
gap> Cocycles(S,1);
<vector space of dimension 45 over GF(3)>
gap> tmp:=Coboundaries(S,0);; Dimension(tmp);; tmp;
<vector space of dimension 0 over GF(3)>
gap> tmp:=Coboundaries(S,1);; Dimension(tmp);; tmp;
<vector space of dimension 29 over GF(3)>

#
gap> STOP_TEST( "algrep.tst", 1);

0 comments on commit 9ad2283

Please sign in to comment.