Model-independent quantum phases classifier

Machine learning has transformed science and technology. In this article, we present a model-independent classifier that uses the k-Nearest Neighbors algorithm to classify phases of a model for which it has never been trained. This is done by studying three different spin-1 chains with some common phases: the XXZ chains with uniaxial single-ion-type anisotropy, the bond alternating XXZ chains, and the bilinear biquadratic chain. We show that the algorithm trained with two of these models can, with high probability, determine phases common to the third one. This is the first step towards a universal classifier, where an algorithm can recognize an arbitrary phase without knowing the Hamiltonian, since it knows only partial information about the quantum state.


Introduction -
The interest on quantum phases and phase transitions has been recently renewed due to new physics uncovered by experiments on cuprate superconductors, heavy fermion materials, organic conductors, and other strongly correlated materials [1].From a theoretical perspective, low-dimensional quantum lattice models can capture many aspects of these new phenomena [2,3].Therefore, determining the quantum (i.e., groundstate) phase diagrams of these models is an important challenge in condensed matter and statistical physics [4].
Concerning quantum phases classification, many alternatives have been highlighted as promising [5][6][7][8][9] with special emphasis on machine learning (ML).The main difference between ML and other statistical models is the fact that an algorithm can improve its performance, that is, learn, without the need for such explicit programming [10,11].ML is a form of applied statistics, where computers use data (usually in large quantities) to estimate functions with a high degree of complexity, which can be used to make predictions and observe patterns in these data sets [12,13].ML has been widely used in the physical sciences, including cosmology [14][15][16], quantum information [17][18][19], many-body physics [8], and also to classify quantum phases and detect their transitions [20][21][22][23][24][25].
In this letter, we analyze the correlation between spins in a closed chain for three distinct spin-1 models.We show that these correlations hold information about the phases of these distinct models, and there is considerable overlap between phase information of different models.This explain how ML algorithms, training a known model, are capable to detect some phases of another unknown model.To illustrate we use a machine learning classifier, fed with correlation and phases labels of two known models, to detect the phases of a third unknown model.We show that the prediction is succeed when the overlap of the information about the different phases is minimal.Also, we show it is possible to apply a transformation in the dataset of the correlations, which allows minimizing the overlap of the information about the different phases, making the ML predictor more accurate.
The Models -We use three well-known distinct spin-1 models, where the phase diagram of these models and their central features are well established in the literature [26][27][28].The first mode, we present is the (i) XXZ chains with uniaxial single-ion-type anisotropy, whose Hamiltonian is given by: (1) where S l is a spin-1 operator acting on site l of a onedimensional lattice (chain) with N sites, D represents uniaxial single ion anisotropy, and J(= 1), J z are spin couplings.For Hamiltonian Eq. 1, the phase diagram consists of six distinct phases, namely, Haldane, Large D, XY1, XY2, Ferromagnetic, and a Néel, and several different transitions can occur [27].The next model is the (ii) bond-alternating XXZ chain, whose Hamiltonian is given by: where ∆ is the strength of the Ising-type anisotropy that originates from the spin-orbit interaction in magnetic materials and δ is the alternation of the bond that describes dimerization.The phase diagram of the model Eq. 2 shows the Ferromagnetic phase, XY1, Néel, Haldane, and Dimerized [26].Finally, the last model analyzed was the (iii) bilinear biquadratic chain, whose Hamiltonian is given by: where θ ∈ [0, 2π) quantifies the amount of coupling between the nearest neighboring spins.The model Eq. 3 presents four phases, namely, Haldane, Trimerized, Ferromagnetic, and Dimerized [28].
To illustrate and summarize the phases and the common phases contained among these models, we prepare arXiv:2109.00625v1[quant-ph] 1 Sep 2021 Table I.As we can be noted, all phases of H 2 are contained in the combined phases of H 1 and H 3 , being the only phase diagram in which this occurs.The union of H 1 and H 2 contains three of four phases of H 3 , and the union of H 2 and H 3 contains four of six phases of H 1 .In total, we have five phases that are shared by at least two models (Haldane, Néel, Ferromagnetic, XY1, and Dimer) and three phases unique to a single model (Large-D, XY2, and Trimer).
We assume that even when different models appear on the phase diagram, a given phase has a trademark that is model independent.We propose here that the spin correlations can capture such a signature.To test this hypothesis, we will analyze several correlations between the spins in the chain.
Table I.Phases contained in the diagrams corresponding to the three Hamiltonians analyzed.The filled circles mean that the quantum phase is present in the model.The numbers subscribed in the circles represent the amount of data calculated for each phase of each model.
Data structure -The correlations between neighbors in the closed spin chain are given by the expected values of the following observables: are the expected values of the correlation for the lowest energy state of the Hamiltonian and we take the number of spins N = 12 [25].Notice that since the chain is closed and, consequently, the chain properties are cyclic, any non-redundant correlation between two spins is obtained for To generate the correlation dataset, we considered thousands of different values for the parameters of the Hamiltonians H 1 , H 2 , and H 3 .To H 1 , Eq. 1, we range the parameters J z and D in the interval [−4, 4] with step size of 0.1, this generates a dataset with 6400 data points.For the Hamiltonian H 2 , Eq. 2, we range the parameters, ∆ in an interval [0, 1], and the parameters δ in an interval [−1.5, 2.5], with step sizes of 0.005 and 0.0125, respectively, again this generate a dataset with 6400 data points.Finally, for the Hamiltonian H 3 , Eq. 3, we set the range of parameter θ in the interval [0, 2π], with the step size of 4.35 × 10 −4 , which results in a dataset with 4600 data points.The labels of the phases for the Hamiltonians H 1 , H 2 , and H 3 , are obtained from the literature [27], [26], and [28], respectively.
With the dataset of the three models, we could visualize the relation of the correlations with the quantum phases.Since we intend to use a classifier algorithm, the idea is to separate, in the multidimensional space, distinct phases in distinct positions.For 12 sites, for example, using the set of correlations described above, we have 24 distinct correlations (a space with 24 dimensions) and to visualize this amount of information in a 3D space is complicated.Nevertheless, a clue as to what happens in the correlation space can be obtained by considering only a pair of correlations.To illustrate this, in Fig. ( One important aspect to consider when working with machine learning is a dataset transformation.In many cases, appropriate transformations can separate the classes in the feature space, which facilitates the classification process.In Fig. (1-a) to Fig. (1-d) we plot the raw data, and in Fig. (1-e) to Fig. (1-h) we plot the raw data after scaling the dataset, for each model, to have a unit norm.This is a well-known renormalization procedure called spatial sign preprocessing [29].Analyzing Fig. (1), we see that even with the information contained in a single pair of correlations, we are able to separate, with high distinctness, states with different phases.Indeed, there is some overlap of this information for different phases, especially when considering several different models, Fig.Despite the improvement in reducing the overlap, Fig. (1-h) shows that there are still overlaps of information from the Haldane phase with Large-D, from the XY1, XY2, Néel, and Haldane phases with the Dimmer phase.However, it is important to note that we are illustrating the procedure considering only two features, which is insufficient to separate all phases given the complexity of the problem.In fact, the use of the 24 features, as well as studying and applying other transformations to separate the phases in the correlation space, becomes crucial and is the focus of this work.Our main goal is to classify the phases of an unknown model, given the distribution of these phases in the correlation space of other known models.For this purpose, we need an algorithm that, given a new quantum state and, consequently, a position in the correlation space, labels it with the corresponding phase based on the information from other known states, located in the vicinity of the new one in the correlation space.As we show below, even a simple algorithm is capable of performing this task with high accuracy.Machine Learning -In this manuscript, we use an supervised algorithm, i.e.where the learning process occurs through labeled data.To this task, one of the the simplest machine learning algorithms is the k-Nearest Neighbors classifier (k-NN) [30].Despite its simplicity, it presented a good result in our classification problem, which can be explained by the way the k-NN works.When a data point of the unknown model is inserted, the algorithm calculated the Euclidean distance (in this work, but the metric can be changed) of this unknown model data point to the k-nearest neighbors.The unknown model data point is classified by a plurality vote of its k neighbors, with the unknown model data point being assigned to the class most common among them.For example, if k = 1, then the object is simply assigned to the class of that single nearest neighbor [30][31][32].
In this work, we use k = 30 and assume that all neighbors have the same voting weight (it could be assumed that the closer, the greater the voting weight).The values were obtained by performing the hypermetrization of the parameters [31].Analyzing Fig. (1) and understanding how k-NN works, it quite plausible that a high accuracy universal classifier can be obtained.Naturally, it is necessary to use an appropriate transformation that reduces the overlap between the different phases in the correlation space.Once the transformation decreases the overlap between different phases (such as that made in Results -To test the accuracy of the k-NN in transferring learning from the known models to the unknown model, we begin by training the algorithm to classify the data points of H 1 .For this case, we train the k-NN with data from models H 2 and H 3 (it means that the k-NN algorithm knows the dataset of H 2 and H 3 and their respective phase labels), and predict the phases of H 1 .In sequence, we do the same for H 2 and H 3 using the data from models H 1 and H 3 , and H 1 and H 2 , respectively.It is worth noting, however, that there are phases in H 1 (Large-D and XY2) that do not exist in H 2 and H 3 , and a phase in H 2 (Trimer) that does not exist in H 1 and H 3 .Clearly, there is no way to learn from the data that were not provided [9,33], for that reason, when we predict the phase of H 1 , we remove the data for the Large-D and XY2 phases.Furthermore, when we predict the phases of H 2 we remove the Trimer phase from the predicted dataset, which ensures that unknown phases do not interfere with the accuracy of the k-NN.
In our analysis, we transform our dataset following a renormalization procedure called spatial sign preprocessing, where the dataset is scaled to have a unit norm [29].As stated before, each ground state and its respective labeled phase, are represented by the correlations between a pair of spins, S k 1 , S k i , which provide 7 features for each variable k = {x, y, z}, and global correlations j S k j , which provide 3 more features.As we note in Fig. (1), where we use only 2 correlations to illustrate our strategy, even after the dataset transformation, some overlap  The prediction of the phase diagram of H 1 , presented in Fig. (2-a), was incredibly successful with an accuracy of 96.31%.All phases are in the correct locations with few mistakes in the phase transitions.As in our two-dimensional illustrative example, the Haldane phase invades the XY1 phase space, and the confusion between the Néel and Dimmer phase persists.Nevertheless, analyzing Fig. (1-f), it is important to note that the k-NN correctly predicts the XY1 phase, even thought this phase is completely overlapped with Dimer and Haldane phase in the two-dimensional case.When considering H 2 , we observe that the algorithm commits mistakes in the separations of the phases, which made its accuracy the lowest 72.72%.Despite this, one aspect needs to be emphasized.The training dataset contains information for H 1 and H 3 , which includes all 8 distinct phases.Nevertheless, the Large-D, XY2, and Trimer phases were not indicated by the k-NN algorithm for all data of H 2 , since the algorithm detects all phases correctly, only making mistakes around the boundaries.
Finally, the prediction for model H 3 is presented in Fig. (1-c), where we use the H 1 and H 2 models for learning.In one hand, the confusion between the Haldane phase and the Dimer phase presented in Fig. (1-f) was removed when all 24 features were included.However, it incorrectly classifies the Haldane phase, mixing it with the Large-D, a phase that is not even present in the model.Nevertheless, even making this mistake, the algorithm achieve an accuracy of 89.17%.Although the good results, different strategies can be used to increase the prediction accuracy.One is to add new models to the predictor dataset, as adding new information to the k-NN would help avoid incorrect phase prediction.The second is to find a transformation that can separate the phase information in the correlation space.Finally, different machine learning algorithms can certainly be implemented to increase the accuracy.Nevertheless, these results demonstrate that the correlations between the spins provide essential information about the phases of the models.This shows that correlations obtained from known models can be used to predict phases in other different models with high accuracy.

Conclusion -
We have developed a method to study the phases of unknown magnetic systems through spin correlations.We show that raw correlation data carry information about the phases, which is independent of the model.With the spin correlation information, we use a k-NN algorithm to predict the phases of an unknown model with high accuracy.We present a proof of concept, showing that a ML algorithm can classify unknown phases of a Hamiltonian through known phases of another Hamiltonian, creating a model-independent quantum phase classifier.We emphasize that no explicit use of the phases order parameters is made, so this model-independent classifier opens up the possibility of universal classifier creation, as more and more model-independent information is added to the classifier database.

Figure 1 .
Figure 1.Correlation S x 1 S x 2 vs correlation S z 1 S z 6 , the color represents the phase of the corresponding data point.And the figures (a) and (e) refer to the system described by H1, (b) and (f) refers to H2, (c) and (g) refers to H3, (d) and (h) are the data from the three systems.The figures (a), (b), (c) and (d) are the raw data, and (e), (f), (g), (h) are the data after performing the transformation.

Figure 2 .
Figure 2. Figure (a) is the phase prediction of model H1 using the learning of models H2 and H3.Figure (b) is the phase prediction of model H2 using the learning of models H1 and H3, and figure (c) is the phase prediction of model H3 using the learning of models H1 and H2.The white dots in panels (a) and (b), and light blue line in panel (c) are the theoretical boundaries of phases given in the literature,[26][27][28], for models H1, H2, and H3, respectively.The name in black represents the real phase in that place of the model, and the color represents the predicted phase.
Figure 2. Figure (a) is the phase prediction of model H1 using the learning of models H2 and H3.Figure (b) is the phase prediction of model H2 using the learning of models H1 and H3, and figure (c) is the phase prediction of model H3 using the learning of models H1 and H2.The white dots in panels (a) and (b), and light blue line in panel (c) are the theoretical boundaries of phases given in the literature,[26][27][28], for models H1, H2, and H3, respectively.The name in black represents the real phase in that place of the model, and the color represents the predicted phase.
are calculated for all dataset, where we consider different values for the parameters of the Hamiltonians H 1 , H 2 , and H 3 .