# Predicting the onset of quantum synchronization using machine learning

F. Mahlow<EMAIL_ADDRESS>Faculty of Sciences, UNESP - São Paulo State
University, 17033-360 Bauru-SP, Brazil  B. Çakmak  Department of Physics,
Farmingdale State College—SUNY, Farmingdale, NY 11735, USA  College of
Engineering and Natural Sciences, Bahçeşehir University, Beşiktaş, Istanbul
34353, Turkiye  G. Karpat  Department of Physics, Faculty of Arts and
Sciences, İzmir University of Economics, İzmir, 35330, Turkey  İ. Yalçınkaya
Department of Physics, Faculty of Nuclear Sciences and Physical Engineering,
Czech Technical University in Prague, Břehová 7, 115 19 Praha 1-Staré Město,
Czech Republic  F. F. Fanchini  Faculty of Sciences, UNESP - São Paulo State
University, 17033-360 Bauru-SP, Brazil  QuaTI - Quantum Technology &
Information, 13560-161 São Carlos-SP, Brazil

(August 28, 2024)

###### Abstract

We have applied a machine learning algorithm to predict the emergence of
environment-induced spontaneous synchronization between two qubits in an open
system setting. In particular, we have considered three different models,
encompassing global and local dissipation regimes, to describe the open system
dynamics of the qubits. We have utilized the $k$-nearest neighbors algorithm
to estimate the long-time synchronization behavior of the qubits only using
the early time expectation values of qubit observables in these three distinct
models. Our findings clearly demonstrate the possibility of determining the
occurrence of different synchronization phenomena with high precision even at
the early stages of the dynamics using a machine learning-based approach.
Moreover, we show the robustness of our approach against potential measurement
errors in experiments by considering random errors in the qubit expectation
values, initialization errors, as well as deviations in the environment
temperature. We believe that the presented results can prove to be useful in
experimental studies on the determination of quantum synchronization.

##  I Introduction

Machine learning is a rapidly growing field of research that involves the use
of computational algorithms to estimate complex functions using large amounts
of available data. These functions can then be used to make some predictions
and identify patterns in given datasets. The main difference between the
machine learning approach and other statistical models is that it allows a
computer program to improve its performance or learn, without the need for
explicit programming [1]. In recent years, machine learning methods have
achieved remarkable success in a wide range of applications, including natural
language processing, image recognition, drug discovery, and finance. Machine
learning algorithms have been applied in many areas, including computer
science, medicine, biology, and even social sciences [2]. In physics, machine
learning techniques have been extensively used in various research fields,
encompassing cosmology, particle physics, condensed matter physics, and
quantum computing [3].

Synchronization is a widespread phenomenon that occurs across many different
systems, from natural systems like the beating of a heart or flashing of
fireflies to social systems such as the behavior of a crowd. Physical systems
can exhibit synchronous behavior in two ways, namely, forced and spontaneous.
When two or more systems are forced to oscillate in unison by an outside
influence, such as the regulation of heart rate by an external pacemaker
through electrical pulses, this is known as forced synchronization. On the
contrary, spontaneous synchronization takes place when two or more systems
naturally synchronize in the absence of any external agent. Synchronization in
classical systems has been studied in a variety of contexts over the past few
decades with many interesting outcomes [4, 5, 6]. Consequently, the study of
this universal phenomenon has been extended to the quantum domain.

Nevertheless, it needs to be emphasized that synchronization is a term of wide
scope that can indeed be interpreted in multiple ways [7, 8, 9, 10, 11].
Forced synchronization due to an external drive, also known as entrainment,
has been studied in driven dissipative oscillators [12, 13], van der Poll
oscillators [14, 15, 16] and spin-boson type models [17]. On the other hand,
environment-induced spontaneous synchronization has also been broadly
explored, for example, in harmonic oscillators [18, 19, 20, 21], van der Poll
oscillators [22, 23], optomechanical arrays [24, 25], cold ions in microtraps
[26], atomic lattices [27], spins coupled to common [28, 29, 30] and local
reservoirs [31], collectively dissipating few-body atom systems [32],
collision models [33, 34, 35] and more recently, in many others [36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49].

In the last few years, machine learning techniques have started to be employed
in physical systems, where synchronous behavior between their constituents
emerges under suitable conditions. Almost all of these studies have focused on
complex networks composed of classical oscillators, with the aim of predicting
their synchronization behavior [50, 51, 52, 53, 54, 55, 56, 57, 58, 59]. On
the other hand, it has also been demonstrated that a quantum machine learning
protocol with classical feedback can enhance synchronization between two two-
level systems within two coupled cavities [60]. Lastly, an artificial neural
network has been shown to be used to infer the dissipation properties of the
environment via a probe observable in an open system scenario where
synchronization manifests, and the emergence of synchronization improves the
performance of classification and regression tasks in this setting [61].

In this work, we consider the environment-induced synchronization phenomenon,
which spontaneously emerges between the expectation values of spin observables
of a pair of qubits during the time evolution of the open system. We present a
machine learning-based approach that employs a supervised learning algorithm
to identify the synchronization behavior of the qubit pair. In particular, we
utilize the $k$-nearest neighbors algorithm to identify whether the pair of
qubits tends toward synchronization, antisynchronization, time-delayed
synchronization, or the complete absence of these phenomena. In order to
quantify the degree of synchronization between the expectation values of local
qubit observables, we calculate the Pearson correlation coefficient that
quantify the association between two variables that are measured in the same
interval. Whereas we set the final value of the Pearson coefficient after a
long time evolution as the target of our algorithm, we use the early time
expectation values of the qubit observables during the dynamics as the input
of the algorithm. We demonstrate the effectiveness of our approach by training
and testing it with calculated quantum data obtained from three distinct open-
system models, and show that it is capable of accurately predicting the
synchronization behavior of the qubit pair even in the presence of random
measurement errors. We establish a trade-off relation between the percentage
of error in the measurement of expectation values and the number of
measurements required to maintain high accuracy.

This paper is organized as follows. In Section II, we introduce the open
system models that we consider. In Section III, we describe our methodology
for obtaining the databases used to train and test the algorithm. In Section
IV we provide a brief overview of how the algorithm works. In Section V, we
present the main results, demonstrating the effectiveness of our approach in
predicting the behavior of the simulated quantum systems, including the
addition of random errors to the measurements. Finally, in Section VI, we
conclude by discussing our central results and their possible applications.

##  II Physical Models

In this chapter, we introduce three physical models that display distinct
synchronous behaviors [33, 32, 34]. Our main aim is to study the
synchronization properties of these models from a machine learning
perspective.

###  II.1 Collision Models

Two of the models we consider in our analysis are based on collision models
[62, 63], which are very versatile and effective tools for modeling open
quantum systems. In the framework of collision models, each interaction,
either between the subsystems or between the system and the environment, is
described as a short unitary coupling among the involved parties, and the
state of the subject system is tracked through these successive couplings.
Before elaborating on the distinctive properties of the two collision models
we will consider, we would like to outline the common parts. From this point
on, we set $\hbar=1$ in both models, and we have two system qubits labeled as
$s_{1}$ and $s_{2}$ with their free Hamiltonians

$H_{s_{1}}=-\frac{\omega_{1}}{2}\sigma^{z}_{s_{1}},\quad
H_{s_{2}}=-\frac{\omega_{2}}{2}\sigma^{z}_{s_{2}},$ (1)

where $\sigma^{z}$ is the usual Pauli operator in z-direction and $\omega_{1}$
and $\omega_{2}$ represent the self-energies of the system qubits $s_{1}$ and
$s_{2}$, respectively, with their self-evolution operators,
$U_{s_{1}}=\exp(-iH_{s_{1}}\delta t_{s})$ and
$U_{s_{2}}=\exp(-iH_{s_{2}}\delta t_{s})$. In addition, we suppose that the
environment in both collision models is made up of identical qubits that are
all initiated in their ground state, i.e., the initial states of environment
qubits $e_{n},e_{n+1},...$ are $|e_{n}\rangle=|e_{n+1}\rangle=...=|0\rangle$,
and there exist no initial correlations between the system qubits and the
environment qubits.

