Morse sequences, reference maps, Morse complexes, and Morse-based persistent homology
Project description
MorseFrames
MorseFrames is an experimental C++ and Python library for working with Morse sequences, reference and coreference maps, Morse complexes, and Morse-based persistent homology.
Documentation is available at https://morseframes.readthedocs.io/en/latest/. New readers may want to start with the overview, quick start, and minimal examples. Please see CONTRIBUTING.md for development instructions and CITATION.cff for citation metadata.
The current codebase contains:
- a header-only C++ core for filtered simplicial complexes;
- several Morse sequence strategies, including saturated, F-Min, F-Max, same-level reduction, plateau-greedy, and flooding variants;
- reference and coreference map construction;
- Morse-reference and Morse-coreference persistence;
- ordinary persistence for validation;
- prime-field coefficients
F_pin the Python interface; - a Python API with a pure-Python fallback and optional nanobind backend;
- an experimental GUDHI-facing adapter for
Simplex_tree; - tests, examples, and reproducible benchmark drivers.
The GUDHI adapter is included to make future upstream integration easier. It
should be considered experimental, but the current native benchmark signal is
encouraging: the optimized direct Simplex_tree path is near parity with
GUDHI persistent cohomology on the tested flag complexes, and faster on the
tested grid plateau complexes for the F-Min, F-Max, and same-level strategies.
The generated tables in docs/native_gudhi_*_table.tex record the current
numbers and the reproduction commands live in docs/benchmark_reproduction.md.
Build the C++ Tests
cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failure
When the C++ GUDHI and Boost headers are available, CMake also builds optional GUDHI adapter tests, examples, and benchmarks. They can be supplied explicitly:
cmake -S . -B build \
-DMORSEFRAMES_GUDHI_INCLUDE_DIR=/path/to/gudhi/include \
-DMORSEFRAMES_BOOST_INCLUDE_DIR=/path/to/boost/include
To skip the optional GUDHI tools:
cmake -S . -B build -DMORSEFRAMES_BUILD_GUDHI_TOOLS=OFF
Python Quick Start
The Python package is installable in editable mode. This uses
scikit-build-core and nanobind to build the optional native backend:
python3 -m pip install -e .
python3 -c "import morseframes as mf; print(mf.__version__, mf.cpp_backend_available())"
For development, install the test dependency as well:
python3 -m pip install -e ".[dev]"
Example:
import morseframes as mf
complex_ = mf.FilteredComplex.from_simplices([
([0], 0.0),
([1], 0.0),
([0, 1], 1.0),
])
sequence = mf.compute_morse_sequence(complex_, algorithm="f-max")
references = mf.compute_reference_map(complex_, sequence)
diagram = mf.compute_morse_persistence(complex_, sequence, references)
print(diagram.finite_barcode())
print(diagram.essential_barcode())
Prime-field coefficients are available by passing a prime modulus:
diagram = mf.compute_morse_persistence(complex_, algorithm="f-min", modulus=3)
Python Tests
MORSEFRAMES_DISABLE_CPP_BACKEND=1 python3 -m unittest discover -s python/tests -p "test_*.py"
python3 python/examples/quickstart.py
The pure-Python fallback can still be exercised directly from the source tree without building the native backend, or by disabling the backend explicitly:
PYTHONPATH=python python3 -c "import morseframes as mf; print(mf.cpp_backend_available())"
MORSEFRAMES_DISABLE_CPP_BACKEND=1 python3 -m unittest discover -s python/tests -p "test_*.py"
Documentation
Read the Docs is configured through .readthedocs.yaml. The public
documentation is available at https://morseframes.readthedocs.io/.
The documentation can also be built locally:
python3 -m pip install -r docs/requirements.txt
sphinx-build -b html docs docs/_build/html
docs/python_api.mdsummarizes the public Python API.docs/project_overview.rstexplains the main objects and computation model.docs/minimal_examples.rstgives small copy-paste examples.docs/inspecting_morse_data.rstshows how to inspect sequences, maps, Morse complexes, and barcodes.docs/strategies.mdexplains the Morse sequence strategies and terminology.docs/python_prime_field_tutorial.mdexplains persistence overF_p.docs/cpp_complex_view_api.mddescribes the C++ complex-view interface.docs/gudhi_contribution_design_note.mdsummarizes the experimental GUDHI adapter.docs/benchmark_reproduction.mdexplains how to regenerate benchmark tables.- Generated benchmark table fragments live in
docs/*_table.tex; the scripts that regenerate them live intools/.
Citation
If you use MorseFrames in academic work, please cite it using the metadata in
CITATION.cff.
Contributing
Development and testing instructions are collected in CONTRIBUTING.md.
Release notes are collected in CHANGELOG.md.
Status
This is research code. The public API is useful for experimentation, but names and interfaces may still change while the paper and GUDHI integration mature.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file morseframes-0.1.0a1.tar.gz.
File metadata
- Download URL: morseframes-0.1.0a1.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8172938f0952850d87b595d6cffcf02902e588a32e85bc566ed975b868bc88f
|
|
| MD5 |
e9c299fe41a9a315f575ad728664c8c0
|
|
| BLAKE2b-256 |
ffad7cab86f8de93e01043229025d811e5a3472343de6021631aec995eaa1f3e
|
Provenance
The following attestation bundles were made for morseframes-0.1.0a1.tar.gz:
Publisher:
publish.yml on lnajman/morseframes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
morseframes-0.1.0a1.tar.gz -
Subject digest:
c8172938f0952850d87b595d6cffcf02902e588a32e85bc566ed975b868bc88f - Sigstore transparency entry: 1886213730
- Sigstore integration time:
-
Permalink:
lnajman/morseframes@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/lnajman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Trigger Event:
release
-
Statement type:
File details
Details for the file morseframes-0.1.0a1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: morseframes-0.1.0a1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 235.0 kB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca4198cd4ac2668fb5d80224ef72e34cdb11fe731ada44c19da1c923a2376ae7
|
|
| MD5 |
ad4511c1fc61a3ab36d173270fc49bb0
|
|
| BLAKE2b-256 |
556d11a2fc501c8aa6b7fc3fedffa8ea60474072345305acdaac6c79b544e0bc
|
Provenance
The following attestation bundles were made for morseframes-0.1.0a1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on lnajman/morseframes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
morseframes-0.1.0a1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
ca4198cd4ac2668fb5d80224ef72e34cdb11fe731ada44c19da1c923a2376ae7 - Sigstore transparency entry: 1886213862
- Sigstore integration time:
-
Permalink:
lnajman/morseframes@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/lnajman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Trigger Event:
release
-
Statement type:
File details
Details for the file morseframes-0.1.0a1-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: morseframes-0.1.0a1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 225.1 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e114ec0886a7efcf01191222f1d82ec5d6b7a66733d17551fc8ff2e7a61d1f2d
|
|
| MD5 |
55312a0e4fe9195c7c99aaec750ddcc8
|
|
| BLAKE2b-256 |
297422833353144a98efd7af1f05afa9a07f2804ce259885baf23633a7860f9c
|
Provenance
The following attestation bundles were made for morseframes-0.1.0a1-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
publish.yml on lnajman/morseframes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
morseframes-0.1.0a1-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
e114ec0886a7efcf01191222f1d82ec5d6b7a66733d17551fc8ff2e7a61d1f2d - Sigstore transparency entry: 1886213833
- Sigstore integration time:
-
Permalink:
lnajman/morseframes@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/lnajman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Trigger Event:
release
-
Statement type:
File details
Details for the file morseframes-0.1.0a1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: morseframes-0.1.0a1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 236.5 kB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95da4e1a9b1f97a5a4f21f7094c890f1bf0b385b79a99cc265fdb8c28442ae67
|
|
| MD5 |
f7a3c687aa010f21f16a93c838b2e17c
|
|
| BLAKE2b-256 |
00a020377a07bc59e25026cfdf8078d3dd64cf433a53f1be77f159e4bd6d4964
|
Provenance
The following attestation bundles were made for morseframes-0.1.0a1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on lnajman/morseframes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
morseframes-0.1.0a1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
95da4e1a9b1f97a5a4f21f7094c890f1bf0b385b79a99cc265fdb8c28442ae67 - Sigstore transparency entry: 1886213881
- Sigstore integration time:
-
Permalink:
lnajman/morseframes@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/lnajman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Trigger Event:
release
-
Statement type:
File details
Details for the file morseframes-0.1.0a1-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: morseframes-0.1.0a1-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 226.3 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3400984b8d60d4d2210996c24875331261d5cc2539a9bf18a60ddf1bc63b7e3
|
|
| MD5 |
f941ae12fa1bdd7de0f4d037f8b32b19
|
|
| BLAKE2b-256 |
0ac0129fa1dbc455af947ec1963cd17213bbe5fe2978f6b513b35b6e325a5d78
|
Provenance
The following attestation bundles were made for morseframes-0.1.0a1-cp311-cp311-macosx_11_0_arm64.whl:
Publisher:
publish.yml on lnajman/morseframes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
morseframes-0.1.0a1-cp311-cp311-macosx_11_0_arm64.whl -
Subject digest:
a3400984b8d60d4d2210996c24875331261d5cc2539a9bf18a60ddf1bc63b7e3 - Sigstore transparency entry: 1886213801
- Sigstore integration time:
-
Permalink:
lnajman/morseframes@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/lnajman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Trigger Event:
release
-
Statement type:
File details
Details for the file morseframes-0.1.0a1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: morseframes-0.1.0a1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 236.8 kB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87ab7dc9f23845915e1284faba51444030d63bc5e20c73966c6ed50e4ff06cde
|
|
| MD5 |
1c6363c71ea589125a7592f54447e30e
|
|
| BLAKE2b-256 |
e9fcc85020e60291c08966c1c86d9b95ee81a8e25183b4a4cdc127c4e7717282
|
Provenance
The following attestation bundles were made for morseframes-0.1.0a1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on lnajman/morseframes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
morseframes-0.1.0a1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
87ab7dc9f23845915e1284faba51444030d63bc5e20c73966c6ed50e4ff06cde - Sigstore transparency entry: 1886213779
- Sigstore integration time:
-
Permalink:
lnajman/morseframes@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/lnajman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Trigger Event:
release
-
Statement type:
File details
Details for the file morseframes-0.1.0a1-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: morseframes-0.1.0a1-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 226.4 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
986861c0685c66195eea52a2078b4c3a60eda01bb98105524c19727fe8ffbf37
|
|
| MD5 |
7a5754089f7d21a8a8b189392ba32a9f
|
|
| BLAKE2b-256 |
8aea733885af841af166a61eb34ef3f1520ebed54474d742f35e39f92f09dbb1
|
Provenance
The following attestation bundles were made for morseframes-0.1.0a1-cp310-cp310-macosx_11_0_arm64.whl:
Publisher:
publish.yml on lnajman/morseframes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
morseframes-0.1.0a1-cp310-cp310-macosx_11_0_arm64.whl -
Subject digest:
986861c0685c66195eea52a2078b4c3a60eda01bb98105524c19727fe8ffbf37 - Sigstore transparency entry: 1886213746
- Sigstore integration time:
-
Permalink:
lnajman/morseframes@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/lnajman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8f6f150bdf58b5cf4c72a65a5dfc302814c135e -
Trigger Event:
release
-
Statement type: