1 Introduction

Persistent homology (Edelsbrunner et al. 2000) measures how structure (encoded as homology classes) varies with the parameter in a parameterized space. In principle, to apply this tool to data, we design parameterized combinatorial encodings in which the presence or absence of homology classes describes features of interest. In practice, it is prohibitively difficult and time-consuming to construct novel combinatorial structures which would be easy to interpret in terms of our data sets. Rather, we employ standard encodings for which theory and computational tools are readily available.

Currently, the most common approach is to take as input a pairwise dissimilarity measure \(M_P\) for system constituents \(P = \{p_1, \dots , p_n\}\) and to construct from this data a weighted clique complex \(X_P^\bullet = X(M_P)^\bullet ;\) vertices correspond to the elements in the system and simplices are weighted by the maximum pairwise dissimilarity of their vertices. When \(M_P\) is a metric, this produces the usual weighted Vietoris-Rips complex for a point cloud. We then employ computational homological algebra to determine the complex’s kth persistent reducedFootnote 1 homology, \(P\smash {\widetilde{H}}_k(X_P^\bullet ).\) Most current software returns this information in the form of a barcode, \(\text {bc}_k(X_P^\bullet )\), which encodes the homology classes and their birth and death parameters.

We are then left with the problem of interpreting the barcode. This is difficult in part due to the intricate structure of the weighted clique complexes, including trade-offs between fidelity of representations and their combinatorial and computational complexity, and in part due to the abstract nature of persistent homology classes, made up of sequences of affine subspaces of quotient vector spaces. As such, most modern applications of persistent homology involve vectorization of the barcode as a statistic for differentiating classes of data, or ad hoc interpretations of classes.

Success stories from classical algebraic topology suggest that to understand homology classes we should appeal to functoriality. By constructing maps to or from reference objects which are better understood, topologists have developed semantics for (co)homology classes in a range of contexts. Perhaps the best known classical examples are classifying maps and characteristic classes for vector bundles (Milnor 1956), which have been adapted to provide nonlinear coordinate systems for data sets (Perea 2020).

In the context of applied topology, our reference often comes in the form of more data: observations of some collection \(Q= \{q_1, \dots , q_m\}\) of inputs to, outputs from, or known correlates for activity in the system P. From a dissimilarity matrix \(M_Q\) derived from these data Q, we can obtain another combinatorial space and compute a barcode \(\text {bc}_k(X_Q^\bullet )\). When this second data set is accessible, experimentally or theoretically, we are better equipped to assign semantics to classes in \(P\smash {\widetilde{H}}_k(X_P^\bullet )\). However, a priori there is insufficient information to construct the maps we need to apply functoriality, and we are left with the problem of determining whether and how classes from \(P\smash {\widetilde{H}}_k(X_Q^\bullet )\) correspond to classes in \(P\smash {\widetilde{H}}_k(X_P^\bullet )\).

To do so, we require some notion of how P and Q are related. In scientific and engineering applications, a common and effectively minimal way to satisfy this requirement is through a measure \(M_{P,Q}\) of cross-dissimilarity between P and Q. For parameterized clique complexes, \(M_{P,Q}\) measures dissimilarity between the vertices of \(X_P^\bullet \) and \(X_Q^\bullet \). It is tempting to construct a Vietoris-Rips complex on the joint dissimilarity measure on \(P\cup Q\) given by combining \(M_P\), \(M_Q\), and \(M_{P,Q}\) and then to apply recently developed methods, including induced matching (Bauer and Lesnick 2014, 2020), cycle registration (Reani and Bobrowski 2021), or basis-independent partial matching (Gonzalez-Díaz and Soriano-Trigueros 2020), to match classes via the zig-zag of induced inclusion maps. However, as we will discuss in Sect. 3, even in simple cases involving pairs of point clouds in the same metric space this approach can fail to produce matches which satisfy our intuition.

The alternative we develop here is to observe that \(M_{P,Q}\) is precisely the data of a weighted witness complexFootnote 2 (Dowker 1952; de Silva and Carlsson 2004). The witness complex \(W_{P, Q}^\bullet \) has vertices P and faces indexed by Q: the face \(q_c\) at parameter \(\ell \) has vertices \(\{p_r \in P :\; (M_{P,Q})_{r,c} \le \ell \}\). The Functorial Dowker Theorem (Dowker 1952; Chowdhury and Mémoli 2018) provides an explicit isomorphism \(P\smash {\widetilde{H}}_k(W_{P, Q}^\bullet ) \cong P\smash {\widetilde{H}}_k(W_{Q, P}^\bullet )\), and thus our cross-dissimilarity matrix provides a bridge between persistent homology classes in simplicial complexes with vertices P and Q.

To apply this information, in Sect. 4 we introduce persistent extension, a general method for comparing persistent homology classes between complexes \(Z^\bullet \) and \(Y^\bullet \) supported on the same vertex set. Suppose \(Y^\epsilon \) is contractible for large \(\epsilon ,\) and fix some parameter \(\psi \) of \(Z^\bullet \). Persistent extension takes as input a class \([\tau ] \in \smash {\widetilde{H}}_k(Z^\psi )\) and outputs an enumeration of persistent homology classes in \(P\smash {\widetilde{H}}_k(Y^\bullet )\) that contain representatives of \([\tau ]\). To do so, we observe that classes of infinite persistence in the auxiliary filtered complex \(Z^\psi \cap Y^\bullet \) are precisely the elements of \(\smash {\widetilde{H}}_k(Z^\psi )\). We then leverage a zig-zag through the auxiliary persistence module to set up systems of linear equations that describe the image in \(P\smash {\widetilde{H}}_k(Y^\bullet )\) of all elements of \(P\smash {\widetilde{H}}_k(Z^\psi \cap Y^\ell )\) which map to \([\tau ]\) as \(\ell \rightarrow \infty .\) As it is common to speak of persistent homology in terms of the barcode, in Sect. 4.2 we develop the necessary tools to translate between the persistence module-level information and the barcodes.

In Sect. 5, we combine the isomorphism from Dowker’s theorem with persistent extension to obtain a pair of processes for relating persistent homology classes in \(P\smash {\widetilde{H}}_k(X^\bullet _Q)\) to those in \(P\smash {\widetilde{H}}_k(X^\bullet _P).\) The first, the feature-centric analogous bars method, focuses on an individual bar \(\tau \in \text {bc}_k(X^\bullet _Q)\) and enumerates subsets of \(\text {bc}_k(X^\bullet _P)\) which potentially correspond to \(\tau \) given the structure of \(M_{P,Q}\). The similarity-centric analogous bars method, on the other hand, focuses on significant features in \(\text {bc}_k(W^\bullet _{P,Q})\), which intuitively describe very strong relationships between subsets of bars in \(\text {bc}_k(X_Q^\bullet )\) and \(\text {bc}_k(X_P^\bullet )\) in the same way long lifetimes in Vietoris-Rips complexes of point clouds intuitively correspond to significant features of the support of the underlying distribution.

In this paper, we assume that all barcodes have unique birth-death pairs. This assumption allows us to efficiently enumerate all possible basis of persistent homology. Such enumeration enables the persistent extension and analogous bars methods to be independent of the choice of basis. As discussed in Sect. 4.2.3, the additional assumptions of unique death parameters and \(\mathbb {F}_2\) coefficients substantially simplifies the algorithm by removing one of the enumeration processes.

This paper is organized as follows. In Sect. 2, we recall the relevant algebraic and topological notions and set the notations and assumptions, and in Sect. 3, we discuss specific difficulties that arise when attempting to match bars between simplicial complexes, including a discussion of existing methods. Having established these preliminaries, in Sects. 4 and 5, we provide the details of the methods of persistent extension and analogous bars and demonstrate their use on simple examples. In Sect. 6 we demonstrate some simple applications: using analogous bars to compare the barcodes of two samples from the same distribution on a metric space, and using persistent extension to determine if topological structures are preserved under clustering and dimensionality reduction. Finally, in Sect. 7 we discuss context and future directions. To improve readability, we defer technical proofs to appendices.

1.1 Contributions

The principal contributions of this paper are:

  • the persistent extension method, which compares persistent homology classes and barcodes between filtered simplicial complexes built on a common vertex set,

  • the analogous bars method, which compares persistent homology classes and barcodes between two distinct clique complexes using a cross-dissimilarity measure,

  • implementation of these methods built using the Eirene persistent homology package (Henselman and Ghrist 2016), available at https://github.com/UDATG/analogous_bars, and

  • demonstration on some toy examples, along with a discussion of potential applications.

Remark 1

While the authors were writing this paper, independent work (Jacquard et al. 2022) investigating the structure of the set of bases for persistence barcodes appeared. While the fundamental aims of the two papers are different, Jacquard et al. (2022) establishes results that generalize our Lemmas 2.2.5, 2.2.6, and 4.2.3, in the course of developing a more complete picture of the relationship between persistence modules and barcodes. We retain our versions of these results in this manuscript for completeness and to save the reader effort in translating their work to our language, notation, and perspective.

2 Preliminaries

We begin by recalling relevant definitions and results from persistent homology. Along the way we will introduce some new terminology and results about change of basis of a persistence module. We assume readers are familiar with the general theory of persistent homology. A more complete development of this material can be found in, for example, Edelsbrunner et al. (2000); Zomorodian and Carlsson (2005); Carlsson (2009); Ghrist (2008). Fix a field \(\mathbb {F}\) throughout.

2.1 Primer on persistent homology

Definition 2.1.1

A persistence module is a \(\mathbb {Z}\)-graded \(\mathbb {F}\)-vector space \(V^\bullet = \bigoplus _{\ell = -\infty }^\infty V^\ell \) equipped with linear structure maps \(\{ \phi ^\ell : V^\ell \rightarrow V^{\ell + 1} \}\), thought of as a \(\mathbb {F}[x]\)-module in which x acts on elements of \(V^\ell \) via \(\phi ^\ell .\) We say a persistence module has finite support if \(V^\ell = 0\) for all \(\ell \) outside some compact interval.

We will omit the field from the notation and simply say “persistence module” throughout. Similarly, we will usually refer to a persistence module by the name of its underlying graded vector space, leaving the structure maps implicit. Finally, as all of our persistence modules have finite support, we will omit vector spaces and maps outside of the support from diagrams without further comment.

The prototypical examples of persistence modules are the interval modules.

Definition 2.1.2

For \(\beta , \delta \in \mathbb {Z}\), the interval module \(I[\beta , \delta )^\bullet \) is the persistence module \(\bigoplus _{\ell = -\infty }^\infty I[\beta , \delta )^\ell \), where

