Skip to main content

wheels ci docs

giotto-ph

giotto-ph is a high-performance implementation of Vietoris–Rips (VR) persistence on the CPU, and is distributed under the GNU AGPLv3 license. It consists of an improved reimplementation of Morozov and Nigmetov’s “lock-free Ripser” and in addition makes use of a parallel implementation of the apparent pairs optimization used in Ripser v1.2. It also contains an improved reimplementation of GUDHI’s Edge Collapse (EC) algorithm and offers support for weighted VR filtrations. See also Morozov’s Ripser fork, Nigmetov’s Oineus library, and GUDHI’s EC implementation.

giotto-ph is part of the Giotto family of open-source projects and designed for tight integration with the giotto-tda and pyflagser libraries.

Project genesis

giotto-ph is the result of a collaborative effort between L2F SA, the Laboratory for Topology and Neuroscience at EPFL, and the Institute of Reconfigurable & Embedded Digital Systems (REDS) of HEIG-VD.

License

giotto-ph is distributed under the AGPLv3 license. If you need a different distribution license, please contact the L2F team.

Parallel persistent homology backend

Computing persistence barcodes of large datasets and in high homology degrees is challenging even on modern hardware. giotto-ph’s persistent homology backend is able to distribute the key stages of the computation (namely, search for apparent pairs and coboundary matrix reduction) across an arbitrary number of available CPU threads.

On challenging datasets, the scaling is quite favourable as shown in the following figure (for more details, see our paper linked below):

https://raw.githubusercontent.com/giotto-ai/giotto-ph/main/docs/images/multithreading_speedup.svg

Basic usage in Python

Basic imports:

import numpy as np
from gph import ripser_parallel

Point clouds

Persistence diagram of a random point cloud of 100 points in 3D Euclidean space, up to homology dimension 2, using all available threads:

pc = np.random.random((100, 3))
dgm = ripser_parallel(pc, maxdim=2, n_threads=-1)

Distance matrices and graphs

You can also work with distance matrices by passing metric="precomputed":

from scipy.spatial.distance import pdist, squareform

# A distance matrix
dm = squareform(pdist(pc))
dgm = ripser_parallel(pc, metric="precomputed", maxdim=2, n_threads=-1)

More generally, you can work with dense or sparse adjacency matrices of weighted graphs. Here is a dense square matrix interpreted as the adjacency matrix of a fully connected weighted graph with 100 vertices:

# Entries can be negative. The only constraint is that, for every i and j, dm[i, j] ≥ max(dm[i, i], dm[j, j])
# With dense input, the lower diagonal is ignored
adj_dense = np.random.random((100, 100))
np.fill_diagonal(adj_dense, 0)
dgm = ripser_parallel(adj_dense, metric="precomputed", maxdim=2, n_threads=-1)

And here is a sparse adjacency matrix:

# See API reference for treatment of entries below the diagonal
from scipy.sparse import random
adj_sparse = random(100, 100, density=0.1)
dgm = ripser_parallel(adj_sparse, metric="precomputed", maxdim=2, n_threads=-1)

Edge Collapser

Push the computation to higher homology dimensions and larger point clouds/distance matrices/adjacency matrices using edge collapses:

dgm_higher = ripser_parallel(pc, maxdim=5, collapse_edges=True, n_threads=-1)

(Note: not all datasets and configurations will benefit from edge collapses. For more details, see our paper below.)

Weighted Rips Filtrations

Use the weights and weight_params parameters to constructed a weighted Rips filtration as defined in this paper. weights can either be a custom 1D array of vertex weights, or the string "DTM" for distance-to-measure reweighting:

dgm_dtm = ripser_parallel(pc, weights="DTM", n_threads=-1)

Documentation and Tutorials

Jupyter notebook tutorials can be found in the examples folder. The API reference can be found at https://giotto-ai.github.io/giotto-ph.

Installation

Dependencies

The latest stable version of giotto-ph requires:

  • Python (>= 3.7)

  • NumPy (>= 1.19.1)

  • SciPy (>= 1.5.0)

  • scikit-learn (>= 0.23.1)

User installation

The simplest way to install giotto-ph is using pip

python -m pip install -U giotto-ph

If necessary, this will also automatically install all the above dependencies. Note: we recommend upgrading pip to a recent version as the above may fail on very old versions.

Developer installation

Please consult the dedicated page for detailed instructions on how to build giotto-ph from sources across different platforms.

Contributing

