From 679f7245ce9e2939175fa12efcf4d83d4950e094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Meike=20Wei=C3=9F?= Date: Mon, 2 Oct 2023 15:15:07 +0200 Subject: [PATCH 1/2] Adaptation of SubcomplexByFaces to edge-coloured complexes --- gap/PolygonalComplexes/modification.gd | 11 ++++++++++ gap/PolygonalComplexes/modification.gi | 28 ++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/gap/PolygonalComplexes/modification.gd b/gap/PolygonalComplexes/modification.gd index 8e68605a..48f8c05f 100755 --- a/gap/PolygonalComplexes/modification.gd +++ b/gap/PolygonalComplexes/modification.gd @@ -576,6 +576,17 @@ DeclareOperation( "SplitEdgePathNC", [IsPolygonalComplex, IsVertexEdgePath and I #! The NC-version does not check whether the given set of faces #! actually consists only of faces in complex. It also does not #! check whether the result of SubsurfaceByFaces is a surface. +#! +#! In Chapter edge colouring will be introduced. +#! If we compute a subcomplex of an edge-coloured complex, it will be edge-coloured again, +#! induced by the edge-colouring of the given complex. +#! @BeginExampleSession +#! gap> colEdges:=[ 1, 2, 1, 2, 1, 2, 3, 3, 3, 3, 3, 3 ];; +#! gap> colSurface:=EdgeColouredPolygonalComplex(hex,colEdges); +#! tame coloured surface (MMB with 7 vertices, 12 edges and 6 faces) +#! gap> SubsurfaceByFaces(colSurface,[1,2]); +#! tame coloured surface (BMB with 4 vertices, 5 edges and 2 faces) +#! @EndExampleSession #! #! @Returns a twisted polygonal complex #! @Arguments complex, faces diff --git a/gap/PolygonalComplexes/modification.gi b/gap/PolygonalComplexes/modification.gi index ef540ba2..132b5f1e 100755 --- a/gap/PolygonalComplexes/modification.gi +++ b/gap/PolygonalComplexes/modification.gi @@ -498,7 +498,8 @@ InstallOtherMethod( SubcomplexByFaces, InstallMethod( SubcomplexByFacesNC, "for a polygonal complex and a set of faces", [IsPolygonalComplex, IsSet], function(complex, subfaces) - local subVertices, subEdges, newVerticesOfEdges, newEdgesOfFaces, e, f; + local subVertices, subEdges, newVerticesOfEdges, newEdgesOfFaces, e, f, + subcomplex, colEdges, colEdgesSub, edge; subEdges := __SIMPLICIAL_UnionSets( EdgesOfFaces(complex){subfaces} ); @@ -514,8 +515,18 @@ InstallMethod( SubcomplexByFacesNC, "for a polygonal complex and a set of faces" newEdgesOfFaces[f] := EdgesOfFaces(complex)[f]; od; - return PolygonalComplexByDownwardIncidenceNC( subVertices, subEdges, + subcomplex:=PolygonalComplexByDownwardIncidenceNC( subVertices, subEdges, subfaces, newVerticesOfEdges, newEdgesOfFaces ); + if IsEdgeColouredPolygonalComplex(complex) then + colEdges:=ColoursOfEdges(complex); + colEdgesSub:=[]; + for edge in Edges(subcomplex) do + colEdgesSub[edge]:=colEdges[edge]; + od; + subcomplex:=EdgeColouredPolygonalComplexNC(subcomplex,colEdgesSub); + fi; + + return subcomplex; end ); InstallMethod( SubcomplexByFacesNC, @@ -523,7 +534,7 @@ InstallMethod( SubcomplexByFacesNC, [IsTwistedPolygonalComplex, IsSet], function(complex, subfaces) local remChambers, vofC, eofC, fofC, c, zeroClass, oneClass, - twoClass, cl; + twoClass, cl, subcomplex, colEdges, colEdgesSub, edge; remChambers := Union( ChambersOfFaces(complex){subfaces} ); vofC := []; @@ -541,7 +552,16 @@ InstallMethod( SubcomplexByFacesNC, twoClass := Set(twoClass); twoClass := Difference(twoClass, [[]]); - return TwistedPolygonalComplexByChamberRelationsNC( vofC, eofC, fofC, zeroClass, oneClass, twoClass ); + subcomplex:=TwistedPolygonalComplexByChamberRelationsNC( vofC, eofC, fofC, zeroClass, oneClass, twoClass ); + if IsEdgeColouredTwistedPolygonalComplex(complex) then + colEdges:=ColoursOfEdges(complex); + colEdgesSub:=[]; + for edge in Edges(subcomplex) do + colEdgesSub[edge]:=colEdges[edge]; + od; + subcomplex:=EdgeColouredTwistedPolygonalComplexNC(subcomplex,colEdgesSub); + fi; + return subcomplex; end ); InstallOtherMethod( SubcomplexByFacesNC, From 90f847b55599f62ef0c14ca3c99c6be821e8d742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Meike=20Wei=C3=9F?= Date: Wed, 11 Sep 2024 13:03:26 +0200 Subject: [PATCH 2/2] changed doc --- gap/PolygonalComplexes/modification.gd | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gap/PolygonalComplexes/modification.gd b/gap/PolygonalComplexes/modification.gd index 48f8c05f..8c26ba03 100755 --- a/gap/PolygonalComplexes/modification.gd +++ b/gap/PolygonalComplexes/modification.gd @@ -577,13 +577,18 @@ DeclareOperation( "SplitEdgePathNC", [IsPolygonalComplex, IsVertexEdgePath and I #! actually consists only of faces in complex. It also does not #! check whether the result of SubsurfaceByFaces is a surface. #! -#! In Chapter edge colouring will be introduced. -#! If we compute a subcomplex of an edge-coloured complex, it will be edge-coloured again, -#! induced by the edge-colouring of the given complex. +#! In Chapter the edge colouring of twisted +#! polygonal complexes will be introduced. +#! +#! The hexagon from above can be coloured as follows: #! @BeginExampleSession #! gap> colEdges:=[ 1, 2, 1, 2, 1, 2, 3, 3, 3, 3, 3, 3 ];; #! gap> colSurface:=EdgeColouredPolygonalComplex(hex,colEdges); #! tame coloured surface (MMB with 7 vertices, 12 edges and 6 faces) +#! @EndExampleSession +#! If we compute a subcomplex of an edge-coloured complex, it will be edge-coloured again, +#! induced by the edge-colouring of the given complex: +#! @BeginExampleSession #! gap> SubsurfaceByFaces(colSurface,[1,2]); #! tame coloured surface (BMB with 4 vertices, 5 edges and 2 faces) #! @EndExampleSession