Skip to content

Commit

Permalink
Fix for computing quotients of certain algebra modules
Browse files Browse the repository at this point in the history
The issue was originally reported by Rudolf Tange on the GAP
support mailing list.
  • Loading branch information
fingolfin committed Nov 7, 2017
1 parent 618bbe2 commit 418d7f7
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/algrep.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,11 @@ DeclareCategoryFamily( "IsSparseRowSpaceElement" );
#T TB, January 12th, 2000.


#
DeclareHandlingByNiceBasis( "IsSparseVectorSpace",
"for free left modules of sparse vectors");


##############################################################################
##
#O FullSparseRowSpace( <R>, <n> )
Expand Down
20 changes: 20 additions & 0 deletions lib/algrep.gi
Original file line number Diff line number Diff line change
Expand Up @@ -3177,6 +3177,26 @@ InstallMethod( Coefficients,
end );


#############################################################################
##
## Prevent nice basis handling to kick in for vector spaces over sparse
## elements, as that ends up trying to enumerate the vector space, which
## is not a good idea for non-trivial examples.
##
InstallHandlingByNiceBasis( "IsSparseVectorSpace", rec(
detect:= function( R, gens, V, zero )
if IsSparseRowSpaceElementCollection(V) then
return fail;
else
return false;
fi;
end,
NiceFreeLeftModuleInfo := function( C ) end,
NiceVector := function( C, c ) end,
UglyVector := function( C, vec ) end,
) );


#############################################################################
##
#M FullSparseRowSpace( <F>, <n> ) . . . . . . for a ring and an integer
Expand Down
34 changes: 34 additions & 0 deletions tst/testinstall/algrep.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
gap> START_TEST("algrep.tst");

#
gap> L:=FullMatrixLieAlgebra(GF(5),2);
<Lie algebra over GF(5), with 3 generators>
gap> V:=AdjointModule(L);
<left-module over <Lie algebra over GF(5), with 3 generators>>
gap> s:=List([0..3],r->SymmetricPowerOfAlgebraModule(V,r));;
gap> V:=DirectSumOfAlgebraModules(s);
<35-dimensional left-module over <Lie algebra over GF(5), with 3 generators>>
gap> BV:=Basis(V);;
gap> lst:=[BV[5]];;
gap> W:=SubAlgebraModule(V,lst,"basis");
<1-dimensional left-module over <Lie algebra over GF(5), with 3 generators>>
gap> V/W;
<34-dimensional left-module over <Lie algebra over GF(5), with 3 generators>>

#
gap> A:=FullSparseRowSpace(GF(5), 35);
<vector space of dimension 35 over GF(5)>
gap> AV:=Basis(A);;
gap> CanonicalBasis(A); # not currently supported for sparse row spaces
fail
gap> IsCanonicalBasis(AV);
false
gap> v:=AV[12];
(Z(5)^0)*e.12
gap> ForAll(AV, v -> v in A);
true
gap> ForAll([1..10], i -> Random(A) in A);
true

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

0 comments on commit 418d7f7

Please sign in to comment.