Introduction

Knot theory holds special significance in science1, which provides a crucial mathematical language to understand the topological properties and interactions of various physical systems2,3,4,5,6,7,8,9,10. For example, the knot invariants derived from solutions of the Yang-Baxter equation are used to characterize the entanglement and topological properties of quantum states11,12. Furthermore, knot theory contributes to the exploration of topological matters, such as topological insulators13 and topological superconductors14, which exhibit exotic phases and protected properties. Recently, it has been discovered that the distinct topological phases of the non-Hermitian band structure in reciprocal space can be classified with braid groups, which are closely related to knots15,16,17,18,19,20,21,22,23. Concrete models that can exhibit different braid patterns have been experimentally implemented in platforms such as optical systems19,20,21, quantum circuits22 and acoustic realization6,24,25. Band braiding structure is also recently shown to induce topologically protected quantized response26. Closed braids represent knots, which are well-established in mathematics.

Yet, there remain great challenges for knot theory, both mathematically and physically in the specific context of non-Hermitian band braids. One of these challenges is the classification and identification of knot types. To overcome the challenge mathematically, the Alexander polynomial was first proposed back in 1923, and subsequently, various other polynomial forms were introduced27,28. However, the algebraic-based methods used to calculate knot invariants are computationally complex. Furthermore, relying solely on one or a few invariants poses challenges in achieving a comprehensive classification of knots. With the rapid development of artificial intelligence, supervised neural networks29,30 are applied to those knot topology. However, this approach relies on tremendous training samples with prior knowledge of known knot types, which necessitates substantial computational resources, and exploring more complex knots remains difficult.

On the other hand, in the physics context of non-Hermitian band braids where closed braids form rich knot structures, the distinct topological phases are influenced by both complex eigenvalues and eigenvectors18. The complex eigenvalues and eigenvectors give rise to intricate phenomena, such as exceptional point (EP), Parity-Time symmetry (PTS) breaking, non-Hermitian skin effect (NHSE). Thus, the topological phase transitions in non-Hermitian systems can be more intricate, manifested not only in the knot topology transitions in band braids, but also in the phase transitions in eigenvectors. As shown in Fig. 1, the band structure can be restricted by additional symmetries, resulting in different phases with the same knot topology. Furthermore, different chiralities can also result in different band braids. Therefore, a fully classification of non-Hermitian knots and band braids goes beyond the realm of purely mathematical problems, solely based on braid words, braid degrees, and other existing complex methods in knot theory (Fig. 1). There is an urgent need to develop an efficient and unified approach to identify and classify the rich topological phases of non-Hermitian band systems.

Fig. 1: Examples of braids and knots in n = 2 non-Hermitian bands with different chiralities and phases.
figure 1

Braid word τi(\({\tau }_{i}^{-1}\)) represents the i-th string crossing over(under) the (i + 1)-th string from the left. Braid degree is defined in Eq. (2). Moreover, the algebraic-based methods such as the Alexander and Jones polynomials are challenging in achieving a comprehensive classification of knots. Therefore, a unified data-driven machine learning classification without any prior mathematical knowledge or any pre-defined topological invariants is highly desired.

Unsupervised machine learning methods have shown promising capabilities in purely data-driven phase classification22,31,32,33,34,35,36,37,38,39,40,41,42, without requiring prior mathematical knowledge. Specifically, diffusion map**43,44, has demonstrated significant advantages in identifying topological phase transitions in various systems, such as the Ising gauge theory34,35, topological condensed matters36,37,38,40, and non-Hermitian systems22,39,41. The effectiveness of diffusion map** is due to the natural connection between the diffusion process in sample manifold and the homotopy in topology. However, the performance depends crucially on the definition of diffusion distances between samples.

