permaviss.spectral_sequence.spectral_sequence_class

Classes

spectral_sequence(nerve, nerve_point_cloud, …) Space and methods for Mayer-Vietoris spectral sequences
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; a simplex for each row.
  • 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

nerve_differentials

Differentials of Nerve. Used for computing Cech Complex.

Type:list(Numpy Array)
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_diff

List storing the vertical differential matrices on the 0 page of the spectral sequence. For integers n_dim, k and dim the variable zero_diff[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:
  • output (list) – Result after using multiprocessing.pool on local_persistent_homology()
  • n_dim (int) – Column of 0-page whose data has been computed.
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_diff(n_dim, deg, start_chains)[source]

Given chains in (n_dim + 1, deg), compute Cech differential.

Parameters:
  • deg (n_dim,) – Codomain position in spectral sequence.
  • chains (local_chains object) – Chains on (n_dim+1, deg) that are stored as references in chains[0] and local coordinates as rows in chains[1].
Returns:

image_chains – Image coordinates of Cech differential.

Return type:

Local Coordinates

cech_diff_and_lift(n_dim, deg, start_chains, R)[source]

Given chains in position (n_dim, deg), computes horizontal differential followed by lift by vertical differential.

Procedure: (1) take chains in position (n_dim, deg) (2) compute the Cech differential of these chains. We do this in parallel over the covers in (n_dim-1, deg) (3) Lift locally. Steps (2) and (3) are parallelized at the same time.

Parameters:
  • deg, current_page (n_dim,) – Postition on spectral sequence and current page.
  • chains (list(list(Numpy Array))) –
Returns:

  • betas (coordinates on first pages)
  • [lift_references, lift_coordinates] (local coordinates lifted by) – vertical differential.

cech_diff_and_lift_local(R, start_chains, n_dim, deg, nerve_spx_index)[source]

Takes some chains in position (n_dim+1, deg) and computes Cech diff followed by a lift by vertical differential. This is done locally at cover information in (n_dim, deg).

This method is meant to be run in parallel.

Parameters:
  • R (list) – Vector of radii
  • start_chains (local_chains object) – Chains in position (n_dim + 1, deg)
  • deg, nerve_spx_index (n_dim,) – Position in spectral sequence and local index.
Returns:

  • betas_1_page (Numpy Array) – Coefficients of lift to 1st page on position (n_dim, deg)
  • local_lift_references (list) – List of local references of lift.
  • local_lift_coordinates (Numpy Array) – Local coordinates of lift.

cech_diff_local(start_chains, n_dim, deg, nerve_spx_index)[source]

Local Cech differential, starting from chains in (n_dim + 1, deg).

Parameters:
  • start_chains (local_chains object) – Chains to compute Cech differential from.
  • deg, nerve_spx_index (n_dim,) – Position in spectral sequence and local index.
Returns:

  • local_image_ref (list) – List of local references of image.
  • local_image_coord.T (Numpy Array) – Local coordinates of image. Expressions correspond to rows while local simplices correspond to columns.

compute_higher_representatives(n_dim, deg, current_page)[source]

Computes total complex representatives for current_page classes in position (n_dim, deg).

Resulting representatives written in self.Hom_reps[current_page][n_dim][deg]

Parameters:deg, current_page (n_dim,) – Position on the spectral sequence and current page.
compute_two_page_representatives(n_dim, deg)[source]

Computes total complex representatives for second page classes in position (n_dim, deg).

Resulting representatives are written in self.Hom_reps[1][n_dim][deg]

Parameters:deg (n_dim,) – These specify the position on the spectral sequence where we want to compute and store the second page representatives.
extension(start_n_dim, start_deg)[source]

Take information from spectral sequence class, and calculate extension coefficients for a given position (start_deg, start_n_dim).

first_differential(n_dim, deg)[source]

Compute differential on first page (n_dim, deg) –> (n_dim-1, deg)

Parameters:deg (n_dim,) – Differential domain position on first page.
Returns:Betas – Coefficients of image of first page differentials. The image of each class from (n_dim, deg) is given as a row.
Return type:np.array
first_page_lift(n_dim, deg, start_chains, R)[source]

Given some chains in position (n_dim, deg), lift to first page accross several covers.

Parameters:
  • deg, current_page (n_dim,) – Postition on spectral sequence and current page.
  • start_chains (local_chains object) – Chains in position (n_dim, deg) that we lift to first page.
  • R (list) – Values at which we lift start_chains
Returns:

  • Betas_1_page (Numpy Array) – Coordinates on first page. Rows correspond to expressions and columns to homology classes.
  • lift_chains (local_coord object) – Chains after lifting vertically by horizontal differential.

first_page_local_lift(n_dim, deg, local_coord, lift_radii, nerve_spx_index)[source]

Lift to first page on a given open cover.

Parameters:
  • deg (n_dim,) – Position on spectral sequence.
  • local_coord (Numpy Array) – Local coordinates to be lifted to first page and vertical differential. Rows are expressions while columns correspond to local simplices.
  • lift_radi (list) – Values at which we want to lift start_chains by the vertical differential.
  • nerve_spx_inex (int) – Local index. This function is meant to be parallelized over this.
Returns:

  • gammas (Numpy Array) – 2D Matrix expressing coefficients of lift. Each expression corresponds to a column, while image generators correspond to rows.
  • betas (Numpy Array) – 2D Matrix expressing coefficients in terms of homology classes on page 1. Expressions correspond to columns, while homology classes correspond to rows.

high_differential(n_dim, deg, current_page)[source]

Compute differential on current-page (n_dim, deg) –> (n_dim - current_page, deg + current_page - 1).

Parameters:deg (n_dim,) – Differential domain position.
Returns:Betas – Coefficients of image of current_page differentials. The image of each class from (n_dim, deg) is given as a row.
Return type:np.array
lift_to_page(n_dim, deg, target_page, Betas, Beta_barcode)[source]

Lifts chains in position (n_dim, deg) from page 1 to target_page

Returns Betas and image coordinates.

Parameters:
  • deg (n_dim,) – Differential domain position.
  • target_page (int) – Lift classes up to this page.
  • Betas (np.array) – Coordinates of classes on first page.
  • Betas_barcode (np.array) – Barcodes of classes to be lifted.
Returns:

  • Betas.T (np.array) – Coefficients of image of current_page differentials. The image of each class from (n_dim, deg) is given as a row.
  • Gammas.T (np.array) – Coefficients of added differentials of (current_page - 1) page. This is such that the sum of differentials using Gammas, plus adding classes using target_betas leads to the original Betas.

local_cech_matrix(n_dim, deg, nerve_spx_index, nerve_face_index, nerve_coeff)[source]

Returns matrix of Cech differential in (n_dim, deg) restricted on component (nerve_face_index, nerve_spx_index).

Parameters:
  • deg (n_dim,) – Position in spectral sequence.
  • nerve_face_index (nerve_spx_index,) – Local indices in domain and codomain respectively.
  • nerve_coeff (int) – Coefficient in nerve differential determined by the pair nerve_spx_index and nerve_face_index.
Returns:

boundary – Matrix of size (subcpx[n_dim-1][nerve_face_index][deg], subcpx[n_dim][nerve_spx_index][deg]) that represents the local cech differential.

Return type:

Numpy Array