In [5]:
from dionysus import Simplex
complex = [Simplex([0]), Simplex([1]), Simplex([2]), Simplex([0, 1]),
Simplex([0, 2]), Simplex([2, 1]), Simplex([0, 1, 2])]
complex
Out[5]:
Since specifying each simplex in a complex is a cumbersome task, dionysus has a closure method which automatically adds missing simplices of lower dimensions in the complex. So the above complex can also be defined as follows.
In [12]:
from dionysus import closure
# Closure accepts 2 arguments: a complex and its dimension
complex = closure([Simplex([0, 1, 2])], 2)
complex
Out[12]:
Write the code for the following methods.
sphere(dimension): returns a simplicial complex for a sphere of dimension dimension.torus(n): returns a simplicial complex for connected sum of n toruses (see http://www-history.mcs.st-and.ac.uk/~john/MT4521/Lectures/L23.html). Test the code to see if the obtained triangulation is valid for torus and sphere of dimension 2.
Read the document http://nbviewer.jupyter.org/github/gregorjerse/rt2/blob/master/2015_2016/lab6/Computing%20homology.ipynb . Then compute homology of the following objects.
In files o1, o2 and o3 are cloud of points. Construct the alpha shape complex on them (hint: use radious 1) and compute the homology of the resulting complex.
Determine betti numbers for each of the complex and based on them determine which of the following objects do they represent.
To refresh memory on alpha shapes generation see the document http://nbviewer.jupyter.org/github/gregorjerse/rt2/blob/master/2015_2016/lab4/Alpha%20shapes%20vs.%20Vietoris%20Rips.ipynb