# Using Zigzag Persistent Homology to Detect Hopf Bifurcations in Dynamical Systems
## 2 Materials and Methods
### Algorithms  
While zigzag persistence has been in the literature for a decade, it has not often been used in application, and thus, the software that computes it is not well developed. A C++ package with python wrappers, Dionysus 2 ([[https://www.mrzv.org/software/dionysus2/](https://www.mrzv.org/software/dionysus2/)]([https://www.mrzv.org/software/dionysus2/](https://www.mrzv.org/software/dionysus2/))), has implemented zigzag persistence; however, it requires significant preprocessing to create the inputs. We have developed a python package ([[https://github.com/sarahtymochko/BuZZ](https://github.com/sarahtymochko/BuZZ)]([https://github.com/sarahtymochko/BuZZ](https://github.com/sarahtymochko/BuZZ))) that, provided the collection of point clouds and radii, will perform all the necessary preprocessing to set up the zigzag diagram as shown in Equation (5) to pass as inputs to Dionysus. Dionysus requires two inputs, a list of simplices, simplex_list, and a list of lists, times_list, where times_list[i] consists of a list of indices in the zigzag where the simplex, simplex_list[i], is added and removed. A small example is shown in Figure 3. Looking at that example, the two vertices and one edge in \(R(X_{0})\) appear at time 0 and disappear at time 1. There are two edges and a triangle in \(R(X_{0}\cup X_{1})\) that appear at time 0.5 (recalling that \(R(X_{i}\cup X_{i+1})\) is time \(i+0.5\)) and disappear  
Figure 2: Outline of the Bifurcations using Zigzag (BuZZ) method. (**a**) the input time series; (**b**) the corresponding point clouds embedded via time-delay embedding; (**c**) the zigzag of Rips complexes constructed as described in Section 2.3; (**d**) the corresponding zigzag persistence diagram. at time 1. Lastly, the one vertex in \(R(X_{1})\) appears at time 0.5 and never disappears in the zigzag sequence; therefore, by default, we set death time to be 2, which is the next index beyond the end of the zigzag sequence. This is done to avoid persistence points of the form \((i,\infty)\), as our zigzag sequences are always finite and these points have no additional meaning. Note that there are other special cases that can occur. If a simplex is added and removed multiple times, then the corresponding entry in times_list has more than two entries, where the zero and even entries in the list correspond to when it appears and the odd entries correspond to when it disappears. An example with this special case is shown in Figure 4 and will be described in more detail later. If we are using a fixed radius across the whole zigzag, these inputs can be computed rather easily. In this setting, we only need to compute the Rips complex of the unions, \(R(X_{i}\cup X_{i+1},r)\), which can be done using the Dionysus package, and the list of simplices can be created by combining lists of simplices for all \(i\), removing duplicates. Next, we will outline how to construct the times list. Starting with the set of simplices in \(R(X_{i}\cup X_{i+1},r)\), we can split them into three groups: (a) simplices for which all 0-dimensional faces are in \(X_{i}\), (b) simplices for which all 0-dimensional faces are in \(X_{i+1}\), or (c) simplices for which some 0-dimensional faces are in \(X_{i}\) and some are in \(X_{i+1}\). Because of the construction of the zigzag, all simplices in group (a) appear at time \(i-0.5\), since \(R(X_{i},r)\) also includes backwards \(R(X_{i-1}\cup X_{i},r)\) and disappears at time \(i+1\), since the union \(R(X_{i}\cup X_{i+1},r)\) is the last time that simplices in \(X_{i}\) are included. Similarly, all simplices in group (b) appear at time \(i+0.5\), since this is the first time simplices \(X_{i+1}\) are included and disappear at time \(i+2\), since \(R(X_{i+1},r)\) also includes forward \(R(X_{i+1}\cup X_{i+2},r)\). Lastly, all simplices in group (c) exist only at \(R(X_{i}\cup X_{i+1},r)\), so they appear at time \(i+0.5\) and disappear at \(i+1\). Note that the first case needs to be treated separately, since in \(R(X_{0}\cup X_{1},r)\), all vertices in group (a) will appear at 0.