Figure 1: (a) First collision model simulating local dissipation for the
system qubit $s_{2}$: (i) The system qubit $s_{2}$ interacts with the
environment qubit $e_{n}$. (ii) The system qubits $s_{1}$ and $s_{2}$ interact
directly with each other. (iii) The system qubits $s_{1}$ and $s_{2}$ evolve
freely. (iv) The environment qubit that has interacted with the system qubit
$s_{2}$ in step (i) is traced out, and the same cycle is iterated with the
next environment qubit $e_{n+1}$. (b) Second collision model that simulates
global dissipation for system qubits $s_{1}$ and $s_{2}$: (i) The system qubit
$s_{1}$ interacts with environment qubit $e_{n}$. (ii) The system qubit
$s_{2}$ interacts with the same environment qubit $e_{n}$. (iii) The system
qubits $s_{1}$ and $s_{2}$ directly interact. (iv) The system qubits $s_{1}$
and $s_{2}$ evolve freely, and the environment qubit that interacted with the
system qubits in step (i-ii) is traced out to continue the cycle with the next
environment qubit $e_{n+1}$.

Let us now continue with the specifics of the first collision model, which is
schematically described in Fig. 1(a). Here, the system qubit $s_{2}$ is
coupled to the environment, while $s_{1}$ is isolated from it and is only
allowed to interact directly with $s_{2}$. This model can be summarized in a
few steps as follows. First, the system qubit $s_{2}$ interacts with the
environment qubit $e_{n}$ through the Hamiltonian,

$H_{s_{2}e_{n}}=\frac{J}{2}(\sigma^{x}_{s_{2}}\sigma^{x}_{e_{n}}+\sigma^{y}_{s_{2}}\sigma^{y}_{e_{n}}),$
(2)

where $\sigma^{x}$ and $\sigma^{y}$ are the standard Pauli operators in the x-
and y-directions, with the corresponding unitary evolution operator given as
$U_{se}=\exp(-iH_{se}\delta t_{se})$. Here, the parameter $J\delta t_{se}$
quantifies the strength of the coupling between the open system qubit $s_{2}$
and the environment qubits. Afterwards, the system qubits $s_{1}$ and $s_{2}$
interact with each other directly described by the Hamiltonian,

$H_{s_{1}s_{2}}=\frac{\lambda}{2}(\sigma^{x}_{s_{1}}\sigma^{x}_{s_{2}}+\sigma^{y}_{s_{1}}\sigma^{y}_{s_{2}}),$
(3)

where the operator $U_{ss}=\exp(-iH_{s_{1}s_{2}}\delta_{t_{ss}})$ describes
their dynamics with $\lambda\delta t_{ss}$ being the coupling strength between
$s_{1}$ and $s_{2}$. In the third step, the system qubits $s_{1}$ and $s_{2}$
evolve freely with their self-Hamiltonians. In the last step, a single
iteration of the collision model is finalized by tracing out the environment
qubit $e_{n}$ and moving on to repeat the procedure described above with the
environment qubit $e_{n+1}$. This cycle is repeated $N$ times to obtain the
evolution of the open system.

In the second collision model, different from the first model we discussed,
both system qubits $s_{1}$ and $s_{2}$ are open to interaction with the
environment. We describe a single cycle in the model below, which is also
pictorially summarized in Fig. 1(b). In the initial step, the system qubit
$s_{1}$ interacts with the environment spin $e_{n}$ via the interaction
Hamiltonian,

$H_{s_{1}e_{n}}=\frac{J}{2}(\sigma^{x}_{s_{1}}\sigma^{x}_{e_{n}}+\sigma^{y}_{s_{1}}\sigma^{y}_{e_{n}}).$
(4)

Next, the system qubit $s_{2}$ interacts with the same environment spin
$e_{n}$ through the same Hamiltonian, i.e.,

$H_{s_{2}e_{n}}=\frac{J}{2}(\sigma^{x}_{s_{2}}\sigma^{x}_{e_{n}}+\sigma^{y}_{s_{2}}\sigma^{y}_{e_{n}}).$
(5)

The associated unitary evolution operator is then given by
$U_{se}=\exp(-iH_{se}\delta t_{se})$ for the interaction of both system qubits
with the environment, and $J\delta t_{se}$ quantifies the coupling strength.
After the system-environment interactions, the system qubits $s_{1}$ and
$s_{2}$ directly interact with each other with the Hamiltonian,

$H_{s_{1}s_{2}}=\frac{\lambda}{2}(\sigma^{x}_{s_{1}}\sigma^{x}_{s_{2}}),$ (6)

where the corresponding unitary evolution operator becomes
$U_{ss}=\exp(-iH_{s_{1}s_{2}}\delta_{t_{ss}})$, and $\lambda\delta t_{ss}$ is
the strength of the qubit-qubit interaction. Lastly, the system qubits $s_{1}$
and $s_{2}$ evolve freely with their self-Hamiltonians given in Eq. (1), and a
single iteration in the model is concluded by tracing out the environment
qubit $e_{n}$ to continue the dynamics with the upcoming environment qubit
$e_{n+1}$.

Finally, we briefly highlight the fundamental difference between the two
collision models that we consider in this work, as depicted in Fig. 1. While
the first collision model describes a local dissipation scenario, where only
one system qubit is open to interaction with the environment, the second model
lets both system qubits couple to the environmental degrees of freedom. In
other words, as the first model is actually a simulation of local dissipation
affecting a single qubit in the two-qubit system, the second one serves as an
example of global dissipation, where both qubits are under the effect of
noise. On the other hand, it is also worth noting that despite the fact that
both collision models have various interaction parameters in common, the
qubit-qubit interaction Hamiltonian in these models is not exactly the same,
which can be seen by comparing Eq. (3) and Eq. (6). Indeed, we consider these
different Hamiltonians to display the independence of our results from a
particular form of qubit-qubit interaction on the prediction of
synchronization based on machine learning.

###  II.2 Master Equation Model

The model we consider in this part can be employed to describe the coupling
between a pair of two-level atoms and a quantized thermal electromagnetic
field environment. Here, we set $\hbar=1$ and adjust the units of other
parameters in accordance with this. Then, the self-Hamiltonians of the system
atoms are given as $H_{s}=\sum_{i=1}^{2}\omega_{i}\sigma_{i}^{z}$, where
$\omega_{i}$ represents the transition frequency between the energy levels of
the $i^{th}$ atom, and $\sigma^{z}$ denotes the usual Pauli operator in the
z-direction. We also suppose that the system atoms have polarized dipole
moments, $\mathbf{d_{eg}}$, and that they are coupled to each other via the
exchange interaction Hamiltonian $H_{d}=\sum_{i\neq
j}^{2}f_{ij}\sigma^{+}_{i}\sigma^{-}_{j}$, where $f_{ij}$ quantifies the
intensity of the atom-atom interaction, and $\sigma^{\pm}$ are the up and down
operators of the two-level atoms. Considering the coupling of the atoms to
thermal photons and focusing on the reduced dynamics of two-level atomic
systems, we obtain the well-known quantum optical master equation given by
[64, 65]

$\dot{\rho}=-i\left[(H_{s}+H_{d}),\rho\right]+\mathcal{D}_{-}(\rho)+\mathcal{D}_{+}(\rho)=\mathcal{L}(\rho),$
(7)

where $\mathcal{D}_{-}(\rho)$ and $\mathcal{D}_{+}(\rho)$ are defined as

$\displaystyle\mathcal{D}_{-}(\rho)=$
$\displaystyle\sum\limits_{i,j=1}^{2}\gamma_{ij}(\bar{n}+1)(\sigma_{j}^{-}\rho\sigma_{i}^{+}-\frac{1}{2}\\{\sigma_{i}^{+}\sigma_{j}^{-},\rho\\}),$
(8) $\displaystyle\mathcal{D}_{+}(\rho)=$
$\displaystyle\sum\limits_{i,j=1}^{2}\gamma_{ij}\bar{n}(\sigma_{j}^{+}\rho\sigma_{i}^{-}-\frac{1}{2}\\{\sigma_{i}^{-}\sigma_{j}^{+},\rho\\}),$
(9)

where $\rho$ represents the density operator for the pair of atoms. In Eq.
(7), as the first term represents the unitary self-evolution and the exchange
interaction between the atoms, the second term detailed in Eq. (8) describes
the spontaneous and thermally induced emission processes. Lastly, the third
term given in Eq. (9) is responsible for the thermally induced absorption
process. The rate at which these processes occur is determined by the mean
number of photons $\bar{n}$ at the transition frequency. The decay rates in
the quantum optical master equation are expressed as
$\gamma_{ij}=\sqrt{\gamma_{i}\gamma_{j}}a(k_{0}r_{ij})$ where
$\gamma_{i(j)}=\omega_{i(j)}^{3}g$, $k_{0}=(\omega_{1}+\omega_{2})/2c$ and
$g=d_{eg}^{2}/3\pi\epsilon_{0}c^{3}$. In addition, condition
$a(k_{0}r_{ij})\leq 1$ needs to be satisfied to guarantee the positivity of
the dynamics. Here, $d_{eg}$, c, $\epsilon_{0}$, and $r_{ij}$ respectively
stand for the identical dipole moment of the atoms, the speed of light in
vacuum, the permittivity of free space, and the relative position of the
$i^{th}$ and $j^{th}$ atoms. While $a_{ij}$ controls the degree of collective
behavior in the dynamics of the atoms, $f_{ij}$ quantifies the strength of the
exchange interaction between them. Explicit forms of these model parameters
can be found in Refs. [65, 66, 67]. In our analysis, we focus on the zero
temperature case $\bar{n}=0$, and assume that the two-atom system undergoes
fully collective dynamics, i.e., $a_{ij}=1$.