In this work, we adopt a diffusion distance measure based on the Bloch vector on the basis of su(n) Lie algebra, so called generalized Gell-Mann matrices, to describe non-Hermitian systems with unit cell size n. This measure can incorporate information of both complex eigenvalues and eigenstates to fully classify the band braid and knot topology in non-Hermitian systems. Importantly, we note that non-Hermitian band braids in a topologically non-trivial phase may enable the occurrence of spontaneous symmetry breaking, of which each mode does not preserve the 2π period that the Hamiltonian provides15. As such, we adopt the momentum space of the descriptors in the n-fold extended non-Hermitian Brillouin zone to ensure that each mode remains 2nπ periodicity throughout. We take two models as examples, one with n = 2 and the other with n = 3. As a result, the diffusion map** on the measure effectively distinguishes different types and chirality of band braids and knots. It also identifies distinct topological phases with different hidden symmetries even they share the same braid and knot. Distinct from previous research22,39,41, our work focus on the intricate topology of multiple band braids and knots. Using our enhanced method, we achieve precise classification of knot topology in n-band systems.

Results

We begin with a concrete n = 2 model which has been realized experimentally recently by utilizing the frequency modes in two coupled ring resonators20. The schematic diagram for this model is shown in Fig. 2a, with asymmetric coupling constants C ± Δ between the adjacent lattice sites within sublattice a. γ > 0 denotes the additional loss rate in sublattice a. Each site in sublattice a couples to a site on sublattice b with the strength g, and there is no coupling between the sites in sublattice b. In momentum-space, the Hamiltonian of this model is written as:

$$\hat{{{{{{{{\bf{H}}}}}}}}}(k)=\left[\begin{array}{cc}2C\cos (k)+i2\Delta \sin (k)-i\gamma &g\\ g&0\end{array}\right].$$
(1)

To explore the versatile phase diagram of this model, we consider a data set with fixed γ = 1.2 and variable g, Δ, C. After the unsupervised learning, as illustrated in Fig. 2b, we observe the first four eigenvalues λn of the probability transition matrix \(\hat{{{{{{{{\bf{P}}}}}}}}}\) are much closer to 1 than the rest. Additionally, the visualization of the first four eigenvectors ψ0−3 (Supplementary Fig. S1) with the first two principal components is displayed in the inset of Fig. 2b. These results indicate the whole data set is classified into four phases autonomously by the algorithm, as shown in Fig. 2c. In phases I and III, the non-Hermitian bands form unlinks, whereas in phases II and II’, they form unknots.

Fig. 2: The manifold classification of the n = 2 non-Hermitian model with asymmetric nearest-neighbor coupling.
figure 2

a Sketch of the two-band lattice model. C, Δ, g are the coupling constants. The asymmetric coupling C ± Δ is between the nearest-neighbor sites in sublattice a. γ > 0 denotes the additional loss rate in sublattice a. b The first ten largest eigenvalues λn. The Hamiltonian samples are uniformly generated in the parameter space consisting of variables Δ, g and C with γ = 1.2. The Gaussian kernel coefficient ϵ = 0.3. The inset is the first two principal components on the first four eigenvectors ψn. The samples are classified into four phases. c The phases diagram in the parameter space. d The eigenvalues of the traceless Hamiltonian \(\hat{{{{{{{{\bf{H}}}}}}}}}{\prime} (k)\) and (e) the eigenstates of \(\hat{{{{{{{{\bf{H}}}}}}}}}{\prime} (k)\) on the Bloch sphere according to phases I (an unlink with PTS breaking), II (an unknot) and III (an unlink with PTS), indicating different topological phases. The red dots in (d) represent the high symmetry points k = π/2 and k = 3π/2. f The intertwined complex eigenenergies of the system in phases II and II'. The scatter plot in the k = 0 plane represents the projection of the energy bands. The insets illustrate the corresponding braid and knot diagrams with opposite chiralities.

We compare the topological classification results obtained from unsupervised learning with those obtained using the previously proposed numerical calculation method for braid degree. For a general n = 2 non-Hermitian Hamiltonian, the braid degree45 ν can be given by:

