From 57cf4ecbda30bfcfd356f1f321af198c844fbf49 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 29 Jul 2026 02:06:56 +0200 Subject: [PATCH 1/3] Do not require SmallGrp for viewing and displaying rcwa groups The `ViewObj' and `Display' methods for rcwa groups mention the isomorphism type of the group if `IdGroup' happens to be known. Both the attribute `IdGroup' and its tester `HasIdGroup' are provided by the SmallGrp package though, so without it viewing or displaying an rcwa group failed with Error, Variable: 'HasIdGroup' must have an assigned value Only SmallGrp can set that attribute, hence it is certainly not set when the package is absent. Add the helpers `RCWA_HasIdGroup' and `RCWA_IdGroup' which take that into account, and use them in the two places in question; the output is unchanged when SmallGrp is available, and falls back to printing the order otherwise. See https://github.com/gap-system/gap/issues/2434 Co-Authored-By: Claude Opus 5 --- lib/rcwagrp.gi | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/rcwagrp.gi b/lib/rcwagrp.gi index 320e7fc..c3e3888 100644 --- a/lib/rcwagrp.gi +++ b/lib/rcwagrp.gi @@ -14,6 +14,21 @@ ## ############################################################################# +############################################################################# +## +#F RCWA_HasIdGroup( ) . . . . . . . . . . `HasIdGroup', if it is present +#F RCWA_IdGroup( ) . . . . . . . . . . . . . `IdGroup', if it is present +## +## The attribute `IdGroup' and its tester `HasIdGroup' are provided by the +## SmallGrp package, which is not always available. Since only SmallGrp can +## set that attribute, it is certainly not set if the package is missing, +## so treating it as unset in that case is safe. These two functions are +## used purely to enrich `ViewObj' and `Display' output. +## +BindGlobal( "RCWA_HasIdGroup", + G -> IsBound( HasIdGroup ) and ValueGlobal( "HasIdGroup" )( G ) ); +BindGlobal( "RCWA_IdGroup", G -> ValueGlobal( "IdGroup" )( G ) ); + ############################################################################# ## #S Implications between the categories of rcwa groups. ///////////////////// @@ -222,8 +237,8 @@ InstallMethod( ViewObj, Print("rcwa group over ",RingString," with ",NrGens," generator"); if NrGens > 1 then Print("s"); fi; if not (HasIsTame(G) and not IsTame(G)) then - if HasIdGroup(G) - then Print(", of isomorphism type ",IdGroup(G)); + if RCWA_HasIdGroup(G) + then Print(", of isomorphism type ",RCWA_IdGroup(G)); elif HasSize(G) then Print(", of order ",Size(G)); fi; fi; @@ -329,8 +344,9 @@ InstallMethod( Display, if prefix then Print("rcwa "); else Print("\nRcwa "); fi; Print("group over ",RingString); if not (HasIsTame(G) and not IsTame(G)) then - if HasIdGroup(G) then Print(" of isomorphism type ",IdGroup(G)); - elif HasSize(G) then Print(" of order ",Size(G)); fi; + if RCWA_HasIdGroup(G) + then Print(" of isomorphism type ",RCWA_IdGroup(G)); + elif HasSize(G) then Print(" of order ",Size(G)); fi; fi; Print(", generated by\n\n[\n"); for g in GeneratorsOfGroup(G) do Display(g); od; From 142085090aa6ee100fca852b2c2a4b445fe704b4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 29 Jul 2026 02:48:08 +0200 Subject: [PATCH 2/3] Make tst/integral.tst work without the SmallGrp package Four tests in tst/integral.tst require SmallGrp: two call `IdGroup' directly (and check that the isomorphism type then shows up in the `ViewObj' output), and two use `StructureDescription', which produces prettier names when it can look up `NAMES_OF_SMALL_GROUPS' via `IdGroup'. Guard these using the `#@if' syntax of the test file parser. For the `IdGroup' case add an `#@else' branch, so that the fallback of printing the order rather than the isomorphism type is covered as well. See https://github.com/gap-system/gap/issues/2434 Co-Authored-By: Claude Opus 5 --- tst/integral.tst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tst/integral.tst b/tst/integral.tst index 586b420..dc6fa4e 100644 --- a/tst/integral.tst +++ b/tst/integral.tst @@ -1111,10 +1111,15 @@ gap> IsBijective(phi); true gap> Size(Image(phi)); 24 +#@if IsPackageMarkedForLoading( "smallgrp", "" ) gap> IdGroup(G); [ 24, 12 ] gap> G; +#@else +gap> G; + +#@fi gap> Modulus(G); 6 gap> A4 := DerivedSubgroup(G); @@ -2023,12 +2028,16 @@ gap> StructureDescription(G); "C2 x C2" gap> G := Group(ClassTransposition(0,4,1,4),ClassShift(0,4), > ClassReflection(1,4),ClassReflection(2,4),ClassShift(3,4));; +#@if IsPackageMarkedForLoading( "smallgrp", "" ) gap> StructureDescription(G:short); "Z^2.((S3xS3):2)x2xZ" +#@fi gap> G := Group(ClassTransposition(0,2,1,4), > ClassShift(2,4),ClassReflection(1,2));; +#@if IsPackageMarkedForLoading( "smallgrp", "" ) gap> StructureDescription(G:short); "Z^2.((S3xS3):2)" +#@fi gap> G := Group(ClassTransposition(0,2,1,4),ClassShift(0,5));; gap> StructureDescription(G); "(Z x Z x Z x Z x Z x Z x Z) . (C2 x S7)" From 74d98a8cd46eeeff09afa5d4ee205b7dbc959b6a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 29 Jul 2026 15:04:26 +0200 Subject: [PATCH 3/3] Mention the SmallGrp change in CHANGES.md Co-Authored-By: Claude Opus 5 --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index c672cad..29f7f45 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,11 @@ - An operation `ClassTranspositionConjugationBall` has been added, together with a method for rcwa groups over Z. (Not documented so far.) + - RCWA no longer requires the SmallGrp package: viewing and displaying + an rcwa group used the attribute `IdGroup` and its tester + `HasIdGroup`, which are provided by that package, and thus failed if + it was not loaded. The isomorphism type is still shown whenever + `IdGroup` is known, and the order is printed otherwise. ## Changes between RCWA 4.8.0 and RCWA 4.9.0 (May 4, 2026):