##  III Data structure

Data are a very crucial part of all machine learning techniques, since
learning algorithms are trained on datasets. To train these learning models,
we need a data structure that can effectively represent the information we
obtain from physical simulations. Having introduced the three different open-
system models that we intend to consider in our study, we will now elaborate
on the formation of the databases to be used by the machine learning algorithm
here to predict the synchronization behavior of the qubits. In general, data
can be divided into two groups: training data and test data. While the
training data is used to train the algorithm, the test data is used to
evaluate its performance. As the algorithm is trained, it naturally has access
to this part of the data and can use it to learn how to map inputs to outputs.
The test data, on the other hand, are not utilized to train the algorithm.
Instead, it is used to evaluate the algorithm’s performance by comparing its
predictions with the actual output. Within these two data groups, we can
further distinguish two subgroups: features and targets. The features are the
independent input variables that the algorithm uses to estimate the target,
which is nothing more than the output that the model aims to predict.

In our analysis, the variables under study are the local expectation values of
the system qubit observables, as we intend to explore the harmony between
their dynamics to witness the emergence of spontaneous synchronization. Due to
the fact that synchronization is a property of the open system dynamics rather
than a particular choice of observable, it is in principle possible to choose
an arbitrary qubit observable to study the synchronization properties of the
system. Here, we focus on the expectation values of system qubit observables
along the x direction, that is, $\langle\sigma^{x}_{s_{1}}\rangle$ and
$\langle\sigma^{x}_{s_{2}}\rangle$, for concreteness. To determine the
eventual synchronization behavior of the qubit pair, it is in general
necessary to trace the long time dynamics of the local expectation values of
qubits and thus the open system dynamics itself. However, we will only
consider 5 to 100 early time expectation values for each qubit as features
(inputs) of the algorithm to demonstrate the ability of our machine learning
approach to successfully anticipate the long-time synchronization behavior of
the open system. Moreover, as customary in the literature, we quantify the
degree of synchronization between the qubits using the Pearson coefficient.
Particularly, we set the Pearson coefficient as the target (output) of the
learning algorithm, and calculate it in simulations for the 100 late time
expectation values of the qubit observables.

Let us also introduce the definition of the Pearson coefficient and briefly
elaborate on its significance in quantifying the synchronous behavior between
the qubit observables. Pearson coefficient is a statistical measure that can
be employed to quantify the degree of linear association between two discrete
variables. It is defined as

$C_{12}=\frac{\sum_{i=1}^{n}(x_{i}-\bar{x})(y_{i}-\bar{y})}{\sqrt{\sum_{i=1}^{n}(x_{i}-\bar{x})^{2}\sum_{i=1}^{n}(y_{i}-\bar{y})^{2}}}$
(10)

where, $\bar{x}$ and $\bar{y}$ are the average values of $x$ and $y$
respectively, and $n$ is the number of values that the variables can take. The
Pearson coefficient $C_{12}$ can assume values in the interval $[-1,1]$. As
the case $C_{12}=0$ indicates that the variables have no correlation,
$C_{12}=1$ ($C_{12}=-1$) signifies that they are perfectly positively
(negatively) correlated. In particular, while the perfect positive (negative)
correlation tells us that as one variable changes so does the other variable
in the same (opposite) manner. In our work, the studied variables are the
expectation values of the local qubit observables
$\langle\sigma^{x}_{s_{1}}\rangle$ and $\langle\sigma^{x}_{s_{2}}\rangle$. In
the context of our study, we are interested in the asymptotic synchronization
behavior of the qubit pair in the long time limit. Therefore, in numerical
simulations, we generate the expectation values as discrete samples that cover
the last 100 expectation values for each local qubit observable, also making
sure that we choose a sufficiently large $n$ value for each model. In other
words, whereas the asymptotic value of $C_{12}\approx 0$ implies uncorrelated
oscillations for the local expectation values in the long time limit,
$C_{12}\approx 1$ $(C_{12}\approx-1)$ means that full synchronization (anti-
synchronization) is established between them. In addition, it is also possible
for the Pearson coefficient $C_{12}$ to reach asymptotic values other than 1
or -1. This suggests that the mutual oscillations of the expectation values
are still phase-locked in the long time limit, however, the phase difference
between them is neither 0 as in full synchronization nor $\pi$ as in full
anti-synchronization. Such cases are known as time-delayed synchronization
[9].

Before concluding this section, we want to discuss how we take into account
potential errors in the expectation values of qubits in our simulations, which
can be caused by various different sources, such as imperfect measurements or
decoherence, in order to emphasize the robustness of our approach in an
experimental setting. To simulate such errors, we add random errors of varying
percentages to the expectation values to see whether the considered machine
learning algorithm would still be able to correctly predict the values for our
target in the presence of error. The error is added by summing the expectation
values with a random value $\epsilon$ between -1 and 1, multiplied by an error
rate between 0.005 and 0.05. This allows us to determine the accuracy of the
algorithm in terms of the deviation from the calculated expectation values.

##  IV $k$-Nearest Neighbors Regressor

Machine learning is a subfield of artificial intelligence that is concerned
with developing algorithms that can learn from the available data to make
predictions or decisions without being explicitly programmed to do so. The
majority of learning algorithms can be classified into two categories, namely,
supervised and unsupervised [68]. In supervised learning, the algorithm is
trained with labeled data to make predictions about future instances. These
data can be either numerical or categorical. As numerical data can be used to
predict continuous values, such as the price of a vehicle, categorical data
can be used to classify subjects into one of several categories. Examples of
supervised learning applications include image classification, speech
recognition, natural language processing, and fraud detection. On the other
hand, unsupervised models work with unlabeled data to explore hidden patterns
that may not be directly visible [69].

We will utilize the $k$-nearest Neighbors (KNN) algorithm, which aims to
calculate the proximity between data points using a metric such as the
Euclidean distance, and then estimates the output of a test sample by
averaging the outputs of its $k$ nearest neighbors in the training data [70].
The number of neighbors K is a hyperparameter that needs to be fixed before
training the model. A small value of K results in a more flexible model that
can recognize complex patterns in the data, but it may possibly lead to
overfitting. On the contrary, a large value of K may result in a more stable
and robust model, but it may fail to capture local patterns in the data. The
algorithm is typically iterated to find the optimal value of K. The KNN
algorithm has several advantages, including its simplicity and
interpretability, as well as its ability to work with any underlying data
distribution and ease of implementation using basic math [71]. However, it may
turn out to be computationally expensive for large datasets, and careful
tuning of the hyperparameters may be necessary to achieve good accuracy. The
implementation of the KNN algorithm in this work has been carried out using
the scikit-learn library in Python [72]. All algorithm parameters are kept at
their default settings.

##  V Results

In this chapter, we present our main results related to the implementation of
the KNN algorithm to predict the long-time synchronization behavior for a pair
of qubits in three distinct open system models introduced previously.

###  V.1 Collision Models