$$\nu =\int_{0}^{2\pi }\frac{{{{{{{{\rm{d}}}}}}}}k}{2\pi i}\frac{{{{{{{{\rm{d}}}}}}}}}{{{{{{{{\rm{d}}}}}}}}k}{{{{{{{\rm{lnDet}}}}}}}}(\hat{{{{{{{{\bf{H}}}}}}}}}^{\prime} (k)),$$
(2)

where \({\hat{{{{{{{{\bf{H}}}}}}}}}}^{{\prime} }(k)\) is the traceless part of the original Hamiltonian. Calculated with Eq. (2), the braid degrees for phase I and III are both 0, while for phase II and II’, they are 1 and −1, respectively. The results obtained from unsupervised learning align with the numerical calculation of the braid degree, but they also provide more comprehensive classification information than the latter.

We analyze the topological properties and knots of different phases by plotting energy bands and eigenvectors of Hamiltonian. Figure 2d displays the complex eigenvalues E of \(\hat{{{{{{\bf{H}}}}}}}^{\prime} (k)\) of the phases I, II, III. In phases I and III, the two bands intertwine into two separate rings, forming an unlink, while in phase II, the two bands are connected at their ends, forming a loop, which represents an unknot. Both phases I and III form unlink with the same braid degree ν = 0 according to Eq. (2), however, they are recognized separately as two distinct topological phases. The qualitative difference between phases I and III is reflected in the energy band structure as demonstrated in Fig. 2d. In phase I, we have \({E}_{\pm }(k)=-{E}_{\pm }^{* }(\pi -k)\) and the system exhibits PTS breaking. In phase III, however, \({E}_{\pm }(k)={E}_{\pm }^{* }(\pi -k)\). The system exhibits PTS at the high symmetry points k = π/2 and k = 3π/2. Those relations are protected by the “hidden” time-reversal symmetry46 in this model (see Supplementary Note 3.2), under which phases I and III cannot deform continuously to each other without band degeneracy. Moreover, the symmetry constraint is similarly reflected in eigenstates for phases I and III. Visualizing the eigenstates as two Bloch vectors \(({S}_{x}^{\pm },{S}_{y}^{\pm },{S}_{z}^{\pm })\) in Fig. 2e, we find in phase I, \({S}_{x}^{\pm }(k)=-{S}_{x}^{\pm }(\pi -k), {S}_{y}^{\pm }(k)= {S}_{y}^{\pm }(\pi -k), {S}_{z}^{\pm }(k)= {S}_{z}^{\pm }(\pi -k)\), while different in phase III, \({S}_{x}^{\pm }(k)={S}_{x}^{\pm }(\pi -k),{S}_{y}^{\pm }(k)= {S}_{y}^{\pm }(\pi -k),{S}_{z}^{\pm }(k)=-{S}_{z}^{\pm }(\pi -k)\). To further demonstrate the differences among phase I, II and III, we plot the Riemann surfaces near EPs in Supplementary Fig. S2, which are linked to the implementation of the two-band braids. More specifically, Supplementary Fig. S3 provides a more detailed analysis of the eigenvalues and eigenvectors, revealing distinct behaviors of phases I, II, III before and after the EPs, supporting that they represent three distinct phases. The different topological phases induced by the parameter g exhibit not only distinct eigenvalue behaviors but also different dynamical (eigenstate) behaviors on the sides of EP (Supplementary Fig. S4).

Figure 2f displays the complex eigenvalue E of phases II (ν = 1) and II’ (ν = −1). The scatter plot in the k = 0 plane represents the knot projection of the energy band braids onto that plane. The insets illustrate the corresponding braid diagrams with braid closures by the gray lines as well as the knot diagrams. Although the over-crossing (II) and the under-crossing (II’) band braids both form the seemly same unknot, they actually represent two distinct phases18. Because the phase transition between over-crossing and under-crossing braids occurs with the degeneracy and subsequent reopening of energy bands, usually accompanied by EP points, and vice versa. Our method takes into account the energy band information comprehensively, allowing us to effectively discern between the over-crossing and under-crossing band braids. The chirality of the braid reversed by the sign of C is also manifested by the direction inversion of the non-Hermitian skin effect (NHSE) under open boundary conditions (see Supplementary Note 3.6), and is successfully identified as distinct topological phases by the unsupervised machine learning.

