From 1e942d91f2bf77fcfb1683e72feb591c17d1a5b3 Mon Sep 17 00:00:00 2001 From: stertooy <5571903+stertooy@users.noreply.github.com> Date: Thu, 15 Oct 2026 12:58:13 +0200 Subject: [PATCH] Fix CRRecordBYPcp for non-snf pcps --- CHANGES.md | 1 + gap/cohom/cohom.gi | 7 +++++++ tst/bugfix/gh-00260.tst | 17 +++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 tst/bugfix/gh-00260.tst diff --git a/CHANGES.md b/CHANGES.md index 83be3501..a74f14ec 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ This file describes changes in the GAP package 'polycyclic'. - `ComplementClassesCR` - `ConjugacyElementsBySeries` - `ConjugacyIntegralAction` + - `CRRecordByPcp` - `FCCentre` - `IsElementaryAbelian` - `IsMatrixRepresentation` diff --git a/gap/cohom/cohom.gi b/gap/cohom/cohom.gi index fd2e7ddb..d3014ca5 100644 --- a/gap/cohom/cohom.gi +++ b/gap/cohom/cohom.gi @@ -307,6 +307,13 @@ end ); BindGlobal( "CRRecordByPcp", function( G, pcp ) local A; + # compute snf if needed + if not IsSNFPcp( pcp ) and + Length( Set( RelativeOrdersOfPcp( pcp ) ) ) > 1 then + pcp := Pcp( GroupOfPcp( pcp ), + SubgroupByIgs( G, DenominatorOfPcp( pcp ) ), "snf" ); + fi; + # set up record A := rec( group := G, factor := Pcp( G, GroupOfPcp( pcp ) ), diff --git a/tst/bugfix/gh-00260.tst b/tst/bugfix/gh-00260.tst new file mode 100644 index 00000000..faf562d0 --- /dev/null +++ b/tst/bugfix/gh-00260.tst @@ -0,0 +1,17 @@ +gap> START_TEST( "gh-00260.tst" ); + +# +# Fix CRRecordByPcp for non-snf pcp's +# +# +gap> G := AbelianPcpGroup( 2 );; +gap> Q := G / Subgroup( G, [ G.1^6 * G.2 ] );; +gap> IsFreeAbelian( Q ); +true +gap> CRRecordByPcp( Q, Pcp( Q, "snf" ) ).dim; +1 +gap> CRRecordByPcp( Q, Pcp( Q ) ).dim; +1 + +# +gap> STOP_TEST( "gh-00260.tst" );