We will commence this section by considering the first collision model,
outlined in Fig. 1(a), where only one of the system qubits is directly coupled
to the environment. We set the initial states of the system qubits $s_{1}$ and
$s_{2}$ as
$|\psi_{s_{1}}\rangle=|\psi_{s_{2}}\rangle=(|0\rangle+|1\rangle)/\sqrt{2}$. At
this point, let us emphasize that the emergence of synchronization does not
depend on the choice of initial states since it is a property of the dynamical
process. Furthermore, we fix the model parameters as $\delta t_{s}=\delta
t_{ss}=1.0$ and $\delta t_{se}=1.0$. To create our data set, we consider the
values of the detuning $\omega_{1}/\omega_{2}$ varied from 0.97 to 1.03 in
steps of 0.0015, the direct coupling strength $\lambda$ varied from 0.01 to
0.06 in steps of 0.002, and the system-environment interaction strength $J$
varied from 0.05 to 0.15 in steps of 0.01. This results in a total of 10,250
different configurations for the model parameters. For each of these
configurations, we calculate the open system dynamics of the model and
evaluate the expectation values of the observables for the system qubits,
$\langle\sigma^{x}_{s_{1}}\rangle=\text{Tr}[\rho_{s_{1}}\sigma^{x}]$ and
$\langle\sigma^{x}_{s_{2}}\rangle=\text{Tr}[\rho_{s_{2}}\sigma^{x}]$, after
each collision, for a total of 4000 collisions, where $\rho_{s_{1}}$ and
$\rho_{s_{2}}$ denote the reduced density operators for the system qubits
$s_{1}$ and $s_{2}$, respectively. Confirming that the system has reached its
long-time dynamical behavior with this data, we calculate the Pearson
correlation coefficient $C_{12}$ by taking into account the expectation values
of system qubits calculated for the last 100 collisions. In Fig. 2(a), we show
the Pearson coefficient $C_{12}$ plotted as a function of the detuning
$\omega_{1}/\omega_{2}$ and the direct coupling strength $\lambda$ for a fixed
system-environment interaction strength, that is, $J=0.1$, for presentation
purposes. It is straightforward to observe that the synchronization and
antisynchronization regions are separated by the resonance line on which
synchronization is absent [34].

To check the capability of our machine learning-based approach to predict the
synchronization properties of this open system model, we calculated the
corresponding expectation values $\langle\sigma^{x}_{s_{1}}\rangle$ and
$\langle\sigma^{x}_{s_{2}}\rangle$ for the first 100 collisions (features),
and the Pearson coefficient $C_{12}$ evaluated for the last 100 collisions
(target) to train the KNN algorithm. To avoid the predictions of $C_{12}$
based directly on the training data in Fig. 2, we reran the entire simulation
considering slight adjustments $+\varepsilon$ in the parameters
$\omega_{1}/\omega_{2}$ and $\lambda$, where $-0.0001<\varepsilon<0.0001$.
This has in fact allowed us to train the KNN algorithm using the original
dataset and evaluate its prediction performance on a new and independent
dataset. In Fig. 2(b), we show the predicted values of the Pearson coefficient
$C_{12}$ once again, fixing $J=0.1$. However, we note that this particular
choice of $J$ is made just for visualization purposes and that the KNN
algorithm has actually been trained with a certain range of $J$ values. We
show the calculated and predicted $C_{12}$ plots side by side in Fig. 2. As
can be seen by comparing the calculated and predicted Pearson coefficient
plots $C_{12}$, the KNN algorithm appears to perform very well in predicting
different synchronization behaviors in this model, i.e.,
synchronization/antisynchronization regimes and lack of synchronization. To
quantify the accuracy of the algorithm, we calculate the mean absolute error
(MAE) for the predicted values as compared to the calculated ones using the
expression

$MAE=\frac{1}{n}\sum_{i=1}^{n}\left|y_{i}-\hat{y}_{i}\right|,$ (11)

where $n$ is the number of data points, $y_{i}$ is the calculated $C_{12}$
value, and $\hat{y}_{i}$ is the predicted $C_{12}$ value. That is, MAE is
simply given by the absolute value of the difference between the calculated
and predicted values averaged over all data points. For the prediction results
displayed in Fig. 2, we find $MAE=0.009$, which exhibits the success of the
KNN algorithm in inferring the long-time synchronization behavior of the model
even though it only has access to early time expectation values for the system
qubits calculated for the first 100 collisions.

Figure 2: The first collision model: (a) The Pearson coefficient $C_{12}$,
calculated for the late time 100 expectation values of the system qubits
$\langle\sigma^{x}_{s_{1}}\rangle$ and $\langle\sigma^{x}_{s_{2}}\rangle$, as
a function of the direct interaction strength $\lambda$ between them and the
detuning between their self-energies $\omega_{1}/\omega_{2}$, for the system-
environment coupling strength $J=0.1$. (b) Predicted $C_{12}$ values given by
the KNN regressor using the early time 100 expectation values of the qubit
pair as a function of $\lambda$ and $\omega_{1}/\omega_{2}$ for $J=0.1$.

Moreover, to examine a more realistic scenario, we take into account potential
errors in the measurement of the local expectations values of the qubits,
which can naturally occur in an experimental setting. As mentioned previously,
we simulate these errors by summing the expectation values with a random
number $\epsilon$ taken from the interval $\epsilon\in[-1,1],$ which is then
multiplied by an error rate between 0.005 and 0.05. In other words, we
consider a percentage error rate between $\%0.5$ and $\%5$ in the expectation
value measurements of both qubits. We also perform the same analysis displayed
in Fig. 2, where the first 100 expectation values are used as the input of the
KNN regressor, but this time using the first 5, 10 and 50 expectation values
of the qubit pair as the input of the algorithm. We summarize the outcomes of
our simulations in Fig. 3, where the dotted red, dot-dashed green, dashed
orange, and solid blue lines display how the MAE for the Pearson coefficient
$C_{12}$ scales with the added percentage error to the expectation values of
qubits, $\langle\sigma^{x}_{s_{1}}\rangle$ and
$\langle\sigma^{x}_{s_{2}}\rangle$, when the expectation values after the
first 100, 50, 10 and 5 collisions are used for prediction, respectively.
Based on these results, it is quite clear that there exists a trade-off
relation between the number of expectation values of the qubits used for the
prediction of $C_{12}$ and the robustness of the KNN regression algorithm
against errors. Particularly, the predictions of the algorithm regarding the
synchronization properties of the model are quite susceptible to even a small
percentage of errors when its input involves a small number of qubit
expectation values, as can be seen from the case of 5 expectation values for
each qubit shown by the solid blue line in Fig. 3. On the other hand, we also
observe that once the algorithm has access to 50 or 100 expectation values for
each qubit, then it can actually make quite accurate predictions of the
Pearson coefficient $C_{12}$. Indeed, in such cases, increasing the percentage
error in the expectation values from $0.5\%$ up to $5\%$ only very marginally
changes the MAE, which is not even visible to the eye in Fig. 3. All in all,
these results suggest that, in the case of the first collision model
describing the local dissipation of one of the qubits in the pair, our machine
learning approach based on the KNN regression algorithm is quite effective in
predicting different regimes of synchronization or its absence accurately. We
should lastly emphasize once again that 50 to 100 expectation value
measurements for each qubit at the early stages of the dynamics turn out to be
sufficient to predict the long time synchronization behavior of this model
with high accuracy, despite the presence of potential measurement errors in a
given experimental setup.

Figure 3: Mean absolute error (MAE) for the Pearson coefficient $C_{12}$ in
the first collision model in terms of the percentage error that is added to
the calculated expectation values of the qubits
$\langle\sigma^{x}_{s_{1}}\rangle$ and $\langle\sigma^{x}_{s_{2}}\rangle$.
Four different lines in the legend correspond to the cases of feeding the KNN
regressor with 5, 10, 50, and 100 pairs of qubit expectation values for
prediction. Figure 4: The second collision model: (a) The Pearson coefficient
$C_{12}$, calculated for the late time 100 expectation values of the system
qubits $\langle\sigma^{x}_{s_{1}}\rangle$ and
$\langle\sigma^{x}_{s_{2}}\rangle$, as a function of the direct interaction
strength $\lambda$ between them and the detuning between their self-energies
$\omega_{1}/\omega_{2}$. (b) Predicted $C_{12}$ values given by the KNN
regressor using the early time 100 expectation values of the qubits as a
function of $\lambda$ and $\omega_{1}/\omega_{2}$.

Having demonstrated the performance of our approach in the first collision
model, we now turn our attention to the second collision model depicted in
Fig. 1(b), which describes the global dissipation of the qubit pair in the
sense that both qubits interact with the same environmental particle at each
iteration. Similarly to the first collision model, we set the initial states
of the system qubits $s_{1}$ and $s_{2}$ as
$|\psi_{s_{1}}\rangle=|\psi_{s_{2}}\rangle=(|0\rangle+|1\rangle)/\sqrt{2}$,
and choose the model parameters as $\delta t_{s}=\delta t_{ss}=0.2$, $\delta
t_{se}=0.05$ and $J=1.0$. After fixing the model and system parameters, we
create our data set considering the values of detuning $\omega_{1}/\omega_{2}$
from 0.93 to 1.08 in steps of 0.002 and the direct coupling strength $\lambda$
from 0.0 to 0.01 in steps of 0.002. This gives us a total of 3876 different
configurations for the model parameters. We obtain the open-system evolution
of the model and the expectation values $\langle\sigma^{x}_{s_{1}}\rangle$ and
$\langle\sigma^{x}_{s_{2}}\rangle$ for each of these configurations for 5000
collisions, after which point the expectation values become negligibly small.
Then, we calculate the Pearson coefficient $C_{12}$ for the expectation values
of the system qubits considering the last 100 collisions to see the long-time
synchronization behavior. In Fig. 4(a), the Pearson coefficient $C_{12}$ is
plotted as a function of the direct coupling strength $\lambda$ and the
detuning $\omega_{1}/\omega_{2}$ between the self-energies of the qubits.
Unlike the first collision model, where both synchronization and anti-
synchronization can occur depending on the detuning between the self-energies
of the qubits, here it is only possible to observe anti-synchronization, which
emerges if the direct coupling between the qubit pair is sufficiently strong
to compensate for the detuning.