Building upon the model illustrated in Fig. 2a, we then consider a data set with Δ = 0.15, C = 0.3 and variable g, γ. The classification results of unsupervised learning are shown in Fig. 3a, indicating there are four distinct phases. Apart from the phases I, II, III mentioned above, a phase IV with ν = 2 (calculated from Eq. (2)) appears when γ < 2Δ − 2g, as shown in Fig. 3b. Figure 3c displays the complex eigenenergies of the system in phase IV, which exhibit a Hopf link topology. Similarly, when the asymmetric couplings C ± Δ appear in the next-nearest neighboring sublattice a instead of the nearest neighboring sublattice, there are also four distinct phases with varying g and γ (Fig. 3d). As depicted in the phase diagram presented in Fig. 3e, when γ < 2Δ − 2g, there will be a case of ν = 4 (calculated from Eq. (2)) with the intertwined band knot corresponding to a Solomon ring. Figure 3f shows the complex eigenenergies of the system forming Solomon ring. A similar knot has also been discovered in ferroelectric polarization recently47. Additionally, when there are lattice sites with further asymmetric couplings, a richer variety of knots can emerge. However, due to limitations in the parameter space, we only display a partial representation of these knots in this study.

Fig. 3: The unsupervised learning classification of n = 2 non-Hermitian models with varying parameters g and γ.
figure 3

a The first eight largest eigenvalues λn and the principal components of the first four eigenvectors ψn of the probability transition matrix \(\hat{{{{{{{{\bf{P}}}}}}}}}\), indicating four distinct phases. The parameters are Δ = 0.15, C = 0.3. The Gaussian kernel coefficient ϵ = 0.001. b The phases diagram coincides with the unsupervised learning classification. Apart from the phases I, II, III shown in Fig. 2, a phase IV appears when γ < 2Δ − 2g. c The intertwined complex eigenenergies of the system in phase IV forms a Hopf link. d The eigenvalues and the corresponding principal components of eigenvectors of the probability transition matrix \(\hat{{{{{{{{\bf{P}}}}}}}}}\) for the model with next nearest-neighbor coupling, using the same parameters as in (a). e When γ < 2Δ − 2g, the intertwined complex eigenenergies of the system braid as a Solomon ring, as shown in (f).

To evaluate the effectiveness of unsupervised learning in classifying complex braids associated with intricate knots and links, we employ adjustable couplings at the m-th (m = 1,2,3) nearest neighbors, as depicted in Fig. 4a. The Hamiltonian of this multiple model (m = 1,2,3) in momentum-space is expressed as:

$$\hat{{{{{{{{\bf{H}}}}}}}}}(k)=\left[\begin{array}{cc}{\sum }_{m}(2{C}_{m}\cos (mk)+i2{\Delta }_{m}\sin (mk))-i\gamma &g\\ g&0\end{array}\right].$$
(3)

The parameters \(\left\{{\Delta }_{m}\right\}\) with (m = 1,2,3) vary simultaneously and continuously while ensuring Cm = 2Δm (see details on parameters setting in Supplementary Note 4.1).

Fig. 4: The unsupervised learning classification of a n = 2 non-Hermitian model with multiple couplings.
figure 4

