kaifczxc-lab/pysimplicial

pysimplicial is an experimental Python library for working with simplicial complexes in the context of topological neural networks

Jupyter Notebook

0

27 commits

updated Sep 25, 2026

See the code

See what people are saying

README

pysimplicial

pysimplicial, small experimental research toolkit for simplicial triangulations and topology-oriented ML experiments,

It grew out from my research report called Open-Closed State-sum Neural Network

Note: This is experimental research code for topological deep learning. Not intended for production use

Author: siritoriyowai

Stage: Early development / experimental

Installation

pip install git+https://github.com/kaifczxc-lab/pysimplicial.git

Quick Start

(The visualization results can be found in showcase)


import PySimplicial.utils
from PySimplicial.utils import Converters

conv = Converters()

octahedron_ = [(10, 50, 15),(10, 15, 25),(10, 25, 40),(10, 40, 50),(90, 15, 50),(90, 25, 15),(90, 40, 25),(90, 50, 40)]

octahedron_relabeled = conv.relabel(octahedron_)

print("Let's visualize the octahedron!")
PySimplicial.utils.visualize_triangulation_2D(octahedron_relabeled)

print("Let's modify this octahedron with Pachner Move 1-3 and visualize it!")
octahedron_modify = PySimplicial.utils.move_1_3(octahedron_relabeled)
PySimplicial.utils.visualize_triangulation_2D(octahedron_modify)

print("Let's return all back with Pachner move 3-1 and visualize it!")
octahedron_return = PySimplicial.utils.move_3_1(octahedron_modify)
PySimplicial.utils.visualize_triangulation_2D(octahedron_return)

print("Let's calculate genus of this octahedron!")
Compute_genus = PySimplicial.utils.euler_characteristics(octahedron_return)
print(f"genus={Compute_genus}")
"""
genus=0
"""

print("Let's convert this figure to into the feature vector for MLP!")

Converter = conv.to_mlp(octahedron_return, return_chi=True) # return F, V, E, g, bins[0], bins[1], bins[2], bins[3], avg_degree, tpv ; 
# Where V = unique vertices, E = unique edges, F = number of faces, g = surface genus ; bins is Histogram of vertex degrees ; avg_degree is "2 * unique edges / unique vertices" ; tpv is "Number of faces / unique vertices"
print(f"result={Converter}")
"""
result=(8, 6, 12, 0, 0, 6, 0, 0, 4.0, 1.3333333333333333)
"""

Features

Documentation

See showcase notebook to see how all functions work (visualization & logs)

Documentation can be found in Documents\Documentation-Pysimplicial

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines

computational-topology
simplicial-complexes
topological-deep-learning

Contributors

kaifczxc-lab

27 commits

kaifczxc-lab/pysimplicial

pysimplicial is an experimental Python library for working with simplicial complexes in the context of topological neural networks

Jupyter Notebook

0

27 commits

updated Sep 25, 2026

See the code

See what people are saying

README

pysimplicial

pysimplicial, small experimental research toolkit for simplicial triangulations and topology-oriented ML experiments,

It grew out from my research report called Open-Closed State-sum Neural Network

Note: This is experimental research code for topological deep learning. Not intended for production use

Author: siritoriyowai

Stage: Early development / experimental

Installation

pip install git+https://github.com/kaifczxc-lab/pysimplicial.git

Quick Start

(The visualization results can be found in showcase)


import PySimplicial.utils
from PySimplicial.utils import Converters

conv = Converters()

octahedron_ = [(10, 50, 15),(10, 15, 25),(10, 25, 40),(10, 40, 50),(90, 15, 50),(90, 25, 15),(90, 40, 25),(90, 50, 40)]

octahedron_relabeled = conv.relabel(octahedron_)

print("Let's visualize the octahedron!")
PySimplicial.utils.visualize_triangulation_2D(octahedron_relabeled)

print("Let's modify this octahedron with Pachner Move 1-3 and visualize it!")
octahedron_modify = PySimplicial.utils.move_1_3(octahedron_relabeled)
PySimplicial.utils.visualize_triangulation_2D(octahedron_modify)

print("Let's return all back with Pachner move 3-1 and visualize it!")
octahedron_return = PySimplicial.utils.move_3_1(octahedron_modify)
PySimplicial.utils.visualize_triangulation_2D(octahedron_return)

print("Let's calculate genus of this octahedron!")
Compute_genus = PySimplicial.utils.euler_characteristics(octahedron_return)
print(f"genus={Compute_genus}")
"""
genus=0
"""

print("Let's convert this figure to into the feature vector for MLP!")

Converter = conv.to_mlp(octahedron_return, return_chi=True) # return F, V, E, g, bins[0], bins[1], bins[2], bins[3], avg_degree, tpv ; 
# Where V = unique vertices, E = unique edges, F = number of faces, g = surface genus ; bins is Histogram of vertex degrees ; avg_degree is "2 * unique edges / unique vertices" ; tpv is "Number of faces / unique vertices"
print(f"result={Converter}")
"""
result=(8, 6, 12, 0, 0, 6, 0, 0, 4.0, 1.3333333333333333)
"""

Features

Documentation

See showcase notebook to see how all functions work (visualization & logs)

Documentation can be found in Documents\Documentation-Pysimplicial

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines

computational-topology
simplicial-complexes
topological-deep-learning

Contributors

kaifczxc-lab

27 commits

Languages

Jupyter Notebook

96.1%

Python

3.9%