We welcome new contributors of all experience levels. The Giotto community goals are to be helpful, welcoming, and effective. To learn more about making a contribution to giotto-ph, please consult the relevant page.

Testing

After installation, you can launch the test suite from inside the source directory

pytest gph

Citing giotto-ph

If you use giotto-ph in a scientific publication, we would appreciate citations to the following paper:

giotto-ph: A Python Library for High-Performance Computation of Persistent Homology of Vietoris–Rips Filtrations, Burella Pérez et al, arXiv:2107.05412, 2021.

You can use the following BibTeX entry:

@misc{burella2021giottoph,
      title={giotto-ph: A Python Library for High-Performance Computation of Persistent Homology of Vietoris--Rips Filtrations},
      author={Julián Burella Pérez and Sydney Hauke and Umberto Lupo and Matteo Caorsi and Alberto Dassatti},
      year={2021},
      eprint={2107.05412},
      archivePrefix={arXiv},
      primaryClass={cs.CG}
}

Community

giotto-ai Slack workspace: https://slack.giotto.ai/

Contacts

maintainers@giotto.ai

Metadata

Release files for giotto-ph 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for giotto-ph 0.2.4
File
giotto_ph-0.2.4-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
giotto_ph-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
giotto_ph-0.2.4-cp312-cp312-macosx_10_9_universal2.whl CPython 3.12 CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64) Details
giotto_ph-0.2.4-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
giotto_ph-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
giotto_ph-0.2.4-cp311-cp311-macosx_10_9_universal2.whl CPython 3.11 CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) Details
giotto_ph-0.2.4-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
giotto_ph-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
giotto_ph-0.2.4-cp310-cp310-macosx_10_9_universal2.whl CPython 3.10 CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) Details
giotto_ph-0.2.4-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
giotto_ph-0.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
giotto_ph-0.2.4-cp39-cp39-macosx_10_9_universal2.whl CPython 3.9 CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) Details
giotto_ph-0.2.4-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
giotto_ph-0.2.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
giotto_ph-0.2.4-cp38-cp38-macosx_10_9_universal2.whl CPython 3.8 CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) Details

Total release size: 8.8 MB

Release files / giotto_ph-0.2.4-cp312-cp312-win_amd64.whl

Download URL giotto_ph-0.2.4-cp312-cp312-win_amd64.whl
Size 408.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
dc8a35c3df35b00c68a5639aac647f2a2747bb7bf342e194bc0d8ab1a548d413
BLAKE2b-256 checksum
How to use checksums
b348cebadab04348f80a1ddbd703d547e40aa0504f0f1f91a0b5e36c7dd2d902
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release files / giotto_ph-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL giotto_ph-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 557.0 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
69bf73304f7a454f7144b2cee83e188f51896a9bcb9e823fa6c75aa36ca11da9
BLAKE2b-256 checksum
How to use checksums
8701d62936007ec193a3b3dc5526158a54224772f2538944747565ddc5a43884
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.14

Release files / giotto_ph-0.2.4-cp312-cp312-macosx_10_9_universal2.whl

Download URL giotto_ph-0.2.4-cp312-cp312-macosx_10_9_universal2.whl
Size 806.0 kB
Tags CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
605ff12d7e0251223ce0cb2e0f0794518ced5389e50a8fbeba7a924585931716
BLAKE2b-256 checksum
How to use checksums
168b9ba340e91990e8493683147d11e43df4ea5d5d42187e5e1efb6342e247fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release files / giotto_ph-0.2.4-cp311-cp311-win_amd64.whl

Download URL giotto_ph-0.2.4-cp311-cp311-win_amd64.whl
Size 410.0 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
0efe781aa51eded6645f62f1266e00ed72a5e81fe87b8fe8208a01d65cfeb074
BLAKE2b-256 checksum
How to use checksums
0c1d3de57bb01660df29ca783bf267b8cfb219e4e9257aaaf83d848f916e27bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release files / giotto_ph-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL giotto_ph-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 558.8 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cf044e7dd8a893abd92824989556974847ca1a7ad57345efd140870ad8f2bbd9
BLAKE2b-256 checksum
How to use checksums
5f34735317b5a23a6b47b56c2359083e2b0d3bc1a3db4d5110bbcad299769749
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.14

Release files / giotto_ph-0.2.4-cp311-cp311-macosx_10_9_universal2.whl

