The simpcomp package defines a new GAP object type SCSimplicialComplex
, which is used to store simplicial complexes and their properties. As a property should not be calculated multiple times if the complex was not altered, simpcomp caches all calculated properties (the ``known properties'') of a simplicial complex within the SCSimplicialComplex
object such that each property is only calculated once (see SCForceRecalc
(3.1-4) for a way of switching off this behaviour). Internally, this behaviour is accomplished by making SCSimplicialComplex
a subtype 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 8.).
SCSimplicialComplex
and SCPropertyObject
The 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
, if object is of type SCSimplicialComplex
, false
otherwise.
Filter for the category of a simplicial complex SCSimplicialComplex
. The category SCSimplicialComplex
is derived from the category 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 |
> SCForceRecalc ( complex, flag ) | ( function ) |
Returns: true upon success, fail
otherwise.
An object of the type SCSimplicialComplex
normally caches its previously calculated properties such that each property only has to be calculated once. With this function this behaviour can be changed, if flag equals true
, caching is turned off, for flag equals false
, caching is turned on.
gap> c:=SCFromFacets(Combinations([1..16],15));; gap> c.F;; time; 2000 gap> c.F;; time; 0 gap> SCForceRecalc(c,true); 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 necessary 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 directly. The first argument of such a property handler function is always the simplicial complex for which the property should be calculated, optionally 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 10. 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 of calling property handlers of a SCSimplicialComplex
object inderectly 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). As GAP lacks object orientation, this behaviour is internally accomplished via a helper function (that calls the property handlers), such that accessing properties in this (indirect) way is a tiny bit slower than with the direct method described above. But this tiny drawback in speed is traded for a great deal of less and easier things that have to be typed (also note that c.F
is accessed like a list, although internally the property handler function is called). If one is interested in utmost efficiency one must either use the direct calling method of property handlers or use a software package that is optimized for performance, such as polymake [GJ00]. 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.
SCSimplicialComplex
simpcomp 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 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 unpon success, fail
otherwise.
Negatively shifts the vertex labels of complex 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 unpon success, fail
otherwise.
Takes all vertex labels of complex modulo the value specified in value. Warning: this might result in different vertices being assigned the same label, 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: a new simplicial complex upon success, fail
otherwise.
Forms the value-th cartesian power of complex, i.e. the value-fold cartesian product of copies of complex. The complex passed as argument is not altered.
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: a new simplicial complex upon success, fail
otherwise.
Forms the connected sum of complex1 and complex2. Currently uses the lexicographically first facets of both complex to do the gluing. The complexes passed as arguments are not altered.
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: a new simplicial complex upon success, fail
otherwise.
Calls SCDifference
(4.6-5)(complex1, complex2)
> Operation * (SCSimplicialComplex, SCSimplicialComplex) ( complex1, complex2 ) | ( operation ) |
Returns: a new simplicial complex upon success, fail
otherwise.
Forms the cartesian product of complex1 and complex2.
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 equal, i.e. have equal facet sets in standard labeling. Returns true
if the facet sets in standard labeling are equal as sets, false
otherwise. Note: this check only compares the facet lists in standard labeling.
gap> c:=SCBdSimplex(3);; gap> c=c+10; true gap> c=SCBdCrossPolytope(4); false |
> Operation Union (SCSimplicialComplex, SCSimplicialComplex) ( complex1, complex2 ) | ( operation ) |
Returns: a new simplicial complex upon success, fail
otherwise.
Computes the union of two simplicial complexes by calling SCUnion
(4.6-24).
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: a new simplicial complex upon success, fail
otherwise.
Computes the ``difference'' of two simplicial complexes by calling SCDifference
(4.6-5).
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: a new simplicial complex upon success, fail
otherwise.
Computes the ``intersection'' of two simplicial complexes by calling SCIntersection
(4.6-7).
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 n" Dim=1 /SimplicialComplex] gap> s1.Facets; [ [ 2, 3 ], [ 2, 4 ], [ 3, 4 ] ] gap> |
SCSimplicialComplex
as a subtype of Set
Apart 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.
> 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 list. If pos <= 0 or pos >= d+2, where d is the dimension of complex, the empty set is returned.
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), 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 asubtyope of SCPropertyObject
The simpcomp package defines a GAP object type SCNormalSurface
to describe normal surfaces / slicings (level sets of discrete Morse functions) in combinatorial 3-manifolds. 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 some fundamental methods and functions for SCNormalSurface
see below.
SCNormalSurface
As 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 normal surface passed as argument upon success, fail
otherwise.
Positively shifts the vertex labels of complex by the amount specified in value.
gap> ns:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);; gap> ns.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> ns:=ns + 2;; gap> ns.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 normal surface passed as argument unpon success, fail
otherwise.
Negatively shifts the vertex labels of complex by the amount specified in value.
gap> ns:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);; gap> ns.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> ns:=ns - 2;; gap> ns.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 normal surface passed as argument unpon success, fail
otherwise.
Takes all vertex labels of complex modulo the value specified in value. Warning: this might result in different vertices being assigned the same label, so be careful.
gap> ns:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);; gap> ns.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> ns:=ns mod 2;; gap> ns.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> |
> Operation = (SCNormalSurface, SCNormalSurface) ( complex1, complex2 ) | ( operation ) |
Returns: true
or false
upon success, fail
otherwise.
Calculates whether two normal surface are equal, i.e. have equal facet sets in standard labeling. Returns true
if the facet sets in standard labeling are equal as sets, false
otherwise. Note: this check only compares the facet lists in standard labeling.
gap> ns:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);; gap> ns1:=SCNSSlicing(SCBdSimplex(4),[[1],[2..5]]);; gap> ns2:=SCNSSlicing(SCBdSimplex(4),[[2],[1,3,4,5]]);; gap> ns1=ns2; true gap> ns2:=SCNSSlicing(SCBdSimplex(4),[[1,2],[3,4,5]]);; gap> ns1=ns2; false gap> |
> Operation Union (SCNormalSurface, SCNormalSurface) ( complex1, complex2 ) | ( operation ) |
Returns: a new normnal surface upon success, fail
otherwise.
Computes the union of two normal surfaces by calling SCUnion
(4.6-24).
gap> SCLib.SearchByAttribute("F=[6,15,18,9]"); [ [ 4, "S^3 (VT)" ] ] gap> c:=SCLib.Load(4);; gap> ns1:=SCNSSlicing(c,[[1,3,5],[2,4,6]]);; gap> ns2:=SCNSSlicing(c,[[1,3,5],[2,4,6]])+10;; gap> SCNSTopologicalType(ns1); "T^2" gap> SCNSTopologicalType(ns2); "T^2" gap> ns3:=Union(ns1,ns2);; gap> SCNSTopologicalType(ns3); "T^2 U T^2" gap> |
SCNormalSurface
as a subtype of Set
Like 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 section 3.4 for details.
generated by GAPDoc2HTML