Using the same approach as we followed in the examination of the first
collision model, we train the KNN regressor with the corresponding expectation
values $\langle\sigma^{x}_{s_{1}}\rangle$ and
$\langle\sigma^{x}_{s_{2}}\rangle$ calculated for the first 100 collisions,
and the Pearson coefficient $C_{12}$ evaluated for the last 100 collisions. In
Fig. 4(b), we show the Pearson coefficient $C_{12}$ predictions performed by
the KNN algorithm. We should also emphasize that we prevent the regressor from
having access to the training data by re-adjusting it with small deviations
$\varepsilon$ from the model parameters $\lambda$ and $\omega_{1}/\omega_{2}$,
as has been done for the case of the first collision model. Directly comparing
the plots for the calculated and predicted $C_{12}$ values side by side in
Fig. 4, it can be observed that the KNN regression algorithm achieves a high
accuracy in predicting the long time synchronization properties of the
considered model. Indeed, MAE in this case turns out to be 0.040. Lastly, we
consider possible measurement imperfections for the expectation values of the
qubits. Taking into account random percentage errors in the qubit expectation
values $\langle\sigma^{x}_{s_{1}}\rangle$ and
$\langle\sigma^{x}_{s_{2}}\rangle$ between $\%0.5$ and $\%5$, we repeat the
same investigation to understand how resilient our machine learning approach,
based on the KNN regressor, is against potential errors in algorithm input. We
present the results of our calculations in Fig. 5, where the first 5, 10 and
50 expectation values of the qubit pair are considered as an input in addition
to the case of the first 100 expectation values. In Fig. 5, the dotted red,
dot-dashed green, dashed orange, and solid blue lines demonstrate how the MAE
for $C_{12}$ changes with the percentage error in the expectation values of
the qubit pair when the first 100, 50, 10 and 5 expectation values are used
for prediction, respectively. We observe that the KNN regression algorithm can
provide reliable predictions regarding synchronization also in the second
collision model, even in the presence of measurement errors in a realistic
setting provided that the number of expectation values for each qubit, which
are used as input variables, is sufficient.

Figure 5: Mean absolute error (MAE) for the Pearson coefficient $C_{12}$ in
the second collision model as a function of the percentage error added to the
calculated expectation values $\langle\sigma^{x}_{s_{1}}\rangle$ and
$\langle\sigma^{x}_{s_{2}}\rangle$. Four different lines in the legend
correspond to the cases of feeding the KNN regressor with 5, 10, 50, and 100
pairs of qubit expectation values for prediction.

To summarize this subsection, we see that our machine learning approach to the
prediction of synchronization in open system dynamics proves to be quite
successful in two distinct models. That is, in both local and global
dissipation regimes described within the collision model framework, the KNN
regressor can accurately foretell the emergence of (anti-)synchronization or
its absence in the long time dynamics, only using the early time expectation
values of the considered qubit observables.

Figure 6: The master equation model: (a) The Pearson coefficient $C_{12}$,
calculated for the late time 100 expectation values of the qubits
$\langle\sigma^{x}_{s_{1}}\rangle$ and $\langle\sigma^{x}_{s_{2}}\rangle$, as
a function of the exchange interaction strength $f_{12}$ between them and the
detuning between their self-energies $\omega_{1}/\omega_{2}$. (b) Predicted
$C_{12}$ values produced by the KNN regressor using the early time 100
expectation values of the qubit pair in terms of $f_{12}$ and
$\omega_{1}/\omega_{2}$.

###  V.2 Master Equation Model

Up to this point, we have considered two open-system models which represent
local and global dissipation scenarios, making use of the collisional model
framework. We have seen that our machine learning-based approach to the
detection of the dynamical emergence of synchronization performs quite
accurately in both models despite potential experimental errors in the qubit
expectation value measurements. As a last test, we consider an open-system
model described by a master equation, where two two-level atomic particles (or
qubits) interact with an electromagnetic field fully collectively. In this
setting, depending on the detuning between the self-energies of the qubits and
the direct coupling between them, it is possible to observe phase-locked
oscillations of expectation values, where the phase difference is not
necessarily $\pi$ or 0 degrees, i.e., time-delayed synchronization [32].

Let us first recall that we will consider the collective dissipation of the
qubit pair in the zero temperature limit, hence we fix $\bar{n}=0$ and
$a_{ij}=1$. Also, we set the initial states of the system qubit pair as
$|\psi_{s_{1}}\rangle=(|0\rangle+|1\rangle)/\sqrt{2}$ and
$|\psi_{s_{2}}\rangle=(|0\rangle+e^{-i\pi/3}|1\rangle)/\sqrt{2}$. To create
our data set, we let the detuning between the self-energies of the qubits
$\omega_{1}/\omega_{2}$ acquire values between 1.0 and 1.1 in steps of 0.001,
and the strength of the exchange interaction between the qubits $f_{12}$
between 0 and 0.05 in steps of 0.001. As a result, we obtain 5151 different
model parameter configurations, for each one of which we simulate the open
system dynamics and then calculate the expectation values
$\langle\sigma^{x}_{s_{1}}\rangle$ and $\langle\sigma^{x}_{s_{2}}\rangle$
until $t=500$. We note that at this point in the dynamics, the system already
displays its long time behavior, and here we simulate the time evolution in
discrete time steps, i.e., taking $t=0,1,...,500$. Next, we evaluate the
Pearson coefficient $C_{12}$ for the expectation values of the qubit pair
observables, taking into account the last 100 time steps in the dynamics,
which shows us the long time synchronization behavior of the open system
model. We demonstrate the outcomes of our calculations in Fig. 6(a). It is
straightforward to notice that when the exchange interaction between the
qubits is sufficiently strong to compensate for the detuning between their
self-energies, full anti-synchronization emerges between the expectation
values of the qubit observables. In addition, for this model, it is known that
even if the expectation values do not get fully anti-synchronized, there still
occurs time-delayed synchronization [32]. In other words, even if the Pearson
coefficient $C_{12}\neq-1$ in a long time, it still settles to a constant
value between 0 and -1 as shown in Fig. 6(a), which signals the onset of
oscillations having a fixed phase difference between the expectation values.

Figure 7: Mean absolute error (MAE) for the Pearson coefficient $C_{12}$ in
the master equation model in terms of the added percentage error to the
calculated expectation values of the qubits $\langle\sigma^{x}_{s_{1}}\rangle$
and $\langle\sigma^{x}_{s_{2}}\rangle$. Four different lines in the legend
correspond to the cases of feeding the KNN regressor with 5, 10, 50 and 100
pairs of qubit expectation values for prediction.

Finally, we will check the ability of the KNN regressor to predict the
synchronization behavior of the qubit pair for the considered master equation
model. As has been done for the collision models, we feed the KNN regressor
with the dataset for this configuration, which involve the qubit expectation
values $\langle\sigma^{x}_{s_{1}}\rangle$ and
$\langle\sigma^{x}_{s_{2}}\rangle$ calculated at the first 100 time points,
and the Pearson coefficient $C_{12}$ evaluated considering the last 100 time
points. The predicted $C_{12}$ values produced by the KNN regression algorithm
are shown in Fig. 6(b) side by side with the calculated $C_{12}$ values. It is
obvious from the comparison of the plots that our approach based on the KNN
regressor performs excellently in predicting the synchronization properties of
the model. In fact, the MAE in this case is calculated to be only 0.002. To
complete this section, we now consider the potential measurement inaccuracies
in the expectation values to assess the robustness of our machine learning-
based approach against errors. Similarly to the previously studied models, we
randomly add percentage errors to the expectation values of the qubit pair
between $0.5\%$ and $5\%$, and perform the same analysis by considering 5, 10,
50, and 100 early time expectation values as the input of the regressor. Fig.
7 displays the results of this investigation, where the dotted red, dot-dashed
green, dashed orange, and solid blue lines show how the MAE for the Pearson
coefficient $C_{12}$ changes as a function of the percentage error added to
the expectation values $\langle\sigma^{x}_{s_{1}}\rangle$ and
$\langle\sigma^{x}_{s_{2}}\rangle$, when the expectation values at the first
100, 50, 10 and 5 time points are given to the regressor for prediction,
respectively. It is evident from Fig. 7 that as long as 10 or more early time
expectation values for the qubit pair are fed to the algorithm as input, the
KNN regressor does an excellent job predicting the late time synchronization
behavior of the model despite the presence of errors in the expectation
values.