a Sketch of the two band lattice model. The asymmetric coupling Cm ± ∆m occurs at the m-th (m = 1, 2, 3) nearest neighbors. g is the coupling constants. γ denotes the additional loss rate. b The largest eigenvalues λn < 8 of the probability transition matrix \(\hat{{{{{{{{\bf{P}}}}}}}}}\) as a function of ϵ. c The largest eigenvalues λn. The inset is the principal components of the first four eigenvectors ψn. The Hamiltonian samples are randomly generated in the parameter space consisting of variable g and Δm. All the samples are classified into four phases, corresponding to different elements in the braid group. The Gaussian kernel coefficient ϵ = 0.05. d The phases diagram obtained by the unsupervised learning, with the corresponding knot diagrams and braid degrees. e The complex eigenenergies of the system and the corresponding braid and knot diagrams in Trefoil phase. The scatter plot in the k = 0 plane represents the projection of the energy bands.

Following the unsupervised learning classification, we investigate the largest eigenvalues λn of \(\hat{{{{{{{{\bf{P}}}}}}}}}\) as a function of the Gaussian kernel coefficient ϵ, as shown in Fig. 4b. Within a prolonged region of small yet finite ϵ, the degeneracy observed in the largest eigenvalues indicates the existence of four topological sectors. Figure 4c shows the largest eigenvalues with ϵ = 0.05. The first and second principal components of the eigenvectors ψ0−3 are shown in the inset, indicating the four distinct phases (Supplementary Fig. S7). Figure 4d exhibits the well classified phases diagram with the corresponding braid degrees (calculated from Eq. (2)). When g is small, three non-trivial cases of the system’s complex energy band emerge as a result of changes in \(\left\{{\Delta }_{m}\right\}\), corresponding to unknot, Hopf link and Trefoil. When g is large, two bands always form two separate loops, resulting in trivial unlinks. The classification results obtained from unsupervised manifold learning are justified by the distinct braids and knot topology. The corresponding complex-energy bands in phase Trefoil in momentum space are shown in Fig. 4e. The complex energy bands of the remaining three phases (unlink, unknot and Hopf link) have been presented in the previous text. Without loss of generality, we only discuss the case \(\left\{{C}_{m}\right\} \, > \, 0\) here. As previously mentioned, the chirality of non-trivial phases - unknot, Hopf link, Solomon ring and Trefoil can be inversed by the sign of \(\left\{{C}_{m}\right\}\), which can also be successfully identified as distinct topological phases by the unsupervised learning (see Supplementary Note 4.3).

We further demonstrate the machine learning of the braid group and knot topology in a n = 3 non-Hermitian bands. As shown in Fig. 5a, we consider a Markovian three-state model which is widely used for counting statistics15, cyclic enzyme reactions48, molecular motors49, and charge currents through quantum dots50. The non-Hermitian Hamiltonian is:

$$\hat{{{{{{{{\bf{H}}}}}}}}}(k)=\left[\begin{array}{ccc}-{l}_{1}-{l}_{5}&{l}_{4}{e}^{-ik}&{l}_{3}\\ {l}_{1}{e}^{ik}&-{l}_{2}-{l}_{4}&{l}_{6}\\ {l}_{5}&{l}_{2}&-{l}_{3}-{l}_{6}\end{array}\right].$$
(4)

For the sake of simplicity, we set l3 = 5, l4 = 2, l5 = 5, and l6 = 0.1, focusing solely on detecting the phase transition in knot topology within the parameter space of (l1, l2). The unsupervised learning results using the proposed method are displayed in Fig. 5b. The eigenvalues and eigenvectors of the probability transition matrix indicate the presence of four topological phases. The phases diagram according to the unsupervised learning outcomes is depicted in Fig. 5c, d shows the complex energy bands in each phases. In phase, the three bands intertwine into three separate rings, forming a trivial unlink with a consistent period of 2π. As we delve into phase, the green and purple bands intertwine through a continuous change of k, resulting in a Hopf link, while the blue band forms a separate loop. In phase, however, the blue and green bands twist as a Hopf link. Phases and are evidently distinct, as it is not possible to continuously transform from one phase to the other. Advancing further to phase, the three bands twist around each other, forming a Trefoil. Due to the spontaneous symmetry breaking15, the period of the bands become 6π rather than 2π. This expansion in period reaffirms the significance of extending the momentum space of the descriptor to k ∈ (0, 2nπ) within our method, allowing us to capture the properties embedded in the Hamiltonian more comprehensively.

