diff --git a/.mailmap b/.mailmap index 26433dbe8..ac96054e2 100644 --- a/.mailmap +++ b/.mailmap @@ -9,6 +9,8 @@ Joseph Edwards Joe Edwards <80713360+Joseph-Edwards@user Joseph Edwards Joseph Edwards Luke Elliott le27 Fernando Flores Brito Fernando Flores Brito +Matthias Fresacher +Matthias Fresacher Tillman Froehlich <47321884+awesometillman@users.noreply.github.com> Nick Ham Robert Hancock Robert Hancock diff --git a/PackageInfo.g b/PackageInfo.g index 6152bcfb1..bbd96e804 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -156,6 +156,15 @@ Persons := [ IsAuthor := true, IsMaintainer := false, Email := "trf1@st-andrews.ac.uk"), + + rec( + LastName := "Fresacher", + FirstNames := "Matthias", + IsAuthor := true, + IsMaintainer := false, + Email := "m.fresacher@westernsydney.edu.au", + WWWHome := "https://staff.cdms.westernsydney.edu.au/~mfresacher/", + Institution := "Western Sydney University"), rec( LastName := "Ham", diff --git a/gap/elements/bipart.gd b/gap/elements/bipart.gd index bf8a60284..650c90e7f 100644 --- a/gap/elements/bipart.gd +++ b/gap/elements/bipart.gd @@ -72,6 +72,8 @@ DeclareProperty("IsPartialPermBipartition", IsBipartition); DeclareOperation("PermLeftQuoBipartition", [IsBipartition, IsBipartition]); +DeclareOperation("NrFloatingBlocks", [IsBipartition, IsBipartition]); + # Collections DeclareAttribute("DegreeOfBipartitionCollection", IsBipartitionCollection); DeclareOperation("OneMutable", [IsBipartitionCollection]); diff --git a/gap/elements/bipart.gi b/gap/elements/bipart.gi index 5045482af..681dde508 100644 --- a/gap/elements/bipart.gi +++ b/gap/elements/bipart.gi @@ -1111,3 +1111,64 @@ function(coll) return TensorBipartitions(coll); end); + +InstallMethod(NrFloatingBlocks, "for bipartition and bipartition", +[IsBipartition, IsBipartition], +function(a, b) + local n, anr, fuse, fuseit, ablocks, bblocks, x, y, made_it, tab, nr, i; + + n := DegreeOfBipartition(a); + anr := NrBlocks(a); + + fuse := [1 .. anr + NrBlocks(b)]; + + fuseit := function(i) + while fuse[i] < i do + i := fuse[i]; + od; + return i; + end; + + ablocks := IntRepOfBipartition(a); + bblocks := IntRepOfBipartition(b); + + for i in [1 .. n] do + x := fuseit(ablocks[i + n]); + y := fuseit(bblocks[i] + anr); + if x <> y then + if x < y then + fuse[y] := x; + else + fuse[x] := y; + fi; + fi; + od; + + made_it := BlistList(fuse, []); + for i in [1 .. n] do + made_it[fuseit(ablocks[i])] := true; + od; + + for i in [n + 1 .. 2 * n] do + made_it[fuseit(bblocks[i] + anr)] := true; + od; + tab := 0 * fuse; + nr := 0; + + for i in [n + 1 .. 2 * n] do + x := fuseit(ablocks[i]); + if not made_it[x] and tab[x] = 0 then + nr := nr + 1; + tab[x] := 1; + fi; + od; + + for i in [1 .. n] do + x := fuseit(bblocks[i] + anr); + if not made_it[x] and tab[x] = 0 then + nr := nr + 1; + tab[x] := 1; + fi; + od; + return nr; +end); diff --git a/gap/elements/twisted-bipart.gd b/gap/elements/twisted-bipart.gd new file mode 100644 index 000000000..80884ee48 --- /dev/null +++ b/gap/elements/twisted-bipart.gd @@ -0,0 +1,107 @@ +############################################################################ +## +## elements/twisted-bipart.gd +## Copyright (C) 2025 James D. Mitchell +## +## Licensing information can be found in the README file of this package. +## +############################################################################# +## +## In collaboration with +## +############################################## +## ## +## Code created ## +## by ## +## *--------------------* ## +## | Matthias Fresacher | ## +## *--------------------* ## +## ## +############################################## + +# *------------------------------* +# |``````````````````````````````| +# |`````____````____`````````````| +# |````|MFMF\ /MFMF|````````````| +# |````|MF|MF\/MF|MF|````````````| +# |````|MF|\MFMF/|MF|_______`````| +# |````|MF|``````|MFMFMFMFMF|````| +# |````|MF|``````|MF|````````````| +# |````|MF|``````|MF|___`````````| +# |``````````````|MFMFMF|````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````````````````````| +# *------------------------------* + +DeclareCategory("IsTwistedBipartition", IsMultiplicativeElementWithOne +and IsMultiplicativeElementWithZero and +IsAssociativeElement); +DeclareCategoryCollections("IsTwistedBipartition"); +DeclareCategoryCollections("IsTwistedBipartitionCollection"); + +DeclareOperation("TwistedBipartition", [IsInt, IsBipartition, IsInt]); +DeclareOperation("ZeroTwistedBipartition", [IsInt, IsInt]); +DeclareAttribute("DegreeOfTwistedBipartition", +IsTwistedBipartition); +DeclareAttribute("DegreeOfTwistedBipartitionCollection", +IsTwistedBipartitionCollection); +DeclareAttribute("MaxFloatingBlocks", +IsTwistedBipartition); +DeclareAttribute("NrFloatingBlocks", +IsTwistedBipartition); +DeclareAttribute("UnderlyingBipartition", +IsTwistedBipartition); +DeclareAttribute("UnderlyingBipartitionCollection", +IsTwistedBipartitionCollection); + +DeclareOperation("RandomNonZeroTwistedBipartition", [IsInt, IsInt]); +DeclareOperation("RandomNonZeroTwistedBipartition", [IsRandomSource, IsInt, IsInt]); +DeclareOperation("RandomTwistedBipartition", [IsInt, IsInt]); +DeclareOperation("RandomTwistedBipartition", [IsRandomSource, IsInt, IsInt]); +DeclareProperty("IsZero", IsTwistedBipartition); +DeclareProperty("IsOne", IsTwistedBipartition); +DeclareOperation("IdentityTwistedBipartition", [IsPosInt, IsInt]); +DeclareAttribute("ZeroImmutable", IsTwistedBipartition); + +DeclareAttribute("DegreeOfBipartition", IsTwistedBipartition); +DeclareAttribute("NrBlocks", IsTwistedBipartition); +DeclareAttribute("NrLeftBlocks", IsTwistedBipartition); +DeclareAttribute("NrRightBlocks", IsTwistedBipartition); +DeclareAttribute("RankOfBipartition", IsTwistedBipartition); + +DeclareAttribute("DomainOfBipartition", IsTwistedBipartition); +DeclareAttribute("CodomainOfBipartition", IsTwistedBipartition); + +DeclareAttribute("NrTransverseBlocks", IsTwistedBipartition); +DeclareOperation("OneMutable", [IsTwistedBipartition, IsInt]); +DeclareOperation("OneMutable", [IsTwistedBipartitionCollection, IsInt]); + +DeclareProperty("IsBlockBijection", IsTwistedBipartition); +DeclareProperty("IsUniformBlockBijection", IsTwistedBipartition); +DeclareProperty("IsPartialPermBipartition", IsTwistedBipartition); +DeclareProperty("IsTransBipartition", IsTwistedBipartition); +DeclareProperty("IsDualTransBipartition", IsTwistedBipartition); +DeclareProperty("IsPermBipartition", IsTwistedBipartition); + +DeclareOperation("AsTwistedBipartition", [IsInt, IsPerm, IsZeroCyc, IsInt]); +DeclareOperation("AsTwistedBipartition", [IsInt, IsPerm, IsInt]); +DeclareOperation("AsTwistedBipartition", [IsInt, IsPerm, IsPosInt, IsInt]); +DeclareOperation("AsTwistedBipartition", [IsInt, IsPartialPerm, IsInt]); +DeclareOperation("AsTwistedBipartition", [IsInt, IsPartialPerm, IsZeroCyc, IsInt]); +DeclareOperation("AsTwistedBipartition", [IsInt, IsPartialPerm, IsPosInt, IsInt]); +DeclareOperation("AsTwistedBipartition", [IsInt, IsTransformation, IsInt]); +DeclareOperation("AsTwistedBipartition", [IsInt, IsTransformation, IsPosInt, IsInt]); +DeclareOperation("AsTwistedBipartition", [IsInt, IsTransformation, IsZeroCyc, IsInt]); +DeclareOperation("AsTwistedBipartition", [IsInt, IsBipartition, IsInt]); +DeclareOperation("AsTwistedBipartition", [IsInt, IsBipartition, IsPosInt, IsInt]); +DeclareOperation("AsTwistedBipartition", [IsTwistedBipartition]); +DeclareOperation("AsTwistedBipartition", [IsTwistedBipartition, IsPosInt]); +DeclareOperation("AsTwistedBipartition", [IsInt, IsBipartition, IsZeroCyc, IsInt]); +# DeclareOperation("AsTwistedBipartition", [IsInt, IsPBR, IsZeroCyc, IsInt]); +# DeclareOperation("AsTwistedBipartition", [IsInt, IsPBR, IsPosInt, IsInt]); +# DeclareOperation("AsTwistedBipartition", [IsInt, IsPBR, IsInt]); + +DeclareOperation("AsBlockBijection", [IsTwistedBipartition, IsPosInt]); +DeclareOperation("AsBlockBijection", [IsTwistedBipartition]); \ No newline at end of file diff --git a/gap/elements/twisted-bipart.gi b/gap/elements/twisted-bipart.gi new file mode 100644 index 000000000..c4a01d86e --- /dev/null +++ b/gap/elements/twisted-bipart.gi @@ -0,0 +1,701 @@ +############################################################################ +## +## elements/twisted-bipart.gi +## Copyright (C) 2025 James D. Mitchell +## +## Licensing information can be found in the README file of this package. +## +############################################################################# +## +## In collaboration with +## +############################################## +## ## +## Code created ## +## by ## +## *--------------------* ## +## | Matthias Fresacher | ## +## *--------------------* ## +## ## +############################################## + +# *------------------------------* +# |``````````````````````````````| +# |`````____````____`````````````| +# |````|MFMF\ /MFMF|````````````| +# |````|MF|MF\/MF|MF|````````````| +# |````|MF|\MFMF/|MF|_______`````| +# |````|MF|``````|MFMFMFMFMF|````| +# |````|MF|``````|MF|````````````| +# |````|MF|``````|MF|___`````````| +# |``````````````|MFMFMF|````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````````````````````| +# *------------------------------* + +BindGlobal("TYPES_TWISTED_BIPART", []); +BindGlobal("TYPE_TWISTED_BIPART", +function(n, d) + local fam, type; + + if IsBound(TYPES_TWISTED_BIPART[n + 1]) then + if IsBound(TYPES_TWISTED_BIPART[n + 1][d + 1]) then + return TYPES_TWISTED_BIPART[n + 1][d + 1]; + fi; + else + TYPES_TWISTED_BIPART[n + 1] := []; + fi; + + fam := NewFamily(Concatenation("TwistedBipartitionFamily", + String(n), + "_", + String(d)), + IsTwistedBipartition, + CanEasilySortElements, + CanEasilySortElements); + fam!.DegreeOfBipartition := n; + fam!.MaxFloatingBlocks := d; + + type := NewType(fam, IsTwistedBipartition and IsPositionalObjectRep); + TYPES_TWISTED_BIPART[n + 1][d + 1] := type; + return type; +end); + +InstallMethod(ZeroTwistedBipartition, +"for degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + local result; + if n >= 2 ^ 29 then + ErrorNoReturn("the degree (a positive integer) must not exceed 2 ^ 29 - 1"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + result := []; + Objectify(TYPE_TWISTED_BIPART(n, d), result); + return result; +end); + +InstallMethod(TwistedBipartition, +"for number of floating blocks, bipartition and max. floating blocks (d)", +[IsInt, IsBipartition, IsInt], +function(i, bipart, d) + local n, result; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + n := DegreeOfBipartition(bipart); + result := [i, bipart]; + Objectify(TYPE_TWISTED_BIPART(n, d), result); + return result; +end); + +InstallMethod(MaxFloatingBlocks, "for a twisted bipartition", +[IsTwistedBipartition], +x -> FamilyObj(x)!.MaxFloatingBlocks); + +InstallMethod(DegreeOfTwistedBipartition, "for a twisted bipartition", +[IsTwistedBipartition], +x -> FamilyObj(x)!.DegreeOfBipartition); + +InstallMethod(IsZero, "for a twisted bipartition", +[IsTwistedBipartition], x -> not IsBound(x![1])); + +InstallMethod(IsOne, "for a twisted bipartition", +[IsTwistedBipartition], x -> One(x)=x); + +InstallMethod(NrFloatingBlocks, "for a twisted bipartition", +[IsTwistedBipartition], +function(x) + if IsZero(x) then + ErrorNoReturn("the zero diagram does not have floating blocks"); + fi; + return x![1]; +end); + +InstallMethod(UnderlyingBipartition, "for a twisted bipartition", +[IsTwistedBipartition], +function(x) + if IsZero(x) then + ErrorNoReturn("the zero diagram does not have an underlying bipartition"); + fi; + return x![2]; +end); + +InstallMethod(UnderlyingBipartitionCollection, "for a twisted bipartition", +[IsTwistedBipartitionCollection], +function(x) + # TODO need to write/check this + if IsZero(x) then + ErrorNoReturn("the zero diagram does not have an underlying bipartition"); + fi; + return x![2]; +end); + +InstallMethod(Zero, "for a twisted bipartition", +[IsTwistedBipartition], +function(x) + local n, d; + if IsZero(x) then + return x; + fi; + + n := DegreeOfBipartition(UnderlyingBipartition(x)); + d := MaxFloatingBlocks(x); + return ZeroTwistedBipartition(n, d); +end); + +InstallMethod(One, "for a twisted bipartition", +[IsTwistedBipartition], +function(x) + local n, d; + n := DegreeOfBipartition(UnderlyingBipartition(x)); + d := MaxFloatingBlocks(x); + return TwistedBipartition(0, IdentityBipartition(n), d); +end); + +InstallMethod(IdentityTwistedBipartition, +"for degree n and max. floating blocks (d)", +[IsPosInt, IsInt], +function(n, d) + if n >= 2 ^ 29 then + ErrorNoReturn("the degree (a positive integer) must not exceed 2 ^ 29 - 1"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + return TwistedBipartition(0, IdentityBipartition(n), d); +end); + +# Viewing, printing etc + +InstallMethod(ViewString, "for a twisted bipartition", +[IsTwistedBipartition], +function(x) + local str, ext, i, d; + + d := MaxFloatingBlocks(x); + + if IsZero(x) then + return StringFormatted("\><{}-twisted zero bipartition>\<", d); + fi; + + if DegreeOfBipartition(x) = 0 then + return StringFormatted("\><{}-twisted empty bipartition>\<", d); + elif IsBlockBijection(UnderlyingBipartition(x)) then + str := "\>\><"; + Append(str, String(d)); + Append(str, "-twisted block bijection:\< ("); + else + str := "\>\><"; + Append(str, String(d)); + Append(str, "-twisted bipartition:\< ("); + fi; + + Append(str, String(NrFloatingBlocks(x))); + Append(str, "; "); + + ext := ExtRepOfObj(UnderlyingBipartition(x)); + Append(str, "\>"); + Append(str, String(ext[1])); + Append(str, "\<"); + + for i in [2 .. Length(ext)] do + Append(str, ", \>"); + Append(str, String(ext[i])); + Append(str, "\<"); + od; + Append(str, ")>\<"); + return str; +end); + +InstallMethod(String, "for a twisted bipartition", +[IsTwistedBipartition], +function(x) + if IsZero(x) then + return Concatenation("ZeroTwistedBipartition(", String(DegreeOfTwistedBipartition(x)), ", ", String(MaxFloatingBlocks(x)), ")"); + fi; + return Concatenation("TwistedBipartition(", String(NrFloatingBlocks(x)), ", ", String(UnderlyingBipartition(x)), ", ", String(MaxFloatingBlocks(x)), ")"); +end); + +InstallMethod(PrintString, "for a twisted bipartition", +[IsTwistedBipartition], +function(x) + if IsZero(x) then + return StringFormatted("ZeroTwistedBipartition({}, {})", + DegreeOfTwistedBipartition(x), MaxFloatingBlocks(x)); + fi; + return StringFormatted("TwistedBipartition({}, {}, {})", + NrFloatingBlocks(x), PrintString(UnderlyingBipartition(x)), + MaxFloatingBlocks(x)); +end); + +InstallMethod(RandomNonZeroTwistedBipartition, +"for a degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + if n >= 2 ^ 29 then + ErrorNoReturn("the degree (a positive integer) must not exceed 2 ^ 29 - 1"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + return TwistedBipartition(Random([0 .. d]), RandomBipartition(n), d); +end); + +InstallMethod(RandomNonZeroTwistedBipartition, +"for a random source, degree and max. floating blocks", [IsRandomSource, IsInt, IsInt], +function(rs, n, d) + if n >= 2 ^ 29 then + ErrorNoReturn("the degree (a positive integer) must not exceed 2 ^ 29 - 1"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + return TwistedBipartition(Random(rs, [0 .. d]), RandomBipartition(rs, n), d); +end); + +InstallMethod(RandomTwistedBipartition, +"for a degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + # Gives 1% chance of selecting zero + if n >= 2 ^ 29 then + ErrorNoReturn("the degree (a positive integer) must not exceed 2 ^ 29 - 1"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if Random(GlobalMersenneTwister, 1, 100) = 16 then + return Zero(TwistedBipartition(Random([0 .. d]), RandomBipartition(n), d)); + else + return TwistedBipartition(Random([0 .. d]), RandomBipartition(n), d); + fi; +end); + +InstallMethod(RandomTwistedBipartition, +"for a random source, degree and max. floating blocks", [IsRandomSource, IsInt, IsInt], +function(rs, n, d) + # Gives 1% chance of selecting zero + if n >= 2 ^ 29 then + ErrorNoReturn("the degree (a positive integer) must not exceed 2 ^ 29 - 1"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if Random(rs, 1, 100) = 16 then + return Zero(TwistedBipartition(Random([0 .. d]), RandomBipartition(rs, n), d)); + else + return TwistedBipartition(Random([0 .. d]), RandomBipartition(rs, n), d); + fi; +end); + +InstallMethod(\*, "for twisted bipartition", IsIdenticalObj, +[IsTwistedBipartition, IsTwistedBipartition], +function(x, y) + local xx, yy, floaters; + + if IsZero(x) then + return x; + elif IsZero(y) then + return y; + fi; + xx := UnderlyingBipartition(x); + yy := UnderlyingBipartition(y); + + floaters := NrFloatingBlocks(xx, yy) + + NrFloatingBlocks(x) + NrFloatingBlocks(y); + + if floaters > MaxFloatingBlocks(x) then + return ZeroTwistedBipartition(DegreeOfTwistedBipartition(x), + MaxFloatingBlocks(x)); + fi; + + return TwistedBipartition(floaters, xx * yy, MaxFloatingBlocks(x)); +end); + +InstallMethod(\*, "for twisted bipartition and a permutation", +[IsTwistedBipartition, IsPerm], {x, y} -> TwistedBipartition(NrFloatingBlocks(x), UnderlyingBipartition(x)*y, MaxFloatingBlocks(x))); +InstallMethod(\*, "for a permutation and twisted bipartition", +[IsPerm, IsTwistedBipartition], {x, y} -> TwistedBipartition(NrFloatingBlocks(y), x*UnderlyingBipartition(y), MaxFloatingBlocks(y))); + +InstallMethod(\*, "for twisted bipartition and a transformation", +[IsTwistedBipartition, IsTransformation], {x, y} -> TwistedBipartition(NrFloatingBlocks(x), UnderlyingBipartition(x)*y, MaxFloatingBlocks(x))); +InstallMethod(\*, "for a transformation and twisted bipartition", +[IsTransformation, IsTwistedBipartition], {x, y} -> TwistedBipartition(NrFloatingBlocks(y), x*UnderlyingBipartition(y), MaxFloatingBlocks(y))); + +InstallMethod(\*, "for twisted bipartition and a partial permutation", +[IsTwistedBipartition, IsPartialPerm], {x, y} -> TwistedBipartition(NrFloatingBlocks(x), UnderlyingBipartition(x)*y, MaxFloatingBlocks(x))); +InstallMethod(\*, "for a partial permutation and twisted bipartition", +[IsPartialPerm, IsTwistedBipartition], {x, y} -> TwistedBipartition(NrFloatingBlocks(y), x*UnderlyingBipartition(y), MaxFloatingBlocks(y))); + +InstallMethod(\^, "for twisted bipartition and a permutation", +[IsTwistedBipartition, IsPerm], {x, y} -> TwistedBipartition(NrFloatingBlocks(x), UnderlyingBipartition(x)^y, MaxFloatingBlocks(x))); + +InstallMethod(\=, "for twisted bipartition", IsIdenticalObj, +[IsTwistedBipartition, IsTwistedBipartition], +function(x, y) + if IsZero(x) then + return IsZero(y); + elif IsZero(y) then + return false; + fi; + return NrFloatingBlocks(x) = NrFloatingBlocks(y) + and UnderlyingBipartition(x) = UnderlyingBipartition(y); +end); + +InstallMethod(\<, "for twisted bipartition", IsIdenticalObj, +[IsTwistedBipartition, IsTwistedBipartition], +function(x, y) + if IsZero(x) then + return not IsZero(y); + elif IsZero(y) then + return false; + fi; + return NrFloatingBlocks(x) < NrFloatingBlocks(y) or + (NrFloatingBlocks(x) = NrFloatingBlocks(y) + and UnderlyingBipartition(x) < UnderlyingBipartition(y)); +end); + +SEMIGROUPS.TwistedBipartitionHashFunc := function(x, data) + if IsZero(x) then + return 1; + fi; + return (163 * data[1].func(NrFloatingBlocks(x), data[1].data) + + data[2].func(UnderlyingBipartition(x), data[2].data)) + mod data[3] + 1; +end; + +InstallMethod(ChooseHashFunction, "for a twisted bipartition", +[IsTwistedBipartition, IsInt], +function(x, hashlen) + local data; + data := [ChooseHashFunction(NrFloatingBlocks(x), hashlen), + ChooseHashFunction(UnderlyingBipartition(x), hashlen), + hashlen]; + return rec(func := SEMIGROUPS.TwistedBipartitionHashFunc, + data := data); +end); + +# Fundamental attributes + +InstallMethod(DegreeOfBipartition, "for a twisted bipartition", +[IsTwistedBipartition], x -> DegreeOfBipartition(UnderlyingBipartition(x))); +InstallMethod(DegreeOfTwistedBipartitionCollection, "for a twisted bipartition semigroup", +[IsTwistedBipartitionSemigroup], DegreeOfTwistedBipartitionSemigroup); +InstallMethod(DegreeOfTwistedBipartitionCollection, "for a twisted bipartition collection", +[IsTwistedBipartitionCollection], {coll} -> DegreeOfBipartition(UnderlyingBipartition(coll[1]))); + +InstallMethod(NrBlocks, "for a twisted bipartition", +[IsTwistedBipartition], x -> NrBlocks(UnderlyingBipartition(x))); + +InstallMethod(NrLeftBlocks, "for a twisted bipartition", +[IsTwistedBipartition], x -> NrLeftBlocks(UnderlyingBipartition(x))); + +InstallMethod(NrRightBlocks, "for a twisted bipartition", +[IsTwistedBipartition], x -> NrRightBlocks(UnderlyingBipartition(x))); + +InstallMethod(RankOfBipartition, "for a twisted bipartition", +[IsTwistedBipartition], x -> RankOfBipartition(UnderlyingBipartition(x))); + +# Attributes + +InstallMethod(DomainOfBipartition, "for a twisted bipartition", +[IsTwistedBipartition], x -> DomainOfBipartition(UnderlyingBipartition(x))); +InstallMethod(CodomainOfBipartition, "for a twisted bipartition", +[IsTwistedBipartition], x -> DomainOfBipartition(UnderlyingBipartition(x))); + +InstallMethod(NrTransverseBlocks, "for a twisted bipartition", +[IsTwistedBipartition], x -> NrTransverseBlocks(UnderlyingBipartition(x))); + +InstallMethod(OneMutable, +"for a twisted bipartition and max. floating blocks (d)", +[IsTwistedBipartition, IsInt], +function(x, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + return TwistedBipartition(0, IdentityBipartition(DegreeOfBipartition(x)), d); +end); + +InstallMethod(OneMutable, +"for a twisted bipartition collection and max. floating blocks (d)", +[IsTwistedBipartitionCollection, IsInt], +function(x, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + return TwistedBipartition(0, IdentityBipartition(DegreeOfBipartitionCollection(x)), d); +end); + +# Properties + +InstallMethod(IsBlockBijection, "for a twisted bipartition", +[IsTwistedBipartition], x -> IsBlockBijection(UnderlyingBipartition(x))); + +InstallMethod(IsPartialPermBipartition, "for a twisted bipartition", +[IsTwistedBipartition], x -> IsPartialPermBipartition(UnderlyingBipartition(x))); + +InstallMethod(IsTransBipartition, "for a twisted bipartition", +[IsTwistedBipartition], x -> IsTransBipartition(UnderlyingBipartition(x))); + +InstallMethod(IsDualTransBipartition, "for a twisted bipartition", +[IsTwistedBipartition], x -> IsDualTransBipartition(UnderlyingBipartition(x))); + +InstallMethod(IsPermBipartition, "for a twisted bipartition", +[IsTwistedBipartition], x -> IsPermBipartition(UnderlyingBipartition(x))); + +# Changing representations + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a permutation, a zero and max. floating blocks (d)", +[IsInt, IsPerm, IsZeroCyc, IsInt], +function(i, f, n, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f, n), d); +end); + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a permutation and max. floating blocks (d)", +[IsInt, IsPerm, IsInt], +function(i, f, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f), d); +end); + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a permutation, a positive integer and max. floating blocks (d)", +[IsInt, IsPerm, IsPosInt, IsInt], +function(i, f, n, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f, n), d); +end); + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a partial permutation and max. floating blocks (d)", +[IsInt, IsPartialPerm, IsInt], +function(i, f, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f), d); +end); + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a partial permutation, a positive integer and max. floating blocks (d)", +[IsInt, IsPartialPerm, IsPosInt, IsInt], +function(i, f, n, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f, n), d); +end); + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a partial permutation, a zero and max. floating blocks (d)", +[IsInt, IsPartialPerm, IsZeroCyc, IsInt], +function(i, f, n, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f, n), d); +end); + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a transformation and max. floating blocks (d)", +[IsInt, IsTransformation, IsInt], +function(i, f, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f), d); +end); + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a transformation, a zero and max. floating blocks (d)", +[IsInt, IsTransformation, IsPosInt, IsInt], +function(i, f, n, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f, n), d); +end); + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a transformation, a zero and max. floating blocks (d)", +[IsInt, IsTransformation, IsZeroCyc, IsInt], +function(i, f, n, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f, n), d); +end); + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a bipartition and max. floating blocks (d)", +[IsInt, IsBipartition, IsInt], +function(i, f, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f), d); +end); + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a bipartition, a positive integer and max. floating blocks (d)", +[IsInt, IsBipartition, IsPosInt, IsInt], +function(i, f, n, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f, n), d); +end); + +InstallMethod(AsTwistedBipartition, +"for a twisted bipartition and a positive integer", +[IsTwistedBipartition, IsPosInt], {x, n} -> TwistedBipartition(NrFloatingBlocks(x), AsBipartition(UnderlyingBipartition(x), n), MaxFloatingBlocks(x))); + +InstallMethod(AsTwistedBipartition, "for a twisted bipartition", [IsTwistedBipartition], IdFunc); + +InstallMethod(AsTwistedBipartition, +"for number of floating blocks, a bipartition, a zero and max. floating blocks (d)", +[IsInt, IsBipartition, IsZeroCyc, IsInt], +function(i, f, n, d) + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + if i < 0 then + ErrorNoReturn("the number of floating blocks must be non-negative"); + elif i > d then + ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); + fi; + return TwistedBipartition(i, AsBipartition(f, n), d); +end); + +# InstallMethod(AsTwistedBipartition, +# "for number of floating blocks, a partitioned binary relation, a zero and max. floating blocks (d)", +# [IsInt, IsPBR, IsZeroCyc, IsInt], +# function(i, f, n, d) +# if d < 0 then +# ErrorNoReturn("the maximum number of floating blocks must be non-negative"); +# fi; +# if i < 0 then +# ErrorNoReturn("the number of floating blocks must be non-negative"); +# elif i > d then +# ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); +# fi; +# return TwistedBipartition(i, AsBipartition(f, n), d); +# end); + +# InstallMethod(AsTwistedBipartition, +# "for number of floating blocks, a partitioned binary relation, a positive integer and max. floating blocks (d)", +# [IsInt, IsPBR, IsPosInt, IsInt], +# function(i, f, n, d) +# if d < 0 then +# ErrorNoReturn("the maximum number of floating blocks must be non-negative"); +# fi; +# if i < 0 then +# ErrorNoReturn("the number of floating blocks must be non-negative"); +# elif i > d then +# ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); +# fi; +# return TwistedBipartition(i, AsBipartition(f, n), d); +# end); + +# InstallMethod(AsTwistedBipartition, +# "for number of floating blocks, a partitioned binary relation and max. floating blocks (d)", +# [IsInt, IsPBR, IsInt], +# function(i, f, d) +# if d < 0 then +# ErrorNoReturn("the maximum number of floating blocks must be non-negative"); +# fi; +# if i < 0 then +# ErrorNoReturn("the number of floating blocks must be non-negative"); +# elif i > d then +# ErrorNoReturn("the number of floating blocks cannot exceed the maximum number of floating blocks"); +# fi; +# return TwistedBipartition(i, AsBipartition(f), d); +# end); + +InstallMethod(AsPartialPerm, "for a twisted bipartition", +[IsTwistedBipartition], x -> AsPartialPerm(UnderlyingBipartition(x))); + +InstallMethod(AsPermutation, "for a twisted bipartition", +[IsTwistedBipartition], x -> AsPermutation(UnderlyingBipartition(x))); + +InstallMethod(AsTransformation, "for a twisted bipartition", +[IsTwistedBipartition], x -> AsTransformation(UnderlyingBipartition(x))); + +InstallMethod(AsBlockBijection, "for a twisted bipartition and positive integer", +[IsTwistedBipartition, IsPosInt], {x, n} -> AsBlockBijection(UnderlyingBipartition(x), n)); +InstallMethod(AsBlockBijection, "for a twisted bipartition", +[IsTwistedBipartition], x -> AsBlockBijection(UnderlyingBipartition(x))); + +InstallMethod(IsUniformBlockBijection, "for a twisted bipartition", +[IsTwistedBipartition], x -> IsUniformBlockBijection(UnderlyingBipartition(x))); \ No newline at end of file diff --git a/gap/semigroups/semiex.gd b/gap/semigroups/semiex.gd index fb262d845..299feee1f 100644 --- a/gap/semigroups/semiex.gd +++ b/gap/semigroups/semiex.gd @@ -7,6 +7,34 @@ ## ############################################################################# ## +## +## In collaboration with +## +############################################## +## ## +## Code created ## +## by ## +## *--------------------* ## +## | Matthias Fresacher | ## +## *--------------------* ## +## ## +############################################## + +# *------------------------------* +# |``````````````````````````````| +# |`````____````____`````````````| +# |````|MFMF\ /MFMF|````````````| +# |````|MF|MF\/MF|MF|````````````| +# |````|MF|\MFMF/|MF|_______`````| +# |````|MF|``````|MFMFMFMFMF|````| +# |````|MF|``````|MF|````````````| +# |````|MF|``````|MF|___`````````| +# |``````````````|MFMFMF|````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````````````````````| +# *------------------------------* # Transformation semigroups DeclareOperation("EndomorphismsPartition", [IsCyclotomicCollection]); @@ -74,6 +102,60 @@ DeclareOperation("SingularPlanarPartitionMonoid", [IsPosInt]); DeclareOperation("ModularPartitionMonoid", [IsPosInt, IsPosInt]); DeclareOperation("SingularModularPartitionMonoid", [IsPosInt, IsPosInt]); +# Twisted bipartition semigroups + +DeclareOperation("TwistedBipartitionMonoid", [IsBipartitionMonoid, IsInt]); +DeclareOperation("TwistedBipartitionSemigroup", [IsBipartitionSemigroup, IsInt]); + +DeclareOperation("TwistedPartitionMonoid", [IsInt, IsInt]); + +DeclareOperation("TwistedDualSymmetricInverseMonoid", [IsInt, IsInt]); +DeclareOperation("TwistedPartialDualSymmetricInverseMonoid", [IsInt, IsInt]); + +DeclareOperation("TwistedBrauerMonoid", [IsInt, IsInt]); +DeclareOperation("TwistedPartialBrauerMonoid", [IsInt, IsInt]); + +DeclareOperation("TwistedJonesMonoid", [IsInt, IsInt]); +DeclareSynonym("TwistedTemperleyLiebMonoid", TwistedJonesMonoid); +DeclareOperation("TwistedAnnularJonesMonoid", [IsInt, IsInt]); +DeclareOperation("TwistedPartialJonesMonoid", [IsInt, IsInt]); + +DeclareOperation("TwistedMotzkinMonoid", [IsInt, IsInt]); + +DeclareOperation("TwistedPlanarUniformBlockBijectionMonoid", [IsPosInt, IsInt]); +DeclareOperation("TwistedUniformBlockBijectionMonoid", [IsPosInt, IsInt]); +DeclareOperation("TwistedPartialUniformBlockBijectionMonoid", [IsPosInt, IsInt]); +DeclareOperation("TwistedRookPartitionMonoid", [IsPosInt, IsInt]); + +DeclareOperation("TwistedApsisMonoid", [IsPosInt, IsPosInt, IsInt]); +DeclareOperation("TwistedCrossedApsisMonoid", [IsPosInt, IsPosInt, IsInt]); + +DeclareOperation("TwistedPlanarModularPartitionMonoid", [IsPosInt, IsPosInt, IsInt]); +DeclareOperation("TwistedPlanarPartitionMonoid", [IsPosInt, IsInt]); + +DeclareOperation("TwistedModularPartitionMonoid", [IsPosInt, IsPosInt, IsInt]); + +DeclareOperation("TwistedSingularPartitionMonoid", [IsPosInt, IsInt]); +DeclareOperation("TwistedSingularBrauerMonoid", [IsPosInt, IsInt]); +DeclareOperation("TwistedSingularJonesMonoid", [IsPosInt, IsInt]); +DeclareSynonym("TwistedSingularTemperleyLiebMonoid", TwistedSingularJonesMonoid); +DeclareOperation("TwistedSingularDualSymmetricInverseMonoid", [IsPosInt, IsInt]); +DeclareOperation("TwistedSingularPlanarUniformBlockBijectionMonoid", [IsPosInt, IsInt]); +DeclareOperation("TwistedSingularUniformBlockBijectionMonoid", [IsPosInt, IsInt]); +DeclareOperation("TwistedSingularApsisMonoid", [IsPosInt, IsPosInt, IsInt]); +DeclareOperation("TwistedSingularCrossedApsisMonoid", [IsPosInt, IsPosInt, IsInt]); +DeclareOperation("TwistedSingularPlanarModularPartitionMonoid", [IsPosInt, IsPosInt, IsInt]); +DeclareOperation("TwistedSingularPlanarPartitionMonoid", [IsPosInt, IsInt]); +DeclareOperation("TwistedSingularModularPartitionMonoid", [IsPosInt, IsPosInt, IsInt]); + + + + + + + + + # Matrix over finite field semigroups DeclareOperation("GeneralLinearMonoid", [IsPosInt, IsPosInt]); diff --git a/gap/semigroups/semiex.gi b/gap/semigroups/semiex.gi index 67696fefe..b77c627c5 100644 --- a/gap/semigroups/semiex.gi +++ b/gap/semigroups/semiex.gi @@ -7,6 +7,34 @@ ## ############################################################################# ## +## +## In collaboration with +## +############################################## +## ## +## Code created ## +## by ## +## *--------------------* ## +## | Matthias Fresacher | ## +## *--------------------* ## +## ## +############################################## + +# *------------------------------* +# |``````````````````````````````| +# |`````____````____`````````````| +# |````|MFMF\ /MFMF|````````````| +# |````|MF|MF\/MF|MF|````````````| +# |````|MF|\MFMF/|MF|_______`````| +# |````|MF|``````|MFMFMFMFMF|````| +# |````|MF|``````|MF|````````````| +# |````|MF|``````|MF|___`````````| +# |``````````````|MFMFMF|````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````````````````````| +# *------------------------------* # for testing purposes @@ -496,6 +524,50 @@ function(n) return Monoid(gens, rec(acting := false)); end); +InstallMethod(TwistedBipartitionMonoid, "for a bipartition monoid and max. floating blocks", [IsBipartitionMonoid, IsInt], +function(M, d) + local gens, MTwist; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + gens := List(GeneratorsOfMonoid(M), x -> AsTwistedBipartition(0, x, d)); + if d >= 1 then + Add(gens, TwistedBipartition(1, One(UnderlyingBipartition(gens[1])), d)); + fi; + + MTwist := Monoid(gens); + + # TODO Not sure if these are needed + # SetFilterObj(MTwist, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(MTwist, true); + SetSize(MTwist, Size(M) * (d + 1) + 1); + return MTwist; +end); + +InstallMethod(TwistedBipartitionSemigroup, "for a bipartition semigroup and max. floating blocks", [IsBipartitionSemigroup, IsInt], +function(S, d) + local gens, STwist; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + gens := List(GeneratorsOfSemigroup(S), x -> AsTwistedBipartition(0, x, d)); + if d >= 1 then + Add(gens, TwistedBipartition(1, One(UnderlyingBipartition(gens[1])), d)); + fi; + + STwist := Semigroup(gens); + + # TODO Not sure if these are needed + # SetFilterObj(STwist, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(STwist, true); + SetSize(STwist, Size(S) * (d + 1) + 1); + return STwist; +end); + InstallMethod(PartitionMonoid, "for an integer", [IsInt], function(n) local gens, M; @@ -520,6 +592,25 @@ function(n) return M; end); +InstallMethod(TwistedPartitionMonoid, "for degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + local M; + + if n < 0 then + ErrorNoReturn("the degree (an integer) is not >= 0"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(PartitionMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(DualSymmetricInverseMonoid, "for an integer", [IsInt], function(n) local gens; @@ -543,6 +634,25 @@ function(n) return InverseMonoid(gens); end); +InstallMethod(TwistedDualSymmetricInverseMonoid, "for degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + local M; + + if n < 0 then + ErrorNoReturn("the degree (an integer) is not >= 0"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(DualSymmetricInverseMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(PartialDualSymmetricInverseMonoid, "for an integer", [IsInt], function(n) local gens; @@ -564,6 +674,25 @@ function(n) return InverseMonoid(gens); end); +InstallMethod(TwistedPartialDualSymmetricInverseMonoid, "for degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + local M; + + if n < 0 then + ErrorNoReturn("the degree (an integer) is not >= 0"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(PartialDualSymmetricInverseMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(BrauerMonoid, "for an integer", [IsInt], function(n) local gens, M; @@ -586,6 +715,25 @@ function(n) return M; end); +InstallMethod(TwistedBrauerMonoid, "for degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + local M; + + if n < 0 then + ErrorNoReturn("the degree (an integer) is not >= 0"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(BrauerMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(PartialBrauerMonoid, "for an integer", [IsInt], function(n) local S; @@ -602,6 +750,25 @@ function(n) return S; end); +InstallMethod(TwistedPartialBrauerMonoid, "for degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + local M; + + if n < 0 then + ErrorNoReturn("the degree (an integer) is not >= 0"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(PartialBrauerMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(JonesMonoid, "for an integer", [IsInt], function(n) @@ -633,6 +800,25 @@ function(n) return M; end); +InstallMethod(TwistedJonesMonoid, "for degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + local M; + + if n < 0 then + ErrorNoReturn("the degree (an integer) is not >= 0"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(JonesMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(AnnularJonesMonoid, "for an integer", [IsInt], function(n) local p, x, M, j; @@ -657,6 +843,25 @@ function(n) return M; end); +InstallMethod(TwistedAnnularJonesMonoid, "for degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + local M; + + if n < 0 then + ErrorNoReturn("the degree (an integer) is not >= 0"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(AnnularJonesMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(PartialJonesMonoid, "for an integer", [IsInt], function(n) @@ -689,6 +894,25 @@ function(n) return M; end); +InstallMethod(TwistedPartialJonesMonoid, "for degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + local M; + + if n < 0 then + ErrorNoReturn("the degree (an integer) is not >= 0"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(PartialJonesMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(MotzkinMonoid, "for an integer", [IsInt], function(n) @@ -708,6 +932,25 @@ function(n) return M; end); +InstallMethod(TwistedMotzkinMonoid, "for degree and max. floating blocks", [IsInt, IsInt], +function(n, d) + local M; + + if n < 0 then + ErrorNoReturn("the degree (an integer) is not >= 0"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(MotzkinMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(POI, "for a positive integer", [IsPosInt], function(n) local out, i; @@ -786,6 +1029,25 @@ function(n) return InverseMonoid(gens); end); +InstallMethod(TwistedPlanarUniformBlockBijectionMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local M; + + if n < 0 then + ErrorNoReturn("the degree (an integer) is not >= 0"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(PlanarUniformBlockBijectionMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(UniformBlockBijectionMonoid, "for a positive integer", [IsPosInt], function(n) @@ -800,6 +1062,22 @@ function(n) return InverseMonoid(gens); end); +InstallMethod(TwistedUniformBlockBijectionMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local M; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(UniformBlockBijectionMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(PartialUniformBlockBijectionMonoid, "for a positive integer", [IsPosInt], function(n) @@ -818,6 +1096,22 @@ function(n) return InverseMonoid(gens); end); +InstallMethod(TwistedPartialUniformBlockBijectionMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local M; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(PartialUniformBlockBijectionMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(RookPartitionMonoid, "for a positive integer", [IsPosInt], function(n) local S; @@ -829,11 +1123,32 @@ function(n) return S; end); +InstallMethod(TwistedRookPartitionMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local M; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(RookPartitionMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(ApsisMonoid, "for a positive integer and positive integer", [IsPosInt, IsPosInt], function(m, n) local gens, next, S, b, i, j; + + if m > n then + ErrorNoReturn("the 1st argument (a pos. int.) is not <= to the ", + "2nd argument (a pos. int.)"); + fi; if n = 1 and m = 1 then return InverseMonoid(Bipartition([[1], [-1]])); @@ -891,11 +1206,37 @@ function(m, n) return S; end); +InstallMethod(TwistedApsisMonoid, "for a positive integer, for a positive integer and max. floating blocks", [IsPosInt, IsPosInt, IsInt], +function(m, n, d) + local M; + + if m > n then + ErrorNoReturn("the 1st argument (a pos. int.) is not <= to the ", + "2nd argument (a pos. int.)"); + fi; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(ApsisMonoid(m, n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(CrossedApsisMonoid, "for a positive integer and positive integer", [IsPosInt, IsPosInt], function(m, n) local gens, S; + + if m > n then + ErrorNoReturn("the 1st argument (a pos. int.) is not <= to the ", + "2nd argument (a pos. int.)"); + fi; if n = 1 then if m = 1 then @@ -918,6 +1259,27 @@ function(m, n) return S; end); +InstallMethod(TwistedCrossedApsisMonoid, "for a positive integer, for a positive integer and max. floating blocks", [IsPosInt, IsPosInt, IsInt], +function(m, n, d) + local M; + + if m > n then + ErrorNoReturn("the 1st argument (a pos. int.) is not <= to the ", + "2nd argument (a pos. int.)"); + fi; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(CrossedApsisMonoid(m, n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(PlanarModularPartitionMonoid, "for a positive integer and positive integer", [IsPosInt, IsPosInt], @@ -985,9 +1347,41 @@ function(m, n) return S; end); +InstallMethod(TwistedPlanarModularPartitionMonoid, "for a positive integer, for a positive integer and max. floating blocks", [IsPosInt, IsPosInt, IsInt], +function(m, n, d) + local M; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(PlanarModularPartitionMonoid(m, n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(PlanarPartitionMonoid, "for a positive integer", [IsPosInt], n -> PlanarModularPartitionMonoid(1, n)); +InstallMethod(TwistedPlanarPartitionMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local M; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(PlanarPartitionMonoid(n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(ModularPartitionMonoid, "for a positive integer and positive integer", [IsPosInt, IsPosInt], @@ -1012,6 +1406,22 @@ function(m, n) return S; end); +InstallMethod(TwistedModularPartitionMonoid, "for a positive integer, for a positive integer and max. floating blocks", [IsPosInt, IsPosInt, IsInt], +function(m, n, d) + local M; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + M := TwistedBipartitionMonoid(ModularPartitionMonoid(m, n), d); + + # TODO Not sure if these are needed, if not, can get rid of local M and just have above line in return + # SetFilterObj(M, IsRegularActingSemigroupRep); + # SetIsStarSemigroup(M, true); + return M; +end); + InstallMethod(SingularPartitionMonoid, "for a positive integer", [IsPosInt], function(n) @@ -1028,6 +1438,33 @@ function(n) return SemigroupIdeal(PartitionMonoid(n), Bipartition(blocks)); end); +InstallMethod(TwistedSingularPartitionMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local blocks, gens, i; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + if n = 1 then + gens := [TwistedBipartition(0, Bipartition([[1], [-1]]), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, Bipartition([[1, -1]]), d)]); + fi; + return SemigroupIdeal(TwistedPartitionMonoid(1, d),gens); + fi; + + blocks := [[1, 2, -1, -2]]; + for i in [3 .. n] do + blocks[i - 1] := [i, -i]; + od; + gens := [TwistedBipartition(0, Bipartition(blocks), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, One(Bipartition(blocks)), d)]); + fi; + return SemigroupIdeal(TwistedPartitionMonoid(n, d), gens); +end); + InstallMethod(SingularTransformationSemigroup, "for a positive integer", [IsPosInt], function(n) @@ -1070,6 +1507,29 @@ function(n) return SemigroupIdeal(S, x); end); +InstallMethod(TwistedSingularBrauerMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local blocks, gens, i; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + if n = 1 then + ErrorNoReturn("the degree is too small (n > 1)"); + fi; + + blocks := [[1, 2], [-1, -2]]; + for i in [3 .. n] do + blocks[i] := [i, -i]; + od; + gens := [TwistedBipartition(0, Bipartition(blocks), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, One(Bipartition(blocks)), d)]); + fi; + return SemigroupIdeal(TwistedBrauerMonoid(n, d), gens); +end); + InstallMethod(SingularJonesMonoid, "for a positive integer", [IsPosInt], function(n) @@ -1087,6 +1547,29 @@ function(n) return SemigroupIdeal(S, x); end); +InstallMethod(TwistedSingularJonesMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local blocks, gens, i; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + if n = 1 then + ErrorNoReturn("the degree is too small (n > 1)"); + fi; + + blocks := [[1, 2], [-1, -2]]; + for i in [3 .. n] do + blocks[i] := [i, -i]; + od; + gens := [TwistedBipartition(0, Bipartition(blocks), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, One(Bipartition(blocks)), d)]); + fi; + return SemigroupIdeal(TwistedJonesMonoid(n, d), gens); +end); + InstallMethod(SingularDualSymmetricInverseMonoid, "for a positive integer", [IsPosInt], function(n) @@ -1104,6 +1587,29 @@ function(n) return SemigroupIdeal(S, x); end); +InstallMethod(TwistedSingularDualSymmetricInverseMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local blocks, gens, i; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + if n = 1 then + ErrorNoReturn("the degree is too small (n > 1)"); + fi; + + blocks := [[1, 2, -1, -2]]; + for i in [3 .. n] do + blocks[i - 1] := [i, -i]; + od; + gens := [TwistedBipartition(0, Bipartition(blocks), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, One(Bipartition(blocks)), d)]); + fi; + return SemigroupIdeal(TwistedDualSymmetricInverseMonoid(n, d), gens); +end); + InstallMethod(SingularPlanarUniformBlockBijectionMonoid, "for a positive integer", [IsPosInt], function(n) @@ -1122,6 +1628,29 @@ function(n) return SemigroupIdeal(S, x); end); +InstallMethod(TwistedSingularPlanarUniformBlockBijectionMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local blocks, gens, i; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + if n = 1 then + ErrorNoReturn("the degree is too small (n > 1)"); + fi; + + blocks := [[1, 2, -1, -2]]; + for i in [3 .. n] do + blocks[i - 1] := [i, -i]; + od; + gens := [TwistedBipartition(0, Bipartition(blocks), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, One(Bipartition(blocks)), d)]); + fi; + return SemigroupIdeal(TwistedPlanarUniformBlockBijectionMonoid(n, d), gens); +end); + InstallMethod(SingularUniformBlockBijectionMonoid, "for a positive integer", [IsPosInt], function(n) @@ -1140,6 +1669,29 @@ function(n) return SemigroupIdeal(S, x); end); +InstallMethod(TwistedSingularUniformBlockBijectionMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local blocks, gens, i; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + if n = 1 then + ErrorNoReturn("the degree is too small (n > 1)"); + fi; + + blocks := [[1, 2, -1, -2]]; + for i in [3 .. n] do + blocks[i - 1] := [i, -i]; + od; + gens := [TwistedBipartition(0, Bipartition(blocks), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, One(Bipartition(blocks)), d)]); + fi; + return SemigroupIdeal(TwistedUniformBlockBijectionMonoid(n, d), gens); +end); + InstallMethod(SingularApsisMonoid, "for a positive integer and positive integer", [IsPosInt, IsPosInt], @@ -1160,6 +1712,29 @@ function(m, n) return SemigroupIdeal(S, x); end); +InstallMethod(TwistedSingularApsisMonoid, "for a positive integer, for a positive integer and max. floating blocks", [IsPosInt, IsPosInt, IsInt], +function(m, n, d) + local blocks, gens, i; + + if m > n then + ErrorNoReturn("the 1st argument (a pos. int.) is not <= to the ", + "2nd argument (a pos. int.)"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + blocks := [[1 .. m], [-m .. -1]]; + for i in [m + 1 .. n] do + blocks[i - m + 2] := [i, -i]; + od; + gens := [TwistedBipartition(0, Bipartition(blocks), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, One(Bipartition(blocks)), d)]); + fi; + return SemigroupIdeal(TwistedApsisMonoid(m, n, d), gens); +end); + InstallMethod(SingularCrossedApsisMonoid, "for a positive integer and positive integer", [IsPosInt, IsPosInt], @@ -1180,6 +1755,29 @@ function(m, n) return SemigroupIdeal(S, x); end); +InstallMethod(TwistedSingularCrossedApsisMonoid, "for a positive integer, for a positive integer and max. floating blocks", [IsPosInt, IsPosInt, IsInt], +function(m, n, d) + local blocks, gens, i; + + if m > n then + ErrorNoReturn("the 1st argument (a pos. int.) is not <= to the ", + "2nd argument (a pos. int.)"); + fi; + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + blocks := [[1 .. m], [-m .. -1]]; + for i in [m + 1 .. n] do + blocks[i - m + 2] := [i, -i]; + od; + gens := [TwistedBipartition(0, Bipartition(blocks), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, One(Bipartition(blocks)), d)]); + fi; + return SemigroupIdeal(TwistedCrossedApsisMonoid(m, n, d), gens); +end); + InstallMethod(SingularPlanarModularPartitionMonoid, "for a positive integer and positive integer", [IsPosInt, IsPosInt], @@ -1205,6 +1803,38 @@ function(m, n) return SemigroupIdeal(S, x); end); +InstallMethod(TwistedSingularPlanarModularPartitionMonoid, "for a positive integer, for a positive integer and max. floating blocks", [IsPosInt, IsPosInt, IsInt], +function(m, n, d) + local blocks, gens, i; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + if n = 1 then + if m = 1 then + gens := [TwistedBipartition(0, Bipartition([[1], [-1]]), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, Bipartition([[1, -1]]), d)]); + fi; + return SemigroupIdeal(TwistedPlanarModularPartitionMonoid(1, 1, d), gens); + else + ErrorNoReturn("the 2nd argument (a pos. int.) must be > 1", + " when the 1st argument (a pos. int.) is also > 1"); + fi; + fi; + + blocks := [[1 .. m], [-m .. -1]]; + for i in [m + 1 .. n] do + blocks[i - m + 2] := [i, -i]; + od; + gens := [TwistedBipartition(0, Bipartition(blocks), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, One(Bipartition(blocks)), d)]); + fi; + return SemigroupIdeal(TwistedPlanarModularPartitionMonoid(m, n, d), gens); +end); + InstallMethod(SingularPlanarPartitionMonoid, "for a positive integer", [IsPosInt], function(n) @@ -1223,6 +1853,33 @@ function(n) return SemigroupIdeal(S, x); end); +InstallMethod(TwistedSingularPlanarPartitionMonoid, "for a positive integer and max. floating blocks", [IsPosInt, IsInt], +function(n, d) + local blocks, gens, i; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + if n = 1 then + gens := [TwistedBipartition(0, Bipartition([[1], [-1]]), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, Bipartition([[1, -1]]), d)]); + fi; + return SemigroupIdeal(TwistedPlanarPartitionMonoid(1, d),gens); + fi; + + blocks := [[1, 2, -1, -2]]; + for i in [3 .. n] do + blocks[i - 1] := [i, -i]; + od; + gens := [TwistedBipartition(0, Bipartition(blocks), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, One(Bipartition(blocks)), d)]); + fi; + return SemigroupIdeal(TwistedPlanarPartitionMonoid(n, d), gens); +end); + InstallMethod(SingularModularPartitionMonoid, "for a positive integer and positive integer", [IsPosInt, IsPosInt], @@ -1248,6 +1905,38 @@ function(m, n) return SemigroupIdeal(S, x); end); +InstallMethod(TwistedSingularModularPartitionMonoid, "for a positive integer, for a positive integer and max. floating blocks", [IsPosInt, IsPosInt, IsInt], +function(m, n, d) + local blocks, gens, i; + + if d < 0 then + ErrorNoReturn("the maximum number of floating blocks must be non-negative"); + fi; + + if n = 1 then + if m = 1 then + gens := [TwistedBipartition(0, Bipartition([[1], [-1]]), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, Bipartition([[1, -1]]), d)]); + fi; + return SemigroupIdeal(TwistedModularPartitionMonoid(1, 1, d), gens); + else + ErrorNoReturn("the 2nd argument (a pos. int.) must be > 1", + " when the 1st argument (a pos. int.) is also > 1"); + fi; + fi; + + blocks := [[1, 2, -1, -2]]; + for i in [3 .. n] do + blocks[i - 1] := [i, -i]; + od; + gens := [TwistedBipartition(0, Bipartition(blocks), d)]; + if d > 0 then + gens := Concatenation(gens, [TwistedBipartition(1, One(Bipartition(blocks)), d)]); + fi; + return SemigroupIdeal(TwistedModularPartitionMonoid(m, n, d), gens); +end); + ############################################################################# ## 2. Standard examples - known generators ############################################################################# diff --git a/gap/semigroups/semitwistedbipart.gd b/gap/semigroups/semitwistedbipart.gd new file mode 100644 index 000000000..7f5eafd10 --- /dev/null +++ b/gap/semigroups/semitwistedbipart.gd @@ -0,0 +1,49 @@ +############################################################################ +## +## elements/semitwistedbipart.gd +## Copyright (C) 2025 James D. Mitchell +## +## Licensing information can be found in the README file of this package. +## +############################################################################# +## +## +## In collaboration with +## +############################################## +## ## +## Code created ## +## by ## +## *--------------------* ## +## | Matthias Fresacher | ## +## *--------------------* ## +## ## +############################################## + +# *------------------------------* +# |``````````````````````````````| +# |`````____````____`````````````| +# |````|MFMF\ /MFMF|````````````| +# |````|MF|MF\/MF|MF|````````````| +# |````|MF|\MFMF/|MF|_______`````| +# |````|MF|``````|MFMFMFMFMF|````| +# |````|MF|``````|MF|````````````| +# |````|MF|``````|MF|___`````````| +# |``````````````|MFMFMF|````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````````````````````| +# *------------------------------* + +DeclareSynonym("IsTwistedBipartitionSemigroup", +IsTwistedBipartitionCollection and IsSemigroup); +DeclareSynonym("IsTwistedBipartitionMonoid", +IsTwistedBipartitionCollection and IsMonoid); + +InstallTrueMethod(IsFinite, IsTwistedBipartitionSemigroup); + +DeclareAttribute("DegreeOfTwistedBipartitionSemigroup", +IsTwistedBipartitionSemigroup); +DeclareAttribute("MaxFloatingBlocksOfTwistedBipartitionSemigroup", +IsTwistedBipartitionSemigroup); diff --git a/gap/semigroups/semitwistedbipart.gi b/gap/semigroups/semitwistedbipart.gi new file mode 100644 index 000000000..f905ef3aa --- /dev/null +++ b/gap/semigroups/semitwistedbipart.gi @@ -0,0 +1,66 @@ +############################################################################# +## +## semigroups/semibipart.gi +## Copyright (C) 2025 James D. Mitchell +## +## Licensing information can be found in the README file of this package. +## +############################################################################# +## +## +## In collaboration with +## +############################################## +## ## +## Code created ## +## by ## +## *--------------------* ## +## | Matthias Fresacher | ## +## *--------------------* ## +## ## +############################################## + +# *------------------------------* +# |``````````````````````````````| +# |`````____````____`````````````| +# |````|MFMF\ /MFMF|````````````| +# |````|MF|MF\/MF|MF|````````````| +# |````|MF|\MFMF/|MF|_______`````| +# |````|MF|``````|MFMFMFMFMF|````| +# |````|MF|``````|MF|````````````| +# |````|MF|``````|MF|___`````````| +# |``````````````|MFMFMF|````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````|MF|````````````| +# |``````````````````````````````| +# *------------------------------* + + +# this file contains methods for every operation/attribute/property that is +# specific to twisted bipartition semigroups. + +InstallTrueMethod(CanUseGapFroidurePin, IsTwistedBipartitionSemigroup); + +############################################################################# +## Printing and viewing +############################################################################# + +InstallMethod(SemigroupViewStringPrefix, "for a twisted bipartition semigroup", +[IsTwistedBipartitionSemigroup], S -> Concatenation("\>", ViewString(MaxFloatingBlocksOfTwistedBipartitionSemigroup(S)), "-twisted bipartition\< ")); + +InstallMethod(SemigroupViewStringPrefix, "for a twisted bipartition *-semigroup", +[IsTwistedBipartitionSemigroup and IsStarSemigroup], S -> Concatenation("\>", ViewString(MaxFloatingBlocksOfTwistedBipartitionSemigroup(S)), "-twisted bipartition *-\< ")); + +InstallMethod(SemigroupViewStringSuffix, "for a twisted bipartition semigroup", +[IsTwistedBipartitionSemigroup], +function(S) + return Concatenation("\>degree \>", + ViewString(DegreeOfTwistedBipartitionSemigroup(S)), + "\<\< "); +end); + +InstallMethod(DegreeOfTwistedBipartitionSemigroup, "for a twisted bipartition semigroup", +[IsTwistedBipartitionSemigroup], S -> DegreeOfBipartition(Representative(S))); +InstallMethod(MaxFloatingBlocksOfTwistedBipartitionSemigroup, "for a twisted bipartition semigroup", +[IsTwistedBipartitionSemigroup], S -> MaxFloatingBlocks(Representative(S))); \ No newline at end of file diff --git a/init.g b/init.g index 1c01899ef..2356bd167 100644 --- a/init.g +++ b/init.g @@ -57,6 +57,7 @@ ReadPackage("semigroups", "gap/elements/star.gd"); ReadPackage("semigroups", "gap/elements/bipart.gd"); ReadPackage("semigroups", "gap/elements/blocks.gd"); +ReadPackage("semigroups", "gap/elements/twisted-bipart.gd"); ReadPackage("semigroups", "gap/elements/boolmat.gd"); ReadPackage("semigroups", "gap/elements/elements.gd"); ReadPackage("semigroups", "gap/elements/ffmat.gd"); @@ -95,6 +96,7 @@ ReadPackage("semigroups", "gap/semigroups/semiquo.gd"); ReadPackage("semigroups", "gap/semigroups/semiringmat.gd"); ReadPackage("semigroups", "gap/semigroups/semirms.gd"); ReadPackage("semigroups", "gap/semigroups/semitrans.gd"); +ReadPackage("semigroups", "gap/semigroups/semitwistedbipart.gd"); ReadPackage("semigroups", "gap/semigroups/grpperm.gd"); diff --git a/read.g b/read.g index d189d3f46..ea6072b3d 100644 --- a/read.g +++ b/read.g @@ -17,6 +17,7 @@ ReadPackage("semigroups", "gap/elements/star.gi"); ReadPackage("semigroups", "gap/elements/pbr.gi"); ReadPackage("semigroups", "gap/elements/bipart.gi"); ReadPackage("semigroups", "gap/elements/blocks.gi"); +ReadPackage("semigroups", "gap/elements/twisted-bipart.gi"); ReadPackage("semigroups", "gap/elements/semiringmat.gi"); ReadPackage("semigroups", "gap/elements/maxplusmat.gi"); ReadPackage("semigroups", "gap/elements/boolmat.gi"); @@ -57,6 +58,7 @@ ReadPackage("semigroups", "gap/semigroups/semiffmat.gi"); ReadPackage("semigroups", "gap/semigroups/semiquo.gi"); ReadPackage("semigroups", "gap/semigroups/semieunit.gi"); ReadPackage("semigroups", "gap/semigroups/semidp.gi"); +ReadPackage("semigroups", "gap/semigroups/semitwistedbipart.gi"); ReadPackage("semigroups", "gap/ideals/ideals.gi"); ReadPackage("semigroups", "gap/ideals/acting.gi");