$$\begin{aligned} I[\beta , \delta )^\ell \cong {\left\{ \begin{array}{ll} \mathbb {F} &{} \beta \le \ell < \delta \\ 0 &{} \text {else}\end{array}\right. }, \end{aligned}$$

along with structure maps \(\phi ^\ell : I[\beta , \delta )^\ell \rightarrow I[\beta , \delta )^{\ell +1}\) for all \(\ell \in \mathbb {Z}\) given by

$$\begin{aligned} \phi ^\ell (f) = {\left\{ \begin{array}{ll} f &{} \ell \ne \beta -1, \delta \\ 0 &{}\text { else }\end{array}\right. }. \end{aligned}$$

Our primary example of interest arises in the context of filtered topological spaces.

Definition 2.1.3

Let

be a filtered topological space. The degree-k reduced persistent homology of \(Z^\bullet \) is the persistence module \(P\smash {\widetilde{H}}_k(Z^\bullet )\) with

$$\begin{aligned} \left( P\smash {\widetilde{H}}_k(Z^\bullet )\right) ^\ell ={\left\{ \begin{array}{ll} \smash {\widetilde{H}}_k(Z^\ell ; \mathbb {F})&{} 1 \le \ell \le N \\ 0 &{} \text{ else } \end{array}\right. } \end{aligned}$$

with structure maps given by the induced maps on reduced homology \(\iota _*^\ell \) where applicable and zero maps elsewhere.

A fundamental result in the study of persistent homology tells us that, for finite data, persistent homology can be decomposed as a collection interval modules.

Theorem 2.1.4

(Interval decomposition for persistent homology (Zomorodian and Carlsson 2005)) Let \(Z^\bullet \) be a filtered finite simplicial complex and k a non-negative integer. Then there exists a triple

$$\begin{aligned} (\text {bc}_k(Z^\bullet ), \beta , \delta ) \end{aligned}$$

called the barcode of the persistence module \(P\smash {\widetilde{H}}_k(Z^\bullet )\), where

  1. 1.

    \(\text {bc}_k(Z^\bullet )\) is a finite set whose elements we call bars,

  2. 2.

    \(\beta , \delta : \text {bc}_k(Z^\bullet ) \rightarrow \mathbb {Z}\) are functions that respectively record the birth and death parameters of each bar \(\tau \in \text {bc}_k(Z^\bullet ),\) so that

  3. 3.

    \(\beta (\tau ) < \delta (\tau )\) for all \(\tau \in \text {bc}_k(Z^\bullet )\),

that is unique up to isomorphism,Footnote 3 along with an isomorphism of persistence modules

$$\begin{aligned} \mathcal {B}: \mathbb {I}_{\text {bc}_k(Z^\bullet )} \xrightarrow {\cong } P\smash {\widetilde{H}}_k(Z^\bullet ), \end{aligned}$$

where \(\mathbb {I}_{ \text {bc}_k(Z^\bullet )} = \bigoplus _{\tau \in \text {bc}_k(Z^\bullet )} I[\beta (\tau ), \delta (\tau ))\) is the barcode module for \(Z^\bullet \) in dimension k. This isomorphism is called an interval decomposition of \(P\smash {\widetilde{H}}_k(Z^\bullet ).\)

By abuse, we will usually refer to the barcode \((\text {bc}_k(Z^\bullet ), \beta , \delta )\) using only the name of its underying set, \(\text {bc}_k(Z^\bullet ).\) Further, we will often refer to the collection of bars which are alive at a particular parameter \(\ell \in \mathbb {Z}\) by

$$\begin{aligned} \text {bc}_k(Z^\ell ) = \{\tau \in \text {bc}_k(Z^\bullet ) \, | \, \beta (\tau ) \le \ell < \delta (\tau )\}. \end{aligned}$$

The length or lifetime of a bar \(\tau \in \text {bc}_k(Z^\bullet )\) is \(\delta (\tau ) - \beta (\tau ).\) Further, for a filtered topological space with N filtration levels, when \(\delta (\tau ) = N+1\), it is common to write instead \(\delta (\tau ) = \infty \) and say that \(\tau \) has infinite length or lifetime. We will require this convention in Sect. 4.1 when we discuss a filtration for which the final level is not a contractible space.

Fig. 1
figure 1

A filtered finite simplicial complex

While the barcode \(\text {bc}_k(Z^\bullet )\) is unique, the interval decomposition is not. For example, let \(Z^\bullet \) denote the filtered simplicial complex in Figure 1. In dimension 1, the corresponding barcode module \(\mathbb {I}_{ \text {bc}_1(Z^\bullet )}\) and the persistence module \(P\smash {\widetilde{H}}_1(Z^\bullet )\) are

$$\begin{aligned}\mathbb {F}\xrightarrow {\begin{bmatrix} 1 \\ 0 \end{bmatrix}} \mathbb {F}^2 \xrightarrow {\begin{bmatrix} 0&1 \end{bmatrix}} \mathbb {F}. \end{aligned}$$

The following illustrates two possible interval decompositions \(\mathcal {B}\) and \(\mathcal {C}\).

figure a

Bars and barcodes are the central actors in our story. Throughout this paper, we will carefully think about how bars correspond to homology classes. In particular, it will be important to think about how the vector space structure on homology is reflected by the bars in a barcode. To that end, we require the following terminology regarding persistence modules.

Definition 2.1.5

Let \(V^\bullet \) be a persistence module with structure maps \(\{\phi ^\ell \}\). A persistent subspace (respectively, persistent affine subspace) of \(V^\bullet \) is given by a choice of \(\beta < \delta \in \mathbb {Z}\) and \(W^\bullet = \bigoplus _{\ell =-\infty }^\infty W^\ell \), where

  1. 1.

    \(W^\ell \subseteq V^\ell \) is a subspace (respectively, affine subspace),

  2. 2.

    \(W^\ell = 0\) if \(\ell < \beta \) or \(\ell \ge \delta \), and

  3. 3.

    \(\phi ^\ell (W^\ell ) = W^{\ell +1}\) if \(\ell \ne \beta -1, \delta -1\)Footnote 4.

That is, a persistent (affine) subspace of \(V^\bullet \) is a choice of (affine) subspaces of each \(V^\ell \) that are consistent with the structure maps and supported on a bounded intervalFootnote 5. If \(\text {dim}(W^\ell ) = d\) for some fixed d whenever \(\beta \le \ell < \delta \), we say \(W^\bullet \) is a persistent d-dimensional subspace.

Observe that given a persistence module \(P\smash {\widetilde{H}}_k(Z^\bullet )\), a bar \(\tau \in \text {bc}_k(Z^\bullet )\), and an interval decomposition \(\mathcal {B}: \mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow P\smash {\widetilde{H}}_k(Z^\bullet ),\) the image of the corresponding interval module \(I[\beta (\tau ), \delta (\tau ))\) under \(\mathcal {B}\) is a persistent 1-dimensional subspace of \(P\smash {\widetilde{H}}_k(Z^\bullet )\). Thus, another way to describe an interval decomposition is as a choice of identification of bars in the barcode with persistent 1-dimensional subspaces in the persistence module. Before we move on, it will be useful to take a closer look at what this choice entails.

2.2 The relationship between bars and homology classes

Theorem 2.1.4 describes \(P\smash {\widetilde{H}}_k(Z^\bullet )\) as a finitely generated \(\mathbb {F}[x]\)-module by providing a minimal set of generators for the module and their annihilators. While the barcode which enumerates these pairs of births and deaths is unique, the explicit identification of these generators as elements of the module is usually quite the opposite. Indeed, this is precisely a choice of basis for a finite-dimensional vector space that is compatible with the structure maps of the persistence module. Since we need cycle representatives, we must check that our constructions are invariant under this choice. Thus, we need analogues of the usual change of basis formalism from linear algebra.

Definition 2.2.1

Let \(Z^\bullet \) be a filtered topological space, and let \(\text {bc}_k(Z^\bullet )\) and \(\mathcal {B}: \mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow P\smash {\widetilde{H}}_k(Z^\bullet )\) be the barcode and interval decomposition for \(P\smash {\widetilde{H}}_k(Z^\bullet )\), made up of the following commutative diagram of vector spaces and linear isomorphisms

figure b

where \(I^\ell \) is a direct sum of copies of \(\mathbb {F}\) indexed over \(\text {bc}_k(Z^\ell )\),

$$\begin{aligned} I^\ell = \bigoplus _{\text {bc}_k(Z^\ell )}\mathbb {F}. \end{aligned}$$

For each \(\ell \in \mathbb {Z}\), let \(\{ \textbf{e}^{\; \ell }_\tau : \tau \in \text {bc}_k(Z^\ell )\}\) be the standard basis of \(\smash {I^{\ell }}\), where \(\textbf{e}^{\;\ell }_\tau \) is the standard basis vector corresponding to the \(\tau \)-summand. We call \(\textbf{e}^{\;\ell }_{\tau }\) the basis vector for \(\tau \) at \(\ell \).

Conceptually, we do not require an ordering on the bars and adding one requires another layer of notation that we would like to avoid. However, when we are working with matrix computations, it will be convenient to set a linear order \(\tau _1< \tau _2< \dots < \tau _{|\text {bc}_k(Z^\ell )|}\) on the bars alive at parameter \(\ell \). In this case, \(\smash {\textbf{e}^{\; \ell }_{\tau _r}}\) is the vector whose \(\smash {r^{\text {th}}}\) component is 1 and all other components are zero.

We can now set some terminology for the correspondence between bars in \(\text {bc}_k(Z^\bullet )\) and classes in \(P\smash {\widetilde{H}}_k(Z^\bullet )\).

Definition 2.2.2

Let \(Z^\bullet \) be a filtered topological space, and let \(\text {bc}_k(Z^\bullet )\) and \(\mathcal {B}:\mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow P\smash {\widetilde{H}}_k(Z^\bullet )\) be the barcode and interval decomposition of \(P\smash {\widetilde{H}}_k(Z^\bullet )\). Let \(\ell \in \mathbb {Z}\) and \(\tau \in \text {bc}_k(Z^{\ell })\). Take \(\textbf{e}_{\tau }^{\; \ell }\) to be the basis vector for \(\tau \) at \(\ell \). Write \([\tau ^{\mathcal {B}, \ell }] = [\mathcal {B}^\ell (\textbf{e}_{\tau }^{\;\ell })]\in \smash {\widetilde{H}}_k(Z^\ell )\) for the homology class that \(\mathcal {B}\)-corresponds to \(\tau \) at parameter \(\ell \) and say that any cycle representative of \([\tau ^{\mathcal {B}, \ell }]\) is a \(\mathcal {B}\)-representative of the bar \(\tau \) at parameter \(\ell \).

Definition 2.2.2 finds the homology class that corresponds to a given bar. Conversely, we can also find bar representations of a homology class. To that end, we first define the notion of a weighted bar.

Definition 2.2.3

A weighted bar is an element in \(\mathbb {F} \times \text {bc}_k(Z^\bullet )\).

We denote a weighted bar \((c, \tau )\) by \(c\tau \) for brevity. A bar representation is a collection of weighted bars as defined in the following.

Definition 2.2.4

Let \(Z^\bullet \) be a filtered topological space, and let \(\text {bc}_k(Z^\bullet )\) and \(\mathcal {B}:\mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow P\smash {\widetilde{H}}_k(Z^\bullet )\) be the barcode and interval decomposition of \(P\smash {\widetilde{H}}_k(Z^\bullet )\). Given any homology class \([z] \in \smash {\widetilde{H}}_k(Z^\ell )\), we say that the collection

$$\begin{aligned} S^{\mathcal {B}}_{[z]} = \{ c_1\tau _1, \dots , c_K \tau _K \; |&\; \tau _1, \dots , \tau _K \in \text {bc}_k(Z^\ell ),\\&c_1, \dots , c_K \in \mathbb {F}\setminus \{0\}, \\&[z] = \sum _{i=1}^Kc_i [\tau ^{\mathcal {B}, \ell }_{i}] \} \end{aligned}$$

is the (\(\mathcal {B}\)-)bar representation of [z] (at \(\ell \)).

We can visually represent the persistent 1-dimensional subspace generated by a \(\mathcal {B}\)-bar representation \(S_{[z]}^{\mathcal {B}} = \{c_1\tau _1, \dots , c_K\tau _K \}\) by highlighting the right half-bars of \(\tau _1, \dots , \tau _K\in \text {bc}_k(Z^\bullet )\) starting from parameter \(\ell \) (see Figs. 9 and 10 in Sect. 6 for such visual depictions). When we work with \(\mathbb {F}_2\) coefficients where bar representations are in correspondence with various subsets of the bars, this visual representation provides complete information.

The correspondence between bars and homology classes in Definitions 2.2.2 and 2.2.4 depend on the specific interval decomposition \(\mathcal {B}\). To avoid choice-dependent constructions, we consider all homology classes corresponding to \(\tau \) under different interval decompositions of \(P\smash {\widetilde{H}}_k(Z^\bullet )\). As noted, interval decompositions are vector space isomorphisms that are compatible with the structure maps. Thus, any interval decomposition \(\mathcal {C}\) of \(P\smash {\widetilde{H}}_k(Z^\bullet )\) can be obtained from a given interval decomposition \(\mathcal {B}\) by the composition \(\mathcal {C} = \mathcal {B}\circ \mathcal {L}\) for some automorphism \(\mathcal {L}: \mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow \mathbb {I}_{\text {bc}_k(Z^\bullet )}\) of the barcode module, given by the following commutative diagram of vector spaces and linear isomorphisms.

figure c

We will require the following two technical lemmasFootnote 6 to work with the set of all such automorphisms in Sect. 4.2. As their statements involve matrices, we fix linear orderings on each \(\text {bc}_k(Z^\ell )\). Let \(L^\ell \) denote the corresponding matrix for the linear automorphisms \(\mathcal {L}^\ell \), and let \(L^\ell _{r,c}\) indicate the matrix entry at row r and column c.

Lemma 2.2.5

Given a filtered topological space \(Z^\bullet \), let \(\mathcal {L}:\mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow \mathbb {I}_{\text {bc}_k(Z^\bullet )}\) be an endomorphism of its barcode module. Let \(\ell \in \mathbb {Z}\), and let \(\tau _1, \dots , \tau _{|\text {bc}_k(Z^\ell )|}\) be some ordering of the bars in \(\text {bc}_k(Z^\ell )\). If \(L^\ell _{r,c} \ne 0\) for \(r \ne c\), then the bars \(\tau _r\) and \(\tau _c\) must satisfy the relations

$$\begin{aligned} \beta (\tau _r) \le \beta (\tau _c) < \delta (\tau _r) \le \delta (\tau _c). \end{aligned}$$
(3)

Proof

Proof can be found in Proposition 16 of Bubenik and Vergili (2018). \(\square \)

Lemma 2.2.6

Given a filtered topological space \(Z^\bullet \), assume that if \(\tau \ne \tau ' \in \text {bc}_k(Z^\bullet )\) then either \(\beta (\tau ) \ne \beta (\tau ')\) or \(\delta (\tau ) \ne \delta (\tau ')\). Let \(\mathcal {L}:\mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow \mathbb {I}_{\text {bc}_k(Z^\bullet )}\) be an automorphism of the barcode module. Then \(L^\ell _{j,j} \ne 0\) for every \(1 \le j \le |\text {bc}_k(Z^\ell )|\) and \(\ell \in \mathbb {Z}\).

Proof

Deferred to Appendix A.1. \(\square \)

In Sect. 4.2, we will enumerate the matrices of isomorphisms \(\mathcal {L}^\ell \) that extend to a barcode module automorphism \(\mathcal {L}\). The following lemma will be useful.

Lemma 2.2.7

Let \(\text {bc}_k(Z^\bullet )\) be the barcode of some persistence module \(P\smash {\widetilde{H}}_k(Z^\bullet )\). Assume that \(\beta (\tau ) \ne \beta (\tau ')\) or \(\delta (\tau ) \ne \delta (\tau ')\) for all \(\tau \ne \tau ' \in \text {bc}_k(Z^\bullet )\). Given \(\ell \in \mathbb {Z}\), let \(\tau _1, \dots , \tau _{|\text {bc}_k(Z^\ell )|}\) be the bars in \(\text {bc}_k(Z^\ell )\). For \(1 \le t \le |\text {bc}_k(Z^\ell )|\), let \(L \in \mathbb {F}^{|\text {bc}_k(Z^\ell )| \times t}\) be any matrix whose entries satisfy

$$\begin{aligned} L_{r,r} \ne 0 \text { and } L_{r, c} = 0 \text { if } \beta (\tau _r)> \beta (\tau _c) \text { or } \delta (\tau _r) > \delta (\tau _c) \text { for all }r, c. \end{aligned}$$
(4)

Then, the columns of L are linearly independent.

Proof

Deferred to Appendix 1.\(\square \)

To apply the above lemmas, we will need to assume that all bars have unique birth-death pairs. To ensure that the enumeration of \(\mathcal {L}^\ell \) is finite, we assume that we are working over a finite field. If we further restrict our attention to homology with \(\mathbb {F}_2\)-coefficients, as is common in applied topology, our persistent affine subspaces will correspond to the power set of some subset of the bars in a barcode. This is appealing both for intuition building and from the perspective of studying data visually using these tools.

Therefore, for the remainder of the paper we will assume that all fields are finite and all bars have unique birth-death pairs. In addition, our computational examples will use \(\mathbb {F}_2\) -coefficients. In all cases, we will suppress the field from our notation unless we need to refer to it specifically. We will occasionally recall these assumptions when they are pertinent for our discussion.

2.3 Birth and death parameters of homology classes.

The barcode of a persistence module has been the primary method for characterizing its structure in practice, so it is common to discuss the birth and death time of bars. The same terminology is often applied to persistent homology classes only informally to avoid dealing directly with the interval decomposition. However, to work with these classes algorithmically we will need to make this terminology precise. Thus, we will use the correspondence between bars and homology classes in Definition 2.2.2 to state and describe how to compute the birth and death parameters of a class \([w]\in \smash {\widetilde{H}}_k(Z^\ell ).\)

Definition 2.3.1

Let \(P\smash {\widetilde{H}}_k(Z^\bullet )\) be a persistence module with structure maps \(\{\phi ^\ell \}\). Given a class \([w] \in \smash {\widetilde{H}}_k(Z^\ell )\), let \(W^\bullet \) be the persistent subspace of \(P\smash {\widetilde{H}}_k(Z^\bullet )\) satisfying the following:

  1. 1.

    \(W^\ell = \text {span}_\mathbb {F}\Big \{[w] \Big \}\)

  2. 2.

    \(W^i = \text {span}_\mathbb {F}\Big \{ [x] \in \smash {\widetilde{H}}_k(Z^i) \; | \; [w] = \phi ^{\ell -1} \circ \cdots \circ \phi ^{i} ([x]) \Big \} \) for \(i < \ell \)

  3. 3.

    \(W^i = \phi ^{i-1}(W^{i-1})\) for \(i > \ell .\)

The birth and death parameters of [w] are given by \(\beta ([w]) = \min \{i \le \ell \; | \; W^i \ne 0 \} \) and \(\delta ([w])= \min \{i > \ell \; | \; W^i =0 \}.\)

That is, \(W^\bullet \) is the maximal persistent subspace of \(P\smash {\widetilde{H}}_k(Z^\bullet )\) containing [w]. To compute the birth and death parameters, we use the following lemma.

Lemma 2.3.2

Given a persistence module \(P\smash {\widetilde{H}}_k(Z^\bullet )\), let \(\mathcal {B}: \mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow P\smash {\widetilde{H}}_k(Z^\bullet )\) be any interval decomposition. Given \([w] \in \smash {\widetilde{H}}_k(Z^\ell )\), express [w] using the bars alive at \(\ell \) as \([w] = \sum _{\tau \in \text {bc}_k(Z^\ell )} f_\tau [\tau ^{\mathcal {B}, \ell }]\) for some coefficients \(f_\tau \in \mathbb {F}\). The birth and death times of [w] are given by \(\max \{ \beta (\tau ) \; | \; \tau \in \text {bc}_k(Z^\ell ) \text { and } f_\tau \ne 0\}\) and \(\max \{ \delta (\tau ) \; | \; \tau \in \text {bc}_k(Z^\ell ) \text { and }f_\tau \ne 0 \},\) respectively.

Note that even though we fix an interval decomposition \(\mathcal {B}\) for the computation, the birth and death times of [w] is independent of the choice of \(\mathcal {B}\). The proof of this lemma is not particularly enlightening to read, so we leave it as an exercise to the interested reader.

2.4 Clique and witness complexes

In this paper we restrict our attention to two special classes of filtered topological spaces: filtered clique complexes and filtered witness complexes. The former is the standard tool for constructing simplicial complexes from data represented by a collection of pairwise dissimilarity measures among elements of a population. The ubiquitous example is the filtered Vietoris-Rips complex of a point cloud in a metric space. The latter is less commonly used but naturally encodes common cross-population dissimilarity measures in a fashion that is compatible with the usual applications of the clique complex.

Definition 2.4.1

Let A be an \((n \times n)\) matrix with zero diagonal and N unique non-negative real off-diagonal entries \(\alpha _1< \dots < \alpha _N\). The (filtered) clique complex for A is the filtered simplicial complex \(X(A)^\bullet \) where \(X(A)^\ell \) has vertices \([n] = \{1, \dots , n\}\) and faces \(\{\sigma \subseteq 2^{[n]}\;:\; \max _{\{r,c\}\in \sigma }A_{r,c} \le \alpha _\ell \}.\)

Our standard context for constructing a clique complex will involve a population \(P = \{p_1, \dots p_n\}\) endowed with a pairwise dissimilarity matrix \(M_P\). In this case, we will write \(X_P^\bullet \) for \(X(M_P)^\bullet .\)

Definition 2.4.2

(Dowker 1952; de Silva and Carlsson 2004; Chowdhury and Mémoli 2018) Let B be an \((n \times m)\) matrix with N unique non-negative real entries \(\beta _1< \dots < \beta _N\). The (filtered) witness complex of B is the filtered simplicial complex \(W(B)^\bullet \) where \(W(B)^\ell \) has vertices \([n] = \{1, \dots , n\}\) and faces \(\{\{r \in [n]: B_{r,c} \le \beta _\ell \} \;:\; c \in [m]\}.\) We refer to the set [n] as the set of landmarks and [m] as the set of witnesses.

Note that some of the faces of \(W(B)^\ell \) may be duplicates or subfaces of other faces. When working with two populations \(P = \{p_1, \dots p_n\}\) and \(Q = \{q_1, \dots q_m\}\) equipped with a \((n \times m)\) cross-dissimilarity matrix \(M_{P,Q}\), we will write \(W_{P, Q}^\bullet \) for \(W(M_{P,Q})^\bullet .\)

The apparent asymmetry between rows and columns—the sets of landmarks and witnesses—in the construction may seem off-putting: there’s no intrinsic reason to choose one of P or Q as the vertex set. Fortunately, this choice no longer matters once we pass to persistent homology.

Theorem 2.4.3

(Functorial Dowker Theorem (Dowker 1952; Chowdhury and Mémoli 2018), paraphrased) Let B be an \((n \times m)\) matrix with non-negative real entries. Then \(P\smash {\widetilde{H}}_k(W(B)^\bullet ) \cong P\smash {\widetilde{H}}_k(W(B^T)^\bullet )\) as persistence modules for every dimension k. In particular \(\text {bc}_k(W(B)^\bullet ) \cong \text {bc}_k(W(B^T)^\bullet ).\)

This result is remarkable: it states that the roles of landmark and witness are interchangeable from a topological perspective. Dowker’s theorem was originally stated for unweighted complexes, and it has been extended to the persistent homology setting (Chowdhury and Mémoli 2018). Further, the isomorphism is explicit, so we can compute it. We will leverage this perspective shift as a foundation for comparing barcodes across populationsFootnote 7.

Note for both \(X_P^\bullet \) and \(W_{P,Q}^\bullet \), the corresponding persistence modules are necessarily finitely generated. Therefore, their homology groups are finite-dimensional vector spaces. Further, observe that both \(X_P^\bullet \) and \(W_{P,Q}^\bullet \) are contractible for large enough filtration parameters. Since we are working with reduced homology, neither construction admits a bar \(\tau \) with \(\delta (\tau ) = \infty .\)

3 Understanding the problem

Now that we have the appropriate language, we pause to discuss more thoroughly the motivation for this work. Recall that we are interested in comparing two populations, \(P = \{p_1, \dots , p_n\}\) and \(Q = \{q_1, \dots , q_m\}\); for example, P and Q can represent point clouds sampled from some distributions on metric spaces or agents in some complex systems. We will take as our data three matrices: \(M_P\) and \(M_Q\), symmetric non-negative dissimilarity matrices for P and Q, and \(M_{P,Q}\), a non-negative \((n \times m)\) matrix whose (rc) entry measures dissimilarity between \(p_r \in P\) and \(q_c \in Q\).

Suppose now that we compute the degree k persistent homology of the clique complexes \(X_P^\bullet \) and \(X_Q^\bullet \) and obtain barcodes \(\text {bc}_k(X^\bullet _P)\) and \(\text {bc}_k(X^\bullet _Q).\) Given a bar of interest \(\tau \in \text {bc}_k(X^\bullet _P),\) corresponding to some 1-dimensional persistent subspace of \(P\smash {\widetilde{H}}_k(X^\bullet _P)\), how can we determine which bars in \(\text {bc}_k(X^\bullet _Q)\) represent topological features similar to \(\tau \), as measured by \(M_{P,Q}\)?

Perhaps the most straightforward option is to apply recently developed methods for comparing barcodes using the functoriality of homology, including induced matching (Bauer and Lesnick 2014, 2020), cycle registration (Reani and Bobrowski 2021), basis-independent partial matching (Gonzalez-Díaz and Soriano-Trigueros 2020), or quiver-representations of correspondences (Takeuchi 2021). In this section, we take P and Q as point clouds in a common metric space to explore why these methods may not provide the answers a practitioner might expect or desire.

3.1 The problem of comparing clique complexes on P and Q

First, let us briefly recall how the above-mentioned methods work. Given a map of persistence modules \(f: U^\bullet \rightarrow V^\bullet \), induced matching (Bauer and Lesnick 2014, 2020; Bauer and Schmahl 2021) factorizes f as \(U^\bullet \twoheadrightarrow \left( \text {im } f\right) ^\bullet \hookrightarrow V^\bullet \) and defines a matching between \(\text {bc}_k(U^\bullet )\) and \(\text {bc}_k(V^\bullet )\) via canonical injections through \(\text {bc}_k((\text {im }f)^\bullet )\). The canonical injections match bars only when their endpoints are aligned. Cycle registration (Reani and Bobrowski 2021) uses induced matching to find matchings between \(\text {bc}_k(U^\bullet )\) and \(\text {bc}_k(V^\bullet )\) given maps of the form \(U^\bullet \rightarrow Y^\bullet \leftarrow V^\bullet \). Basis-independent partial matching (Gonzalez-Díaz and Soriano-Trigueros 2020), on the other hand, considers the map \(f: U^\bullet \rightarrow V^\bullet \) as a commutative diagram and reports the dimension of the appropriate subspace that corresponds to given bars in \(\text {bc}_k(U^\bullet )\) and \(\text {bc}_k(V^\bullet )\). Lastly, if X and Y are topological spaces with a continuous map \(g: X \rightarrow Y\) and P is a finite sample of X, then one can use quiver-representations of correspondences (Takeuchi 2021) to approximate \(g_*: H_k(X) \rightarrow H_k(Y)\) from the sampled data \(g|_P\). We can adapt this construction to the context of persistent homology by considering maps of persistence modules \(PH_k(X^\bullet ) \leftarrow PH_k(G^\bullet ) \rightarrow PH_k(Y^\bullet ),\) where \(G^\bullet \) represents a filtered simplicial complex associated to the graph of the sampled map \(g|_P\).

When we have access to explicit maps on persistence modules or maps on finite samples of topological spaces, these methods provide the best possible comparison of topological features; they recapitulate the usual functoriality on homology in the context of barcodes. However, we often build our persistence modules using samples from unknown distributions on unknown spaces, so the required maps of persistence modules of the form \(U^\bullet \rightarrow V^\bullet \) or \(U^\bullet \rightarrow Y^\bullet \leftarrow V^\bullet \) are not known. Indeed, if the point clouds P and Q represent time series data on two different systems, there may not be an explicit map between P and Q at all.

In simple cases, we might still attempt to impute the necessary maps from the data. If \(P = \{p_1, \dots , p_n\}\) and \(Q = \{q_1, \dots q_m\}\) are sampled from a common metric space, then the metric provides enough information to naïvely construct a diagram of persistence modules as

$$\begin{aligned} P\smash {\widetilde{H}}_k(X_P^\bullet ) \rightarrow P\smash {\widetilde{H}}_k(X_{P\cup Q}^\bullet ) \leftarrow P\smash {\widetilde{H}}_k(X_Q^\bullet ). \end{aligned}$$
(5)

However, attempts to apply the above-listed methods to this diagram suffer from two major issues.

First, the lifetimes of the topological features in P and Q must be very closely aligned in the parameter range. Consider two probability distributions on an annulus illustrated in green on the top of Fig. 2. Let P and Q be samples from the two probability distributions. Because they surround the hole in the middle of the annulus, we intuit that the two samples share a common topological feature. However, as the bottom panel in as Fig. 2 illustrates, the bars in \(\text {bc}_1(X_{P\cup Q}^\bullet )\) and \(\text {bc}_1(X_Q^\bullet )\) are not aligned because the scale of the two point clouds is different. As a result, existing methods will fail to identify the longest bar in \(\text {bc}_1(X_P^\bullet )\) with the longest bar in \(\text {bc}_1(X_Q^\bullet )\), even though intuition suggests they represent the same feature. When working with measurements taken from multiple sources, different calibrations of instruments or small changes in experimental conditions could easily result in these kinds of shifts in scale.

Fig. 2
figure 2

Complexities arise in applying induced matching with related point clouds. (top) Point clouds P, Q, R sampled on an annulus. P is sampled from the distribution in green concentrated around the inner boundary, while Q and R are sampled from identical, centrally concentrated distributions. (bottom) Barcodes in dimension 1 for the Vietoris-Rips complexes of the point clouds P, \(P\cup Q\), Q, \(Q \cup R\), and R. Because the unique bar in \(\text {bc}_1(X_Q^\bullet )\) is misaligned with the others, induced matching through the unions will fail to identify the feature in Q with non-trivial features in either P or R. Blue bars indicate the only possible induced match between \(\text {bc}_1(X_{Q \cup R}^{\bullet })\) and \(\text {bc}_1(X_R^{\bullet })\)

The second issue with the construction in Eq. 5 is that we must have a dense sample of points to ensure that persistent features have similar scale. Consider the populations Q and R in Fig. 2 sampled from the same distribution. Each individual point cloud has a barcode that suggests a strong 1-dimensional feature. However, when we apply induced matching, only the highlighted blue bars in \(\text {bc}_1(X^\bullet _{Q \cup R})\) and \(\text {bc}_1(X^\bullet _R)\) can possibly match; the unique bar in \(\text {bc}_1(X^\bullet _Q)\) does not have any matching due to an apparent scale difference. Note, however, that P and R can be matched using existing methods; thus, the existence or non-existence of a matching is unreliable even in this simple setting.

3.2 The problem of comparing clique complexes and witness complex

Some of the earliest papers in applied topology suggest an alternative to the union for investigating the relationship between two point clouds in a common metric space: the witness complex \(W_{P, Q}^\bullet \) (de Silva and Carlsson 2004). Empirically, witness complexes have been observed to mitigate many (though not all) of the issues with scale and density we describe above. However, we no longer have an inclusion map and cannot directly apply induced matching to compare persistent homology.Footnote 8

Simple examples show that features in \(\text {bc}_k(W^\bullet _{P,Q})\) need not correspond in any meaningful way to those in \(\text {bc}_k(X^\bullet _P)\). Taking P and Q to be dense samples from complementary semi circles on the unit circle, the barcode \(\text {bc}_1(W_{P,Q}^\bullet )\) will have a single nontrivial bar, while \(\text {bc}_1(X^\bullet _P)\) and \(\text {bc}_1(X^\bullet _Q)\) will both be empty. On the other hand, taking P to be concentrated along the equator of a sphere and at its poles, and Q only at the poles, \(\text {bc}_1(W_{P,Q}^\bullet )\) will be empty while \(\text {bc}_1(X_P^\bullet )\) will have a persistent bar. To get traction, we will need a method for comparing homology classes between these complexes.

In Sect. 4, we propose a solution to this problem we call the persistent extension method. Persistent extension uses a zig-zag through the intersection of two simplicial complexes on the same vertex set to identify classes which contain identical representatives at the chain level for some range of parameters, thus identifying topological features one could reasonably consider to be “the same.” In Sect. 5, we apply this method and Dowker’s theorem to develop the method of analogous bars, which provides our desired method for comparing topological features of \(X_P^\bullet \) and \(X_Q^\bullet \) using only the data in the cross-dissimilarity measure \(M_{P,Q}.\)

4 Persistent extension

In this section, we develop the persistent extension method for comparing persistent homology classes between two filtered simplicial complexes supported on the same vertex set P. In Sect. 4.1, we introduce the class-to-class extension method, which, given a homology class in one simplicial complex, enumerates classes in the other that share its cycle representatives. In Sect. 4.2, we extend this algorithm to a bar-to-bars extension method, which, given a bar in one barcode, enumerates representations in the other barcode. In Sect. 4.3 we discuss considerations for reducing the computational overhead of applying the persistent extension method.

4.1 class-to-class extension

Suppose \(Z^\bullet \) and \(Y^\bullet \) are filtered simplicial complexes on vertices P. Fix some parameter \(\psi \) and take \([\tau ] \in \smash {\widetilde{H}}_k(Z^\psi )\). The goal of the class-to-class extension is to find all parameters \(\ell \) and classes \([y] \in \smash {\widetilde{H}}_k(Y^\ell )\) for which \([\tau ]\) and [y] share cycle representatives. We begin by setting some terminology with which to describe the steps in our algorithm.

To simplify this section, we assume that the filtered simplicial complex \(Y^\bullet \) has the property that \(Y^N\) is the complete simplex on its vertices, as is the case for both clique and witness complexes as defined in Sect. 2.4. It is straightforward but tedious to modify the following for settings where this is not the case.

Definition 4.1.1

Let \(Z^\bullet \) and \(Y^\bullet \) be filtered simplicial complexes on common vertex set P and fix a parameter \(\psi \) of \(Z^\bullet \). Given a parameter \(\ell \), let \(\chi _{\ell }\) and \( \Upsilon _{\ell }\) each denote the following induced maps

$$\begin{aligned}\smash {\widetilde{H}}_k(Z^{\psi }) \xleftarrow {\chi _{\ell }} \smash {\widetilde{H}}_k(Z^{\psi } \cap Y^\ell ) \xrightarrow {\Upsilon _{\ell }} \smash {\widetilde{H}}_k(Y^\ell ).\end{aligned}$$

Given a homology class \([\tau ] \in \smash {\widetilde{H}}_k(Z^\psi )\), define the set of restrictions (of \([\tau ]\)) at \(\ell \) as

$$\begin{aligned} R_{\ell } = \{ [w] \in \smash {\widetilde{H}}_k(Z^{\psi } \cap Y^\ell ) \, | \, \, [\tau ] = \chi _{\ell } [w] \}, \end{aligned}$$

and define the set of class extensions (of \([\tau ]\)) at \(\ell \) as

$$\begin{aligned} E_{\ell } = \{ [y] \in \smash {\widetilde{H}}_k(Y^\ell ) \, | \, [y] = \Upsilon _{\ell } [w] \text { for } [w] \in R_{\ell } \}. \end{aligned}$$

We refer to any \([y] \in E_\ell \) for which \([y] = \Upsilon _{\ell } [w]\) as a class extension (via [w]). We refer to \(E = \bigcup _{\ell } E_{\ell }\) as the set of class extensions (of \([\tau ]\)).

For a fixed parameter \(\ell \), the set \(R_\ell \) can be expressed as the solution to a chain-level linear equation, and \(E_\ell \) is then given by the solutions to a set of linear equations indexed by \(R_\ell \). To naively compute E, we would have to iterate this process across every parameter \(\ell \), which would be infeasible for even moderately sized data. However, the following two lemmas characterize how restrictions and class extensions at different parameters are related, allowing us to limit our computations to a much smaller set of linear systems.

Given parameters \({\ell } \le \ell '\), let

$$\begin{aligned} \eta ^{\ell }_{\ell '}:&\quad \smash {\widetilde{H}}_k(Z^{\psi } \cap Y^\ell ) \rightarrow \smash {\widetilde{H}}_k(Z^{\psi } \cap Y^{\ell '}), \\ \lambda ^{\ell }_{\ell '}:&\quad \smash {\widetilde{H}}_k(Y^\ell ) \rightarrow \smash {\widetilde{H}}_k(Y^{\ell '}) \end{aligned}$$

denote the structure maps for the persistence modules, induced by inclusion.

Lemma 4.1.2

Let \(Z^\bullet , Y^\bullet \) be filtered simplicial complexes on a common vertex set P. Given \([\tau ] \in \smash {\widetilde{H}}_k(Z^\psi )\), fix parameter \({\ell }\) and let \([y] \in \smash {\widetilde{H}}_k(Y^\ell )\) be a class extension of \([\tau ]\) at \(\ell \) via some \([w] \in \smash {\widetilde{H}}_k(Z^{\psi } \cap Y^\ell ) \). If \(\ell ' > {\ell }\), then \(\lambda ^{\ell }_{\ell '}[y]\) is a class extension of \([\tau ]\) at \(\ell '\) via \(\eta ^{\ell }_{\ell '}[w]\).

That is, any class extension at \(\ell \) passes to a class extension at any later parameter \({\ell '}\) via the structure maps.

Lemma 4.1.3

Let \(Z^\bullet , Y^\bullet \) be filtered simplicial complexes on a common vertex set P. Given \([\tau ] \in \smash {\widetilde{H}}_k(Z^{\psi })\), let \([y'] \in \smash {\widetilde{H}}_k(Y^{\ell '})\) be a class extension of \([\tau ]\) at \(\ell '\) via some \([w'] \in \smash {\widetilde{H}}_k(Z^\psi \cap Y^{\ell '})\). Assume that there exists a parameter \(\ell < \ell '\) and \([w] \in \smash {\widetilde{H}}_k(Z^\psi \cap Y^{\ell })\) such that \(\eta ^{\ell }_{\ell '}[w] = [w']\). Then, there exists a class extension \([y] \in \smash {\widetilde{H}}_k(Y^\ell )\) of \([\tau ]\) at \(\ell \) via [w] satisfying \([y'] = \lambda ^{\ell }_{\ell '}[y]\).

The proofs of both lemmas follows directly from commutativity of the relevant diagrams of structure maps and morphisms induced by inclusions. Details are left to the interested reader.

Lemma 4.1.3 states that if a restriction \([w']\) is in the image of the structure map \(\eta ^{\ell }_{\ell '},\) then any class extension at parameter \({\ell '}\) via \([w']\) is in the image of the structure map \(\lambda ^{\ell }_{\ell '},\) so this extension is induced by an extension at \(\ell .\)

In particular, suppose \([w] \in \smash {\widetilde{H}}_k(Z^{\psi } \cap Y^\ell )\) is a restriction at \(\ell \). Let \(\hat{\beta }[w] \le \ell \) denote the birth parameter of [w] in \(P\smash {\widetilde{H}}_k(Z^\psi \cap Y^\bullet )\). Then, there exists some \([\hat{w}] \in \smash {\widetilde{H}}_k(Z^\psi \cap Y^{\hat{\beta }[w]})\) satisfying \([w] = \eta ^{\hat{\beta }[w]}_{\ell } [\hat{w}]\). Let \([\hat{y}]\) be a class extension of \([\tau ]\) at \(\hat{\beta }[w]\) via \([\hat{w}]\). Together, Lemmas 4.1.2 and 4.1.3 tell us that any class extension [y] of \([\tau ]\) at \({\ell }\) via [w] must satisfy \([y] = \lambda ^{\hat{\beta }[w]}_{\ell }[\hat{y}]\). That is, in order to find class extensions of \([\tau ]\) via [w] at all parameters, it suffices to find the class extensions via \([\hat{w}]\) at \(\hat{\beta }[w]\).

We leverage this observation to enumerate all possible class extensions while considering only a substantially restricted set of parameters. To do so, we utilize the auxiliary filtration

$$\begin{aligned} Z^{\psi } \cap Y^\bullet : Z^{\psi } \cap Y^{1} \rightarrow Z^{\psi } \cap Y^{2} \rightarrow \cdots \rightarrow Z^{\psi } \cap Y^{N} = Z^{\psi } \end{aligned}$$
(6)

along with its barcode \({(\text {bc}_k(Z^{\psi } \cap Y^\bullet ), \widehat{\beta }, \widehat{\delta })}\). The benefit of using this filtration is that if \(\widehat{\delta }(\rho ) = \infty \) for \(\rho \in \text {bc}_k(Z^{\psi } \cap Y^\bullet ),\) then \(\rho \) corresponds to a homology class in \(\smash {\widetilde{H}}_k(Z^{\psi })\) under any choice of interval decomposition of \(P\smash {\widetilde{H}}_k(Z^\psi \cap Y^\bullet )\).

We now refer the reader to Algorithm 1, where we describe the class-to-class extension method in full. In step (1), we compute the auxiliary filtration in Eq. 6. In step (2), we find the collection of parameters that correspond to the birth times of all restrictions of \([\tau ]\). In step (3), we find all restrictions at a given birth parameter and find the corresponding class extensions.

figure d

There are several facets of Algorithm 1 that require justification. We need to show that the collections \(p_Y\) and \(\mathfrak {R}^{\mathcal {F}}_{\ell }\) are independent of the choice of interval decomposition \(\mathcal {F}\) of \(P\smash {\widetilde{H}}_k(Z^\psi \cap Y^\bullet )\), that the affine subspace \(\mathfrak {R}^{\mathcal {F}}_{\ell }\) coincides with the set \(R_{\ell }\) of restrictionsFootnote 9 as defined in Definition 4.1.1, and that the output \(\mathfrak {E}\) of the algorithm provides the complete set E of class extensions of \([\tau ]\) from Definition 4.1.1, as stated in the following Theorem.

Theorem 4.1.4

Let \(Z^\bullet , Y^\bullet \) be filtered simplicial complexes on a common vertex set P. Fix a parameter \(\psi \) and homology class \([\tau ] \in \smash {\widetilde{H}}_k(Z^\psi )\). The output of Algorithm 1 suffices to recover all class extensions of \([\tau ]\). That is, let E be the set of all class extensions of \([\tau ]\) per Definition 4.1.1. Given parameters \(\ell < \ell '\), let \(\lambda ^{\ell }_{\ell '}: \smash {\widetilde{H}}_k(Y^{\ell }) \rightarrow \smash {\widetilde{H}}_k(Y^{\ell '})\) be the map induced by inclusion. Let

$$\begin{aligned}\mathfrak {E}^* = \{[y] \in \smash {\widetilde{H}}_k(Y^{\ell '}) \; | \; \text { there exists }\ell \in p_Y, [y_{\ell }] \in \mathfrak {E}_{\ell } \text { such that } [y] = \lambda ^{\ell }_{\ell '}([y_{\ell }]) \},\end{aligned}$$

where \(p_Y\) and \(\mathfrak {E}= \cup _{\ell \in p_Y} \mathfrak {E}_\ell \) are the outputs of Algorithm 1. Then \(E = \mathfrak {E}^*\).

The proof is technical, so we defer it to Appendix B where we break it down into a sequence of smaller theorems, and we instead proceed with an example that illustrates the method.

Example 1

We visualize the key steps of Algorithm 1 using a set of points P sampled from a flat torus and a set of points Q sampled near a essential circle on that torus, as depicted in Fig. 3. We assume that homology is computed with \(\mathbb {F}_2\) coefficients and that all bars have unique birth-death pairs.

Let \(Z^\bullet = W^\bullet _{P,Q}\), the Witness filtration with P as landmarks and Q as witnesses computed from the cross-dissimilarity matrix \(M_{P,Q}\), and let \(Y^\bullet = X^\bullet _P,\) computed from the pairwise dissimilarity matrix \(M_P\). Let \([\tau ] \in \smash {\widetilde{H}}_1(W^\psi _{P,Q})\) be the homology class illustrated in Fig. 3.

We now execute Algorithm 1. The right panel in Fig. 3 illustrates the barcode \(\text {bc}_1(W_{P,Q}^\psi \cap X^\bullet _P)\), and we will refer to it throughout. In step (1), we fix an interval decomposition \(\mathcal {F}: \mathbb {I}_{\text {bc}_1(W_{P,Q}^{\psi } \cap X^\bullet _P)} \rightarrow P\smash {\widetilde{H}}_1(W_{P,Q}^{\psi } \cap X^\bullet _P)\). In step (2), we gather information about this barcode. For our choice of \(\mathcal {F}\), the unique \(\mathcal {F}\)-bar representation of \([\tau ]\) at N is \(S^{\mathcal {F}}_{[\tau ]} = \{ \rho _1\}\), where \(\rho _1\) is the green bar. The parameter \(\ell _0 = \hat{\beta }(\rho _1)\) at which this bar is born is indicated by the vertical dotted line. Note that \(\ell _0\) is the minimum parameter at which there exists a restriction of \([\tau ]\). The set \(\text {{bars}}_{> \ell _0}\) consists of the blue bars above the green bar, each being born and dying within the interval \((\ell _0, \infty )\). Finally, take our list of parameters \(p_Y\) to be the set of birth times of the green and blue bars. The collection \(p_Y\) corresponds to the birth parameters of restrictions of \([\tau ]\) in \(P\smash {\widetilde{H}}_k(Z^\psi \cap Y^\bullet )\).

For step (3), we take \(\textsc {bars}_{\text {short}}\) to be the set of all bars that die after the green bar is born. In the first pass through the loop in step (3-b), taking \(\ell _0 \in p_Y\) as our parameter, the purple bars in Fig. 3 indicate the intervals \(\textsc {bars}^{\ell _0}_{\text {short}} = \{ \rho _2, \dots , \rho _{15} \}\) selected in step (3-b-i). The restrictions at \(\ell _0\) in step (3-b-iii) thus constitute the affine subspace

$$\begin{aligned} \mathfrak {R}_{\ell _0} = \{ [\rho _1^{\mathcal {F}, \ell _0}] + c_2[\rho _2^{\mathcal {F}, \ell _0}] + \dots + c_{15} [\rho _{15}^{\mathcal {F}, \ell _0}] \, | \, c_2, \dots , c_{15} \in \mathbb {F}_2 \}.\end{aligned}$$

The inset panel in Fig. 3 illustrates cycle representatives of \([\rho _1^{\mathcal {F}, \ell _0}]\) in green and \([\rho _2^{\mathcal {F}, \ell _0}]\) in purple. Here, we report the default cycle representatives returned by software Eirene (Henselman and Ghrist 2016). While the algorithm is independent of the cycle representatives, we included the illustrations to show that elements of \(\mathfrak {R}_{\ell _0}\) are homology classes that are similar to \([\tau ]\). Note that both \([\rho _1^{\mathcal {F}, \ell _0}]\) and \([\rho _1^{\mathcal {F}, \ell _0}] + [\rho _2^{\mathcal {F}, \ell _0}]\) describe homology classes whose representatives are similar to that of \([\tau ]\); the latter is simply a deformation of the former to pass through a local cycle with short lifetime. Indeed, all elements of \(\mathfrak {R}_{\ell _0}\) are such deformations. Finally, in step (3-b-iv), we push these into \(\smash {\widetilde{H}}_k(Y^{\ell _0})\) as elements in \(\mathfrak {E}_{\ell _0}\), which is the collection of class extensions at \(\ell _0\).

Step 3(b) repeats the above process for all \(\ell \in p_Y\). For a fixed \(\ell \), the set \(\mathfrak {R}_{\ell }\) corresponds to the set of restrictions at \(\ell \), and \(\mathfrak {E}_{\ell }\) corresponds to the set of class extensions at \(\ell \).

Fig. 3
figure 3

Elements of Algorithm 1 in Example 1. (left) Grey points P sampled from a flat torus and blue points Q sampled near an essential circle of that torus, along with a representative \(\tau \) of a class \([\tau ]\in \smash {\widetilde{H}}_1(W^\psi _{P,Q})\) that represents the essential circle. (right) The barcode of the auxiliary filtration, \(\text {bc}_1(W^\psi _{P,Q}\cap X^\bullet _P)\). For a fixed interval decomposition \(\mathcal {F}\) of \(\text {bc}_1(W^\psi _{P,Q}\cap X^\bullet _P)\), the long green bar corresponds to the only element \(\rho _1 \in \textsc {bars}^\mathcal {F}_\tau ,\) which is born at parameter \(\ell _0.\) Short purple bars with lifetimes intersecting \(\ell _0\) make up \(\textsc {bars}^{\ell _0}_{\text {short}}\), and finite blue bars born after \(\ell _0\) constitute the set \(\text {{bars}}_{> \ell _0}\). (inset) Representatives of \([\rho _1^{\mathcal {F},\ell _0}]\) in green and \([\rho _2^{\mathcal {F},\ell _0}]\) in purple corresponding to a bar in \(\textsc {bars}^{\ell _0}_{\text {short}}\)

4.2 Bar-to-bars extensions

It is common in applications to refer to bars, not homology classes, as the features of a data set. Thus, for practitioners, it may be of use to understand relations between bars rather than homology classes. The bar-to-bars extension method enumerates ways in which a selected bar \(\tau \in \text {bc}_k(Z^\bullet )\) coincides at the chain level with elements of \(P\smash {\widetilde{H}}_k(Y^\bullet )\) and represents the corresponding homology classes in terms of \(\text {bc}_k(Y^\bullet )\). To do so, we first find all homology class representations of \(\tau \) in \(P\smash {\widetilde{H}}_k(Z^\bullet )\). For each homology class representation, we find all class extensions, and, for each class extension, we find the corresponding bar representation in \(\text {bc}_k(Y^\bullet )\). We discuss the notion of bar extensions before presenting the algorithm.

The first step is to find all homology classes that correspond to a given bar \(\tau \in \text {bc}_k(Z^\bullet )\). If we fix an interval decomposition \(\mathcal {B}\) of \(P\smash {\widetilde{H}}_k(Z^\bullet )\) and some parameter \(\psi \) for \(Z^\bullet \), then we automatically have the homology class \([\tau ^{\mathcal {B}, \psi }]\) that \(\mathcal {B}\)-corresponds to \(\tau \).

Which parameter \(\psi \) should we choose? In the absence of further information, the safest choice is to select \(\psi \) which maximizes the size of our homology class of interestFootnote 10 but avoiding introducing enough equivalences to trivialize our feature of interest. Thus, we consider the last parameter at which the bar \(\tau \) is alive.

Definition 4.2.1

Let \(\mathcal {B}: \mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow P\smash {\widetilde{H}}_k(Z^\bullet )\) be an interval decomposition. The terminal class of a bar \(\tau \) in \(\text {bc}_k(Z^\bullet )\) (under \(\mathcal {B}\)) is the class \([\tau ^\mathcal {B}_*] = [\tau ^{\mathcal {B}, \delta (\tau )-1}]\in \smash {\widetilde{H}}_k(Z^{\delta (\tau )-1})\). When \(\mathcal {B}\) is unambiguous, we will suppress it and write \([\tau _*]\).

Recall that a bar \(\tau \in \text {bc}_k(Z^\bullet )\) corresponds to a 1-dimensional persistent subspace \(V^\bullet \) of \(P\smash {\widetilde{H}}_k(Z^\bullet )\) under \(\mathcal {B}\).

Remark 2

Without a preferred interval decomposition \(\mathcal {B},\) it will be necessary to consider all possible choices of \(\mathcal {B}\) to obtain a comprehensive list of possible terminal classes of \(\tau .\) In Sect. 4.2.3, we will show that the terminal class is independent of the interval decomposition \(\mathcal {B}\) if homology is computed with \(\mathbb {F}_2\) coefficients and if the bars of \(\text {bc}_k(Z^\bullet )\) have unique death parameters. Thus, for readers interested in that very common case, it is reasonable to ignore the dependence on \(\mathcal {B}\) in what follows.

Once we fix the terminal class \([\tau _*^{\mathcal {B}}]\) of \(\tau \), one can compute the class extensions of \([\tau _*^{\mathcal {B}}]\). In the context of comparing barcodes, we need to describe these class extensions in terms of the bars in \(\text {bc}_k(Y^\bullet )\). Given an interval decomposition \(\mathcal {D}:\mathbb {I}_{\text {bc}_k(Y^\bullet )} \rightarrow P\smash {\widetilde{H}}_k(Y^\bullet )\) and a class extension \([y] \in \smash {\widetilde{H}}_k(Y^\ell )\) of \([\tau _*^{\mathcal {B}}]\) at \(\ell \), recall from Definition 2.2.4 that \(S^{\mathcal {D}}_{[y]}\) denotes the \(\mathcal {D}\)-bar representation of [y]. Recall that \(S^{\mathcal {D}}_{[y]}\) is a collection of weighted bars. Using this terminology, we can describe class extensions and bar extensions of a bar \(\tau \in \text {bc}_k(Z^\bullet )\).

Definition 4.2.2

Let \(Z^\bullet , Y^\bullet \) be filtered simplicial complexes on a common vertex set P. Let \(\tau \in \text {bc}_k(Z^\bullet )\). Given an interval decomposition \(\mathcal {B}\) of \(P\smash {\widetilde{H}}_k(Z^\bullet )\), let \(E_{\mathcal {B}}\) denote the set of class extensions of \([\tau ^{\mathcal {B}}_*]\). Let B and D each denote the set of all possible interval decompositions of \(P\smash {\widetilde{H}}_k(Z^\bullet )\) and \(P\smash {\widetilde{H}}_k(Y^\bullet )\). Define the class extensions of \(\tau \) as

$$\begin{aligned} E(\tau , Y^\bullet ) = \bigcup _{\mathcal {B} \in B} E_{\mathcal {B}}, \end{aligned}$$

and define the bar extensions of \(\tau \) as

$$\begin{aligned}S(\tau , Y^\bullet ) = \{ S^{\mathcal {D}}_{[y]} \; | \; [y] \in E(\tau , Y^\bullet ), \mathcal {D} \in D \}. \end{aligned}$$

When given a homology class \([\tau ] \in \smash {\widetilde{H}}_k(Z^\psi )\), we use the corresponding terminology bar extensions of \([\tau ]\) to refer to

$$\begin{aligned} S([\tau ], Y^\bullet ) = \{S^{\mathcal {D}}_{[y]} \; | \; [y] \in E, \mathcal {D} \in D \}, \end{aligned}$$

where E denotes the set of class extensions of \([\tau ]\) from Definition 4.1.1.

Now that we defined the bar extensions of \(\tau \), we can discuss the overall structure of our bar-to-bars extension algorithm. Given \(\tau \in \text {bc}_k(Z^\bullet )\) we first find all terminal classes of \(\tau \) by enumerating all possible interval decompositions of \(P\smash {\widetilde{H}}_k(Z^\bullet )\). We then use the resulting homology classes as input for Algorithm 1 and generate all class extensions of \(\tau \). Finally, for each class extension, we enumerate all interval decompositions of \(P\smash {\widetilde{H}}_k(Y^\bullet )\) to find the bar representations of the class extensions.

In Sects. 4.2.1 and 4.2.2, we discuss details of performing this enumeration efficiently and summarize the process in Algorithm 2. Finally, in Sect. 4.2.3, we show that a much simpler process (Algorithm 3) suffices when we compute persistent homology with \(\mathbb {F}_2\) coefficients and when our bars have unique death parameters. We first discuss the computational details of enumerating the interval decompositions.

4.2.1 Finding all terminal classes of a bar

Given a bar \(\tau \in \text {bc}_k(Z^\bullet )\), we must find an explicit parameter \(\psi \) and homology class \([\tau ] \in \smash {\widetilde{H}}_k(Z^\psi )\) to be used as input to the class-to-class extension method (Algorithm 1). As discussed in Definition 4.2.1, we fix \(\psi = \delta (\tau )-1\) and the terminal class \([\tau ^{\mathcal {B}}_*] \in \smash {\widetilde{H}}_k(Z^{\delta (\tau )-1})\) under some fixed interval decomposition \(\mathcal {B}: \mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow P\smash {\widetilde{H}}_k(Z^\bullet )\). To avoid imposing an arbitrary choice of \(\mathcal {B}\), it is necessary to find all terminal classes \([\tau ^{\mathcal {C}}_*]\) under different interval decompositions \(\mathcal {C}\) of \(P\smash {\widetilde{H}}_k(Z^\bullet )\) and apply Algorithm 1 to these terminal classes. Note that the iteration over all interval decompositions of \(P\smash {\widetilde{H}}_k(Z^\bullet )\) allows us to find all 1-dimensional persistent subspaces of \(P\smash {\widetilde{H}}_k(Z^\bullet )\) that can be represented by \(\tau \). We then find all homology classes representing such persistent subspaces.

Recall from Sect. 2.2 that any interval decomposition \(\mathcal {C}\) of \(P\smash {\widetilde{H}}_k(Z^\bullet )\) can be obtained from \(\mathcal {B}\) as \(\mathcal {C} = \mathcal {B}\circ \mathcal {L}\) for some automorphism \(\mathcal {L}\) of the barcode module \(\mathbb {I}_{\text {bc}_k(Z^\bullet )}\). The terminal class under \(\mathcal {C}\) can be computed by \([\tau ^{\mathcal {C}}_*] = [\mathcal {C}^{\psi }(\textbf{e}^{\,\psi }_\tau )] = [\mathcal {B}^\psi \circ \mathcal {L}^\psi (\textbf{e}^{\, \psi }_{\tau })] =[B^\psi \cdot L^\psi \cdot \textbf{e}^{\, \psi }_{\tau }],\) where \(\psi = \delta (\tau )-1\), \(\textbf{e}^{\, \psi }_{\tau }\) is the basis vector for \(\tau \) at \(\psi \), and \(B^\psi \) and \(L^\psi \) are the matrix representations of the maps \(\mathcal {B}^\psi \) and \(\mathcal {L}^\psi \). Thus, to find all possible terminal class \([\tau ^{\mathcal {C}}_*]\), it suffices to find all linear isomorphisms \(\mathcal {L}^{\psi }: (\mathbb {I}_{\text {bc}_k(Z^\bullet )})^\psi \rightarrow (\mathbb {I}_{\text {bc}_k(Z^\bullet )})^\psi \) resulting from the restriction of the automorphism \(\mathcal {L}:\mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow \mathbb {I}_{\text {bc}_k(Z^\bullet )}\). We use the following lemma for this purpose.Footnote 11

Lemma 4.2.3

Given persistence module \(P\smash {\widetilde{H}}_k(Z^\bullet )\), let \(\text {bc}_k(Z^{\psi }) = \{ \tau _1, \dots , \tau _m \}\) be some ordering of bars alive at \(\psi \). Let \(L_Z\) be the collection of \(m \times m\) matrices

$$\begin{aligned}L_Z = \{ L \in \mathbb {F}^{m \times m} \; | \; L_{r,r} \ne 0, L_{r,c} = 0 \text { if } \beta (\tau _r)> \beta (\tau _c) \text { or } \delta (\tau _r) > \delta (\tau _c) \text { for all } r,c \}. \end{aligned}$$

The collection \(L_Z\) is precisely the collection of matrices representing the map \(\mathcal {L}^{\psi }: (\mathbb {I}_{\text {bc}_k(Z^\bullet )})^{\psi } \rightarrow (\mathbb {I}_{\text {bc}_k(Z^\bullet )})^{\psi }\) under all possible choices of barcode module automorphism \(\mathcal {L}: \mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow \mathbb {I}_{\text {bc}_k(Z^\bullet )}\).

Proof

Deferred to Appendix C. \(\square \)

Since \(L_Z\) contains all of the pertinent linear isomorphisms \(\mathcal {L}^{\psi }\), we can enumerate the terminal classes of interest via \(T = \{[B^{\psi } \cdot L \cdot \textbf{e}^{\;\psi }_{\tau }] \in \smash {\widetilde{H}}_k(Z^{\psi }) \; | \; L \in L_Z \} \), where \(B^{\psi }\) denotes the matrix representation of \(\mathcal {B}^{\psi }\). Step (2) of Algorithm 2 performs this process.Footnote 12

Once we find the collection T, we apply the class-to-class extension method (Algorithm 1) to each terminal class in T, which results in a collection of class extensions \([y] \in \smash {\widetilde{H}}_k(Y^\ell )\) at various parameters \(\ell \). The final step we need to discuss is finding all bar representations of class extensions.

4.2.2 Finding all bar-representations of a class extension.

Let \([y] \in \smash {\widetilde{H}}_k(Y^{\ell })\) be a class extension output from Algorithm 1. Fix some interval decomposition \(\mathcal {D}\) of \(P\smash {\widetilde{H}}_k(Y^\bullet )\), and let \(S^{\mathcal {D}}_{[y]}\) denote the \(\mathcal {D}\)-bar representation of [y]. Our goal is to find all \(\mathcal {G}\)-bar representation of [y] for all possible interval decompositions \(\mathcal {G}\) of \(P\smash {\widetilde{H}}_k(Y^\bullet )\).

Any interval decomposition \(\mathcal {G}\) of \(P\smash {\widetilde{H}}_k(Y^\bullet )\) can be obtained by \(\mathcal {G}= \mathcal {D}\circ \mathcal {L}^{-1},\) where \(\mathcal {L}\) is an automorphism of \( \mathbb {I}_{\text {bc}_k(Y^\bullet )}.\) Given \(\mathcal {L}^{\ell }\), we can find the \(\mathcal {G}\)-bar representation of [y] from \(S^{\mathcal {D}}_{[y]}\) as follows. Let \(D^{\ell }\), \(G^{\ell }\), and \(L^{\ell }\) each denote the matrix representing the linear isomorphism \(\mathcal {D}^{\ell }\), \(\mathcal {G}^{\ell }\), and \(\mathcal {L}^{\ell }\). Let \(S^{\mathcal {D}}_{[y]} = \{ \MakeLowercase {D}_1 \gamma _{j_1}, \dots , \MakeLowercase {D}_t \gamma _{j_t} \}\). That is, \(d_1[\gamma _{j_1}^{\mathcal {D},\ell }] + \dots + d_t[\gamma _{j_t}^{\mathcal {D},\ell }] = [y]\) in \(\smash {\widetilde{H}}_k(Y^\ell )\) for nonzero \(d_1, \dots , d_t\), i.e.,

$$\begin{aligned}D^{\ell }(\MakeLowercase {D}_1\textbf{e}^{\; \ell }_{{j_1}} + \dots + \MakeLowercase {D}_t \textbf{e}^{\; \ell }_{{j_t}}) = [y] \text { in } \smash {\widetilde{H}}_k(Y^\ell ) \text { for nonzero }d_1, \dots , d_t,\end{aligned}$$

where \(\textbf{e}^{\;\ell }_j\) is the basis vector for \(\gamma _j\) at parameter \(\ell \). Note that \(S^{\mathcal {G}}_{[y]} = \{ c_{1} \gamma _{i_1}, \dots , c_{s} \gamma _{i_s} \}\) if \(G^{\ell }(c_{1} \textbf{e}^{\; \ell }_{i_1} + \dots + c_{s} \textbf{e}^{\; \ell }_{i_s}) = [y]\) for nonzero \(c_1, \dots , c_s\). Since \(L^{\ell } = ({G^{\ell }})^{-1} \circ D^{\ell }\), this means that \(L^{\ell }(\MakeLowercase {D}_1 \textbf{e}^{\; \ell }_{j_1} + \dots + \MakeLowercase {D}_t \textbf{e}^{\; \ell }_{j_t}) = c_{1} \textbf{e}_{i_1}^{\, \ell } + \dots + c_{s} \textbf{e}_{i_s}^{\, \ell }\). Thus, given the matrix \(L^{\ell }\) and \(S^{\mathcal {D}}_{[y]}\), we can directly compute \(S^{\mathcal {G}}_{[y]}\).

figure e

Footnote 13

Footnote 14

figure f

As in the previous case, we can enumerate the matrix \(L^{\ell }\). Let \(n = \dim \smash {\widetilde{H}}_k(Y^\ell )\) and fix an order of the bars \(\text {bc}_k(Y^\ell ) = \{ \gamma _1, \dots , \gamma _n \}\). Let \(L_Y\):

$$\begin{aligned} L_Y = \{ L \in \mathbb {F}^{n \times n} \; |&\; L_{r,r} \ne 0, L_{r,c} = 0 \text { if } \beta (\gamma _r)> \beta (\gamma _c) \text { or } \delta (\gamma _r) > \delta (\gamma _c) \nonumber \\&\text { for all } r,c \}. \end{aligned}$$
(7)

Lemma 4.2.3 showed that \(L_Y\) finds all \(\mathcal {L}^{\ell }\) that are restrictions of a persistence module automorphism \(\mathcal {L}\) to the parameter \(\ell \). For each \(L \in L_Y\), we can compute the bar representation of [y] under a new interval decomposition as

$$\begin{aligned} S^{\mathcal {D} \circ L^{-1}}_{[y]} = \{ c_{1} \gamma _{i_1}, \dots , c_{s} \gamma _{i_s} \;|&\;L(d_1 \textbf{e}_{j_1}^{\; \ell } + \dots + d_t \textbf{e}_{j_t}^{\; \ell }) = c_{1} \textbf{e}_{i_1}^{\; \ell } + \dots + c_{s} \textbf{e}_{i_s}^{\; \ell } \\&\text { for } c_1, \dots , c_s \ne 0 \}. \end{aligned}$$

We return the collection of all bar representations of [y]

$$\begin{aligned}S_{[y]} = \{S^{\mathcal {D} \circ L^{-1}}_{[y]} \; | \; L \in L_Y \}. \end{aligned}$$

Step (5-b) of Algorithm 2 performs this process.

Lemma 4.2.3 guarantees that the enumerations in Sects. 4.2.1 and 4.2.2 find all terminal classes and bar-representations. Combining the two, we obtain Algorithm 2, which provides a complete enumeration of bar extensions of \(\tau \in \text {bc}_k(Z^\bullet )\) to \(\text {bc}_k(Y^\bullet )\). In step (1), we fix initial interval decompositions \(P\smash {\widetilde{H}}_k(Z^\bullet )\) and \(P\smash {\widetilde{H}}_k(Y^\bullet )\). In steps (2) to (4), we compute all terminal classes of bar \(\tau \). In step (5), we compute the class extensions of each terminal class and find their bar representations in \(\text {bc}_k(Y^\bullet )\).

4.2.3 The case of \(\mathbb {F}_2\)-coefficients and bars with unique death parameters

Algorithm 2 can be substantially simplified when we make two assumptions that are often satisfied when working with real data: that homology is computed with \(\mathbb {F}_2\) coefficients, and that all bars in \(\text {bc}_k(Z^\bullet )\) have unique death parameters. Under such assumptions, the following lemma says we can omit the loop over interval decompositions of \(P\smash {\widetilde{H}}_k(Z^\bullet )\).

Lemma 4.2.4

Assume that \(\mathbb {F}= \mathbb {F}_2\) and that all bars of \(\text {bc}_k(Z^\bullet )\) have unique death parameters. Let \(\mathcal {B}, \mathcal {C}: \mathbb {I}_{\text {bc}_k(Z^\bullet )} \rightarrow P\smash {\widetilde{H}}_k(Z^\bullet )\) be two different interval decompositions. Given a bar \(\tau \in \text {bc}_k{(Z^\bullet )}\), let \([\tau ^{\mathcal {B}}_*]\) and \([\tau ^{\mathcal {C}}_*]\) denote the terminal class for \(\tau \) under \(\mathcal {B}\) and \(\mathcal {C}\) respectively. Then, \([\tau ^{\mathcal {B}}_*] = [\tau ^{\mathcal {C}}_*]\) in \(H_k(Z^{\delta (\tau )-1})\).

Proof

Deferred to Appendix D. \(\square \)

Algorithm 3 describes the modified bar-to-bars extension method under these assumptions.

Example 2

Recall the point clouds P and Q on the torus from Example 1 and Fig. 3, and again let \(Z^\bullet = W^\bullet _{P,Q}\), and \(Y^\bullet = X^\bullet _P\). Let \(\tau \) be the highlighted bar in \(\text {bc}_1(W^\bullet _{P,Q})\), as shown in Fig. 4. We will apply Algorithm 3 to determine how the selected bar \(\tau \) can be related to bars in \(\text {bc}_1(X^\bullet _P)\).

In step (1), we fix the interval decompositions of \(P\smash {\widetilde{H}}_k(Z^\bullet )\) and \(P\smash {\widetilde{H}}_k(Y^\bullet )\). In step (2), we find the terminal class \([\tau _*]\) of \(\tau \); the cycle representative depicted in the left panel of Fig. 3 is a representative of this \([\tau _*]\). We apply Algorithm 1 to this terminal class and find all class extensions. Finally, we enumerate possible bar representations of the resulting class extensions in \(\text {bc}_1(Y^\bullet )\). The bottom pane of Fig. 4 illustrates two possible bar-representations of some class extension [y]. The union of the green and purple bars illustrates the \(\mathcal {D}\)-bar representation \(S^{\mathcal {D}}_{[y]}\) under some fixed interval decomposition \(\mathcal {D}\). The collection of green bars represent an alternative bar-representation \(S^{\mathcal {D}\circ L^{-1}}_{[y]}\) for some \(L \in L_Y\).

The output \(S(\tau , Y^\bullet )\) is large, as it is a collection of \(S^{\;\mathcal {D}\circ L^{-1}}_{[y]}\) for all possible combinations of \(\ell \in p_Y\), \([y] \in (\mathfrak {E}_{[\tau _*]} )_{\ell }\), and \(L \in L_Y\). In this example, \(p_Y\) is a set with 18 parameters. Fig. 4 illustrates an example \(\mathcal {D}\)-bar representative \(S^{\mathcal {D}}_{[y]}\) for \(\ell = \min p_Y\), a randomly selected \([y] \in (\mathfrak {E}_{[\tau _*]} )_{\ell }\), and an identity matrix L. For the fixed \(\ell \) and L, there are \(2^{14}\) possibilities for \(S^{\mathcal {D} \circ L^{-1}}_{[y]}\). However, every possible \(S^{\mathcal {D} \circ L^{-1}}_{[y]}\) is a sum of the green bars and a short bar in \(\text {bc}_1(X^\bullet _P)\), much like the presentation in Figure 4. There are 14 short bars in \(\text {bc}_1(X^\bullet _P)\) that one can highlight as the purple bar. Any subsets of the 14 short bars, when combined with the green bars, are valid bar representatives. In all \(2^{14}\) different possibilities, the longest green bar is always present. The observation that every bar representative \(S^{\mathcal {D}}_{[y]}\) can be written as a combination of the green bars and a selection of short bars motivated the development of component-wise extension discussed in the following section.

Fig. 4
figure 4

Input and output of the bar-to-bars extension in Example 2. (top) Barcode \(\text {bc}_1(W^\bullet _{P,Q})\) for the witness complex of point clouds P and Q from Fig. 3. We apply the bar-to-bars extension method to the blue long bar. (bottom) Barcode for the clique complex of the point cloud P from Fig. 3. Green and purple bars together are the \(\mathcal {D}\)-bar representative \(S^{\mathcal {D}}_{[y]}\) produced by Algorithm 3. Omitting the purple bar produces the alternative bar representation \(S^{\mathcal {D}\circ L^{-1}}_{[y]}\) for one choice of \(L \in L_Y\)

4.3 Component-wise extension

The process of computing the \(\mathcal {D}\)-bar representation \(S^\mathcal {D}_{[y]}\) can be computationally intensive. In step (5-b-iii) of Algorithm 2, we find the bar extension \(S^{\mathcal {D}}_{[y]}\) for every \([y] \in (\mathfrak {E}_{[\tau ]})_{\ell }\). From steps (3-b-iii) - (3-b-iv) of Algorithm 1, we know that any \([y] \in (\mathfrak {E}_{[\tau ]})_{\ell }\) has the form

$$\begin{aligned}{}[y] = \Upsilon _{\ell } \Bigg ( \sum _{i=1}^m\MakeLowercase {F}^*_i[\rho _i^{\mathcal {F}, \ell }] \Bigg ) + \sum _{[\rho ^{\mathcal {F}, \ell }_j] \in V_{\text {short}}^{\ell }} \Upsilon _{\ell } \Bigg (\MakeLowercase {F}_j [\rho ^{\mathcal {F}, \ell }_j] \Bigg ) \end{aligned}$$
(8)

for some \(\MakeLowercase {F}_j \in \mathbb {F}\). Note that \(f_1^*, \dots , f_m^* \in \mathbb {F}\) are fixed from \(S^{\mathcal {F}}_{[\tau ]} = \{f_1^* \rho _1, \dots , f_m^* \rho _m \}\) in step (2-a) of Algorithm 1. Thus, the number of class extensions \([y] \in (\mathfrak {E}_{[\tau ]})_{\ell }\) we must consider grows exponentially as \(|\mathbb {F}|^{|\textsc {bars}^{\ell }_{\text {short}}|}\).

Fortunately, we can leverage the vector space structure on homology to mitigate the resulting explosion in computation time. Suppose that \([y_1], [y_2] \in \smash {\widetilde{H}}_k(Y^\ell )\) and define \(S^{\mathcal {D}}_{[y_1]} \oplus S^{\mathcal {D}}_{[y_2]} = S^{\mathcal {D}}_{[y_1+y_2]}\). Given \(c \in \mathbb {F}\), define \(c \cdot S^{\mathcal {D}}_{[y]} = S^{\mathcal {D}}_{c[y]}\) for any \([y] \in \smash {\widetilde{H}}_k(Y^\ell ).\) From Definition 2.2.4, we see that \(\oplus \) and \(\cdot \) defines a \(\mathbb {F}\)-vector space structure on the set \(\{S^{\mathcal {D}}_{[y]} \;|\; [y] \in \smash {\widetilde{H}}_k(Y^\ell )\}\), and that the collection of \(\mathcal {D}\)-bar representations of \((\mathfrak {E}_{[\tau ]})_{\ell }\) can be regarded as an affine subspace of this space.

Therefore, instead of computing bar representations for every \([y] \in (\mathfrak {E}_{[\tau ]})_{\ell }\), we can compute bar representations \(S^{\mathcal {D}}_{\Upsilon _{\ell }(\sum _{i=1}^m\MakeLowercase {F}^*_i[\rho _i^{\mathcal {F}, \ell }] )}\) and \(S^{\mathcal {D}}_{\Upsilon _{\ell }[\rho ^{\mathcal {F},\ell }]}\) for each \([\rho ^{\mathcal {F}, \ell }] \in V^{\ell }_{\text {short}}\). We’ll refer to

$$\begin{aligned} B = \Upsilon _{\ell } \Big (\sum _{i=1}^m\MakeLowercase {F}^*_i[\rho _i^{\mathcal {F}, \ell }] \Big ) \text { and }O = \left\{ \Upsilon _{\ell } \Big ( [\rho ^{\mathcal {F},\ell }] \Big ) \; | \; [\rho ^{\mathcal {F},\ell }] \in V^{\ell }_{\text {short}}\right\} \end{aligned}$$

as the baseline and offset class extensions, respectively, with \((\mathfrak {E}_{[\tau ]})_{\ell } = B \oplus \text {span}_\mathbb {F}O\). We then take

$$\begin{aligned} B^{\mathcal {D}} = \left\{ S^{\mathcal {D}}_{\Upsilon _{\ell }(\sum _{i=1}^m\MakeLowercase {F}^*_i[\rho _i^{\mathcal {F}, \ell }] )} \right\} \text { and } O^{\mathcal {D}} = \left\{ S^{\mathcal {D}}_{\Upsilon _{\ell }([\rho ^{\mathcal {F},\ell }])} \;|\; [\rho ^{\mathcal {F},\ell }] \in V^{\ell }_{\text {short}}\right\} \end{aligned}$$

to be the collections of baseline and offset bar extensions. Note that \(\{S^{\mathcal {D}}_{[y]} \; | \; [y] \in (\mathfrak {E}_{[\tau ]})_{\ell } \} = \text {span}_\mathbb {F}B^{\mathcal {D}} \oplus \text {span}_\mathbb {F}O^{\mathcal {D}}\). Perhaps unsurprisingly, we have found it simpler and faster to visualize the sets \(B^{\mathcal {D}}\) and \(O^{\mathcal {D}}\) for understanding extensions in examples. Note that the individual members of the baseline and offset class extensions depend on the interval decomposition \(\mathcal {F}\). However, when the baseline and offset class extensions are considered collectively, the collection of class extensions is independent of \(\mathcal {F}\) according to Theorem B.2.2. Similarly, the collection of baseline and offset bar extensions is independent of \(\mathcal {F}\).

Remark 3

When the number of bars in the barcode is large, the number of linear systems we must solve to carry out the extension method can be prohibitive, even when we consider only these basis elements. Therefore, it may be useful to omit classes of bars based on length statistics for a null model or domain knowledge. We have found this to be a useful strategy in practice, but leave a detailed discussion for future work.

5 Analogous bars

With the persistent extension method developed in Sect. 4 in hand, we can move on to addressing the motivating question for this paper. Let \(Q = \{q_1, \dots , q_m \}\) and \(P= \{p_1, \dots , p_n \}\) be two populations equipped with dissimilarity matrices \(M_Q\) and \(M_P,\) as well as a cross-dissimilarity matrix \(M_{Q,P}\). Let \(X^\bullet _Q\) and \(X^\bullet _P\) each denote the Vietoris-Rips complexes on Q and P. Given a bar \(\tau \in \text {bc}_k(X^\bullet _Q)\), our goal is to find all persistent 1-dimensional subspaces of \(P\smash {\widetilde{H}}_k(X^\bullet _P)\), represented as collections of bars in \(\text {bc}_k(X^\bullet _P),\) which could correspond to features similar to \(\tau \) under the information provided by the cross-dissimilarity measure.

As discussed in Sect. 3, we will encode the information in \(M_{Q,P}\) as a witness complex and utilize the isomorphism in Dowker’s theorem to identify \(\text {bc}_k(W_{Q,P}^\bullet )\) and \(\text {bc}_k(W_{P,Q}^\bullet ).\) We then apply the persistent extension method to associate bars in \(\text {bc}_k(X_Q^\bullet )\) and \(\text {bc}_k(X_P^\bullet )\) to those in the witness barcodes. There are two perspectives that we can take.

  1. 1.

    First, a feature-centric approach, where the goal is to study how a particular bar \(\tau \in \text {bc}_k(X_Q^\bullet )\) is represented in \(\text {bc}_k(X_P^\bullet )\). To streamline this approach, we give two truncated variations of Algorithm 2. Algorithm 4, the bar-to-class extension method, returns only the collection of class extensions, thereby eliminating the need to iterate over the interval decompositions of \(P\smash {\widetilde{H}}_k(Y^\bullet )\). Algorithm 5, the class-to-bar extension method, takes as input an explicit homology class \([\tau ] \in \smash {\widetilde{H}}_k(Z^{\psi })\), which eliminates the iteration over interval decompositions of \(P\smash {\widetilde{H}}_k(Z^\bullet )\). Given a bar \(\tau \in \text {bc}_k(X^\bullet _Q)\), we first apply Algorithm 4 to \(\tau \), producing a family \(E(\tau , W_{Q, P}^\bullet )\) of class extensions in \(P\smash {\widetilde{H}}_k(W^\bullet _{Q,P})\). We find the corresponding collection of homology classes \(E(\tau , W^\bullet _{P,Q})\) in \(P\smash {\widetilde{H}}_k(W^\bullet _{P,Q})\) by applying Dowker’s Theorem to elements of \(E(\tau , W_{Q,P}^\bullet )\). Finally, to each class extension \([\sigma ] \in E(\tau , W^\bullet _{P,Q})\), we apply Algorithm 5 to find a family of bar extensions \(S(\tau , X^\bullet _P) = \bigcup _{[\sigma ] \in E(\tau , W_{P, Q}^\bullet )} S( [\sigma ], X_P^\bullet )\) in \(\text {bc}_k(X^\bullet _P)\). Any bar extension in \(S([\sigma ], X^\bullet _P)\subseteq S( \tau , X^\bullet _P)\) is analogous to \(\tau \) through \([\sigma ].\) Algorithm 6 provides a complete account of this approach.

  2. 2.

    Second, a similarity-centric approach, where the goal is to understand what relationship a particular bar \(\tau \in \text {bc}_k(W^\bullet _{Q,P})\) indicates between bars in \(\text {bc}_k(X_Q^\bullet )\) and \(\text {bc}_k(X_P^\bullet ).\) In this case, we apply Dowker’s Theorem to find the corresponding bar \(\tau ' \in \text {bc}_k(W^\bullet _{P,Q})\), and then we apply the persistent extension method to \(\tau \) and \(\tau '\) respectively. We end up with a collections of bar extensions \(S(\tau , X^\bullet _Q)\) of \(\tau \) to \(\text {bc}_k(X^\bullet _Q)\) and \(S(\tau ', X_P^\bullet )\) of \(\tau '\) to \(\text {bc}_k(X^\bullet _P)\). Any pair of extensions in \(S(\tau , X^\bullet _Q) \times S(\tau ', X^\bullet _P)\) can be viewed as analogous through \(\tau .\) This approach is described in Algorithm 7.

figure g

Footnote 15

Both methods use Dowker’s Theorem to compare \(W^\bullet _{Q,P}\) and \(W^\bullet _{P,Q}\) and use the extension method to compare the Witness complexes and Vietoris-Rips complexes. Because the involved algorithms enumerate different collections of homology classes, in general, we expect that the relationship between these two approaches may be quite intricate. Nonetheless, we believe it is useful to study how they relate in a simple example. In the following section, we provide an empirical comparison of the two perspectives on a slightly modified version of our earlier torus example which demonstrates that, in simple settings, the outputs of the two methods can coincide in a reasonable way.

figure h

Footnote 16

Footnote 17

figure i
figure j

Example 3

Take P to be the collection of points sampled uniformly from a flat torus considered in Examples 1 and 2, and let Q be a set of points sampled along a deformation of one of its essential circles, as illustrated in Fig. 5. We have chosen Q to take a substantial detour from the usual “taut” essential circle so that both the Vietoris-Rips complex \(X_Q^\bullet \) and the witness complex \(W^\bullet _{Q,P}\) will, for some range of parameters, contain homology classes representing both of the essential circles in the torus, but that the primary feature will be the vertical circle. The left panel in Fig. 5 shows the three relevant barcodes \(\text {bc}_1(X^\bullet _Q)\), \(\text {bc}_1(W^\bullet _{Q,P}) = \text {bc}_1(W^\bullet _{P,Q})\), and \(\text {bc}_1(X^\bullet _Q)\). Note that all bars have unique death times.

Feature-centric analogous bars: We will apply the feature-centric analogous bars method (Algorithm 6) to investigate the representation of the longest bar \(\tau \in \text {bc}_1(X^\bullet _Q)\) in \(\text {bc}_1(X^\bullet _P)\). Step (1) is to apply the bar-to-class extension (Algorithm 4) to find all class extensions \(E(\tau , W^\bullet _{Q,P})\). Since we are working with \(\mathbb {F}_2\) coefficients, the terminal class \([\tau _*] \in \smash {\widetilde{H}}_1(X^{\delta (\tau )-1})\) is independent of the interval decomposition of \(P\smash {\widetilde{H}}_1(X^\bullet _Q)\) by Lemma 4.2.4. Algorithm 4 simplifies since T, the collection of possible terminal classes, contains only one element \([\tau _*]\). The left-middle panel in the right column in Fig. 5 illustrates an example cycle in the class extension \([x_Q] \in E(\tau , W^\bullet _{Q,P})\). The class \([x_Q]\) is the baseline class extension.

In step (2) of Algorithm 6, we find the family of homology classes that are dual to \(E(\tau , W^\bullet _{Q,P})\) via Dowker’s Theorem. The right-middle panel in the right column of Fig. 5 illustrates the dual \([x_P] \in E(\tau , W^\bullet _{P,Q})\) to the previously illustrated \([x_Q]\).

In step (3) of Algorithm 6, for each class extension \([\sigma ] \in E(\tau , W^\bullet _{P, Q})\), we apply the class-to-bar extension method (Algorithm 5) to find the bar extensions \(S([\sigma ], X^{\bullet }_P)\) in \(\text {bc}_1(X^\bullet _P)\). The baseline bar extension is illustrated on \(\text {bc}_1(X^\bullet _P)\) in the left column of Fig. 5. The highlighted bars in \(\text {bc}_1(X^\bullet _Q)\) and \(\text {bc}_1(X^\bullet _P)\) are analogous through \([\sigma ]\). The bottom panel in the right column of Fig. 5 illustrates the corresponding cycle representative of the baseline bar extension.

Note that Fig. 5 illustrates only one example output of the feature-centric analogous bars method. Specifically, it illustrates the output obtained by computing the baseline persistence extensions in steps (1) and (3-b) of Algorithm 6. Other analogous bars in \(\text {bc}_1(X^\bullet _P)\) are combinations of the highlighted orange bar and short bars in \(\text {bc}_1(X^\bullet _P).\)

Fig. 5
figure 5

Illustration of the feature-centric analogous bars method. Let P be a point cloud sampled from a torus from Example 1, and let Q be a deformation of an essential circle that witnesses both essential circles of the torus. (left column) Beginning with the black bar in \(\text {bc}_1(X^\bullet _Q)\), apply persistent extension to obtain class extensions in \(W^\bullet _{Q,P}\). Using the isomorphism in Dowker’s theorem, find the corresponding class extension in \(W^\bullet _{P,Q}.\) Apply persistent extension again to obtain the orange bar in \(\text {bc}_1(X^\bullet _P)\). The highlighted bars in \(\text {bc}_1(X^\bullet _Q)\) and \(\text {bc}_1(X^\bullet _P)\) are analogous bars. (right column) Cycle representatives illustrating the classes obtained in this example. (top) Chain in \(X^\bullet _Q\) representing the long bar in \(\text {bc}_1(X^\bullet _Q).\) (middle-left) Cycle representative in \(W_{Q,P}^\bullet \) obtained by persistent extension of the bar in the top row is transformed into (middle-right) a cycle in \(W_{P,Q}^\bullet ,\) supported on P,  via Dowker’s theorem. (bottom) Applying persistent extension to this cycle, we obtain a corresponding cycle in \(X^\bullet _P\)

Fig. 6
figure 6

Illustration of the similarity-centric analogous bars method. Let P be a point cloud sampled from a torus from in Examples 1, and let Q be a deformation of an essential circle that witnesses both essential circles of the torus. (left column) Beginning with the green bar in \(\text {bc}_1(W^\bullet _{P,Q}) = \text {bc}_1(W^\bullet _{Q,P}),\) we apply persistent extension twice to obtain baseline black bar extension in \(\text {bc}_1(X^\bullet _{Q})\) and orange bar extension in \(\text {bc}_1(X^\bullet _P)\). The highlighted bars in \(\text {bc}_1(X^\bullet _Q)\) and \(\text {bc}_1(X^\bullet _P)\) are analogous bars. (right column) Cycle representatives illustrating the classes obtained in this example. (middle) Cycle in \(W_{Q,P}^\bullet \) representing the selected bar in the left column and a corresponding representative in \(W_{P,Q}^\bullet \) obtained via Dowker’s theorem. (top, bottom) Cycles in \(X^\bullet _Q\) and \(X^\bullet _P\) respectively representing the corresponding bars in \(\text {bc}_1(X^\bullet _Q)\) and \(\text {bc}_1(X^\bullet _P)\)

Similarity-centric analogous bars: We now illustrate the similarity-centric analogous bars method on the same dataset. The presence of a long bar in \(\text {bc}_1(W^\bullet _{P,Q})\) in Fig. 6 suggests that there is a significant feature present in both P and Q. Thus, we select the long interval \(\tau \in \text {bc}_1(W^\bullet _{Q,P})\) to which to apply the similarity-centric analogous bars method (Algorithm 7).

We apply Dowker’s Theorem to identify the corresponding bar \(\tau ' \in \text {bc}_1(W^\bullet _{P,Q})\), though morally these are identical. Computationally, we need to change representations to proceed. We then apply the bar-to-bar extension method (Algorithm 2) to find bar extensions of \(\tau \) in \(\text {bc}_1(X^\bullet _Q)\) and \(\tau '\) in \(\text {bc}_1(X^\bullet _P)\). The left column of Fig. 6 illustrates the selected bar \(\tau \in \text {bc}_1(W^\bullet _{Q,P})\) and the baseline bar extensions in \(\text {bc}_1(X^\bullet _Q)\) and \(\text {bc}_1(X^\bullet _P)\) respectively. The highlighted bars of \(\text {bc}_1(X^\bullet _Q)\) and \(\text {bc}_1(X^\bullet _P)\) are analogous through \(\tau \). The cycle representatives show that these analogous bars, indeed, trace qualitatively similar homology classes.

Note that Fig. 6 illustrates only one example output of the similarity-centric analogous bars method. Specifically, it illustrates the output obtained by computing the baseline persistence extensions in steps (2) and (3) of Algorithm 7.

Comparing Figs. 5 and 6, we see that at the level of barcodes on simple examples, the feature- and similarity-centric methods produce comparable and reasonable results.

6 Applications

Finally, we demonstrate the use of the methods we have developed on some simple data sets: we apply the analogous bars method to identify corresponding features from two samples of the same space and to determine whether topological features are retained under clustering; then, we use persistent extension on its own to investigate how topological features are transformed by dimensionality reduction.

6.1 Two samples from the same distribution

One of the most common tasks in topological data analysis is the recovery of topological features from a finite sample of a probability distribution on a metric space. If we have multiple samples, for example, from different measurements of a system, understanding how the features in those samples are related would provide utility in understanding what these features mean in terms of the system being studied. This is one of the simplest settings in which we can apply the analogous bars method, using the block sub-matrix of the distance matrix that measures distance between the two samples as a measure of cross-dissimilarity.

In Fig. 7, we illustrate this approach using two point clouds, P and Q, sampled uniformly and independently from a flat torus. We consider a choice of feature \(\tau \in \text {bc}_1(X^\bullet _Q)\), and locate the corresponding feature in \(\text {bc}_1(X^\bullet _P)\) using the feature-centric analogous bars method with \(\tau \) as input. The highlighted bars of \(\text {bc}_1(X^\bullet _Q)\) and \(\text {bc}_1(X^\bullet _P)\) are analogous bars that represent the same essential circle.

Note that Fig. 7 illustrates only one example output of the feature-centric analogous bars method. The particular output was obtained by computing the baseline persistence extensions in steps (1) and (3-b) of Algorithm 6.

Fig. 7
figure 7

Using the feature-centric analogous bars method to identify features from independent samples of a torus. Grey points P and blue points Q are independently sampled from the uniform distribution on the torus. (left column) Dimension-one barcodes for \(X^\bullet _Q\), \(W^\bullet _{Q,P}\) and \(X^\bullet _P.\) The black bar in \(\tau \in \text {bc}_1(X^\bullet _Q)\) is the input to the method, and the orange bar in \(\text {bc}_1(X^\bullet _P)\) is the baseline bar extension. The highlighted bars in \(\text {bc}_1(X^\bullet _Q)\) and \(\text {bc}_1(X^\bullet _P)\) are analogous bars. No bars in \(\text {bc}_1(W^\bullet _{P,Q})\) are highlighted as Algorithm 6 bypasses translation through this barcode. (right column) Cycle representatives at each stage of the feature-centric analogous bars method. (top) Cycle representative of \(\tau \) supported on Q. (middle-left) Representatives of a homology class \([x_Q] \in E(\tau , W^\bullet _{Q,P})\) produced by step (1) of Algorithm 6 and (middle-right) its Dowker dual \([x_P] \in E(\tau , W^\bullet _{P,Q}).\) (bottom) Representative of \(\tau ' \in S(\tau , X^\bullet _P)\) produced by step (3) of Algorithm 6 applied to \([x_P]\) in (middle-right)

6.2 Clustering

The analogous bars method can similarly be applied to determine if topological features of a point cloud Q are preserved by clustering. In Fig. 8, we demonstrate such a comparison using the distance matrix between points Q and cluster centroids P as our cross-dissimilarity matrix. Because the witness barcode \(\text {bc}_1(W^\bullet _{P,Q})\) has a long bar, we expect that the two point clouds share a feature. Applying the similarity-centric analogous bars method, we find the analogous bars in \(\text {bc}_1(X^\bullet _Q)\) and \(\text {bc}_1(X^\bullet _P)\) and conclude that the major topological feature of Q is, in fact, retained by P.

Fig. 8
figure 8

Application of similarity-centric analogous bars to detect topological features preserved by clustering. Grey points Q sampled from a multimodal distribution in the plane, and blue centroids P induced by clustering. (left column) Barcodes for \(X^\bullet _Q\), \(W^\bullet _{Q,P}\) and \(X^\bullet _P.\) The green bar \(\tau \in \text {bc}_1(W^\bullet _{Q,P})\) is the input to the method, and the black bar in \(\text {bc}_1(X^\bullet _Q)\) and orange bar in \(\text {bc}_1(X^\bullet _P)\) are the baseline bar extensions. These highlighted bars in \(\text {bc}_1(X^\bullet _Q)\) and \(\text {bc}_1(X^\bullet _P)\) are analogous bars. (right column) Cycle representatives for the input, its Dowker dual, and the outputs. (middle-left) Representative of the cycle in \(W^\bullet _{Q,P}\) corresponding to the selected bar and (middle-right) its Dowker dual in \(W^\bullet _{P,Q}\). (top) Cycle representatives in the original data Q and (bottom) in the centroids of the clusters P confirm that this topological feature of Q is preserved by clustering

6.3 Dimensionality reduction

Most dimensionality reduction techniques retain the identities of the projected points. Thus, we can apply the persistent extension method to the Vietoris-Rips complexes of the original point cloud and the projected point cloud to study whether, and how, the resulting lower-dimensional point cloud retains topological features of interest. Here, we provide two toy examples using the extension method in the context of dimensionality reduction via principal component analysis.

6.3.1 Trefoil knot

First, we consider a collection of points \(Q \subseteq \mathbb {R}^3\) sampled from the trefoil knot depicted in Fig. 9 and take \(\pi (Q)\subseteq \mathbb {R}^2\) to be its 2-dimensional projection via PCA. We apply the persistent extension method to these two point clouds to identify how the dominant 1-dimensional homological feature of the trefoil knot is represented in its two-dimensional projection.

The 1-dimensional barcodes \(\text {bc}_1(X^\bullet _Q)\) and \(\text {bc}_1(X^\bullet _{\pi (Q)})\) are depicted in the middle panes of Fig. 9. We apply the persistent extension method to the long bar in \(\text {bc}_1(X^\bullet _Q)\). The vertical line in the bottom pane indicates the \(\ell _0\) parameter, and the highlighted bars in \(\text {bc}_1(X^\bullet _{\pi (Q)})\) correspond to one of the bar extensions; in fact, the top bar of \(\text {bc}_1(X^\bullet _{\pi (Q)})\) corresponds to the baseline bar extension, and the three bars whose interiors intersect the \(\ell _0\)-line independently make up the offset bar extensions and so can be included in any combination. The pictured extension indicates that the \(S^1\) described by the 3-dimensional trefoil knot can be represented by a combination of the four features detected in \(\text {bc}_1(X^\bullet _{\pi (Q)})\). Examining the cycle representatives of the highlighted bars of \(\text {bc}_1(X^\bullet _{\pi (Q)})\) depicted on the right of Fig. 9 illustrates why this is a reasonable answer: the homology class of the baseline bar encloses the region “internal” to the knot projection.

Fig. 9
figure 9

Application of persistent extension method to planar projection of the trefoil knot via PCA. (left) Blue points Q sampled from a standard trefoil knot in three dimensions. (middle) One-dimensional barcodes for the sample Q and its projection \(\pi (Q)\) to the first two loading vectors via PCA. Selecting the long orange bar \(\tau \in \text {bc}_1(X^\bullet _Q)\) and applying bar-to-bar persistent extension (Algorithm 3), we find that the top black bar in \(\text {bc}_1(X^\bullet _{\pi (Q)})\) is our baseline bar extension and the remainder are individually offsets. (right) Cycle representatives illustrating the four bars appearing in the set of possible extensions

6.3.2 Cylinder

Sometimes, applying dimensionality reduction to a point cloud flattens the object too much to easily visualize what happens to the topological features. Let Q be a set of points sampled from a cylinder in \(\mathbb {R}^3\), as shown in the left panel of Fig. 10, and let \(\pi (Q)\) be the result of projecting the points onto their first two loading vectors. As before, we consider \(X^\bullet _Q\) and \(X^\bullet _{\pi (Q)},\) with 1-dimensional barcodes as shown in the middle pane of Fig. 10. Selecting the highlighted long bar in \(\text {bc}_1(X^\bullet _Q)\) and applying the persistent extension method produces the highlighted bars in \(\text {bc}_1(X^\bullet _{\pi (Q)})\) as our baseline bar extensions. The right panel in Fig. 10 shows the cycle representative of the baseline class extension corresponding to the baseline bar extension in \(\text {bc}_1(X^\bullet _{\pi (Q)})\). Other choices of extension and representatives will recover how paths “around” the cylinder project onto this plane.

Fig. 10
figure 10

Application of persistent extension method to planar projection of a sampled cylinder via PCA. (left) Blue points Q sampled from a cylinder in three dimensions. (middle) One-dimensional barcodes for the sample Q and its projection \(\pi (Q)\) to the first two loading vectors via PCA. Selecting the long bar \(\tau \in \text {bc}_1(X^\bullet _Q)\) and applying bar-to-bar persistent extension (Algorithm 3), we find that the green bars in \(\text {bc}_1(X^\bullet _{\pi (Q)})\) form our baseline bar extension. (right) Cycle representative for the baseline class extension. Green represents the cycle representative of the sum of the homology classes corresponding to the two green bars. Cycle representative illustrates how the homology class in the cylinder is flattened

7 Conclusion

In this paper, we addressed the problem of comparing topological features computed from a pair of finite systems equipped with internal and cross-dissimilarity measures. We focused on the case where a triple of matrices provides a summary of the observations about such systems, a setting that commonly arises in applications. To leverage this information we developed two methods:

  1. 1.

    the persistent extension method, a zig-zag computation which provides a means for testing potential relationships between two complexes built on the same vertex set; and,

  2. 2.

    the analogous bars method, which leverages the Dowker complex of a cross-dissimilarity matrix to bridge between complexes supported on two distinct vertex sets.

Our examples in this paper focused on point cloud data, a common setting for topological data analysis. However, there are a variety of settings where these tools are likely to be of use. In particular, there is no explicit requirement that we use clique complexes; we focused on this example because it is the most commonly studied and easily implemented with existing software packages.

For some time there has been discussion of using zig-zag based analyses for time-varying simplicial complexes. The persistent extension method provides a concrete approach for studying how features evolve within a single system. It can also be applied to study how different filtrations affect the topology of a complex. Indeed, the dimensionality reduction examples in Sect. 6.3 can be cast in this light. We can also envision using this approach to investigate two-dimensional persistence modules, studying how features in given one-dimensional submodules manifest in others.

The analogous bars method provides a tool for studying simultaneously observed systems and determining whether their structure and dynamics capture common features. It is worth noting that while many potential applications will involve an underlying function, the Dowker complex was originally conceived as a topological method for studying relations (Dowker 1952), and so our method does not require such an assumption to provide sensible answers. For example, it could be used to study a pair of systems driven by a common topologically interesting input signal and detect signatures of that signal which are preserved in each. In forthcoming work, the authors apply these methods for precisely this kind of analysis.

While we have laid out the theoretical and computational foundation for using these tools, we have not attempted to address a large number of immediate questions that arose while we were writing this paper. We close with a selection of these that we find compelling.

  1. 1.

    Can we systematically choose the parameter \(\psi \) used in Algorithm 1 using features of the data? That is, given a homology class \([\tau ]\) and its death time \(\delta ([\tau ])\), what is the optimal parameter \(\psi \)? In this paper, we suggested \(\psi = \delta ([\tau ]) - 1\) as a safe choice. Empirically, we have found that when the homology class \([\tau ]\) is represented by multiple bars, for example, as \(S^{\mathcal {B}}_{[\tau ]} = \{ \tau _1, \dots , \tau _n\}\), then the class extension that one intuitively expects may arise only when we consider a parameter \(\psi \) that is smaller than \(\delta ([\tau ])\). This appears to be the result of homology classes becoming too large as the parameter increases so that the intuitive class extension becomes homologous to unexpected homology classes.

  2. 2.

    How do we characterize the quality of the output of these methods? For example, suppose we consider Vietoris-Rips complexes for samples from some distribution on underlying metric spaces X and Y, where our cross-dissimilarity measure is given by \(d(f(x),y) + \eta \) for a noise distribution \(\eta \) and some underlying map \(f:X \rightarrow Y.\) Can we analytically or computationally give a measure of confidence that a pair of analogous bars is correct?

  3. 3.

    If we consider a sequence of Vietoris-Rips complexes built from increasingly large samples from a distribution on a metric space, do the sequence of analogous bars obtained from these methods stabilize in some manner, as we might hope they would?

  4. 4.

    Under what conditions do the feature-centric and similarity-centric analogous bars methods produce comparable results? As the feature-centric method is more intuitive and the similarity-centric method can be much more computationally efficient, understanding how they compare would be useful.

  5. 5.

    How stable are the analogous bars under deformation of the original complexes and the cross-dissimilarity matrix? We expect the standard stability theorems of persistent homology (Chazal et al. 2009; Cohen-Steiner et al. 2005) and of Dowker persistence diagrams (Chowdhury and Mémoli 2018) will provide a first approximation to this answer, but can we say more?

  6. 6.

    There is a form of inverse problem suggested by this work: can we use information about semantics of topological features, such as knowledge that we have two samples from the same distribution, to infer information about relationships between the underlying points when no explicit pointwise cross-dissimilarity measure is available? That is, what constraints does the existence of an analogous class put on cross-dissimilarity measures?

  7. 7.

    Can we generalize the persistent extension and analogous bars method to barcodes with non-unique birth-death pairs? Recent work by Jacquard et al. (2022) characterizes interval decompositions of a barcode, including barcodes with repeated bars. Incorporating the characterizations will generalize the methods. The challenge lies in navigating the large search space of interval decompositions.

  8. 8.

    Recent work by Gregory Henselman-Petrusek and the second author Ghrist and Henselman-Petrusek (2021) develops a framework for persistence over more general (non-field) coefficient systems. Can we leverage this to generalize the algorithms developed in the current paper to, for example, the setting of lattices?