coherence_levels#

tangles.analysis.coherence_levels(tangle_matrix: ndarray)#

Calculate the coherence levels of tangles.

The coherence level of a tangle, given a tangle matrix, is the smallest index of a column where it has a zero. This corresponds to the level at which the tangles ceases to exist for the first time. In case a tangle does not have such a zero its coherence level is -1 instead.

Parameters#

tangle_matrixnp.ndarray

A (tangles x separations)-matrix encoding how a tangle orients a separation. Contains the orientation of the separation if the tangle orients the separation and otherwise 0.

Returns#

np.ndarray

The coherence levels of the tangles.