###  V.3 Possible Physical Error Mechanisms

In this section, we will investigate possible error mechanisms that could
affect the state of the quantum system in question, prior to the prediction
stage. We will assume that our algorithm is trained with the data obtained
from the ideal case and try to assess the impact of such potential errors as
quantified via the MAE.

First, we intend to examine the effects of initialization errors, which might
occur in experiments, on the initial state of the system. To account for
realistic conditions, we now consider a modified initial state for all three
models that is described by the density matrix,

$\rho=p|++\rangle\langle++|+(1-p)\left(|+-\rangle\langle+-|+|-+\rangle\langle-+|\right).$
(12)

This modification accommodates the potential of qubit states being incorrectly
initialized through two specific mechanisms: a phase error where an intended
$|+\rangle$ state initializes as $|-\rangle$, or a bit-flip error since the
state $|+\rangle$ can be generated from the $|0\rangle$ state via a Hadamard
gate. In the latter case, $1-p$ reflects the probability that the
initialization intended for the state $|0\rangle$ actually ended up to give
the state $|1\rangle$ , leading to the unintended creation of a $|-\rangle$
state by the Hadamard transformation. Such errors are relatively common,
particularly in superconducting qubit platorms, where there is always a non-
zero probability of measuring the state $|1\rangle$ ($|0\rangle$) when the
intention was to create the state $|0\rangle$ ($|1\rangle$) [73]. In Fig. 8,
we present the MAE as a function of $1-p$, i.e., the probability of having an
initialization error, which shows us how sensitive our method is to a possible
initial state error in the prediction stage for the three different models.

In all of the cases investigated in this subsection, we calculate the
expectation values using 100 time points. We also note that here we refer to
the first and second collision models as local collision model (LCM) and
global collision model (GCM) for presentation purposes. We observe in Fig. 8
that the master equation (ME) model demonstrates the least sensitivity to
initialization errors, maintaining a consistently low MAE, with an increase
from 0.002 (in the absence of initialization errors) to values still below
0.01. In contrast, LCM and GCM exhibit higher MAEs, with the LCM’s MAE
increasing from 0.009 to approximately 0.02 and the GCM’s MAE rising from 0.04
to the order of 0.1. Despite these increases, the overall changes in MAE
remain modest, which shows the robustness of our method against initialization
errors. Notably, the GCM experiences a relatively more significant effect,
with MAE now in the order of 10% when considering initialization errors. Such
errors still remain relatively low, highlighting the efficiency of our
approach.

Figure 8: Mean absolute error (MAE) for the Pearson coefficient $C_{12}$ in
terms of the error probability in the initial state that is fed into the KNN
regressor for the master equation model (ME), local collision model (LCM), and
global collision model (GCM) using 100 early time expectation values.

Furthermore, we have explored how the temperature of the environment
influences the ability of the algorithm to predict the emergence of
(anti-)synchronization across all three considered models. To this aim, we
have evaluated the prediction performance of the KNN regressor in the presence
of non-zero environmental temperatures, when the algorithm is still trained
using the zero temperature data. In order to take into account the temperature
effects, we assume that the density matrices of the environmental qubit in
both local and global collision models are given by
$\rho_{E}=(1-p)|0\rangle\langle 0|+p|1\rangle\langle 1|$, with $p$ ranging
from $0.01$ to $0.05$. Physically, this implies that the environment is
actually found in a mixed thermal state, reflecting the effects of the
temperature. In particular, as $p$ changes from $0.01$ to $0.05$, a gradual
increase in the environmental temperature is being simulated, where the
probability of the environment being in the ground state decreases while at
the same time its probability of being in the excited state increases. On the
other hand, in case of the master equation model, we slightly vary the average
number of photons, allowing $\bar{n}$ to change from $0.01$ to $0.05$ in Eq.
(8) and Eq. (9), which lets us analyze the effect of the temperature of the
environment on the performance of the KNN regressor.

In Fig. 9, we display the MAE for our predictions obtained utilizing the KNN
regressor, trained with the ideal dataset, as a function of the environment
temperature for all three models. We observe that for the GCM and ME, the MAE
slightly increases as the environment temperature rises. Nonetheless, in case
of the LCM, where one of the qubits is not directly in contact with the
environment, the performance of our approach is basically indifferent to the
changes in the environment temperature.

Figure 9: Mean absolute error (MAE) for the Pearson coefficient $C_{12}$ as a
function of the temperature of the environment for the master equation model
(ME), local collision model (LCM), and global collision model (GCM)
considering 100 early time qubit expectation values.

##  VI Conclusion

To sum up, we have employed a machine learning technique, based on the KNN
regression algorithm, to predict the emergence of environment-induced
spontaneous synchronization between the expectation values of observables for
a pair of qubits in the dynamics of open quantum systems. We have considered
three different open system models that cover local, global, and collective
dissipation regimes. While the first two models are described within the
collisional model framework, the third one is represented by a master equation
of Lindblad form. We have demonstrated that in all of these three models, our
machine learning-based approach is able to identify the long time
synchronization behavior of the open system with quite high accuracy, only
utilizing the early time expectation values for the qubit observables as an
input. In fact, we have shown that the machine learning algorithm not only
very accurately estimates the onset of synchronization or anti-synchronization
between the qubit expectation values but also the phase-locked oscillations
between them with arbitrary phase difference, i.e., time-delayed
synchronization. The proposed approach has the potential to be useful in
experiments since it can significantly reduce the number of measurements
required to determine the dynamical establishment of synchronous evolution. To
see the robustness of our approach against potential measurement imperfections
in an experimental setting, we added random errors to the simulated qubit
expectation values and benchmarked the capability of our method to recognize
the synchronization behavior in the models considered. Additionally, we have
tested the robustness of our model to small variations in the initial state of
the system, as well as to temperature, showing that despite a slight increase
in the MAE, the predictions remained fairly accurate. We have established a
trade-off relation between the degree of randomly introduced error in the
expectation values and the accuracy of the algorithm to predict
synchronization. All in all, our results demonstrate that despite the presence
of errors in the input values of the KNN regressor, the proposed approach
still works with high accuracy as long as a few dozen early time qubit
expectation values are introduced to the algorithm for prediction. The fact
that the employed method works accurately in three different open system
scenarios suggests that it might actually be applied in a wide range of
physical models efficiently. Lastly, motivated by the performance of the
employed machine learning approach in succesfully predicting the appearance of
mutual synchronization between two qubits, one can try to apply similar
methods to more sophisticated problems involving a higher number of principal
quantum spins or oscillators, where exotic dynamical states such as chimera
states can emerge under suitable conditions [74, 75].

###### Acknowledgements.

F. M. acknowledges support from Coordenação de Aperfeiçoamento de Pessoal de
Nível Superior (CAPES), project number 88887.607339/2021-00. B. Ç. and G. K.
are supported by The Scientific and Technological Research Council of Turkey
(TUBITAK) under Grant No. 121F246. F.F.F acknowledge support from Fundação de
Amparo à Pesquisa do Estado de São Paulo (FAPESP), project number 2023/04987-6
and from ONR, project number N62909-24-1-2012. İ. Y. acknowledges financial
support from Czech Grant Agency project number GAČR 23-07169S.

