Skip to content

Commit

Permalink
Merge pull request #257 from MeikeWeiss/meike/subcomplex
Browse files Browse the repository at this point in the history
Adaptation of SubcomplexByFaces to edge-coloured complexes
  • Loading branch information
ReymondAkpanya authored Sep 12, 2024
2 parents 3a9b04a + 90f847b commit edcd68f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
16 changes: 16 additions & 0 deletions gap/PolygonalComplexes/modification.gd
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,22 @@ DeclareOperation( "SplitEdgePathNC", [IsPolygonalComplex, IsVertexEdgePath and I
#! The NC-version does not check whether the given set of <A>faces</A>
#! actually consists only of faces in <A>complex</A>. It also does not
#! check whether the result of <K>SubsurfaceByFaces</K> is a surface.
#!
#! In Chapter <Ref Chap="Chapter_EdgeColouring"/> 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
#!
#! @Returns a twisted polygonal complex
#! @Arguments complex, faces
Expand Down
28 changes: 24 additions & 4 deletions gap/PolygonalComplexes/modification.gi
Original file line number Diff line number Diff line change
Expand Up @@ -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} );
Expand All @@ -514,16 +515,26 @@ 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,
"for a twisted polygonal complex and a set of faces",
[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 := [];
Expand All @@ -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,
Expand Down

0 comments on commit edcd68f

Please sign in to comment.