permaviss.spectral_sequence.spectral_sequence_class

Functions

add_dictionaries(coefficients, …) Computes a dictionary that is the linear combination of coefficients on representatives
copy_dictionary(original) Copies a dictionary where each entry is a Numpy Array

Classes

spectral_sequence(nerve, nerve_point_cloud, …) Space and methods for Mayer-Vietoris spectral sequences
permaviss.spectral_sequence.spectral_sequence_class.add_dictionaries(coefficients, representatives, p)[source]

Computes a dictionary that is the linear combination of coefficients on representatives

Parameters:
  • coefficients (Numpy Array) – 1D array with the same number of elements as representatives. Each entry is an integer mod p.
  • representatives (list(dict)) – List where each entry is a dictionary. The keys on each dictionary are integers, and these might coincide with dictionaries on other entries.
  • p (int(prime)) –
Returns:

rep_sum – Result of adding the dictionaries on representatives with coefficients.

Return type:

dict

Example

>>> import numpy as np
>>> p=5
>>> coefficients = np.array([1,2,3])
>>> representatives = [
... {0:np.array([1,3]), 3:np.array([0,0,1])},
... {0:np.array([4,3]),2:np.array([4,5])},
... {3:np.array([0,4,0])}]
>>> add_dictionaries(coefficients, representatives, p)
{0: array([4, 4]), 3: array([0, 2, 1]), 2: array([3, 0])}
permaviss.spectral_sequence.spectral_sequence_class.copy_dictionary(original)[source]

Copies a dictionary where each entry is a Numpy Array

class permaviss.spectral_sequence.spectral_sequence_class.spectral_sequence(nerve, nerve_point_cloud, points_IN, max_dim, max_r, no_pages, p)[source]

Space and methods for Mayer-Vietoris spectral sequences

Parameters:
  • nerve (list(Numpy Array)) – Simplicial complex storing the nerve of the covering. This is stored as a list, where the ith entry contains a Numpy Array storing all the ith simplices.
  • nerve_point_cloud (list(list(Numpy Array))) – Point clouds indexed by nerve of the cover, see permaviss.covers.cubical_cover
  • points_IN (list(list(Numpy Array))) – Point Identification Numbers (IN) indexed by nerve of the cover, see permaviss.covers.cubical_cover
  • max_dim (int) – Maximum dimension of simplices.
  • max_r (float) – Maximum persistence radius.
  • no_pages (int) – Number of pages of the spectral sequence
  • p (int(prime)) – The prime number so that our computations are mod p
nerve, nerve_point_cloud, points_IN, max_dim, max_r, no_pages, p

as described above

no_rows, no_columns

Number of rows and columns in each page

Type:int, int
nerve_differentials

List storing the differentials of the Nerve. The ith entry stores the matrix of the ith differential.

Type:list(Numpy Array)
subcomplexes

List storing the simplicial complex on each cover element. For integers n_dim, k and dim the variable subcomplexes[n_dim][k][dim] stores the dim-simplices on the cover indexed by the k simplex of dimension n_dim in the nerve.

Type:list(list(list(Numpy Array)))
zero_differentials

List storing the vertical differential matrices on the 0 page of the spectral sequence. For integers n_dim, k and dim the variable zero_differentials[n_dim][k][dim] stores the dim differential of the complex on the cover indexed by the k simplex of dimension n_dim in the nerve.

Type:list(list(list(Numpy Array)))
cycle_dimensions

List storing the number of bars on each local persistent homology. Given two integers n_dim and dim, the variable cycle_dimensions[n_dim][dim] contains a list where each entry corresponds to an n_dim simplex in the nerve. For each such entry, we store the number of nontrivial persistent homology classes of dimension dim in the corresponding cover.

Type:list(list(list(int)))
Hom

Homology for each page of the spectral sequence. Given three integers which we denote n_dim, nerv_spx and deg we have that Hom[0][n_dim][nerv_spx][deg] stores a barcode_basis with the deg-persistent homology of the covering indexed by nerve[n_dim][nerv_spx]. All these store the homology on the 0 page of the spectral sequence. Additionally, for integers k > 0, n_dim and deg, we store in Hom[k][n_dim][deg] the barcode_basis for the homology on the (deg, n_dim) entry in the k page of the spectral sequence.