## References

  * Schuld and Petruccione [2018] M. Schuld and F. Petruccione,  _Supervised Learning with Quantum Computers_ (Springer, 2018).
  * Jordan and Mitchell [2015] M. I. Jordan and T. M. Mitchell, Machine learning: Trends, perspectives, and prospects, Science 349, 255 (2015).
  * Carleo  _et al._ [2019] G. Carleo, I. Cirac, K. Cranmer, L. Daudet, M. Schuld, N. Tishby, L. Vogt-Maranto, and L. Zdeborová, Machine learning and the physical sciences, Rev. Mod. Phys. 91, 045002 (2019).
  * Pikovsky  _et al._ [2001] A. Pikovsky, M. G. Rosenblum, and J. Kurths,  _Synchronization, A Universal Concept in Nonlinear Sciences_ (Cambridge University Press, Cambridge, 2001).
  * Arenas  _et al._ [2008] A. Arenas, A. Díaz-Guilera, J. Kurths, Y. Moreno, and C. Zhou, Synchronization in complex networks, Phys. Rep. 469, 93 (2008).
  * Osipov  _et al._ [2007] G. Osipov, J. Kurths, and C. Zhou,  _Synchronization in Oscillatory Networks_, Springer Series in Synergetics (Springer Berlin Heidelberg, 2007).
  * Mari  _et al._ [2013] A. Mari, A. Farace, N. Didier, V. Giovannetti, and R. Fazio, Measures of quantum synchronization in continuous variable systems, Phys. Rev. Lett. 111, 103605 (2013).
  * Li  _et al._ [2017] W. Li, W. Zhang, C. Li, and H. Song, Properties and relative measure for quantifying quantum synchronization, Phys. Rev. E 96, 012211 (2017).
  * Galve  _et al._ [2017] F. Galve, G. Luca Giorgi, and R. Zambrini, Quantum correlations and synchronization measures, in  _Lectures on General Quantum Correlations and their Applications_, edited by F. F. Fanchini, D. d. O. Soares Pinto, and G. Adesso (Springer International Publishing, Cham, 2017) pp. 393–420.
  * Roulet and Bruder [2018] A. Roulet and C. Bruder, Synchronizing the smallest possible system, Phys. Rev. Lett. 121, 053601 (2018).
  * Giorgi  _et al._ [2019] G. L. Giorgi, A. Cabot, and R. Zambrini, Transient synchronization in open quantum systems, in  _Advances in Open Systems and Fundamental Tests of Quantum Mechanics_ , edited by B. Vacchini, H.-P. Breuer, and A. Bassi (Springer International Publishing, Cham, 2019) pp. 73–89.
  * Zhirov and Shepelyansky [2008] O. V. Zhirov and D. L. Shepelyansky, Synchronization and bistability of a qubit coupled to a driven dissipative oscillator, Phys. Rev. Lett. 100, 014101 (2008).
  * Zhirov and Shepelyansky [2009] O. V. Zhirov and D. L. Shepelyansky, Quantum synchronization and entanglement of two qubits coupled to a driven dissipative resonator, Phys. Rev. B 80, 014519 (2009).
  * Lee and Sadeghpour [2013] T. E. Lee and H. R. Sadeghpour, Quantum synchronization of quantum van der pol oscillators with trapped ions, Phys. Rev. Lett. 111, 234101 (2013).
  * Walter  _et al._ [2014] S. Walter, A. Nunnenkamp, and C. Bruder, Quantum synchronization of a driven self-sustained oscillator, Phys. Rev. Lett. 112, 094102 (2014).
  * Sonar  _et al._ [2018] S. Sonar, M. Hajdušek, M. Mukherjee, R. Fazio, V. Vedral, S. Vinjanampathy, and L.-C. Kwek, Squeezing enhances quantum synchronization, Phys. Rev. Lett. 120, 163601 (2018).
  * Goychuk  _et al._ [2006] I. Goychuk, J. Casado-Pascual, M. Morillo, J. Lehmann, and P. Hänggi, Quantum stochastic synchronization, Phys. Rev. Lett. 97, 210601 (2006).
  * Giorgi  _et al._ [2012] G. L. Giorgi, F. Galve, G. Manzano, P. Colet, and R. Zambrini, Quantum correlations and mutual synchronization, Phys. Rev. A 85, 052101 (2012).
  * Manzano  _et al._ [2013a] G. Manzano, F. Galve, G. Giorgi, E. Hernández-García, and R. Zambrini, Synchronization, quantum correlations and entanglement in oscillator networks, Sci. Rep. 3, 1439 (2013a).
  * Manzano  _et al._ [2013b] G. Manzano, F. Galve, and R. Zambrini, Avoiding dissipation in a system of three quantum harmonic oscillators, Phys. Rev. A 87, 032114 (2013b).
  * Benedetti  _et al._ [2016] C. Benedetti, F. Galve, A. Mandarino, M. G. A. Paris, and R. Zambrini, Minimal model for spontaneous quantum synchronization, Phys. Rev. A 94, 052118 (2016).
  * Lee  _et al._ [2014] T. E. Lee, C.-K. Chan, and S. Wang, Entanglement tongue and quantum synchronization of disordered oscillators, Phys. Rev. E 89, 022913 (2014).
  * Walter  _et al._ [2015] S. Walter, A. Nunnenkamp, and C. Bruder, Quantum synchronization of two van der pol oscillators, Ann. Phys. 527, 131 (2015).
  * Heinrich  _et al._ [2011] G. Heinrich, M. Ludwig, J. Qian, B. Kubala, and F. Marquardt, Collective dynamics in optomechanical arrays, Phys. Rev. Lett. 107, 043603 (2011).
  * Ludwig and Marquardt [2013] M. Ludwig and F. Marquardt, Quantum many-body dynamics in optomechanical arrays, Phys. Rev. Lett. 111, 073603 (2013).
  * Hush  _et al._ [2015] M. R. Hush, W. Li, S. Genway, I. Lesanovsky, and A. D. Armour, Spin correlations as a probe of quantum synchronization in trapped-ion phonon lasers, Phys. Rev. A 91, 061401 (2015).
  * Cabot  _et al._ [2019] A. Cabot, G. L. Giorgi, F. Galve, and R. Zambrini, Quantum synchronization in dimer atomic lattices, Phys. Rev. Lett. 123, 023604 (2019).
  * Orth  _et al._ [2010] P. P. Orth, D. Roosen, W. Hofstetter, and K. Le Hur, Dynamics, synchronization, and quantum phase transitions of two dissipative spins, Phys. Rev. B 82, 144423 (2010).
  * Giorgi  _et al._ [2013] G. L. Giorgi, F. Plastina, G. Francica, and R. Zambrini, Spontaneous synchronization and quantum correlation dynamics of open spin systems, Phys. Rev. A 88, 042115 (2013).
  * Bellomo  _et al._ [2017] B. Bellomo, G. L. Giorgi, G. M. Palma, and R. Zambrini, Quantum synchronization as a local signature of super- and subradiance, Phys. Rev. A 95, 043807 (2017).
  * Giorgi  _et al._ [2016] G. L. Giorgi, F. Galve, and R. Zambrini, Probing the spectral density of a dissipative qubit via quantum synchronization, Phys. Rev. A 94, 052121 (2016).
  * Karpat  _et al._ [2020] G. Karpat, I. Yalçınkaya, and B. Çakmak, Quantum synchronization of few-body systems under collective dissipation, Phys. Rev. A 101, 042121 (2020).
  * Karpat  _et al._ [2019] G. Karpat, I. Yalçınkaya, and B. Çakmak, Quantum synchronization in a collision model, Phys. Rev. A 100, 012133 (2019).
  * Karpat  _et al._ [2021] G. Karpat, I. Yalçınkaya, B. Çakmak, G. L. Giorgi, and R. Zambrini, Synchronization and non-markovianity in open quantum systems, Phys. Rev. A 103, 062217 (2021).
  * Li  _et al._ [2023a] Y. Li, X. Li, and J. Jin, Quantum nonstationary phenomena of spin systems in collision models, Phys. Rev. A 107, 042205 (2023a).
  * Schmolke and Lutz [2022] F. Schmolke and E. Lutz, Noise-induced quantum synchronization, Phys. Rev. Lett. 129, 250601 (2022).
  * Xiao  _et al._ [2023] X. Xiao, T.-X. Lu, W.-J. Zhong, and Y.-L. Li, Classical-driving-assisted quantum synchronization in non-markovian environments, Phys. Rev. A 107, 022221 (2023).
  * Krithika  _et al._ [2022] V. R. Krithika, P. Solanki, S. Vinjanampathy, and T. S. Mahesh, Observation of quantum phase synchronization in a nuclear-spin system, Phys. Rev. A 105, 062206 (2022).
  * Es’haqi-Sani  _et al._ [2020] N. Es’haqi-Sani, G. Manzano, R. Zambrini, and R. Fazio, Synchronization along quantum trajectories, Phys. Rev. Res. 2, 023101 (2020).
  * Qiao  _et al._ [2020] G. J. Qiao, X. Y. Liu, H. D. Liu, C. F. Sun, and X. X. Yi, Quantum $\phi$ synchronization in a coupled optomechanical system with periodic modulation, Phys. Rev. A 101, 053813 (2020).
  * Li  _et al._ [2023b] X. Li, Y. Li, and J. Jin, Synchronization of persistent oscillations in spin systems with nonlocal dissipation, Phys. Rev. A 107, 032219 (2023b).
  * Li [2022] W. Li, Analyzing quantum synchronization through bohmian trajectories, Phys. Rev. A 106, 023512 (2022).
  * Wächtler and Platero [2023] C. W. Wächtler and G. Platero, Topological synchronization of quantum van der pol oscillators, Phys. Rev. Res. 5, 023021 (2023).
  * Cattaneo  _et al._ [2021] M. Cattaneo, G. L. Giorgi, S. Maniscalco, G. S. Paraoanu, and R. Zambrini, Bath-induced collective phenomena on superconducting qubits: Synchronization, subradiance, and entanglement generation, Annalen der Physik 533, 2100038 (2021).
  * Cabot  _et al._ [2021] A. Cabot, G. Luca Giorgi, and R. Zambrini, Synchronization and coalescence in a dissipative two-qubit system, Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences 477, 20200850 (2021).
  * Buča  _et al._ [2022] B. Buča, C. Booker, and D. Jaksch, Algebraic theory of quantum synchronization and limit cycles under dissipation, SciPost Phys. 12, 097 (2022).
  * Impens and Guéry-Odelin [2023] F. Impens and D. Guéry-Odelin, Shortcut to synchronization in classical and quantum systems, Scientific Reports 13, 453 (2023).
  * Štěrba  _et al._ [2023] D. Štěrba, J. Novotný, and I. Jex, Asymptotic phase-locking and synchronization in two-qubit systems, Journal of Physics Communications 7, 045003 (2023).
  * Kalita  _et al._ [2021] S. Kalita, S. Chakraborty, and A. K. Sarma, Switching of quantum synchronization in coupled optomechanical oscillators, Journal of Physics Communications 5, 115006 (2021).
  * Itabashi  _et al._ [2021] K. Itabashi, Q. H. Tran, and Y. Hasegawa, Evaluating the phase dynamics of coupled oscillators via time-variant topological features, Phys. Rev. E 103, 032207 (2021).
  * Bassi  _et al._ [2022] H. Bassi, R. P. Yim, J. Vendrow, R. Koduluka, C. Zhu, and H. Lyu, Learning to predict synchronization of coupled oscillators on randomly generated graphs, Scientific Reports 12, 15056 (2022).
  * Fan  _et al._ [2022] H. Fan, L. Wang, Y. Du, Y. Wang, J. Xiao, and X. Wang, Learning the dynamics of coupled oscillators from transients, Phys. Rev. Res. 4, 013137 (2022).
  * Guth and Sapsis [2019] S. Guth and T. P. Sapsis, Machine learning predictors of extreme events occurring in complex dynamical systems, Entropy 21, 10.3390/e21100925 (2019).
  * Chowdhury  _et al._ [2021] S. N. Chowdhury, A. Ray, A. Mishra, and D. Ghosh, Extreme events in globally coupled chaotic maps, Journal of Physics: Complexity 2, 035021 (2021).
  * Weng  _et al._ [2023] T. Weng, X. Chen, Z. Ren, H. Yang, J. Zhang, and M. Small, Synchronization of machine learning oscillators in complex networks, Information Sciences 630, 74 (2023).
  * Zhang  _et al._ [2022] H. Zhang, H. Fan, Y. Du, L. Wang, and X. Wang, Anticipating measure synchronization in coupled Hamiltonian systems with machine learning, Chaos: An Interdisciplinary Journal of Nonlinear Science 32, 10.1063/5.0093663 (2022), 083136.
  * Thiem  _et al._ [2020] T. N. Thiem, M. Kooshkbaghi, T. Bertalan, C. R. Laing, and I. G. Kevrekidis, Emergent spaces for coupled oscillators, Frontiers in Computational Neuroscience 14, 10.3389/fncom.2020.00036 (2020).
  * Biccari and Zuazua [2020] U. Biccari and E. Zuazua, A stochastic approach to the synchronization of coupled oscillators, Frontiers in Energy Research 8, 10.3389/fenrg.2020.00115 (2020).
  * Fan  _et al._ [2021] H. Fan, L.-W. Kong, Y.-C. Lai, and X. Wang, Anticipating synchronization with machine learning, Phys. Rev. Res. 3, 023237 (2021).
  * Cárdenas-López  _et al._ [2019] F. A. Cárdenas-López, M. Sanz, J. C. Retamal, and E. Solano, Enhanced quantum synchronization via quantum machine learning, Advanced Quantum Technologies 2, 1800076 (2019).
  * Garau Estarellas  _et al._ [2019] G. Garau Estarellas, G. L. Giorgi, M. C. Soriano, and R. Zambrini, Machine learning applied to quantum synchronization-assisted probing, Advanced Quantum Technologies 2, 1800085 (2019).
  * Ciccarello [2017] F. Ciccarello, Collision models in quantum optics, Quantum Measurements and Quantum Metrology 4, 53 (2017).
  * Ciccarello  _et al._ [2022] F. Ciccarello, S. Lorenzo, V. Giovannetti, and G. M. Palma, Quantum collision models: Open system dynamics from repeated interactions, Physics Reports 954, 1 (2022), quantum collision models: Open system dynamics from repeated interactions.
  * Breuer and Petruccione [2002] H.-P. Breuer and F. Petruccione,  _The Theory of Open Quantum Systems_ (Oxford University Press, Oxford, 2002).
  * Damanet and Martin [2016] F. Damanet and J. Martin, Competition between finite-size effects and dipole–dipole interactions in few-atom systems, Journal of Physics B: Atomic, Molecular and Optical Physics 49, 225501 (2016).
  * Bhattacharya  _et al._ [2018] S. Bhattacharya, S. Banerjee, and A. K. Pati, Evolution of coherence and non-classicality under global environmental interaction, Quantum Information Processing 17, 236 (2018).
  * Lehmberg [1970] R. H. Lehmberg, Radiation from an $n$-atom system. i. general formalism, Phys. Rev. A 2, 883 (1970).
  * Goodfellow  _et al._ [2016] I. Goodfellow, Y. Bengio, and A. Courville,  _Deep Learning_ (The MIT Press, Cambridge, Massachussetts, 2016).
  * Hastie  _et al._ [2009] T. Hastie, R. Tibshirani, J. H. Friedman, and J. H. Friedman,  _The elements of statistical learning: data mining, inference, and prediction_ , Vol. 2 (Springer, 2009).
  * Alpaydin [2020] E. Alpaydin,  _Introduction to machine learning_ (MIT press, 2020).
  * Alsharif  _et al._ [2020] M. H. Alsharif, A. H. Kelechi, K. Yahya, and S. A. Chaudhry, Machine learning algorithms for smart data analysis in internet of things environment: Taxonomies and research trends, Symmetry 12, 88 (2020).
  * Pedregosa  _et al._ [2011] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay, Scikit-learn: Machine learning in Python, Journal of Machine Learning Research 12, 2825 (2011).
  * IBM Quantum [2024] IBM Quantum, Computer resources, https://quantum.ibm.com (2024), accessed: 2024-02-12.
  * Bastidas  _et al._ [2015] V. M. Bastidas, I. Omelchenko, A. Zakharova, E. Schöll, and T. Brandes, Quantum signatures of chimera states, Phys. Rev. E 92, 062924 (2015).
  * Senthilkumar and Chandrasekar [2019] D. V. Senthilkumar and V. K. Chandrasekar, Local and global chimera states in a four-oscillator system, Phys. Rev. E 100, 032211 (2019).

##  Appendix A Early time behavior and emergence of synchronization

We present the explicit dynamics of the spin expectation values for all three
models we consider in the manuscript in Fig. 10. All subfigures include pre-
synchronization dynamics together with the emergence of (anti-)synchronized
dynamics in all three models. Once the synchronous behavior is established
between the observables, it persists either in the steady-state or until the
expectation values decay to zero. The time window that we use to train the
machine learning algorithm consists of the data after the synchronization is
established. Then, using this algorithm, we try to predict synchronization by
looking at the very early time data (up to first 100 points) where the
synchronization is not yet established, as outlined in Sec. III. Therefore, we
believe that our approach to the problem is a promising way to guess the late-
time behavior of a property of a quantum system by looking at the early-time
dynamics.

Figure 10: Dynamics of the local spin expectation values of the two qubits for
the local collision model (LCM) (upper), global collision model (GCM)
(middle), and master equation model (ME) (lower), which display both their
pre-synchronous dynamics and also the emergence of dynamical transition into
the (anti-)synchronous behavior.