Fig. 5: The unsupervised learning classification of a n = 3 non-Hermitian model.
figure 5

a Sketch of the Markovian three-band kinetic model. l1, l2, l3, l4, l5, l6 are the coupling constants. b The first ten largest eigenvalues λn and the principal components of the first four eigenvectors ψn. The Hamiltonian samples are generated by varying the values of l1 and l2, while kee** l3 = 5, l4 = 2, l5 = 5, and l6 = 0.1 fixed. These samples are classified into four distinct phases. The Gaussian kernel coefficient ϵ = 0.5. c The phase diagram in the parameter space obtained through unsupervised learning. d The corresponding complex energy bands.

Conclusions

To summarize, we introduced a diffusion distance measure based on the Bloch vector, utilizing the su(n) Lie algebra framework, to characterize one-dimensional non-Hermitian systems with a unit cell size of n. Significantly, we extended the momentum space of the descriptors to k ∈ (0, 2nπ), effectively accommodating the possibility of spontaneous symmetry breaking. Combining the introduced diffusion distance measure with unsupervised learning, we successfully classified the the braid group and knot topology in both n = 2 and n = 3 non-Hermitian systems. Furthermore, the method enabled the distinction of the chirality of band braids. It also identified distinct topological phases embedded in eigenstates and protected by hidden symmetry, which were previously overlooked. The proposed method can be extended to other non-Hermitian models, such as non-Hermitian quantum models51 to detect phases which are currently unknown. Other machine learning methods52,53 may also be able to solve similar band braids classification. Our results prove significant potential of purely data-driven machine learning in uncovering unknown insights in the knot topology, braid groups, and non-Hermitian systems, without human knowledge.

Method

The traceless part \({\hat{{{{{{{{\bf{H}}}}}}}}}}^{{\prime} }\) of the non-Hermitian n × n Hamiltonian \(\hat{{{{{{{{\bf{H}}}}}}}}}\) can be represented on the basis of su(n) Lie algebra, so called generalized Gell-Mann matrices (see Supplementary Note 2), which manifests as the Gell-Mann matrices when n = 3 and reduces to the usual Pauli matrix when n = 2. For the non-Hermitian system with n = 2, which is expressed as:

$${\hat{{{{{{{{\bf{H}}}}}}}}}}^{{\prime} }(k)={{{{{{{\bf{h}}}}}}}}(k)\cdot {{{\hat{{{{{\boldsymbol{\sigma }}}}}}}}}={h}_{x}(k){\hat{\sigma }}_{x}+{h}_{y}(k){\hat{\sigma }}_{y}+{h}_{z}(k){\hat{\sigma }}_{z}.$$
(5)

The descriptor for the i-th Hamiltonian sample is identified as the generalized Bloch vector \({{{{{{{{\bf{d}}}}}}}}}_{\pm }^{i}(k)\equiv {{{{{{{{\bf{h}}}}}}}}}^{i}(k)/{E}_{\pm }^{i}(k)\) with \({E}_{\pm }^{2}(k)={h}_{x}^{2}(k)+{h}_{y}^{2}(k)+{h}_{z}^{2}(k)\) the two continuous complex energy bands. Due to the occurrence of spontaneous symmetry breaking in topologically non-trivial phases, the energy bands no longer exhibit periodicity with a period of 2π15. Thus, we expand the momentum space to k ∈ (0, 2nπ) and ensure E±(k) = E±(k + 2nπ). However, unlike the Hermitian system where the distance between two samples can be defined from the occupied energy band below certain Fermi level, the occupied band for non-Hermitian systems with complex band braiding is not well defined. Thus, we formally introduce the following distance between sample i and j as:

