Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
user_guide:tutorials:chain_complex_homology [2019/01/29 21:46] – external edit 127.0.0.1 | user_guide:tutorials:chain_complex_homology [2019/02/04 22:55] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======General chain complexes in topaz====== | + | {{page>.:latest:@FILEID@}} |
- | Apart from being capable of computing integer homology of simplicial complexes (see this [[..: | + | |
- | <code> | + | |
- | > application ' | + | |
- | </ | + | |
- | ====Constructing a ChainComplex==== | + | |
- | You can construct a chain complex via its differential matrices. For example purposes, we use the sparse boundary matrices of a triangulation of the real projective plane. You can then construct a general chain complex from it like this: | + | |
- | < | + | |
- | topaz > $bd1 = real_projective_plane()-> | + | |
- | topaz > $bd2 = real_projective_plane()-> | + | |
- | topaz > $a = new Array< | + | |
- | topaz > $cc = new ChainComplex< | + | |
- | </ | + | |
- | + | ||
- | The template parameter of '' | + | |
- | + | ||
- | You can access the data stored in the object like this: | + | |
- | < | + | |
- | topaz > print $cc-> | + | |
- | (15) (0 1) (1 -1) (2 1) | + | |
- | (15) (0 1) (3 -1) (4 1) | + | |
- | (15) (5 1) (6 -1) (7 1) | + | |
- | (15) (1 -1) (5 1) (8 1) | + | |
- | (15) (3 -1) (6 1) (9 1) | + | |
- | (15) (7 1) (10 1) (11 -1) | + | |
- | (15) (4 -1) (10 1) (12 1) | + | |
- | (15) (2 -1) (11 1) (13 1) | + | |
- | (15) (8 1) (12 -1) (14 1) | + | |
- | (15) (9 -1) (13 1) (14 1) | + | |
- | </ | + | |
- | + | ||
- | ====Computing integer homology==== | + | |
- | There is a user function to compute integer homology of your complex. You can access the documentation by typing the name of the function in the interactive shell and then pressing F1. | + | |
- | < | + | |
- | topaz > print homology($cc, | + | |
- | ({} 1) | + | |
- | ({(2 1)} 0) | + | |
- | ({} 0) | + | |
- | </ | + | |
- | The output rows correspond to the dimensions of your homology modules, containing the torsion coefficients in curly brackets, and the betti number. Note that this is non-reduced homology, unlike what gets computed when using the '' | + | |
- | + | ||
- | There is an extra function for computing the generators of the homology modules as well. | + | |
- | < | + | |
- | topaz > print homology_and_cycles($cc, | + | |
- | (({} 1) | + | |
- | <(6) (0 1) | + | |
- | > | + | |
- | ) | + | |
- | (({(2 1)} 0) | + | |
- | <(15) (10 1) (11 -1) (12 1) (13 -1) (14 -1) | + | |
- | > | + | |
- | ) | + | |
- | (({} 0) | + | |
- | <> | + | |
- | ) | + | |
- | </ | + | |
- | The output pairs the homology module representation with a representation of the cycles generating the respective modules, where the indices correspond to the indices in your input matrices. | + | |
- | + | ||
- | ====Computing Betti numbers==== | + | |
- | + | ||
- | If your complex' | + | |
- | < | + | |
- | print betti_numbers($cc); | + | |
- | 1 0 0 | + | |
- | </ | + | |