summaryrefslogtreecommitdiff
path: root/example/Persistent_cohomology/README
blob: 7803e5ab7438d3717f8688a6cbef7679f3da07aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
To build the example, run in a Terminal:

cd /path-to-example/
cmake .
make

***********************************************************************************************************************
Example of use of RIPS:

Computation of the persistent homology with Z/2Z coefficients of the Rips complex on points 
sampling a Klein bottle:

./rips_persistence ../../data/points/Kl.txt -r 0.25 -d 3 -p 2 -m 100

output:
210  0 0 inf
210  1 0.0702103 inf
2  1 0.0702103 inf
2  2 0.159992 inf


Every line is of this format: p1*...*pr   dim b d
where
 	p1*...*pr is the product of prime numbers pi such that the homology feature exists in homology with Z/piZ coefficients. 
	dim is the dimension of the homological feature,
    b and d are respectively the birth and death of the feature and
   


with Z/3Z coefficients:

./rips_persistence ../../data/points/Kl.txt -r 0.25 -d 3 -p 3 -m 100

output:
3  0 0 inf
3  1 0.0702103 inf

and the computation with Z/2Z and Z/3Z coefficients simultaneously:

./rips_multifield_persistence ../../data/points/Kl.txt -r 0.25 -d 3 -p 2 -q 3 -m 100

output:
6  0 0 inf
6  1 0.0702103 inf
2  1 0.0702103 inf
2  2 0.159992 inf

and finally the computation with all Z/pZ for 2 <= p <= 71 (20 first prime numbers):

 ./rips_multifield_persistence ../../data/points/Kl.txt -r 0.25 -d 3 -p 2 -q 71 -m 100

output:
557940830126698960967415390  0 0 inf
557940830126698960967415390  1 0.0702103 inf
2  1 0.0702103 inf
2  2 0.159992 inf

***********************************************************************************************************************
Example of use of ALPHA:

For a more verbose mode, please run cmake with option "DEBUG_TRACES=TRUE" and recompile the programs.

1) 3D special case
------------------
Computation of the persistent homology with Z/2Z coefficients of the alpha complex on points 
sampling a torus 3D:

./alpha_complex_3d_persistence ../../data/points/tore3D_300.off 2 0.45

output:
Simplex_tree dim: 3
2  0 0 inf 
2  1 0.0682162 1.0001 
2  1 0.0934117 1.00003 
2  2 0.56444 1.03938 

Here we retrieve expected Betti numbers on a tore 3D:
Betti numbers[0] = 1
Betti numbers[1] = 2
Betti numbers[2] = 1

N.B.: - alpha_complex_3d_persistence accepts only OFF files in 3D dimension.
      - filtration values are alpha square values

2) d-Dimension case
-------------------
Computation of the persistent homology with Z/2Z coefficients of the alpha complex on points 
sampling a torus 3D:

./alpha_complex_persistence -r 32 -p 2 -m 0.45 ../../data/points/tore3D_300.off

output:
Alpha complex is of dimension 3 - 9273 simplices - 300 vertices.
Simplex_tree dim: 3
2  0 0 inf 
2  1 0.0682162 1.0001 
2  1 0.0934117 1.00003 
2  2 0.56444 1.03938 

Here we retrieve expected Betti numbers on a tore 3D:
Betti numbers[0] = 1
Betti numbers[1] = 2
Betti numbers[2] = 1

N.B.: - alpha_complex_persistence accepts OFF files in d-Dimension.
      - filtration values are alpha square values

3) 3D periodic special case
---------------------------
./periodic_alpha_complex_3d_persistence ../../data/points/grid_10_10_10_in_0_1.off 3 1.0

output:
Periodic Delaunay computed.
Simplex_tree dim: 3
3  0 0 inf 
3  1 0.0025 inf 
3  1 0.0025 inf 
3  1 0.0025 inf 
3  2 0.005 inf 
3  2 0.005 inf 
3  2 0.005 inf 
3  3 0.0075 inf 

Here we retrieve expected Betti numbers on a tore 3D:
Betti numbers[0] = 1
Betti numbers[1] = 3
Betti numbers[2] = 3
Betti numbers[3] = 1

N.B.: - periodic_alpha_complex_3d_persistence accepts only OFF files in 3D dimension. In this example, the periodic cube
is hard coded to { x = [0,1]; y = [0,1]; z = [0,1] }
      - filtration values are alpha square values

***********************************************************************************************************************
Example of use of PLAIN HOMOLOGY:

This example computes the plain homology of the following simplicial complex without filtration values:
  /* Complex to build. */
  /*    1   3          */
  /*    o---o          */
  /*   /X\ /           */
  /*  o---o   o        */
  /*  2   0   4        */

./plain_homology 

output:
2  0 0 inf 
2  0 0 inf 
2  1 0 inf 

Here we retrieve the 2 entities {0,1,2,3} and {4} (Betti numbers[0] = 2) and the hole in {0,1,3} (Betti numbers[1] = 1)