Skip to content

Commit

Permalink
semidp: improve speed & scope of DirectProduct
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Sep 28, 2017
1 parent e5c359e commit 6010627
Show file tree
Hide file tree
Showing 14 changed files with 1,259 additions and 264 deletions.
2 changes: 1 addition & 1 deletion doc/properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ gap> R := RectangularBand(3, 2);
<regular transformation semigroup of size 6, degree 6 with 3
generators>
gap> S := DirectProduct(G, R);
<transformation semigroup of size 47520, degree 17 with 5 generators>
<transformation semigroup of size 47520, degree 17 with 9 generators>
gap> IsRectangularGroup(R);
true
gap> IsRectangularGroup(G);
Expand Down
58 changes: 58 additions & 0 deletions doc/semidp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#############################################################################
##
#W semidp.xml
#Y Copyright (C) 2017 Wilf A. Wilson
##
## Licensing information can be found in the README file of this package.
##
#############################################################################
##

<#GAPDoc Label="DirectProduct">
<ManSection>
<Func Name = "DirectProduct" Arg = "S[, T, ...]"/>
<Oper Name = "DirectProductOp" Arg = "list, S"/>
<Returns>A transformation semigroup.</Returns>
<Description>
The function <C>DirectProduct</C> takes an arbitrary positive number of
finite semigroups, and returns a semigroup that is isomorphic to their
direct product. <P/>

If these finite semigroups are either all partial perm semigroups, or all
bipartition semigroups, or all PBR semigroups, then <C>DirectProduct</C>
returns a semigroup of the same type. Otherwise, <C>DirectProduct</C>
returns a transformation semigroup. <P/>

The operation <C>DirectProductOp</C> is included for consistency with the
&GAP; library (see <Ref Oper="DirectProductOp" BookName="ref"/>). It takes
exactly two arguments, namely a non-empty list <A>list</A> of semigroups and
one of these semigroups, <A>S</A>, and returns the same result as
<C>CallFuncList(DirectProduct, <A>list</A>)</C>. <P/>

If <C>D</C> is the direct product of a collection of semigroups, then an
embedding of the <C>i</C>th factor into <C>D</C> can be accessed with
the command <C>Embedding(D, i)</C>, and a projection of <C>D</C> onto its
<C>i</C>th factor can be accessed with the command <C>Projection(D, i)</C>;
see <Ref Oper = "Embedding" BookName = "ref" /> and
<Ref Oper = "Projection" BookName = "ref" /> for more information.

<Example><![CDATA[
gap> S := InverseMonoid([PartialPerm([2, 1])]);;
gap> T := InverseMonoid([PartialPerm([1, 2, 3])]);;
gap> D := DirectProduct(S, T);
<commutative inverse partial perm monoid of rank 5 with 1 generator>
gap> Elements(D);
[ <identity partial perm on [ 1, 2, 3, 4, 5 ]>, (1,2)(3)(4)(5) ]
gap> S := PartitionMonoid(3);;
gap> D := DirectProduct(S, S, S);
<bipartition monoid of size 8365427, degree 9 with 12 generators>
gap> S := Semigroup([PartialPerm([2, 5, 0, 1, 3]),
> PartialPerm([5, 2, 4, 3])]);;
gap> T := Semigroup([Bipartition([[1, -2], [2], [3, -1, -3]])]);;
gap> D := DirectProduct(S, T);
<transformation semigroup of size 122, degree 9 with 63 generators>
gap> Size(D) = Size(S) * Size(T);
true]]></Example>
</Description>
</ManSection>
<#/GAPDoc>
38 changes: 2 additions & 36 deletions doc/semitrans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -330,44 +330,10 @@ true]]></Example>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="DirectProduct">
<ManSection>
<Func Name = "DirectProduct" Arg = "S[, T, ...]"/>
<Oper Name = "DirectProductOp" Arg = "list, S"/>
<Returns>A transformation semigroup.</Returns>
<Description>
The function <C>DirectProduct</C> takes an arbitrary positive number of
transformation semigroups and returns another transformation semigroup
isomorphic to their direct product.

The operation <C>DirectProductOp</C> is included for consistency with the
&GAP; library (see <Ref Oper="DirectProductOp" BookName="ref"/>). It takes
exactly two arguments, namely a non-empty list <C>list</C> of transformation
semigroups and one of these semigroups, <C>S</C>. <P/>

<Example><![CDATA[
gap> S := Semigroup(Transformation([2, 1]));;
gap> T := Semigroup(Transformation([1, 2, 3, 3, 3]));;
gap> DP := DirectProduct(S, T);
<commutative transformation semigroup of degree 7 with 2 generators>
gap> Elements(DP);
[ Transformation( [ 1, 2, 3, 4, 5, 5, 5 ] ),
Transformation( [ 2, 1, 3, 4, 5, 5, 5 ] ) ]
gap> S := Monoid([Transformation([2, 4, 3, 4]),
> Transformation([3, 3, 2, 3, 3])]);;
gap> T := Semigroup([Transformation([3, 5, 4, 2, 6, 3])]);;
gap> DP := DirectProduct(S, T);
<transformation semigroup of degree 11 with 4 generators>
gap> Size(DP);
35
]]></Example>
</Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="FixedPointsOfTransformationSemigroup">
<ManSection>
<Attr Name="FixedPointsOfTransformationSemigroup" Arg="S" Label="for a transformation semigroup"/>
<Attr Name="FixedPointsOfTransformationSemigroup" Arg="S"
Label="for a transformation semigroup"/>
<Returns>A set of positive integers.</Returns>
<Description>
If <A>S</A> is a transformation semigroup, then
Expand Down
15 changes: 15 additions & 0 deletions gap/semigroups/semidp.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#############################################################################
##
#W semidp.gd
#Y Copyright (C) 2017 Wilf A. Wilson
##
## Licensing information can be found in the README file of this package.
##
#############################################################################
##

# This file contains methods for creating direct products of semigroups

DeclareOperation("DirectProductOp", [IsList, IsSemigroup]);

DeclareAttribute("SemigroupDirectProductInfo", IsSemigroup, "mutable");

0 comments on commit 6010627

Please sign in to comment.