Generator functions¶
simpicial
provides a set of functions for creating the common kinds of
simplicial complex. These can be used as the basis for complexes built from
other, simpler, complexes and glued together.
Simplices, skeletons, and voids¶
- simplicial.k_simplex(k, id=None, attr=None, c=None)¶
Create a k-simplex. If no complex is provided, a new one is created. The top-level simplex can be named and given attributes; its faces will be “anonymous” and have names created for them.
- Parameters
k (
int
) – the order of simplex to createid (
Optional
[Any
]) – (optional) the name of the simplex createdattr (
Optional
[Dict
[str
,Any
]]) – (optional) attributes ot the top-level simplexc (
Optional
[SimplicialComplex
]) – (optional) the complex to create into
- Return type
- Returns
the complex containing the new simplex
- simplicial.k_skeleton(k, c=None)¶
Create the skeleton of a k-simplex, consisting of (k + 1) 0-simplices for the basis and k(k - 1)/2 1-simplices for the skeleton. Note that this doesn’t create the k-simplex itself, just a skeleton of points and lines: to get the simplex itself use
k_simplex()
. If no complex is provided, a new one is created.- Parameters
k (
int
) – the order of simplex to createc (
Optional
[SimplicialComplex
]) – (optional) the complex to create into
- Return type
- Returns
a complex containing the skeleton
- simplicial.k_void(k, c=None)¶
Create a (k + 1)-dimensional void or hole with a k-dimensional boundary – or in other words all the faces of a (k + 1)-simplex without filling in the (k + 1) simplex itself.
The numbering of holes is a bit confusing, but a cycle of edges (1-simplices) creates what is referred to as a 1-hole, even though it’s a 2-dimensional structure.
- Parameters
k (
int
) – the order of simplex to createc (
Optional
[SimplicialComplex
]) – (optional) the complex to create into
- Return type
- Returns
the complex containing the skeleton
Structures¶
- simplicial.ring(n, c=None)¶
Create a closed ring of n lines (1-simplices), where n is strictly greater than 2.
- Parameters
n (
int
) – the number of lines in the ringc (
Optional
[SimplicialComplex
]) – (optional) the complex to create into
- Return type
- Returns
the complex containing the skeleton