03-complex.py
author Dmitriy Morozov <dmitriy@mrzv.org>
Mon, 18 Jun 2012 10:04:58 -0700
changeset 5 9acb920a945c
parent 0 337c84a13184
permissions -rw-r--r--
Added PDF of the talk

## Complexes
# Square
#square = [[0], [1], [2], [3], [0,1], [0,3], [1,2], [2,3]]
#square = [Simplex(vertices) for vertices in square]

#square_points = [[0,0], [0,1], [1,1], [1,0]]
#show_complex(square_points, square)

# 8-sphere
simplex_9 = Simplex(range(10))          # 9-simplex
sphere_8 = closure([simplex_9], 8)      # 8-skeleton of the 9_simplex
print "Number of simplices:", len(sphere_8)

f = Filtration(sphere_8, dim_cmp)
p = StaticPersistence(f)
p.pair_simplices()

dgms = init_diagrams(p, f, lambda s: 0)
for i, dgm in enumerate(dgms):
    print "Dimension:", i
    print dgm