toponetx

Computing on Topological Domains

https://github.com/pyt-team/toponetx

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary

Keywords

cell-complex-neural-networks cell-complexes cellular-complex combinatorial-complex cw-complex cw-complex-networks cw-networks heterogeneous-hypergraph higher-order-message-passing higher-order-networks hypergraph-neural-networks simplicial-complex simplicial-neural-networks tensor-diagrams topological-data-analysis topological-deep-learning topological-learning topological-message-passing topological-neural-networks
Last synced: 6 months ago · JSON representation ·

Repository

Computing on Topological Domains

Basic Info
Statistics
  • Stars: 236
  • Watchers: 11
  • Forks: 44
  • Open Issues: 13
  • Releases: 4
Topics
cell-complex-neural-networks cell-complexes cellular-complex combinatorial-complex cw-complex cw-complex-networks cw-networks heterogeneous-hypergraph higher-order-message-passing higher-order-networks hypergraph-neural-networks simplicial-complex simplicial-neural-networks tensor-diagrams topological-data-analysis topological-deep-learning topological-learning topological-message-passing topological-neural-networks
Created over 3 years ago · Last pushed 6 months ago
Metadata Files
Readme License Code of conduct Citation

README.md

Computing with Relational Data Abstracted as Topological Domains

Scope and FunctionalityMain FeaturesInstalling TopoNetXGetting StartedReferencesAcknowledgements

