Quick Start
The current public alpha can be installed from PyPI:
python3 -m pip install "morseframes==0.1.0a2"
For development from a source checkout, install in editable mode:
python3 -m pip install -e ".[dev]"
For documentation-only or pure-Python experiments, the optional C++ backend can be disabled:
MORSEFRAMES_DISABLE_CPP_BACKEND=1 PYTHONPATH=python python3
The minimal workflow is to build a filtered complex, compute a Morse sequence, construct a reference map, and reduce the resulting Morse frame:
import morseframes as mf
complex_ = mf.FilteredComplex.from_simplices([
([0], 0.0),
([1], 0.0),
([2], 0.0),
([0, 1], 1.0),
([1, 2], 1.0),
([0, 2], 1.0),
([0, 1, 2], 2.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())
The sequence and reference map can also be computed in one pass:
frame = mf.compute_morse_sequence_and_reference_map(
complex_,
algorithm="f-max",
)
diagram = mf.compute_morse_persistence(
complex_,
frame.sequence,
frame.references,
)
Prime-field coefficients are available by passing a prime modulus:
diagram = mf.compute_morse_persistence(
complex_,
algorithm="f-min",
modulus=3,
)
See Python API Guide, Python prime-field tutorial, and Morse Sequence Strategies for the fuller interface.