Type:list(...(list(barcode_basis)))
Im

Image for each page of the spectral sequence. Given three integers which we denote n_dim, nerv_spx and deg we have that Im[0][n_dim][nerv_spx][deg] stores a barcode_basis for the image of the deg+1-differential of the covering indexed by nerve[n_dim][nerv_spx]. All these store the images on the 0 page of the spectral sequence. Additionally, for integers k > 0, n_dim and deg, we store in Im[k][n_dim][deg] the barcode_basis for the image on the (deg, n_dim) entry in the k page of the spectral sequence.

Type:list(...(list(barcode_basis)))
PreIm

Preimages for each page of the spectral sequence. Given three integers which we denote n_dim, nerv_spx and deg we have that PreIm[0][n_dim][nerv_spx][deg] stores a Numpy Array for the Preimage of the deg+1-differential of the covering indexed by nerve[n_dim][nerv_spx]. Additionally, for integers k > 0, n_dim and deg, we store in PreIm[k][n_dim][deg] a Numpy Array for the preimages of the differential images in the (deg, n_dim) entry in the k page of the spectral sequence.

Type:list(...(list(Numpy Array)))
tot_complex_reps

The asterisc * on the type can be either [] or list(Numpy Array). This is used for storing complex representatives for the cycles.

Type:list(list(*))
page_dim_matrix

Array storing the dimensions of the entries in each page. Notice that the order in which we store columns and rows differs from all the previous attributes.

Type:Numpy Array(no_pages+1, max_dim, no_columns)
persistent_homology

List storing the persistent homology generated by the spectral sequence. The i entry contains the i dimensional persistent homology.

Type:list(barcode_basis)
order_diagonal_basis

This intends to store the original order of persistent_homology before applying the standard order.

Type:list
extensions

Nested lists, where the first two indices are for the column and row. The last index indicates the corresponding extension matrix.

Type:list(list(list(Numpy Array)))

Notes

The indexing on the 0 page is different from that of the next pages. This is because we do not want to store all the 0 page information on the same place.

add_output_first(output, n_dim)[source]

Stores the 0 page data of n_dim column after it has been computed in parallel by multiprocessing.pool

Parameters:
add_output_higher(Hom, Im, PreIm, end_n_dim, end_deg, current_page)[source]

Stores higher page data that has been computed along a sequence of consecutive differentials.

The studied sequence of differentials ends in

(end_n_dim, end_deg)

coming from

(end_n_dim + current_page, end_deg - current_page + 1)

and continuing until reaching an integer r > 0 such that either

end_n_dim + r * current_page > self.no_columns

or

end_deg - r * current_page + 1 > 0
Parameters:
  • Hom (list(barcode_basis)) – Homology of a sequence of differentials in the spectral sequence. This is computed using permaviss.persistence_algebra.module_persistence_homology.
  • Im (list(barcode_basis)) – Images of a sequence of differentials in the spectral sequence.
  • PreIm (list(Numpy Array)) – Preimages of a sequence of differentials in the spectral sequence.
  • end_n_dim (int) – Integer specifying the column position where the sequence of differentials ends.
  • end_deg (int) – Integer specifying the row position where the sequence of differentials ends.
  • current_page (int) – Current page of the spectral sequence.
cech_differential(start_coordinates, n_dim, deg)[source]

Computes the Cech Differential of various cochains.

That is, given a few cochains on the position (deg, n_dim) of the 0 page, we compute the Cech differential. This leads to cochains on (deg, n_dim - 1).

Parameters:
  • start_coordinates (list(dict)) – List where each entry contains a dictionary storing the coordinates of a cochain in (n_dim, deg). Each dictionary key corresponds to a n_dim simplex s on the covering nerve, and this contains the local coordinates for each cochain.
  • n_dim (int) – Column on page
  • deg (int) – Row on page
