semvec/pypi-packages huggingface dataset:
morse-sequence 0.1.0
Python interface to compute Morse Sequence in C++
License: MIT
Requires Python: >=3.6
Keywords: morse, sequence, cpp, interface

# Morse-Sequence

Repository created for the report of an internship as an assistant of research at ESIEE PARIS under Mr. NAJMAN L.
Based on the library SimplexTree to compute Morse Sequences and F-Sequences from a simplicial complex.

## Prerequisites

You will first need to install the library SimplexTree either via pip or locally.
Refer to the following for more information: [simplextree-py](https://github.com/peekxc/simplextree-py)

C++ and Python compilers are also necessary.

## How to install morse_sequence

### Clone with submodules

```bash
git clone --recurse-submodules https://github.com/RussianDoggo21/Morse_Sequence.git
cd Morse-Sequence
```

### Installation (standard)

To build and install the package, run:

```bash
pip install .
```

This will compile the C++ code via Meson and install the package.

### Installation in development mode (editable)

If you want to install the package in editable mode to develop locally:

```bash
pip install --no-build-isolation --editable .
```

This allows you to modify the code without reinstalling after every change.

## Usage example

```python
from morse_sequence import MorseSequence
from simplextree import SimplexTree

st = SimplexTree([[1,2,3]]) # Creation of simplicial complex via the library SimplexTree
ms = MorseSequence(st) # MorseSequence created

morse_seq_dec, n_crit_dec = ms.ms_decreasing(st) # Computation of a decreasing Morse Sequence on st and its critical simplices
print(f"Critical simplices = {n_crit_dec}") # Critical simplices = 1
print(f"Decreasing Morse Sequence = {morse_seq_dec}") # Decreasing Morse Sequence = [((2, 3), (1, 2, 3)), ((3,), (1, 3)), ((1,), (1, 2)), [(2,)]]

morse_seq_inc, n_crit_inc = ms.ms_increasing(st) # Computation of an increasing Morse Sequence on st and its critical simplices
print(f"Critical simplices = {n_crit_inc}") # Critical simplices = 1
print(f"Increasing Morse Sequence = {morse_seq_inc}") # Increasing Morse Sequence = [[1], ([3], [1, 3]), ([2], [2, 3]), ([1, 2], [1, 2, 3])]

```