Differences
This shows you the differences between two versions of the page.
— | user_guide:tutorials:latest:chain_complex_homology [2023/11/06 10:57] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== General chain complexes in topaz ====== | ||
+ | |||
+ | Apart from being capable of computing integer homology of simplicial complexes (see this [[apps_topaz|tutorial]] for an introduction), | ||
+ | |||
+ | <code perl> | ||
+ | > 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: | ||
+ | |||
+ | <code perl> | ||
+ | > $bd1 = real_projective_plane()-> | ||
+ | > $bd2 = real_projective_plane()-> | ||
+ | > $a = new Array< | ||
+ | > $cc = new ChainComplex< | ||
+ | </ | ||
+ | The template parameter of '' | ||
+ | |||
+ | You can access the data stored in the object like this: | ||
+ | |||
+ | <code perl> | ||
+ | > 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. | ||
+ | |||
+ | <code perl> | ||
+ | > 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. | ||
+ | |||
+ | <code perl> | ||
+ | > 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' | ||
+ | |||
+ | <code perl> | ||
+ | > print betti_numbers($cc); | ||
+ | 1 0 0 | ||
+ | </ | ||