diff --git a/lib/addmagma.gi b/lib/addmagma.gi index 72f692d91b..ab653cbf46 100644 --- a/lib/addmagma.gi +++ b/lib/addmagma.gi @@ -175,7 +175,7 @@ InstallGlobalFunction( SubadditiveMagmaNC, function( M, gens ) if IsEmpty( gens ) then K:= NewType( FamilyObj(M), IsAdditiveMagma - and IsTrivial + and IsEmpty and IsAttributeStoringRep ); S:= Objectify( K, rec() ); SetGeneratorsOfAdditiveMagma( S, [] ); diff --git a/lib/magma.gi b/lib/magma.gi index 47c3598d5a..00d1e7701f 100644 --- a/lib/magma.gi +++ b/lib/magma.gi @@ -1209,6 +1209,14 @@ InstallMethod( AsMagma, D := AsSSortedList( D ); L := ShallowCopy( D ); M := Submagma( MagmaByGenerators( D ), [] ); + # the following is a workaround for a bug in the magma code: If the + # elements family of $M$ is associative, what is returned is not the + # empty magma, but the trivial magma. + # If this is the case (which is indicated by M being a group) rather + # create this trivial magma properly. + if IsGroup(M) then + M:=Submagma(MagmaByGenerators(D),[One(ElementsFamily(FamilyObj(D)))]); + fi; SubtractSet( L, AsSSortedList( M ) ); while not IsEmpty(L) do M := ClosureMagmaDefault( M, L[1] );