$${M}_{i,j}={\sum}_{{b} \in \{+,-\}}{\min}_{{b}^{\prime} \in \{+,-\}}\left({\left\Vert {\hat{{{{{{\bf{d}}}}}}}}_{b}^{i}-{\hat{{{{{{\bf{d}}}}}}}}_{{b}^{\prime} }^{j}\right\Vert }_{{{\mathbb{L}}}_{1}}^{2}\right),$$
(6)

which is the minimum distance between all possible pairs of modes. Discretizing uniformly along the n-fold extended non-Hermitian Brillouin zone k ∈ (0, 2nπ) with L points, each \({\hat{{{{{{{{\bf{d}}}}}}}}}}_{b}^{i}\) is a L × 3 matrix and \(\left\Vert \cdot \right\Vert\) represents the taxicab \({{\mathbb{L}}}_{1}\)-norm distance. This matrix-based descriptor also finds effective applications in neural network recognition of topological invariants52.

For the higher dimensions systems of n = 3, the traceless part \({\hat{{{{{{{{\bf{H}}}}}}}}}}^{{\prime} }\) is expressed on the basis of su(3) Lie algebra, as:

$${\hat{{{{{{{{\bf{H}}}}}}}}}}^{{\prime} }(k)={{{{{{{\bf{h}}}}}}}}(k)\cdot {{{\hat{{{{{\bf{a}}}}}}}}}=\sum\limits_{m=1}^{8}{h}_{m}(k){\hat{a}}_{m},$$
(7)

where \({\hat{a}}_{1,2,..,8}\) are the Gell-Mann matrices. The descriptor for the i-th sample is \({{{{{{{{\bf{d}}}}}}}}}_{1,2,3}^{i}(k)\equiv {{{{{{{{\bf{h}}}}}}}}}^{i}(k)/{E}_{1,2,3}^{i}(k)\), where \({E}_{1,2,3}^{i}(k)\) are the three continuous complex energy bands with k ∈ (0, 2nπ). The sample distance is defined as:

$${M}_{i,j} = {\min }_{S}{\sum}_{b}\left({\left\Vert {\hat{{{{{{\bf{d}}}}}}}}_{b}^{i}-{\hat{{{{{{\bf{d}}}}}}}}_{S(b)}^{\,j}\right\Vert }_{{{\mathbb{L}}}_{1}}^{2}\right),$$
(8)

where \(S=\left\{1,2,3\right\}\). Here Mi,j describes the minimum distance combination between pairwise matches of three energy bands for sample i and sample j.

The similarity matrix is then given by a Gaussian kernel:

$${K}_{i,j}=\exp \left(-\frac{{M}_{i,j}}{2\epsilon {L}^{2}}\right),$$
(9)

where ϵ is the Gaussian kernel coefficient. Using Eq. (9), we obtain the similarity matrix of N randomly sampled Hamiltonians in the parameters space, i.e., Ki,j → 1 if two samples are similar, otherwise, Ki,j → 0. The probability transition matrix is defined as \({P}_{i,j}={K}_{i,j}/\mathop{\sum }_{j = 1}^{N}{K}_{i,j}\) to describe the diffusion progress. After t steps, the diffusion distance between sample i and j on the manifold is \({D}_{i,j}^{t}={\sum }_{n}[{({P}_{i,n}^{t}-{P}_{j,n}^{t})}^{2}/ {\sum }_{n{\prime} }{K}_{n,n{\prime} }]=\mathop{\sum }_{n = 1}^{N-1}{\lambda }_{n}^{2t}{[{({\psi }_{n})}_{i}-{({\psi }_{n})}_{j}]}^{2}\), where ψn is the n-th right eigenvectors of \(\hat{{{{{{\bf{P}}}}}}}\) and λn is the n-th eigenvalue, n = 0, 1, ... , N − 1. After long time diffusion, the first few components ψn that have the largest eigenvalues λn ≈ 1 will dominate in the manifold diffusion process. Consequently, the prime information of the manifold diffusion distance is encoded within these few components, which reveals the classification information of different phases (see Supplementary Note 1).