Skip to content
Merged
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
3 changes: 2 additions & 1 deletion lib/twocohom.gi
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,8 @@ local field,fp,fpg,gens,hom,mats,fm,mon,tzrules,dim,rules,eqs,i,j,k,l,o,l1,
#eqs:=Filtered(TriangulizedMat(eqs),x->not IsZero(x));
eqs:=ShallowCopy(BasisVectors(eqs));
if Length(eqs)=0 then
eqs:=IdentityMat(Length(rules),field);
# no conditions, so the whole space of tail vectors consists of cocycles
eqs:=IdentityMat(nvars,field);
else
eqs:=ImmutableMatrix(field,eqs);
eqs:=NullspaceMat(TransposedMat(eqs)); # basis of cocycles
Expand Down
17 changes: 17 additions & 0 deletions tst/testbugfix/2026-08-02-TwoCohomologyGeneric.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# TwoCohomologyGeneric used the wrong dimension for the space of cocycles
# in case no conditions on the tails were found, which made it error out
# (or return a wrong answer) for modules of dimension > 1.
gap> triv:=function(G,d,F)
> local mo;
> mo:=GModuleByMats(List(GeneratorsOfGroup(G),x->IdentityMat(d,F)),d,F);
> return Length(TwoCohomologyGeneric(G,mo).cohomology);
> end;;
gap> List([1..3],d->triv(CyclicGroup(2),d,GF(2)));
[ 1, 2, 3 ]
gap> List([1..3],d->triv(ElementaryAbelianGroup(8),d,GF(2)));
[ 6, 12, 18 ]
gap> List([1..3],d->triv(DihedralGroup(8),d,GF(2)));
[ 3, 6, 9 ]
gap> List([1..3],d->triv(CyclicGroup(3),d,GF(3)));
[ 1, 2, 3 ]
gap> Unbind(triv);
Loading