Download URL giotto_ph-0.2.4-cp311-cp311-macosx_10_9_universal2.whl
Size 807.4 kB
Tags CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
a583a3715d96f2eba0b706d735c19056e9fd8e8413e25a007d3ecca562812b2b
BLAKE2b-256 checksum
How to use checksums
233d658e888e7705b79f7c77aaab28f1ac928f76734e61b1b98b2df574d7f54e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release files / giotto_ph-0.2.4-cp310-cp310-win_amd64.whl

Download URL giotto_ph-0.2.4-cp310-cp310-win_amd64.whl
Size 407.0 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
d2921c1279ffbc0cfcd54574e40b37f3b81e9998fb1a3980b0c75562bd4b058e
BLAKE2b-256 checksum
How to use checksums
101dfe54d20a58ee76b7965058a417f340c86c068e6b34eab3a497c68e3d1357
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release files / giotto_ph-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL giotto_ph-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 554.6 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
8533c908b5124b13024e0e8c800a1ef9434bfd11c80b6dc9271e80e69bdfce13
BLAKE2b-256 checksum
How to use checksums
9de3c715eafeb6f34f8dd9a64c48643c5812edd41fc5f2dde5ef318bcbb07cb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.14

Release files / giotto_ph-0.2.4-cp310-cp310-macosx_10_9_universal2.whl

Download URL giotto_ph-0.2.4-cp310-cp310-macosx_10_9_universal2.whl
Size 800.3 kB
Tags CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
85158dcba2c9340508556b42a92c11b0cedffd64ecf01d196bbd9044390aebdf
BLAKE2b-256 checksum
How to use checksums
0e93236de3e9d4c6ef9d77865c189f1e675ba67623dbeefa69748cfb94b7ccf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release files / giotto_ph-0.2.4-cp39-cp39-win_amd64.whl

Download URL giotto_ph-0.2.4-cp39-cp39-win_amd64.whl
Size 406.9 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
69dbc15bf79f211abfef7226bcda5c5220efb06e67679c9a6ee37e27e7ea2daa
BLAKE2b-256 checksum
How to use checksums
a10977b260511cb4db27ae112cd264ec127c1090c26a72c972dd91d22d94e54b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release files / giotto_ph-0.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL giotto_ph-0.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 555.1 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
5b7d9788ef37b21b7d7499501b0ed8ce39ce8a1de995041b8550249c90f594f8
BLAKE2b-256 checksum
How to use checksums
f3dd488af7346685354841a3cfac499575e17f426247fa9f45d4026312f0d874
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.14

Release files / giotto_ph-0.2.4-cp39-cp39-macosx_10_9_universal2.whl

Download URL giotto_ph-0.2.4-cp39-cp39-macosx_10_9_universal2.whl
Size 800.8 kB
Tags CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
ff3f266bf13e3dda895f98d4cc4e5780668499638eb1b55e3652e3613999c27b
BLAKE2b-256 checksum
How to use checksums
1527a2b0b1b1788f551be3980cc07a20e4ca4fd3a825ad12532198ba59855e88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release files / giotto_ph-0.2.4-cp38-cp38-win_amd64.whl

Download URL giotto_ph-0.2.4-cp38-cp38-win_amd64.whl
Size 406.3 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
4b09c85b83c5744c37abab35086c163e8c6d5b2c2c899514a7b08cbe8daf721e
BLAKE2b-256 checksum
How to use checksums
449fecd5d77aefa6ec2067fdb8ed02b1551477c2ec1f55c616cf249297caac65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release files / giotto_ph-0.2.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL giotto_ph-0.2.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 554.6 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
ef990963901c2b207935c1500b1a1d504e657e04b63957f974adea416d9ace08
BLAKE2b-256 checksum
How to use checksums
26bf2c685016a1d91500833b63fa3ff5edd923477bab4d007fe4437e36ce5e22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.14

Release files / giotto_ph-0.2.4-cp38-cp38-macosx_10_9_universal2.whl

Download URL giotto_ph-0.2.4-cp38-cp38-macosx_10_9_universal2.whl
Size 799.7 kB
Tags CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
3eb1aa135b1f82b6e2d0b7beb4896c8ceb6d802053029ce1260b121711325ffd
BLAKE2b-256 checksum
How to use checksums
ff6330bcd0c9816610b8647050c86eaaa2442bc5e587b898a9d99748d7adb662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.2.4 This release

15 release files

0.2.3

12 release files

0.2.2

12 release files

0.2.1

15 release files

0.1.0

12 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page