I spent the past few days writing SimplicialHomology which is a package providing an abstract simplicial complex object and various functionalities to manipulate or analyse simplicial complexes. It supports common topological computations such as homology groups, Betti numbers, Euler characteristics, connected components, and other combinatorial invariants while providing a consistent interface for experimentation, teaching, and perhaps even research in algebraic topology. So far, there has been no concrete (upto my knowledge) in-built or third party support in Mathematica for simplicial homology or discrete topology in general. Hence, that motivated me to create this. The sagemath library of Python has been of great help to me during this process, providing me a reference to look at.
See the package on Wolfram paclet repository https://resources.wolframcloud.com/PacletRepository/resources/Taggar/SimplicialHomology/ and development takes place at https://github.com/zplus11/SimplicialHomology/. Currently the package is at version 1.0.0 and supports basic but a concrete set of functionalitoes, though there is a lot of scope for further development. I invite you to contribute if you wish!

Installation

Install the package as follows:
In[]:=
PacletInstall["Taggar/SimplicialHomology"]
Out[]=
PacletObject
Name: Taggar/SimplicialHomology
Version: 1.0.0

and load it in the current session:
In[]:=
<<Taggar`SimplicialHomology`

Usage

Create a simplicial complex using its facets:
In[]:=
S1=SimplicialComplex[{{1,2},{2,3},{3,1}}]
Out[]=
SimplicialComplex
Dimension: 1
Vertices: 3

or using Simplex objects:
In[]:=
D1=SimplicialComplex[{Simplex[{1,2}]}]
Out[]=
SimplicialComplex
Dimension: 1
Vertices: 2

The input simplices are sorted by ordinary sorting. Mathematica can sort almost anything, so almost anything can be provided for vertices:
In[]:=
SimplicialComplex[{{1,Red,f,g,Sort}}]
Out[]=
SimplicialComplex
Dimension: 4
Vertices: 5

but it is recommended that integers be provided. Arbitrary expressions will not work for some functionalities like calculating automorphism group etc (see below). The package also supports named objects:
In[]:=
torus=SimplicialComplex["Torus"]
Out[]=
SimplicialComplex
Dimension: 2
Vertices: 7

In[]:=
klein=SimplicialComplex["KleinBottle"]
Out[]=
SimplicialComplex
Dimension: 2
Vertices: 8

Create a simplicial complex out of a mesh region:
In[]:=
ResourceData["Utah Teapot","MeshRegion"]
Out[]=
In[]:=
teapot=SimplicialComplex[%]
Out[]=
SimplicialComplex
Dimension: 2
Vertices: 480

Calculate homology of a space, say torus:
In[]:=
HomologyGroup[torus]
Out[]=
0,1
2

,2
Reduced homology can also be computed:
In[]:=
HomologyGroup[klein,"Reduced"->True]
Out[]=
00,1{,CyclicGroup[2]},20
or over rationals or finite fields:
In[]:=
HomologyGroup[klein,"Coefficients"->Rationals]
Out[]=
0,1,20
In[]:=
HomologyGroup[klein,"Coefficients"->2]
Out[]=
0

2
,1
2

2
,2

2

Here,
{,CyclicGroup[2]}
denotes the direct product of
Z
with CyclicGroup[2]. Compute Betti numbers of
1
S
:
In[]:=
BettiNumber[S1]
Out[]=
01,11
Calculate betti numbers of the teapot:
In[]:=
BettiNumber[teapot]
Out[]=
03,13,20
This demonstrates there are 3 connected components, 3 holes, and no enclodes voids in the teapot!

New spaces from old

Calculate cones, suspensions, or joins of spaces:
In[]:=
SimplicialCone[torus]
Out[]=
SimplicialComplex
Dimension: 3
Vertices: 8

In[]:=
SimplicialJoin[S1,S1]
Out[]=
SimplicialComplex
Dimension: 3
Vertices: 6

Repeated application of cone keeps resulting complexes:
In[]:=
NestList[SimplicialCone,SimplicialComplex["Point"],4]
Out[]=
SimplicialComplex
Dimension: 0
Vertices: 1
,SimplicialComplex
Dimension: 1
Vertices: 2
,SimplicialComplex
Dimension: 2
Vertices: 3
,SimplicialComplex
Dimension: 3
Vertices: 4
,SimplicialComplex
Dimension: 4
Vertices: 5