Returns:

target_coordinates – Cech differential images of start_coordinates. These are stored as a list of cochains in (n_dim-1, deg) with the same format as start_coordinates

Return type:

list(dict)

extension(start_n_dim, start_deg)[source]

Generate extension block matrices for given n_dim and deg

Parameters:
  • start_n_dim (int) – Column on page where we want to compute the extension coefficients.
  • start_deg (int) – Row on page where we want to compute the extension coefficients.
  • Stores
  • ------
  • extensions (list(Numpy Array)) – Extension matrices for the basis contained at (start_deg, start_n_dim) of the infinity page. More precisely, given an integer ext_dim, the entry extension[ext_dim] stores a Numpy Array matrix where the i column corresponds to the i generator in the position (start_deg, start_n_dim) from the infinity page. Each such column contains the extension coefficients in terms of the generators from the (deg + ext_deg, n_dim - ext_deg) entry on the infinity page. Recall that each slope -1 diagonal on the infinity page corresponds to a broken basis for the persistent homology. Then, each of the matrices in extension_matrices corresponds to a block in the broken differentials. Notice that the order in which we store columns and rows differs from all the previous attributes except page_dim_matrix.
image_coordinates(start_coordinates, R, n_dim, deg, target_page)[source]

Given cochains on the 0-page, we compute the coordinates of their persistent Homology classes in terms of the basis in Im[target_page][n_dim][deg]

Parameters:
  • start_coordinates (list(dict)) – These are the cochains on the (deg, n_dim) position that we want to lift through the vertical differential. List containing cochains on (deg, n_dim). Each entry contains the coefficients of a cochain as a dictionary indexed by n_dim simplices on the nerve of the cover.
  • R (Numpy Array) – 1D array storing the radii of birth for each cochain stored in start_coordinates
  • n_dim (int) – Column on page
  • deg (int) – Row on page
  • target_page (int) – Page of spectral sequence at which we want to solve the image equation.
Returns:

image_coordinates – Start_coordinates classes in target_page written in terms of image of differential. Rows correspond to different vectors and columns correspond to the dimension of the image.

Return type:

Numpy Array

Raises:

ValueError – If the classes of the cochains are not contained in the images.

lift_preimage(start_coordinates, R, n_dim, deg, sign=-1)[source]

Given a zero page element, we lift it using the vertical differentials.

Additionally, we multiply the lift by -1 mod self.p In this method we assume that this can be done.

Parameters:
  • start_coordinates (list(dict)) – These are the cochains on the (deg, n_dim) position that we want to lift through the vertical differential. List containing cochains on (deg, n_dim). Each entry contains the coefficients of a cochain as a dictionary indexed by n_dim simplices on the nerve of the cover.
  • R (Numpy Array) – 1D array storing the radii of birth for each cochain stored in start_coordinates.
  • n_dim (int) – Column on page
  • deg (int) – Row on page
Returns:

lifted_coordinates – These are the cochains on the (deg+1, n_dim) position that we want to lift through the vertical differential. List containing cochains on (deg+1, n_dim). Each entry contains the coefficients of a cochain as a dictionary indexed by n_dim simplices on the nerve of the cover.

Return type:

list(dict)

lift_to_page(start_coordinates, R, n_dim, deg, target_page)[source]

Lifts some zero page element to a target page.

This is, in a way, opposite to permaviss.spectral_sequence.spectral_sequence_class.load_to_zero_page(). More precisely, given a few cochains in start_coordinates, we compute their respective classes on target_page.

Parameters:
  • start_coordinates (list(dict)) – List where each entry contains a dictionary storing cochains on zero page. Each dictionary entry corresponds to a n_dim simplex s on the covering nerve, and this contains the local coordinates for each cochain.
  • R (Numpy Array) – 1D array storing the radii of birth for each cochain stored in start_coordinates.
  • n_dim (int) – Column on page
  • deg (int) – Row on page
  • target_page (int) – Page to which we want to lift start_coordinates.
Returns:

