SCSimplicialComplex and SCPropertyObject
SCSimplicialComplex
SCSimplicialComplex as a subtype of Set
The simpcomp package defines two new GAP object types SCSimplicialComplex and SCNormalSurface, which are used to store simplicial complexes and discrete normal surfaces as well as their properties. As a property should not be calculated multiple times in case the object was not altered, simpcomp caches all calculated properties (the ``known properties'') of a simplicial complex or a discrete normal surface within the corresponding object such that each property is only calculated once (see SCPropertiesDropped (3.1-4) for a way of dropping previously calculated properties).
Internally, this behaviour is accomplished by making SCSimplicialComplex and SCNormalSurface both subtypes of SCPropertyObject, a GAP object type defined by simpcomp that provides the means to store (i.e. cache) certain properties of objects and also provides means of (de)serializing these objects to and from a XML format (see Section 10).
SCSimplicialComplex and SCPropertyObjectThe object type SCPropertyObject provides a GAP object consisting of permanent and temporary attributes. While the permanent attributes are serialized to and from XML (and thus are persistent), this is not the case for temporary attributes. The permanent and temporary properties of a SCPropertyObject can be accessed directly with the functions SCPropertyByName, SCPropertyTmpByName and changed with SCPropertySet, SCPropertyTmpSet. But this direct access to property objects is discouraged when working with simpcomp, as the internal consistency of the objects cannot be guaranteed when the properties of the objects are accessed (and modified) in this way. Instead, the access to the object properties via so called property handlers is strongly recommended (and actually the SCProperty...-functions are only meant for internal use). For each property that an object of type SCPropertyObject can have, a function referred to as property handler ensures the integrity of the property and handles caching of this property. See Section 3.2 below for a description of how to access properties of a SCSimplicialComplex object. Note that all properties returned by such property handlers are immutable objects. You can use ShallowCopy to obtain mutable copies. For a list of properties that SCSimplicialComplex handles, see Chapter 4. For a few fundamental methods and functions (such as checking the object class, copying objects of this type, etc.) for SCSimplcicialComplex see below.
> SCIsSimplicialComplex( object ) | ( filter ) |
Returns: true or false upon success, fail otherwise.
Checks if object is of type SCSimplicialComplex. The object type SCSimplicialComplex is derived from the object type SCPropertyObject.
gap> c:=SCEmpty();; gap> SCIsSimplicialComplex(c); true |
> SCCopy( complex ) | ( operation ) |
Returns: a copy of complex upon success, fail otherwise.
Makes a ``deep copy'' of complex -- this is a copy such that all properties of the copy can be altered without changing the original complex.
gap> c:=SCBdSimplex(4);; gap> d:=SCCopy(c)-1;; gap> c.Facets=d.Facets; false |
gap> c:=SCBdSimplex(4);; gap> d:=SCCopy(c);; gap> IsIdenticalObj(c,d); false |
> ShallowCopy (SCSimplicialComplex)( complex ) | ( operation ) |
Returns: a copy of complex upon success, fail otherwise.
Makes a copy of complex. This is actually a ``deep copy'' such that all properties of the copy can be altered without changing the original complex. Internally calls SCCopy (3.1-2).
gap> c:=SCLib.Load(87);; gap> d:=ShallowCopy(c)+10;; gap> c.Facets=d.Facets; false |
> SCPropertiesDropped( complex ) | ( function ) |
Returns: a object of type SCSimplicialComplex upon success, fail otherwise.
An object of the type SCSimplicialComplex caches its previously calculated properties such that each property only has to be calculated once. This function returns a copy of complex with all properties (apart from Facets, Dim and Name) dropped, clearing all previously computed properties. See also SCPropertyDrop (14.1-8) and SCPropertyTmpDrop (14.1-13).
gap> c:=SCFromFacets(Combinations([1..16],15));; gap> c.F;; time; 2000 gap> c.F;; time; 0 gap> c:=SCPropertiesDropped(c); true gap> c.F;; time; 2036 |
SCSimplicialComplex objectAs described in Section 3.1 the object type SCSimplicialComplex has properties that are handled by so called property handlers. These handlers take care of the internal consistency of objects of type SCSimplicialComplex and (re)compute object attributes if necessary.
There are two ways of accessing properties of a SCSimplicialComplex object. The first is to call a property handler function of the property one wishes to calculate. The first argument of such a property handler function is always the simplicial complex for which the property should be calculated, in some cases followed by further arguments of the property handler function. An example would be:
gap> c:=SCBdSimplex(3);; # create a simplicial complex object gap> SCFVector(c); [ 4, 6, 4 ] gap> SCSkel(c,0); [ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ] |
Here the functions SCFVector and SCSkel are the property handler functions, see Chapter 12 for a list of all property handlers of a SCSimplicialComplex object. Apart from this (standard) method of calling the property handlers directly with a SCSimplicialComplex object, simpcomp provides the user with another more object oriented method which calls property handlers of a SCSimplicialComplex object indirectly and more conveniently:
gap> c:=SCBdSimplex(3);; # create a simplicial complex object gap> c.F; [ 4, 6, 4 ] gap> c.Skel(0); [ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ] |
Note that the code in this example calculates the same properties as in the first example above, but the properties of a SCSimplicialComplex object are accessed via the . operator (the record access operator).
For each property handler of a SCSimplicialComplex object the short object oriented form of this property handler is given in the description of the property handler function. In most cases it is just formed by dropping the prefix ``SC'' of the property handler functions.
SCSimplicialComplexsimpcomp overloads some standard operations for the object type SCSimplcicialComplex if this definition is intuitive and mathematically sound. See a list of overloaded operators below.
> Operation + (SCSimplicialComplex, Integer)( complex, value ) | ( operation ) |
Returns: the simplicial complex passed as argument upon success, fail otherwise.
Positively shifts the vertex labels of complex (provided that all labels satisfy the property IsAdditiveElement) by the amount specified in value.
gap> c:=SCBdSimplex(3)+10;; gap> c.Facets; [[11, 12, 13], [11, 12, 14], [11, 13, 14], [12, 13, 14]] |
> Operation - (SCSimplicialComplex, Integer)( complex, value ) | ( operation ) |
Returns: the simplicial complex passed as argument upon success, fail otherwise.
Negatively shifts the vertex labels of complex (provided that all labels satisfy the property IsAdditiveElement) by the amount specified in value.
gap> c:=SCBdSimplex(3)-1;; gap> c.Facets; [[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]] |
> Operation mod (SCSimplicialComplex, Integer)( complex, value ) | ( operation ) |
Returns: the simplicial complex passed as argument upon success, fail otherwise.
Takes all vertex labels of complex modulo the value specified in value (provided that all labels satisfy the property IsAdditiveElement). Warning: this might result in different vertices being assigned the same label or even in invalid facet lists, so be careful.
gap> c:=(SCBdSimplex(3)*10) mod 7;; gap> c.Facets; [[3, 6, 2], [3, 6, 5], [3, 2, 5], [6, 2, 5]] |
> Operation ^ (SCSimplicialComplex, Integer)( complex, value ) | ( operation ) |
Returns: simplicial complex of type SCSimplicialComplex upon success, fail otherwise.
Forms the value-th simplicial cartesian power of complex, i.e. the value-fold cartesian product of copies of complex. The complex passed as argument is not altered. Internally calls SCCartesianPower (4.4-1).
gap> c:=SCBdSimplex(2)^2; #a torus [SimplicialComplex Properties known: Dim, Facets, Name, TopologicalType, VertexLabels. Name="(S^1_3)^2" Dim=2 TopologicalType="(S^1)^2" /SimplicialComplex] |
> Operation + (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 ) | ( operation ) |
Returns: simplicial complex of type SCSimplicialComplex upon success, fail otherwise.
Forms the connected sum of complex1 and complex2. Uses the lexicographically first facets of both complexes to do the gluing. The complexes passed as arguments are not altered. Internally calls SCConnectedSum (4.4-5).
gap> SCLib.SearchByName("RP^3");
[ [ 45, "RP^3" ], [ 103, "RP^3=L(2,1) (VT)" ], [ 246, "(S^2~S^1)#RP^3" ],
[ 247, "(S^2xS^1)#RP^3" ], [ 283, "(S^2~S^1)#2#RP^3" ],
[ 285, "(S^2xS^1)#2#RP^3" ], [ 409, "RP^3#RP^3" ], ...
gap> SCLib.SearchByName("S^2~S^1");
[ [ 14, "S^2~S^1 (VT)" ], [ 29, "S^2~S^1 (VT)" ], [ 34, "S^2~S^1 (VT)" ],
[ 42, "S^2~S^1 (VT)" ], [ 48, "S^2~S^1 (VT)" ], [ 49, "S^2~S^1 (VT)" ],
[ 84, "S^2~S^1 (VT)" ], [ 87, "S^2~S^1 (VT)" ], ...
gap> c:=SCLib.Load(45)+SCLib.Load(14); #form RP^3#(S^2~S^1)
[SimplicialComplex
Properties known: Dim, Facets, Name, VertexLabels, Vertices.
Name="RP^3#+-S^2~S^1 (VT)"
Dim=3
/SimplicialComplex]
|
> Operation - (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 ) | ( operation ) |
Returns: simplicial complex of type SCSimplicialComplex upon success, fail otherwise.
Calls SCDifference (4.8-7)(complex1, complex2)
> Operation * (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 ) | ( operation ) |
Returns: simplicial complex of type SCSimplicialComplex upon success, fail otherwise.
Forms the simplicial cartesian product of complex1 and complex2. Internally calls SCCartesianProduct (4.4-2).
gap> SCLib.SearchByName("RP^2");
[ [ 3, "RP^2 (VT)" ], [ 284, "RP^2xS^1" ] ]
gap> c:=SCLib.Load(3)*SCBdSimplex(3); #form RP^2 x S^2
[SimplicialComplex
Properties known: Dim, Facets, Name, VertexLabels.
Name="RP^2 (VT)xS^2_4"
Dim=4
/SimplicialComplex]
|
> Operation = (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 ) | ( operation ) |
Returns: true or false upon success, fail otherwise.
Calculates whether two simplicial complexes are isomorphic, i.e. are equal up to a relabeling of the vertices.
gap> c:=SCBdSimplex(3);; gap> c=c+10; true gap> c=SCBdCrossPolytope(4); false |
SCSimplicialComplex as a subtype of SetApart from being a subtype of SCPropertyObject, an object of type SCSimplicialComplex also behaves like a GAP Set type. The elements of the set are given by the facets of the simplical complex, grouped by their dimensionality, i.e. if complex is an object of type SCSimplicialComplex, c[1] refers to the 0-faces of complex, c[2] to the 1-faces, etc.
> Operation Union (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 ) | ( operation ) |
Returns: simplicial complex of type SCSimplicialComplex upon success, fail otherwise.
Computes the union of two simplicial complexes by calling SCUnion (4.8-27).
gap> c:=Union(SCBdSimplex(3),SCBdSimplex(3)+3); #a wedge of two 2-spheres [SimplicialComplex Properties known: Dim, Facets, Name, VertexLabels. Name="S^2_4 cup S^2_4" Dim=2 /SimplicialComplex] |
> Operation Difference (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 ) | ( operation ) |
Returns: simplicial complex of type SCSimplicialComplex upon success, fail otherwise.
Computes the ``difference'' of two simplicial complexes by calling SCDifference (4.8-7).
gap> c:=SCBdSimplex(3);; gap> d:=SC([[1,2,3]]);; gap> disc:=Difference(c,d);; gap> disc.Facets; [ [ 1, 2, 4 ], [ 1, 3, 4 ], [ 2, 3, 4 ] ] gap> empty:=Difference(d,c);; gap> empty.Dim; -1 gap> |
> Operation Intersection (SCSimplicialComplex, SCSimplicialComplex)( complex1, complex2 ) | ( operation ) |
Returns: simplicial complex of type SCSimplicialComplex upon success, fail otherwise.
Computes the ``intersection'' of two simplicial complexes by calling SCIntersection (4.8-10).
gap> c:=SCBdSimplex(3);; gap> d:=SCBdSimplex(3);; gap> d:=SCMove(d,[[1,2,3],[]]);; gap> d:=d+1;; gap> s1:=SCIntersection(c,d); [SimplicialComplex Properties known: Dim, Facets, Name, VertexLabels. Name="S^2_4 cap unnamed complex m" Dim=1 /SimplicialComplex] gap> s1.Facets; [ [ 2, 3 ], [ 2, 4 ], [ 3, 4 ] ] gap> |
> Size (SCSimplicialComplex)( complex ) | ( operation ) |
Returns: an integer upon success, fail otherwise.
Returns the ``size'' of a simplicial complex. This is d+1, where d is the dimension of the complex. d+1 is returned instead of d, as all lists in GAP are indexed beginning with 1 -- thus this also holds for all the face lattice related properties of the complex.
gap> SCLib.SearchByAttribute("F=·[12,66,108,54]");
[ [ 116, "S^2xS^1 (VT)" ], [ 117, "S^2xS^1 (VT)" ],
[ 118, "(S^2xS^1)#(S^2xS^1) (VT)" ], [ 119, "S^2~S^1 (VT)" ],
[ 120, "(S^2xS^1)#(S^2xS^1) (VT)" ], [ 121, "(S^2xS^1)#(S^2xS^1) (VT)" ],
[ 122, "S^2xS^1 (VT)" ], [ 123, "(S^2xS^1)#(S^2xS^1) (VT)" ], ...
gap> c:=SCLib.Load(116);;
gap> for i in [1..Size(c)] do Print(c.F[i],"\n"); od;
12
66
108
54
|
> Length (SCSimplicialComplex)( complex ) | ( operation ) |
Returns: an integer upon success, fail otherwise.
Returns the ``size'' of a simplicial complex by calling Size(complex).
gap> SCLib.SearchByAttribute("F=¸[12,66,108,54]");
[ [ 116, "Sˆ2xSˆ1 (VT)" ], [ 117, "Sˆ2xSˆ1 (VT)" ],
[ 118, "(Sˆ2xSˆ1)#(Sˆ2xSˆ1) (VT)" ], [ 119, "Sˆ2˜Sˆ1 (VT)" ],
[ 120, "(Sˆ2xSˆ1)#(Sˆ2xSˆ1) (VT)" ], [ 121, "(Sˆ2xSˆ1)#(Sˆ2xSˆ1) (VT)" ],
[ 122, "Sˆ2xSˆ1 (VT)" ], [ 123, "(Sˆ2xSˆ1)#(Sˆ2xSˆ1) (VT)" ], ...
gap> c:=SCLib.Load(116);;
gap> for i in [1..Length(c)] do Print(c.F[i],"\n"); od;
12
66
108
54
|
> Operation [] (SCSimplicialComplex)( complex, pos ) | ( operation ) |
Returns: a list of faces upon success, fail otherwise.
Returns the (pos-1)-dimensional faces of complex as a list. If pos >= d+2, where d is the dimension of complex, the empty set is returned. Note that pos must be >= 1.
gap> SCLib.SearchByName("K^2");
[ [ 19, "K^2 (VT)" ], [ 230, "K^2 (VT)" ] ]
gap> c:=SCLib.Load(230);;
gap> c[2];
[ [ 1, 2 ], [ 1, 3 ], [ 1, 7 ], [ 1, 9 ], [ 1, 13 ], [ 1, 14 ], [ 2, 3 ],
[ 2, 4 ], [ 2, 8 ], [ 2, 10 ], [ 2, 14 ], [ 3, 4 ], [ 3, 5 ], [ 3, 9 ],
[ 3, 11 ], [ 4, 5 ], [ 4, 6 ], [ 4, 10 ], [ 4, 12 ], [ 5, 6 ], [ 5, 7 ],
[ 5, 11 ], [ 5, 13 ], [ 6, 7 ], [ 6, 8 ], [ 6, 12 ], [ 6, 14 ], [ 7, 8 ],
[ 7, 9 ], [ 7, 13 ], [ 8, 9 ], [ 8, 10 ], [ 8, 14 ], [ 9, 10 ], [ 9, 11 ],
[ 10, 11 ], [ 10, 12 ], [ 11, 12 ], [ 11, 13 ], [ 12, 13 ], [ 12, 14 ],
[ 13, 14 ] ]
gap> c[4];
[ ]
gap>
|
> IsBound (SCSimplicialComplex)( complex, pos ) | ( operation ) |
Returns: true or false upon success, fail otherwise.
Returns true when complex has proper faces of dimension (pos-1) (pos>= 1), false otherwise.
gap> c:=SCBdCrossPolytope(4);; gap> IsBound(c[4]); true gap> IsBound(c[5]); false |
> Iterator (SCSimplicialComplex)( complex ) | ( operation ) |
Returns: an iterator on the face lattice of complex upon success, fail otherwise.
Provides an iterator object for the face lattice of a simplicial complex.
gap> c:=SCBdCrossPolytope(4);; gap> for faces in c do Print(Length(faces),"\n"); od; 8 24 32 16 |
SCNormalSurface as a subtype of SCPropertyObjectThe simpcomp package defines a GAP object type SCNormalSurface to describe slicings (level sets of discrete Morse functions) of combinatorial 3-manifolds, i. e. discrete normal surfaces. Internally SCNormalSurface is a subtype of SCPropertyObject and, thus, mostly behaves like a SCSimplicialComplex object (see Section 3.1). For a very short introduction to normal surfaces see 2.4, for a more thorough introduction to the field see [Spr10b]. For some fundamental methods and functions for SCNormalSurface see below. For more functions related to the SCNormalSurface object type see Chapter 9.
SCNormalSurfaceAs with the object type SCSimplcicialComplex, simpcomp overloads some standard operations for the object type SCNormalSurface. See a list of overloaded operators below.
> Operation + (SCNormalSurface, Integer)( complex, value ) | ( operation ) |
Returns: the discrete normal surface passed as argument upon success, fail otherwise.
Positively shifts the vertex labels of complex (provided that all labels satisfy the property IsAdditiveElement) by the amount specified in value.
gap> sl:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);; gap> sl.Facets; [ [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ] ], [ [ 1, 2 ], [ 1, 3 ], [ 1, 5 ] ], [ [ 1, 2 ], [ 1, 4 ], [ 1, 5 ] ], [ [ 1, 3 ], [ 1, 4 ], [ 1, 5 ] ] ] gap> sl:=sl + 2;; gap> sl.Facets; [ [ [ 3, 4 ], [ 3, 5 ], [ 3, 6 ] ], [ [ 3, 4 ], [ 3, 5 ], [ 3, 7 ] ], [ [ 3, 4 ], [ 3, 6 ], [ 3, 7 ] ], [ [ 3, 5 ], [ 3, 6 ], [ 3, 7 ] ] ] gap> |
> Operation - (SCNormalSurface, Integer)( complex, value ) | ( operation ) |
Returns: the discrete normal surface passed as argument upon success, fail otherwise.
Negatively shifts the vertex labels of complex (provided that all labels satisfy the property IsAdditiveElement) by the amount specified in value.
gap> sl:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);; gap> sl.Facets; [ [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ] ], [ [ 1, 2 ], [ 1, 3 ], [ 1, 5 ] ], [ [ 1, 2 ], [ 1, 4 ], [ 1, 5 ] ], [ [ 1, 3 ], [ 1, 4 ], [ 1, 5 ] ] ] gap> sl:=sl - 2;; gap> sl.Facets; [ [ [ -1, 0 ], [ -1, 1 ], [ -1, 2 ] ], [ [ -1, 0 ], [ -1, 1 ], [ -1, 3 ] ], [ [ -1, 0 ], [ -1, 2 ], [ -1, 3 ] ], [ [ -1, 1 ], [ -1, 2 ], [ -1, 3 ] ] ] gap> |
> Operation mod (SCNormalSurface, Integer)( complex, value ) | ( operation ) |
Returns: the discrete normal surface passed as argument upon success, fail otherwise.
Takes all vertex labels of complex modulo the value specified in value (provided that all labels satisfy the property IsAdditiveElement). Warning: this might result in different vertices being assigned the same label or even invalid facet lists, so be careful.
gap> sl:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);; gap> sl.Facets; [ [ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ] ], [ [ 1, 2 ], [ 1, 3 ], [ 1, 5 ] ], [ [ 1, 2 ], [ 1, 4 ], [ 1, 5 ] ], [ [ 1, 3 ], [ 1, 4 ], [ 1, 5 ] ] ] gap> sl:=sl mod 2;; gap> sl.Facets; [ [ [ 1, 0 ], [ 1, 1 ], [ 1, 0 ] ], [ [ 1, 0 ], [ 1, 1 ], [ 1, 1 ] ], [ [ 1, 0 ], [ 1, 0 ], [ 1, 1 ] ], [ [ 1, 1 ], [ 1, 0 ], [ 1, 1 ] ] ] gap> |
SCNormalSurface as a subtype of SetLike objects of type SCSimplicialComplex, an object of type SCNormalSurface behaves like a GAP Set type. The elements of the set are given by the facets of the normal surface, grouped by their dimensionality and type, i.e. if complex is an object of type SCNormalSurface, c[1] refers to the 0-faces of complex, c[2] to the 1-faces, c[3] to the triangles and c[4] to the quadrilaterals. See below for some examples and Section 3.4 for details.
> Operation Union (SCNormalSurface, SCNormalSurface)( complex1, complex2 ) | ( operation ) |
Returns: discrete normal surface of type SCNormalSurface upon success, fail otherwise.
Computes the union of two discrete normal surfaces by calling SCUnion (4.8-27).
gap> SCLib.SearchByAttribute("F=[6,15,18,9]");
[ [ 4, "S^3 (VT)" ] ]
gap> c:=SCLib.Load(4);;
gap> sl1:=SCNSSlicing(c,[[1,3,5],[2,4,6]]);;
gap> sl2:=SCNSSlicing(c,[[1,3,5],[2,4,6]])+10;;
gap> SCNSTopologicalType(sl1);
"T^2"
gap> SCNSTopologicalType(sl2);
"T^2"
gap> sl3:=Union(sl1,sl2);;
gap> SCNSTopologicalType(sl3);
"T^2 U T^2"
gap>
|
generated by GAPDoc2HTML