Taking a cone kills the homology groups:
In[]:=
HomologyGroup[​​SimplicialCone[SimplicialComplex["Torus"]],​​"Reduced"->True]
Out[]=
00,10,20,30
Characteristic number of a cone is always one:
In[]:=
SimplicialCone[SimplicialComplex[#]]["EulerCharacteristic"]&/@{"Circle","Sphere","Torus","RealProjectivePlane","Tetrahedron"}
Out[]=
{1,1,1,1,1}

Comparing complexes

Two spaces are equal if they are generated from the same facets:
In[]:=
SimplicialComplex[{{1}}]===SimplicialComplex[{{1}}]
Out[]=
True
The package checks input facets for maximality so that redundant facets are removed:
In[]:=
SimplicialComplex[{{1,2,3}}]===SimplicialComplex[{{1,2,3},{2,1}}]
Out[]=
True
Now even though the following two are not equal:
In[]:=
SimplicialComplex[{{1}}]===SimplicialComplex[{{2}}]
Out[]=
False
we can note that they are isomorphic:
In[]:=
SimplicialIsomorphicQ[SimplicialComplex[{{1}}],SimplicialComplex[{{1}}]]
Out[]=
True
A non-trivial example of isomorphism:
In[]:=
SimplicialIsomorphicQ[​​SimplicialComplex[{{1,2,3},{1,3,4},{1,4,5},{1,5,6}}],​​SimplicialComplex[{{1,2,6},{2,3,6},{3,4,6},{4,5,6}}]​​]
Out[]=
True
Prove that the Poincare homology 3-sphere is not isomorphic to
3
S
though they have the same homology:
In[]:=
SimplicialIsomorphicQ[​​SimplicialComplex["PoincareHomologyThreeSphere"],​​SimplicialComplex[{"Circle",3}]​​]
Out[]=
False
In[]:=
HomologyGroup[SimplicialComplex["PoincareHomologyThreeSphere"]]
Out[]=
0,10,20,3
In[]:=
HomologyGroup[SimplicialComplex[{"Circle",3}]]
Out[]=
0,10,20,3

Automorphism groups

Find the automorphism group of a simplicial complex:
that for the tetrahedron it is isomorphic to SymmetricGroup[4]:
Check that automorphism group of the real projective plane is isomorphic to AlternatingGroup[5]:
Symmetries of a regular pentagon:

Closing

This is the first public release of SimplicialHomology, and there is a lot of room for improvement. Planned additions include more topological constructions, relative homology, simplicial maps, barycentric subdivision, chain-level functionality, and more. I would be grateful for any feedback, bug reports, feature requests, or contributions. If you try the package, I’d be interested to hear about your use cases and suggestions for making it more useful to the community :)

References

◼
  • Munkres, J. R. Elements of Algebraic Topology, Addison Wesley Publishing Company, 1984.
  • ◼
  • Hatcher A., Algebraic Topology, Cambridge University Press, Cambridge, 2002.
  • ◼
  • W. Kühnel and T. F. Banchoff, The 9-vertex complex projective plane, Math. Intelligencer 5 (1983), no. 3, 11-22. doi:10.1007/BF03026567
  • ◼
  • M. Hachimori. http://infoshako.sk.tsukuba.ac.jp/~hachi/math/library/dunce_hat_eng.html.
  • ◼
  • Anders Björner and Frank H. Lutz, Simplicial manifolds, bistellar flips and a 16-vertex triangulation of the Poincaré homology 3-sphere, Experiment. Math. 9 (2000), no. 2, 275-289.
  • ◼
  • U. Brehm and W. Kuhnel, 15-vertex triangulations of an 8-manifold, Math. Annalen 294 (1992), no. 1, 167-193.
  • ◼
  • M. E. Rudin. An unshellable triangulation of a tetrahedron. Bull. Amer. Math. Soc. 64 (1958), 90-91.
  • ◼
  • Frank H. Lutz, Császár's Torus, Electronic Geometry Model No. 2001.02.069 (2002). http://www.eg-models.de/models/Classical_Models/2001.02.069/_direct_link.html.
  • ◼
  • G. M. Ziegler. Shelling polyhedral 3-balls and 4-polytopes. Discrete Comput. Geom. 19 (1998), 159-174. doi:10.1007/PL00009339
  • ◼
  • https://doc.sagemath.org/html/en/reference/topology/sage/topology/simplicial_complex.html
  • ◼
  • https://doc.sagemath.org/html/en/reference/topology/sage/topology/simplicial_complex_examples.html
  • ◼
  • https://doc.sagemath.org/html/en/reference/references/index.html
  • CITE THIS NOTEBOOK

    SimplicialHomology: homology groups, Betti numbers, automorphisms for simplicial complexes​
    by Naman Taggar​
    Wolfram Community, STAFF PICKS, July 10, 2026
    https://community.wolfram.com/groups/-/m/t/3755323