target_coordinates – Matrix storing the coordinates for each class corresponding to each cochain in start_coordinates. Rows correspond to the number of classes, while the columns correspond to the dimension of Hom[n_dim][deg][target_page].

Return type:

Numpy Array

liftable_0_class(start_coordinates, R, n_dim, deg, target_page, store_reps, start_n_dim=None, start_deg=None)[source]

Given cochains on the 0-page, and assuming that they are zero when lifted to target_page, we get representatives that are equivalent on target_page - 1 and also lift through the vertical differential.

Parameters:
  • start_coordinates (list(dict)) – These are the cochains on the (deg, n_dim) position that we want to lift through the vertical differential. List containing cochains on (deg, n_dim). Each entry contains the coefficients of a cochain as a dictionary indexed by n_dim simplices on the nerve of the cover. This is modified so that it can be lifted.
  • R (Numpy Array) – 1D array storing the radii of birth for each cochain stored in start_coordinates
  • n_dim (int) – Column on page
  • deg (int) – Row on page
  • target_page (int) – Page of spectral sequence at which the given classes vanish.
Returns:

liftable_coordinates – Cochains on the (deg, n_dim) position whose classes on target_page are equivalent to those of start_coordinates. Furthermore, these can also be lifted through vertical differentials.

Return type:

list(dict)

load_to_zero_page(initial_sum, n_dim, deg, current_page)[source]

Given an expression on the nth page of the spectral sequence, we pick a representative on the 0th page and return it.

Parameters:
  • initial_sum (Numpy Array) – Matrix storing the coordinates of different elements in terms of the basis stored in Hom at (deg, n_dim) and on the page current_page. Different element coordinates are on each column, while the basis corresponds to rows in the matrix.
  • n_dim (int) – Column position on page.
  • deg (int) – Row position on page
  • current_page (int) – Current page number
Returns:

  • target_coordinates (list(dict)) – List where each entry contains a dictionary storing cochains on zero page. Each dictionary entry corresponds to a n_dim simplex s on the covering nerve, and this contains the local coordinates for each cochain.
  • R (Numpy Array) – 1D array storing the radii of birth for each cochain stored in target_coordinates.

vert_image(initial_sum, n_dim, deg)[source]

Given an expression on zero page, computes the image under the vertical differentials.

Parameters:initial_sum (list(dict)) – Coordinates of chains stored as a dictionary. Each dictionary entry corresponds to a n_dim simplex s on the covering nerve, and this corresponds to an intersection of covers K_s. On each such entry, there is a Numpy Array matrix storing the local coordinates for each chain. More precisely, the rows correspond to different cochains while the columns correspond deg simplices contained in K_s.
zig_zag(n_dim, deg, current_page, lift_sum=True, initial_sum=[], store_reps=False)[source]

Computes the image of the differential of the spectral sequence applied to a matrix of coordinates.

Given an array of coordinates, computes the image under the differential in the current page. If no coordinates are given in initial_sum, we compute the image of all the generators on the position (deg, n_dim) of the current_page-page of the spectral sequence.

Parameters:
  • n_dim (int) – Column in page.
  • deg (int) – Row in page
  • current_page (int) – Current page in spectral sequence
  • lift_sum (bool, default is True) – Whether we return a lifted sum on current_page or we return an expression on the 0 page instead.
  • initial_sum (list, default is []) – Expression for which we want to compute zig-zag. Coordinates are stored on each column and are given in terms of the basis stored in Hom for the position (deg, n_dim) in current_page -1. If this is not given, we set it to be the identity of size equal to the dimension of the considered position on the spectral sequence.
  • store_reps (bool, default is False.) – Whether we want to store total complex representatives.
Returns:

Coordinates for images. Each column stores the image by the current_page differential applied to the corresponding column in initial_sum. These coordinates are given in terms of the basis stored in Hom for the position (deg, n_dim) for the page current_page -1. If lift_sum is set up to False, then this is a list where each entry stores a cochain. Each cochain is a dictionary dict, where entries are indexed by covering simplices, and these contain the local coordinates.

Return type:

Numpy Array, if lift_sum==False then returns list(dict)