Persistent homology based on Alpha complex on MATLAB

Sharing a naive implementation of persistent homology calculation from data on MATLAB
143 Downloads
Updated 14 May 2023

PersistentHomologyOnMATLAB

View Persistent homology based on Alpha complex on MATLAB on File Exchange

Overview

This is a naive implimetation of persistent homology calculation and visualization by persistent diagram. My implimentation is based on [1] for the reduction of boundary oparator matrix, and [2] for calculate minimum bounding sphere to yield Alpha filtration.

[1] Edelsbrunner, H., & Harer, J. L. (2022). Computational topology: an introduction. American Mathematical Society.

[2] Welzl, E. (1991). Smallest enclosing disks (balls and ellipsoids). In H. Maurer (Ed.), New Results and New Trends in Computer Science (pp. 359–370). Springer. https://doi.org/10.1007/BFb0038202

Usage

Here is an example file for short introduction.

close all; clc; clear;

% Example 
dat = load("../Dat/Lorenz-chaos-dt0.001-T1000.mat");
ndata = 1e2;
data = dat.x(1000:50:(1000+ndata*50), :);
[PD, Rinfs] = get_PD_H012_from_3Ddata(data);

% Visualization
figure;
scatter3(data(:, 1), data(:, 2), data(:, 3), 'filled'); hold on
VisualizePersistentDiagram(PD, Rinfs);

Practical functions are following:

[PD, Rinfs] = get_PD_H0...(d-1)_from_dDdata(data)

This calculates persistent diagram for <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="22411487ac6f18a08d83595eb03a3d30">$p$</math-renderer>-th persistent homology groups <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="22411487ac6f18a08d83595eb03a3d30">$(p = 0,\dots, d-1)$</math-renderer>, where <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="22411487ac6f18a08d83595eb03a3d30">$d$</math-renderer> is the dimension of input data. Output PD is data points of persistent diagram for each dimensions, and Rinfs recomended dummy values to show a persistent pair at infinity.

VisualizePersistentDiagram(PD, Rinfs);

This shows plots of persistent diagram based on inputs PD and Rinfs.

Cite As

Taiki Yamada (2025). Persistent homology based on Alpha complex on MATLAB (https://github.com/codetyt/PersistentHomologyOnMATLAB/releases/tag/1.1.0), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2023a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.