[![Test](https://github.com/pyt-team/TopoNetX/actions/workflows/test.yml/badge.svg)](https://github.com/pyt-team/TopoNetX/actions/workflows/test.yml) [![Lint](https://github.com/pyt-team/TopoNetX/actions/workflows/lint.yml/badge.svg)](https://github.com/pyt-team/TopoNetX/actions/workflows/lint.yml) [![Codecov](https://codecov.io/gh/pyt-team/TopoNetX/branch/main/graph/badge.svg)](https://app.codecov.io/gh/pyt-team/TopoNetX) [![Docs](https://img.shields.io/badge/docs-website-brightgreen)](https://pyt-team.github.io/toponetx/index.html) [![Python](https://img.shields.io/badge/python-3.10+-blue?logo=python)](https://www.python.org/) [![license](https://badgen.net/github/license/pyt-team/TopoNetX?color=green)](https://github.com/pyt-team/TopoNetX/blob/main/LICENSE) [![slack](https://img.shields.io/badge/chat-on%20slack-purple?logo=slack)](https://join.slack.com/t/pyt-teamworkspace/shared_invite/zt-2k63sv99s-jbFMLtwzUCc8nt3sIRWjEw) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7958504.svg)](https://doi.org/10.5281/zenodo.7958504)

toponetx

Many complex systems, ranging from socio-economic systems such as social networks, over to biological systems (e.g., proteins) and technical systems can be abstracted as a set of entities with are linked to each other via a set of relations. For instance, a social network may be abstracted as a set vertices corresponding to people linked via various social interactions, including pairwise relationships such as friendships and higher-order relationships involving multiple people. This relational data can be abstracted as a topological domain such as a graph, hypergraph, simplicial, cellular path or combinatorial complex, which enables the principled analysis of such data.

TopoNetX provides a unified platform to compute with such relational data.

🎯 Scope and functionality

TopoNetX (TNX) is a package for computing with topological domains and studying their properties.

With its dynamic construction capabilities and support for arbitrary attributes and data, TopoNetX allows users to easily explore the topological structure of their data and gain insights into its underlying geometric and algebraic properties.

Available functionality ranges from computing boundary operators and Hodge Laplacians on simplicial/cell/combinatorial complexes to performing higher-order adjacency calculations.

TNX is similar to NetworkX, a popular graph package, and extends its capabilities to support a wider range of mathematical structures, including cell complexes, simplicial complexes and combinatorial complexes. The TNX library provides classes and methods for modeling the entities and relations found in higher-order networks such as simplicial, cellular, CW and combinatorial complexes. This package serves as a repository of the methods and algorithms we find most useful as we explore the knowledge that can be encoded via higher-order networks.

TNX supports the construction of many topological structures including the CellComplex, PathComplex, "ColoredHyperGraph" SimplicialComplex and CombinatorialComplex classes. These classes provide methods for computing boundary operators, Hodge Laplacians and higher-order adjacency operators on cell, simplicial and combinatorial complexes, respectively. The classes are used in many areas of mathematics and computer science, such as algebraic topology, geometry, and data analysis.

TNX is developed by the pyt-team

🛠️ Main features

  1. Dynamic construction of cell, simplicial and combinatorial complexes, allowing users to add or remove objects from these structures after their initial creation.
  2. Compatibility with the NetworkX and gudhi packages, enabling users to leverage the powerful algorithms and data structures provided by these packages.
  3. Support for attaching arbitrary attributes and data to cells, simplices and other entities in a complex, allowing users to store and manipulate a versatile range of information about these objects.
  4. Computation of boundary operators, Hodge Laplacians and higher-order adjacency operators on a complex, enabling users to study the topological properties of the space.
  5. Robust error handling and validation of input data, ensuring that the package is reliable and easy to use.
  6. Package dependencies are kept to a minimum, to facilitate easy installation and to reduce future installation issues arising from such dependencies.

🤖 Installing TopoNetX

TopoNetX is available on PyPI and can be installed using pip:

bash pip install toponetx

🦾 Getting Started

Example 1: creating a simplicial complex

```python import toponetx as tnx

Instantiate a SimplicialComplex object with a few simplices

sc = tnx.SimplicialComplex([[1, 2, 3], [2, 3, 4], [0, 1]])

Compute the incidence matrix between 1-skeleton and 0-skeleton

B1 = sc.incidence_matrix(1)

Compute the incidence matrix between 2-skeleton and 1-skeleton

B2 = sc.incidence_matrix(2) ```

Example 2: creating a cell complex

```python import toponetx as tnx

Instantiate a CellComplex object with a few cells

cx = tnx.CellComplex([[1, 2, 3, 4], [3, 4, 5, 6, 7, 8]], ranks=2)

Add an edge (cell of rank 1) after initialization

cx.add_edge(0, 1)

Compute the Hodge Laplacian matrix of dimension 1

L1 = cx.hodgelaplacianmatrix(1)

Compute the Hodge Laplacian matrix of dimension 2

L2 = cx.hodgelaplacianmatrix(2) ```

Example 3: creating a combinatorial complex

```python import toponetx as tnx

Instantiate a combinatorial complex object with a few cells

cc = tnx.CombinatorialComplex()

Add some cells of different ranks after initialization

cc.addcell([1, 2, 3], rank=2) cc.addcell([3, 4, 5], rank=2) cc.addcellsfrom([[2, 3, 4, 5], [3, 4, 5, 6, 7]], ranks=3)

Compute the incidence matrix between cells of rank 0 and 2

B02 = cc.incidence_matrix(0, 2)

Compute the incidence matrix between cells of rank 0 and 3

B03 = cc.incidence_matrix(0, 3) ```

🧑‍💻 Install from source

To install the latest version from source, follow these steps:

  1. Clone a copy of TopoNetX from source:

bash git clone https://github.com/pyt-team/TopoNetX cd TopoNetX

  1. If you have already cloned TopoNetX from source, update it:

bash git pull

  1. Install TopoNetX in editable mode (requires pip ≥ 21.3 for PEP 660 support):

bash pip install -e '.[all]'

  1. Install pre-commit hooks:

bash pre-commit install

🔍 References

TopoNetX is a part of TopoX, a suite of Python packages for machine learning on topological domains. If you find TopoNetX useful please consider citing our software paper:

@article{hajij2024topox, title={TopoX: A Suite of Python Packages for Machine Learning on Topological Domains}, author={PYT-Team}, journal={arXiv preprint arXiv:2402.02441}, year={2024} }

To learn more about topological domains, and how they can be used in deep learning:

@misc{hajij2023topological, title={Topological Deep Learning: Going Beyond Graph Data}, author={Mustafa Hajij and Ghada Zamzmi and Theodore Papamarkou and Nina Miolane and Aldo Guzmán-Sáenz and Karthikeyan Natesan Ramamurthy and Tolga Birdal and Tamal K. Dey and Soham Mukherjee and Shreyas N. Samaga and Neal Livesay and Robin Walters and Paul Rosen and Michael T. Schaub}, year={2023}, eprint={2206.00606}, archivePrefix={arXiv}, primaryClass={cs.LG} }

@misc{papillon2023architectures, title={Architectures of Topological Deep Learning: A Survey on Topological Neural Networks}, author={Mathilde Papillon and Sophia Sanborn and Mustafa Hajij and Nina Miolane}, year={2023}, eprint={2304.10031}, archivePrefix={arXiv}, primaryClass={cs.LG} }

⭐ Acknowledgements

TopoNetX has been built with the help of several open-source packages. All of these are listed in setup.py. Some of these packages include:

Funding

Partially funded by the European Union (ERC, HIGH-HOPeS, 101039827). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.

Partially funded by the National Science Foundation (DMS-2134231, DMS-2134241).

Owner

  • Name: pyt-team
  • Login: pyt-team
  • Kind: organization
  • Location: United States of America

Citation (CITATION.cff)

cff-version: 1.2.0
title: "TopoX: A Suite of Python Packages for Machine Learning on Topological Domains"
message: "If you use this software, please cite it using the metadata from this file."
type: software
authors:
  - given-names: Mustafa
    family-names: Hajij
    email: mhajij@usfca.edu
    orcid: 'https://orcid.org/0000-0002-2625-9286'
  - given-names: Mathilde
    family-names: Papillon
    email: papillon@ucsb.edu
    orcid: 'https://orcid.org/0000-0003-1674-4218'
  - given-names: Florian
    family-names: Frantzen
    email: florian.frantzen@cs.rwth-aachen.de
    orcid: 'https://orcid.org/0000-0003-0187-3738'
identifiers:
  - type: doi
    value: 10.5281/zenodo.7958503
repository-code: 'https://github.com/pyt-team'
url: 'https://pyt-team.github.io/'
abstract: >-
  We introduce TopoX, a Python software suite that provides
  reliable and user-friendly building blocks for computing
  and machine learning on topological domains that extend
  graphs: hypergraphs, simplicial, cellular, path and
  combinatorial complexes. TopoX consists of three packages:
  TopoNetX facilitates constructing and computing on these
  domains, including working with nodes, edges and
  higher-order cells; TopoEmbedX provides methods to embed
  topological domains into vector spaces, akin to popular
  graph-based embedding algorithms such as node2vec;
  TopoModelX is built on top of PyTorch and offers a
  comprehensive toolbox of higher-order message passing
  functions for neural networks on topological domains.
license: MIT
preferred-citation:
  type: article
  title: "TopoX: A Suite of Python Packages for Machine Learning on Topological Domains"
  authors:
    - given-names: Mustafa
      family-names: Hajij
      email: mhajij@usfca.edu
      orcid: 'https://orcid.org/0000-0002-2625-9286'
    - given-names: Mathilde
      family-names: Papillon
      email: papillon@ucsb.edu
      orcid: 'https://orcid.org/0000-0003-1674-4218'
    - given-names: Florian
      family-names: Frantzen
      email: florian.frantzen@cs.rwth-aachen.de
      affiliation: RWTH Aachen University
      orcid: 'https://orcid.org/0000-0003-0187-3738'
  journal: Journal of Machine Learning Research
  volume: 25
  issue: 374

GitHub Events

Total
  • Create event: 58
  • Issues event: 13
  • Release event: 2
  • Watch event: 49
  • Delete event: 56
  • Issue comment event: 83
  • Push event: 98
  • Pull request review comment event: 1
  • Pull request review event: 50
  • Pull request event: 134
  • Fork event: 13
Last Year
  • Create event: 58
  • Issues event: 13
  • Release event: 2
  • Watch event: 49
  • Delete event: 56
  • Issue comment event: 83
  • Push event: 98
  • Pull request review comment event: 1
  • Pull request review event: 50
  • Pull request event: 134
  • Fork event: 13

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 5
  • Total pull requests: 53
  • Average time to close issues: 6 months
  • Average time to close pull requests: 18 days
  • Total issue authors: 4
  • Total pull request authors: 3
  • Average comments per issue: 0.2
  • Average comments per pull request: 1.11
  • Merged pull requests: 38
  • Bot issues: 0
  • Bot pull requests: 43
Past Year
  • Issues: 4
  • Pull requests: 52
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 6 days
  • Issue authors: 4
  • Pull request authors: 3
  • Average comments per issue: 0.25
  • Average comments per pull request: 0.92
  • Merged pull requests: 37
  • Bot issues: 0
  • Bot pull requests: 43
Top Authors
Issue Authors
  • ffl096 (8)
  • gurug-dev (3)
  • devendragovil (3)
  • mhajij (2)
  • rodroadl (1)
  • iot327 (1)
  • DaminK (1)
  • rballeba (1)
  • bahramiramazan (1)
  • gm1225 (1)
  • renovate[bot] (1)
  • SnapeLiu (1)
  • viyx (1)
  • Hellsegga (1)
  • ninamiolane (1)
Pull Request Authors
  • ffl096 (61)
  • renovate[bot] (47)
  • mhajij (4)
  • USFCA-MSDS (3)
  • rballeba (3)
  • dependabot[bot] (3)
  • ninamiolane (2)
  • rodroadl (1)
  • josefhoppe (1)
  • luisfpereira (1)
Top Labels
Issue Labels
discussion (3) bug (3) good first issue (1) enhancement (1) dependencies (1)
Pull Request Labels
enhancement (22) refactor (19) bug (12) dependencies (11) documentation (2) discussion (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 738 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
pypi.org: toponetx

Computing on Topological Domains

  • Documentation: https://toponetx.readthedocs.io/
  • License: Copyright (c) 2022 pyt-team authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 0.2.0
    published about 1 year ago
  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 738 Last month
Rankings
Stargazers count: 6.7%
Forks count: 8.4%
Dependent packages count: 10.5%
Average: 21.2%
Dependent repos count: 59.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/lint.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/test.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • codecov/codecov-action v3 composite
.github/workflows/docs.yml actions
  • JamesIves/github-pages-deploy-action v4 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
  • decorator *
  • gudhi *
  • hypernetx < 2.0.0
  • networkx *
  • numpy *
  • requests *
  • scipy *
  • spharapy *
  • trimesh *