1 Introduction

Quantum computers can make possible quantum computations for efficient problem solving [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]. Gate-based quantum computations represent a way to construct gate-model quantum computers. In a gate-model quantum computer architecture, computations are implemented via sequences of unitary operations [9,10,11,12, 19,20,21,22,23,24,25,26,27]. Gate-model quantum computers allow establishing experimental quantum computations in near-term architectures [28,29,30,31,32,33,34,35,36,37,38,39,40]. Practical demonstrations of gate-model quantum computers have been already proposed [1,2,3,4,5,6,7,8,9,10,11,12], and several physical-layer developments are currently in progress.

Finding a stable quantum state of a quantum computer is a challenge, since it requires precise unitaries that yield stable quantum evolutions in the quantum computer. The problem is further increased if the stable system state must be available for a pre-determined time or for a pre-determined number of running sequences. Particularly, the quantum state of a quantum computer subject to stabilization also coincides with the optimal quantum state. The optimal quantum state of a quantum computer maximizes a particular objective function of an arbitrary computational problem fed into the quantum computer. The problem therefore is to fix the quantum state of the quantum computer in the optimal state for an arbitrary number of running sequences that is determined by the actual environment or by the current problem. Another challenge connected to the problem of stabilization of the system state of a quantum computer is the classification of the sequences of the stabilized quantum states into stability classes. Practically, a solution to these problems can be covered by an unsupervised learning method.

Here, we propose a method for the stabilization of an optimal quantum state of a quantum computer through an arbitrary number of running sequences. We define a solution that utilizes unsupervised learning algorithms to determine the stable quantum states of the quantum computer and to classify the stable quantum states into stability classes. The proposed results are useful for experimental gate-based quantum computations and near-term quantum computer architectures.

The novel contributions of our manuscript are as follows:

  1. 1.

    We propose a method for the stabilization of an optimal quantum state of a quantum computer through an arbitrary number of running sequences.

  2. 2.

    We define a solution that utilizes unsupervised learning algorithms to determine the stable quantum states of the quantum computer.

  3. 3.

    We evaluate a solution to classify the stable system states into stability classes.

This paper is organized as follows. Section 2 provides the problem statement. Section 3 discusses the stabilization procedure of an optimal quantum state of a quantum computer. Section 4 defines an unsupervised learning method to find the stable quantum states and the stability classes of the stabilized quantum states. In Sect. 5, a numerical evaluation is proposed. Finally, Sect. 6 concludes with the results. Supplemental information is included in the Appendix.

2 Problem statement

Let QG be the quantum gate structure of a gate-model quantum computer with a sequence of L unitaries [9,10,11,12] with an n-length input system \(\left| \psi \right\rangle \),

$$\begin{aligned} \left| \psi \right\rangle =\sum \limits _{i=0}^{{{d}^{n}-1}}{{{\alpha }_{i}}\left| i \right\rangle }, \end{aligned}$$
(1)

where d is the dimension (d=2 for a qubit system), \(\sum \nolimits _{i=0}^{{{d}^{n}}-1}{{{\left| {{\alpha }_{i}} \right| }^{2}}}=1\), and let

$$\begin{aligned} {| \vec {\theta }^{*} \rangle } =U_{L} \left( \theta _{L}^{*} \right) U_{L-1} \left( \theta _{L-1}^{*} \right) \ldots U_{1} \left( \theta _{1}^{*} \right) \left| \psi \right\rangle \end{aligned}$$
(2)

be the optimal system state of the quantum computer that maximizes a particular objective function \(f(\vec {\theta }^{*} )\),

$$\begin{aligned} f(\vec {\theta }^{*} )=\langle \vec {\theta }^{*} |C|\vec {\theta }^{*} \rangle \end{aligned}$$
(3)

of an arbitrary problem fed into the quantum computer, where C is the classical value of the objective function, while \(\vec {\theta }^{*} \) is the gate parameter vector,

$$\begin{aligned} \vec {\theta }^{*} =\left[ \theta _{1}^{*} ,\ldots ,\theta _{L}^{*} \right] ^{T} \end{aligned}$$
(4)

that identifies the L unitaries, \(U_{1} \left( \theta _{1}^{*} \right) ,\ldots ,U_{1} \left( \theta _{L}^{*} \right) \), of the QG quantum circuit of the quantum computer in the optimal state \({| \vec {\theta }^{*} \rangle } \), such that an i-th unitary, \(U_{i} \left( \theta _{i}^{*} \right) \) is as [10]

$$\begin{aligned} U_{i} \left( \theta _{i}^{*} \right) =\exp \left( -i\theta _{i}^{*} P\right) , \end{aligned}$$
(5)

where \(\theta _{i}^{*}\) is the gate parameter (real continuous variable) of unitary \(U_{i}\), P is a generalized Pauli operator formulated by the tensor product of Pauli operators \(\left\{ X,Y,Z\right\} \) [10, 11].

The aim is to stabilize the \({| \vec {\theta }^{*} \rangle } \) optimal state of the quantum computer through R running sequences via unsupervised learning of the evolution of the unitaries in the quantum computer.

The R running sequences refer to R input systems fed into the input of the quantum computer, such that in an r-th running sequence, \(r=1,\ldots ,R\), an r-th input system, \(\left| {{\psi }_{r}} \right\rangle \) (defined as in (1)), is evolved via the sequence of the L uniaries of the quantum computer. The R running sequences identify an input system, \(\left| {{\psi }_{in}} \right\rangle \), formulated via R, n-length quantum systems, as

$$\begin{aligned} \left| {{\psi }_{in}} \right\rangle =\left| {{\psi }_{1}} \right\rangle \otimes \cdots \otimes \left| {{\psi }_{R}} \right\rangle , \end{aligned}$$
(6)

where it is considered that the R input systems are unentangled.

Let \(\vec {\varphi }\) be the gate parameter vector associated with the stable system state \({\left| \vec {\varphi } \right\rangle } \),

$$\begin{aligned} {\left| \vec {\varphi } \right\rangle } =U_{L} \left( \varphi _{L} \right) U_{L-1} \left( \varphi _{L-1} \right) \ldots U_{1} \left( \varphi _{1} \right) \left| \psi \right\rangle \end{aligned}$$
(7)

as

$$\begin{aligned} \vec {\varphi }=\left[ \varphi _{1} ,\ldots ,\varphi _{L} \right] ^{T} , \end{aligned}$$
(8)

where \(\varphi _{i} \in \left[ 0,\pi \right] \) is the gate parameter of unitary \(U_{i} \) in the stabilized system state \({\left| \vec {\varphi } \right\rangle } \), such that the objective function value is stabilized into

$$\begin{aligned} f(\vec {\varphi })=\langle \vec {\varphi }|C|\vec {\varphi }\rangle =f(\vec {\theta }^{*}). \end{aligned}$$
(9)

For the R sequences of the quantum computer, we define matrices \(\alpha \) and \(\beta \) as

$$\begin{aligned} \alpha =[\vec {\theta }_{1}^{*} ,\ldots ,\vec {\theta }_{R}^{*}], \end{aligned}$$
(10)

where \(\vec {\theta }_{r}^{*} =[\theta _{r,1}^{*} ,\ldots ,\theta _{r,L}^{*}]^{T}\) identifies the quantum state \({| \vec {\theta }_{r}^{*} \rangle }\) of an r-th running sequence of the quantum computer, while

$$\begin{aligned} \beta =\left[ \vec {\varphi }_{1} ,\ldots ,\vec {\varphi }_{R} \right] , \end{aligned}$$
(11)

where \(\vec {\varphi }_{r} =\left[ \varphi _{r,1} ,\ldots ,\varphi _{r,L} \right] ^{T} \), identifies the stabilized quantum state \({\left| \vec {\varphi }_{r} \right\rangle } \) of an r-th sequence of the quantum computer.

The problem therefore is to find \(\beta \) from \(\alpha \) that stabilizes the \({| \vec {\theta }^{*} \rangle } \) optimal state of the quantum computer through R sequences as

$$\begin{aligned} \beta =S^{T} \alpha , \end{aligned}$$
(12)

where S is a stabilizer matrix,

$$\begin{aligned} S^{T} S=I, \end{aligned}$$
(13)

and I is the identity matrix.

The problems to be solved are therefore summarized as follows.

Problem 1

Find S to construct \(\beta \) (11) from \(\alpha \) (10) to stabilize the quantum computer in \({| \vec {\theta }^{*} \rangle } \) via \({\left| \vec {\varphi } \right\rangle } \) for all running sequences.

Problem 2

Describe the stability of \(\beta \) via unsupervised learning of the stability levels of the \({\left| \vec {\varphi }_{r} \right\rangle } \) quantum states of \(\beta \).

The resolutions of Problems 1 and 2 are proposed in Theorems 1 and 2. The solution framework \({\mathcal {F}}\) is defined via a \({\mathcal {P}}_{S} \) stabilization procedure with an embedded stabilization algorithm \({\mathcal {A}}_{S} \) (see Theorem 1), and via an \({\mathcal {A}}_{C} \) classification algorithm that characterizes the stability class of the results of \({\mathcal {P}}_{S} \) (see Theorem 2). Figure 1 depicts the system model.

Fig. 1
figure 1

The framework \({\mathcal {F}}\) for the stabilization of the optimal state of the quantum computer and the stability class determination. In the R running sequences, R input systems are fed into the input of the quantum computer, in an r-th running sequence, \(r=1,\ldots ,R\), an r-th input system, \(\left| {{\psi }_{r}} \right\rangle =\sum \nolimits _{i}{{{\alpha }_{i}}}\left| i \right\rangle \), is evolved via the sequence of the L uniaries of the quantum computer. The R running sequences identify an input system \(\left| {{\psi }_{in}} \right\rangle =\left| {{\psi }_{1}} \right\rangle \otimes \cdots \otimes \left| {{\psi }_{R}} \right\rangle \) (considering that the R input systems are unentangled). The R running sequences of the QG structure of the quantum computer produces \(\alpha =[\vec {\theta }_{1}^{*} ,\ldots ,\vec {\theta }_{R}^{*}]\), where \(\vec {\theta }_{r}^{*} =[\theta _{r,1}^{*} ,\ldots ,\theta _{r,L}^{*}]^{T}\). The \({\mathcal {P}}_{S} \) stabilization procedure outputs \(\beta =\left[ \vec {\varphi }_{1} ,\ldots ,\vec {\varphi }_{R} \right] \), where \(\vec {\varphi }_{r} =\left[ \varphi _{r,1} ,\ldots ,\varphi _{r,L} \right] ^{T} \), via an embedded stabilization algorithm \({\mathcal {A}}_{S} \) that determines the S stabilizer matrix. The \(C\left( \beta \right) \) stability level of the resulting \(\beta \) is determined via a classification algorithm \({\mathcal {A}}_{C} \). The \({\mathcal {P}}_{S} \) and \({\mathcal {A}}_{S} \) methods are realized as unsupervised learning

3 Stabilization of the optimal state of the quantum computer

Theorem 1

The S matrix for the stabilization of the \({| \vec {\theta }^{*} \rangle } \) optimal state of the quantum computer via \(\beta =S^{T} \alpha \) can be determined via the minimization of an objective function \(F^{*} \).

Proof

For an r-th sequence of the quantum computer, define \(\Delta (\vec {\theta }_{r}^{*})\) and \(\Delta \left( \vec {\varphi }_{r} \right) \) as

$$\begin{aligned} \Delta (\vec {\theta }_{r}^{*})=\vec {\theta }_{r}^{*} -\vec {\theta }_{r+1}^{*} \end{aligned}$$
(14)

and

$$\begin{aligned} \Delta \left( \vec {\varphi }_{r} \right) =\vec {\varphi }_{r} -\vec {\varphi }_{r+1}, \end{aligned}$$
(15)

respectively. These vectors formulate \(\Delta \alpha \) and \(\Delta \beta \) as

$$\begin{aligned} \Delta \alpha =[\Delta (\vec {\theta }_{1}^{*}),\ldots ,\Delta (\vec {\theta }_{R-1}^{*})] \end{aligned}$$
(16)

and

$$\begin{aligned} \Delta \beta =\left[ \Delta \left( \vec {\varphi }_{1} \right) ,\ldots ,\Delta \left( \vec {\varphi }_{R-1} \right) \right] , \end{aligned}$$
(17)

respectively. Then, using Eqs. (16) and (17) for the \(r=1,\ldots ,R-1\) sequences, let \(\chi \) be a sum defined as

$$\begin{aligned} \begin{aligned} \chi&=\sum \limits _{r}^{R-1}{\left\| \Delta \left( {{{\vec {\varphi }}}_{r}} \right) \right\| _{2}^{2}}\\&=\text {Tr}\left( \Delta \beta {{\left( \Delta \beta \right) }^{T}} \right) \\&=\text {Tr}\left( {{S}^{T}}\left( \Delta \alpha {{\left( \Delta \alpha \right) }^{T}} \right) S \right) , \end{aligned} \end{aligned}$$
(18)

where \(\left\| \cdot \right\| _{2}^{2} \) is the squared \(\mathrm{L}2\)-norm, \(\mathrm{Tr}\left( \cdot \right) \) is the trace operator, \(\Delta \alpha \) is as given in Eq. (16), and \(\Delta \beta \) is as in Eq. (17).

For the r-th and s-th sequences, \(s>r\), with \(\Delta \left( \vec {\varphi }_{r} \right) \) and \(\Delta \left( \vec {\varphi }_{s} \right) \), let \(\gamma _{rs} \) be defined as

$$\begin{aligned} \gamma _{rs} =\omega _{rs} \left\| \Delta \left( \vec {\varphi }_{r} \right) -\Delta \left( \vec {\varphi }_{s} \right) \right\| _{2}^{2} , \end{aligned}$$
(19)

where \(\omega _{rs} \) is a weight coefficient defined as

$$\begin{aligned} \omega _{rs} =\left\{ \begin{array}{l} {\exp \left( -{\textstyle \frac{\left\| \Delta (\vec {\theta }_{r}^{*})-\Delta \left( \vec {\theta }_{s}^{*} \right) \right\| ^{2} }{\zeta }} \right) ,\mathrm{if\; }\left( s-r\right) \le \kappa } \\ {0,\mathrm{\; otherwise}} \end{array}\right. , \end{aligned}$$
(20)

where \(\kappa \) and \(\zeta \) are nonzero parameters.

A sum is defined for the \(r=1,\ldots ,R-1\) sequences of the quantum computer as

$$\begin{aligned} \tau =\sum _{r}^{R-1}\sum _{s}^{R-1}\gamma _{rs} . \end{aligned}$$
(21)

At a particular S in Eqs. (18) and (21), the stabilization of the optimal state of the quantum computer through the R sequences can be reformulated via an objective function \(F^{*} \), subject to a minimization as

$$\begin{aligned} \begin{aligned} {{F}^{*}}&=\arg \underset{S}{\mathop {\min }}\,\left( \chi +c\tau \right) \\&=\arg \underset{S}{\mathop {\min }}\,\left( \text {Tr}\left( {{S}^{T}}\left( \Delta \alpha {{\left( \Delta \alpha \right) }^{T}} \right) S \right) +c\tau \right) , \end{aligned} \end{aligned}$$
(22)

where c is a regularization constant [41, 42]. The \(F^{*} \) objective function therefore stabilizes the optimal state via the minimization of \(\chi \), while the term \(c\tau \) achieves stabilization between the sequences.

Then, let W be the weight matrix formulated via coefficients (20) with \(W_{rs} =\omega _{rs} \), and let \(\eta \) be a diagonal matrix of the weight coefficients (20) with

$$\begin{aligned} \eta _{rr} =\sum _{s}\omega _{rs} , \end{aligned}$$
(23)

such that

$$\begin{aligned} \left( \Delta \beta \right) ^{T} \eta \Delta \beta =I. \end{aligned}$$
(24)

Using W and \(\eta \), the \(F^{*} \) objective function in Eq.  (22) can be rewritten as

$$\begin{aligned} \begin{aligned} {{F}^{*}}&=\arg \underset{S}{\mathop {\min }}\,\left( \tfrac{1}{\Omega }\left( \text {Tr}\left( \Delta \beta {{\left( \Delta \beta \right) }^{T}} \right) +c\text {Tr}\left( \Delta \beta \left( \eta -W \right) {{\left( \Delta \beta \right) }^{T}} \right) \right) \right) \\&=\arg \underset{S}{\mathop {\min }}\,\left( \tfrac{1}{\Omega }\left( \text {Tr}\left( \Delta \beta \left( I+c\left( \eta -W \right) \right) {{\left( \Delta \beta \right) }^{T}} \right) \right) \right) \\&=\arg \underset{S}{\mathop {\min }}\,\left( \tfrac{1}{\Omega }\left( \text {Tr}\left( \Delta \beta \sigma {{\left( \Delta \beta \right) }^{T}} \right) \right) \right) \\&=\arg \underset{S}{\mathop {\min }}\,\left( \tfrac{1}{\Omega }\left( \text {Tr}\left( {{S}^{T}}\left( \Delta \alpha \sigma {{\left( \Delta \alpha \right) }^{T}} \right) S \right) \right) \right) , \end{aligned} \end{aligned}$$
(25)

where \(\sigma \) is as

$$\begin{aligned} \sigma =I+c\left( \eta -W\right) , \end{aligned}$$
(26)

and

$$\begin{aligned} \Omega =\mathrm{Tr}\left( S^{T} \left( \Delta \alpha \eta \left( \Delta \alpha \right) ^{T} \right) S\right) . \end{aligned}$$
(27)

At a particular \(\Delta \alpha \) (16) and \(\sigma \) (26), the S stabilizer matrix in Eq.  (25) is evaluated via

$$\begin{aligned} \left( \Delta \alpha \sigma \left( \Delta \alpha \right) ^{T} \right) S=\lambda \left( \Delta \alpha \eta \left( \Delta \alpha \right) ^{T} \right) S, \end{aligned}$$
(28)

where \(\lambda \) is a diagonal matrix of eigenvalues [41, 42].

Algorithm A.1 (\({\mathcal {A}}_{S} \)) gives the method for stabilizing the optimal state of the quantum computer.\(\square \)

figure a

\(\square \)

4 Learning the stable quantum state and stability class

Lemma 1

The stabilized sequences of the quantum computer can be determined via unsupervised learning.

Proof

Algorithm 1 with the objective function (25) can be used to formulate an unsupervised learning framework to find the stabilized unitaries. The steps are detailed in Procedure 1 (\({\mathcal {P}}_{S} \)).\(\square \)

figure b

4.1 Learning the sequence stability of stabilized quantum states

Proposition 1

The stability of a given sequence \(\vec {\varphi }_{r} \) can be characterized via K stability levels. The sequence \(\vec {\varphi }_{r} \) can be classified into K stability classes from set \({\mathcal {C}}\),

$$\begin{aligned} {\mathcal {C}}=\left\{ C_{1} ,\ldots ,C_{K} \right\} , \end{aligned}$$
(37)

where \(C_{k} \), \(k=1,\ldots ,K\), is the k-th stability class.

Theorem 2

The \(C\left( \vec {\varphi }_{r} \right) \), \(r=1,\ldots ,R\) stability class of a \(\vec {\varphi }_{r} \) stabilized sequence, \(\vec {\varphi }_{r} =\varphi _{r,1} ,\ldots ,\varphi _{r,L} \), of the quantum computer can be learned via \(\phi _{k} \left( \vec {\varphi }_{r} \right) =\left( \nu _{k} \left( \vec {\varphi }_{r} \right) \right) ^{T} f_{k}^{{\mathcal {C}}} \left( \vec {\varphi }_{r} \right) \) quantities in the high-dimensional Hilbert space \({\mathcal {H}}\), where \(\nu _{k} \left( \varphi _{r,i} \right) ={\textstyle \frac{1}{\pi }} \left( \varphi _{r,i} \right) ,\) and \(f_{k}^{{\mathcal {C}}} \left( \varphi _{r,i} \right) \in \left[ 0,1\right] \) is a probability.

Proof

Since the gate parameters are stabilized, the gate parameters \(\vec {\varphi }_{r} \) and \(\vec {\varphi }_{r+1} \) of the r-th and \(\left( r+1\right) \)-th sequences must be correlated in the stable system state \({\left| \vec {\varphi } \right\rangle } \) (7) of the quantum computer.

Let \(\beta \) from Eq. (11) be the R stabilized sequences, where \(\vec {\varphi }_{r} \) is the stabilized gate parameter vector of an r-th sequence of the quantum computer, and let \({\mathcal {S}}\) be the set of all sequences of gate parameters as

$$\begin{aligned} {\mathcal {S}}=\bigcup _{\vec {\varphi }_{r} \in \beta }\left\{ \left. \varphi _{r,i} \right| \varphi _{r,i} \in \vec {\varphi }_{r} \right\} . \end{aligned}$$
(38)

For an k-th stabilization class \(C_{k} \), a probabilistic classifier function \(f_{k}^{{\mathcal {C}}} \) [41, 43] can be defined as

$$\begin{aligned} f_{k}^{{\mathcal {C}}} :{\mathcal {S}}\rightarrow \left[ 0,1\right] . \end{aligned}$$
(39)

The goal is to learn a function that maps any \(\vec {\varphi }_{r} \) sequence to the correct stability class. Applying Eq.  (39) on a given sequence \(\vec {\varphi }_{r} \), i.e., \(f_{k}^{{\mathcal {C}}} \left( \vec {\varphi }_{r} \right) \) therefore maps \(\vec {\varphi }_{r} \) to a given stability class via the classification of each L gate parameter of the sequence.

Thus, an i-th stabilized gate parameter \(\varphi _{r,i} \) of an r-th sequence \(\vec {\varphi }_{r} \) can be also classified into a particular stabilization class from \({\mathcal {C}}\) (37). The \(f_{k}^{{\mathcal {C}}} \left( \varphi _{r,i} \right) \in \left[ 0,1\right] \), \(k=1,\ldots ,K\), classifier (39) is trained to classify [43] each of the \(\varphi _{r,i} \) gate parameters of \(\vec {\varphi }_{r} \), \(i=1,\ldots ,L\) via outputting a corresponding probability that \(\varphi _{r,i} \) belongs to a given \(C_{k} \) class. For a particular \(\varphi _{r,i} \), the sum of the probabilities yields

$$\begin{aligned} \sum _{k=1}^{K}f_{k}^{{\mathcal {C}}} \left( \varphi _{r,i} \right) =1, \end{aligned}$$
(40)

for all i.

Then, let \(\nu _{k} \left( \varphi _{r,i} \right) \ge 0\) be a weight parameter associated with a particular \(\varphi _{r,i} \) and k-th class \(C_{k} \), defined as

$$\begin{aligned} \nu _{k} \left( \varphi _{r,i} \right) ={\textstyle \frac{1}{\pi }} \left( \varphi _{r,i} \right) , \end{aligned}$$
(41)

which normalizes \(\varphi _{r,i} \) into the range of \(\left[ 0,1\right] \), \(\nu _{k} \left( \varphi _{r,i} \right) \in \left[ 0,1\right] \).

For an r-th sequence \(\vec {\varphi }_{r} \), a \(\nu _{k} \left( \vec {\varphi }_{r} \right) \) collection can be defined as

$$\begin{aligned} \nu _{k} \left( \vec {\varphi }_{r} \right) =\left[ \nu _{k} \left( \varphi _{r,1} \right) ,\ldots ,\nu _{k} \left( \varphi _{r,L} \right) \right] , \end{aligned}$$
(42)

where \(\sum _{i=1}^{L}\nu _{k} \left( \varphi _{r,i} \right) =1\).

From Eqs. (39) and (42), the \(\phi _{k} \left( \vec {\varphi }_{r} \right) \) evolution of a particular sequence \(\vec {\varphi }_{r} \) with respect to a k-th class \(C_{k} \) is defined as

$$\begin{aligned} \begin{aligned} {{\phi }_{k}}\left( {{{\vec {\varphi }}}_{r}} \right)&={{\left( {{\nu }_{k}}\left( {{{\vec {\varphi }}}_{r}} \right) \right) }^{T}}f_{k}^{\mathcal {C}}\left( {{{\vec {\varphi }}}_{r}} \right) \\&=\left[ {{\nu }_{k}}\left( {{\varphi }_{r,1}} \right) f_{k}^{\mathcal {C}}\left( {{\varphi }_{r,1}} \right) ,\ldots ,{{\nu }_{k}}\left( {{\varphi }_{r,L}} \right) f_{k}^{\mathcal {C}}\left( {{\varphi }_{r,L}} \right) \right] . \end{aligned} \end{aligned}$$
(43)

Since the \(\phi _{k} \left( \vec {\varphi }_{r} \right) \) term (43) is a nonlinear map, the problem of correlation analysis [41, 43] between the inner products of nonlinear functions \(\phi _{k} \left( \vec {\varphi }_{r} \right) \) and \(\phi _{l} \left( \vec {\varphi }_{r} \right) \) can be reformulated via a kernel machine \({\mathcal {K}}\) [44,45,46] as \({\mathcal {K}}\left( \phi _{k} \left( \vec {\varphi }_{r} \right) ,\phi _{l} \left( \vec {\varphi }_{r} \right) \right) \), which yields a distance in a high-dimensional Hilbert space \({\mathcal {H}}\). This distance in \({\mathcal {H}}\) can therefore be used as a metric to describe the correlation between \(\phi _{k} \left( \vec {\varphi }_{r} \right) \) and \(\phi _{l} \left( \vec {\varphi }_{r} \right) \).

Let \({\mathcal {X}}\) be the input space, and let \({\mathcal {K}}\) be an arbitrary kernel machine, defined for a given \(x,y\in {\mathcal {X}}\) via the kernel function

$$\begin{aligned} {\mathcal {K}}\left( x,y\right) =\Gamma \left( x\right) ^{T} \Gamma \left( y\right) , \end{aligned}$$
(44)

where

$$\begin{aligned} \Gamma :{\mathcal {X}}\rightarrow {\mathcal {H}} \end{aligned}$$
(45)

is a nonlinear map from \({\mathcal {X}}\) to the high-dimensional reproducing kernel Hilbert space (RKHS) \({\mathcal {H}}\) associated with \({\mathcal {K}}\). Without a loss of generality, \(\dim \left( {\mathcal {H}}\right) \mathrm{\gg }\dim \left( {\mathcal {X}}\right) \), and we assume that the map \(\Gamma \) in Eq. (45) has no inverse.

Then, for a \(\phi _{k} \left( \vec {\varphi }_{r} \right) \) and \(\phi _{l} \left( \vec {\varphi }_{r} \right) \), let \(\rho \left( \phi _{k} \left( \vec {\varphi }_{r} \right) ,\phi _{l} \left( \vec {\varphi }_{r} \right) \right) \rightarrow {\mathcal {H}}\) be the correlation identifier, as

$$\begin{aligned} \begin{aligned}&\rho \left( {{\phi }_{k}}\left( {{{\vec {\varphi }}}_{r}} \right) ,{{\phi }_{l}}\left( {{{\vec {\varphi }}}_{r}} \right) \right) \\ {}&=\mathcal {K}\left( {{\phi }_{k}}\left( {{{\vec {\varphi }}}_{r}} \right) ,{{\phi }_{l}}\left( {{{\vec {\varphi }}}_{r}} \right) \right) \\&=\sum \limits _{i=1}^{L}{\mathcal {K}\left( {{\nu }_{k}}\left( {{\varphi }_{r,i}} \right) f_{k}^{\mathcal {C}}\left( {{\varphi }_{r,i}} \right) ,{{\nu }_{l}}\left( {{\varphi }_{r,i}} \right) f_{l}^{\mathcal {C}}\left( {{\varphi }_{r,i}} \right) \right) }. \end{aligned} \end{aligned}$$
(46)

Assuming that \({\mathcal {K}}\) is a Gaussian kernel [44,45,46] in Eq. (46), for an i-th gate parameter the kernel function is

$$\begin{aligned} \begin{aligned}&\mathcal {K}\left( {{\nu }_{k}}\left( {{\varphi }_{r,i}} \right) f_{k}^{\mathcal {C}}\left( {{\varphi }_{r,i}} \right) ,{{\nu }_{l}}\left( {{\varphi }_{r,i}} \right) f_{l}^{\mathcal {C}}\left( {{\varphi }_{r,i}} \right) \right) \\&\quad =\exp \left( -\tfrac{1}{c}{{f}_{d}}\left( {{\nu }_{k}}\left( {{\varphi }_{r,i}} \right) f_{k}^{\mathcal {C}}\left( {{\varphi }_{r,i}} \right) ,{{\nu }_{l}}\left( {{\varphi }_{r,i}} \right) f_{l}^{\mathcal {C}}\left( {{\varphi }_{r,i}} \right) \right) \right) , \end{aligned} \end{aligned}$$
(47)

where \(c=2\sigma ^{2} \), while \(f_{d} \left( \cdot \right) \) yields the \(\mathrm{L}2\)-distance in \({\mathcal {H}}\),

$$\begin{aligned} \begin{aligned}&f_{d} \left( \nu _{k} \left( \varphi _{r,i} \right) f_{k}^{{\mathcal {C}}} \left( \varphi _{r,i} \right) ,\nu _{l} \left( \varphi _{r,i} \right) f_{l}^{{\mathcal {C}}} \left( \varphi _{r,i} \right) \right) \\&\quad =\left\| \nu _{k} \left( \varphi _{r,i} \right) f_{k}^{{\mathcal {C}}} \left( \varphi _{r,i} \right) -\nu _{l} \left( \varphi _{r,i} \right) f_{l}^{{\mathcal {C}}} \left( \varphi _{r,i} \right) \right\| _{2}^{2} . \end{aligned} \end{aligned}$$
(48)

For a given \(\phi _{k} \left( \vec {\varphi }_{r} \right) \) and \(\phi _{l} \left( \vec {\varphi }_{r} \right) \), an \(f_{A} \left( \phi _{c} \left( \vec {\varphi }_{r} \right) ,\phi _{c} \left( \vec {\varphi }_{r} \right) \right) \rightarrow \delta _{+}^{K} \) average is yielded as

$$\begin{aligned} \begin{aligned}&\varsigma \left( {{\phi }_{c}}\left( {{{\vec {\varphi }}}_{r}} \right) ,{{\phi }_{c}}\left( {{{\vec {\varphi }}}_{r}} \right) \right) ={{\left( {{\phi }_{c}}\left( {{{\vec {\varphi }}}_{r}} \right) \right) }^{T}}{{\phi }_{c}}\left( {{{\vec {\varphi }}}_{r}} \right) \\&\quad =\sum \limits _{i=1}^{L}{\nu _{c}^{2}\left( {{\varphi }_{r,i}} \right) {{\left( f_{c}^{\mathcal {C}}\left( {{\varphi }_{r,i}} \right) \right) }^{2}}}\le \sum \limits _{i=1}^{L}{{{\nu }_{c}}\left( {{\varphi }_{r,i}} \right) f_{c}^{\mathcal {C}}\left( {{\varphi }_{r,i}} \right) }, \end{aligned} \end{aligned}$$
(49)

where \(\delta _{+}^{K} \) refers to the space of \(K\times K\) symmetric positive semi-definite matrices [43, 45, 46], while the \(\iota \) inner products of \(\phi _{k} \left( \vec {\varphi }_{r} \right) \) and \(\phi _{l} \left( \vec {\varphi }_{r} \right) \) are represented in \(\delta _{+}^{K} \) via \(\iota \left( \phi _{k} \left( \vec {\varphi }_{r} \right) ,\phi _{l} \left( \vec {\varphi }_{r} \right) \right) \rightarrow \delta _{+}^{K} \) as

$$\begin{aligned} \begin{aligned}&\iota \left( {{\phi }_{k}}\left( {{{\vec {\varphi }}}_{r}} \right) ,{{\phi }_{l}}\left( {{{\vec {\varphi }}}_{r}} \right) \right) ={{\left( {{\phi }_{k}}\left( {{{\vec {\varphi }}}_{r}} \right) \right) }^{T}}{{\phi }_{l}}\left( {{{\vec {\varphi }}}_{r}} \right) \\&\quad =\sum \limits _{i=1}^{L}{{{\nu }_{k}}\left( {{\varphi }_{r,i}} \right) {{\nu }_{l}}\left( {{\varphi }_{r,i}} \right) \left( f_{k}^{\mathcal {C}}\left( {{\varphi }_{r,i}} \right) \right) }\left( f_{l}^{\mathcal {C}}\left( {{\varphi }_{r,i}} \right) \right) . \end{aligned} \end{aligned}$$
(50)

The \(\vec {\varphi }_{r} \) sequence is classified into a given class from set \({\mathcal {C}}\), as given in Algorithm 2 (\({\mathcal {A}}_{C} \)).\(\square \)

figure c

\(\square \)

5 Numerical evaluation

5.1 System stability

Let \({\left| \phi \right\rangle } \) be the stabilized system state of the quantum computer formulated by R output systems, \({\left| \vec {\varphi }_{r} \right\rangle } \), \(r=1,\ldots ,R\), as

$$\begin{aligned} {\left| \phi \right\rangle } ={\left| \vec {\varphi }_{1} \right\rangle } \otimes \cdots \otimes {\left| \vec {\varphi }_{R} \right\rangle } , \end{aligned}$$
(51)

with gate parameters \(\beta \), as given in (11).

Then, let \({\left| \phi ^{*} \right\rangle } \) be a target stabilized system of the quantum computer, as

$$\begin{aligned} {\left| \phi ^{*} \right\rangle } ={\left| \vec {\varphi }_{1}^{*} \right\rangle } \otimes \cdots \otimes {\left| \vec {\varphi }_{R}^{*} \right\rangle } , \end{aligned}$$
(52)

with target gate parameters \(\beta ^{*} \), as

$$\begin{aligned} \beta ^{*} =\left[ \vec {\varphi }_{1}^{*} ,\ldots ,\vec {\varphi }_{R}^{*} \right] \end{aligned}$$
(53)

where \(\vec {\varphi }_{r}^{*} =\left[ \varphi _{r,1}^{*} ,\ldots ,\varphi _{r,L}^{*} \right] ^{T} \).

Then, let \(\left[ \beta \right] _{rl}\) refer to the gate parameter \(\varphi _{r,l} \) of an l-th unitary of an r-th running sequence of the quantum computer, \(l=1,\ldots ,L\), \(r=1,\ldots ,R\), in the state \({\left| \phi \right\rangle } \), and let \(\left[ \beta ^{*} \right] _{rl} \) identify the target gate parameter \(\varphi _{r,l}^{*} \) in state \({\left| \phi ^{*} \right\rangle } \).

Then, let \(D\left( \left. \beta \right\| \beta ^{*} \right) \) be the relative entropy between \(\beta \) and \(\beta ^{*} \), as

$$\begin{aligned} D\left( \left. \beta \right\| \beta ^{*} \right) =\sum _{r,l}\left( \left[ \beta \right] _{rl} \log {\textstyle \frac{\left[ \beta \right] _{rl} }{\left[ \beta ^{*} \right] _{rl} }} +\left[ \beta ^{*} \right] _{rl} -\left[ \beta \right] _{rl} \right) . \end{aligned}$$
(54)

where \(D\left( \left. \beta \right\| \beta ^{*} \right) \ge 0\), and let \(f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \ge 0\) be a function that returns the value of the relative entropy function for an r-th running sequence as

$$\begin{aligned} f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) =\sum _{l}\left( \left[ \beta \right] _{rl} \log {\textstyle \frac{\left[ \beta \right] _{rl} }{\left[ \beta ^{*} \right] _{rl} }} +\left[ \beta ^{*} \right] _{rl} -\left[ \beta \right] _{rl} \right) . \end{aligned}$$
(55)

Let \(f_{D\left( \left. \beta \right\| \beta ^{*} \right) }^{*} \left( r\right) \) be a target value for function (55), and let \(\Delta \left( f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \right) \) be the difference [47] between \(f_{D\left( \left. \beta \right\| \beta ^{*} \right) }^{*} \left( r\right) \) and (55), as

$$\begin{aligned} \Delta \left( {{f}_{D\left( \left. \beta \right\| {{\beta }^{*}} \right) }}\left( r \right) \right) =\tfrac{1}{R}\int \limits _{1}^{R}{\partial _{D\left( \left. \beta \right\| {{\beta }^{*}} \right) }^{2}\left( r \right) \mathrm{d}r}, \end{aligned}$$
(56)

where \({{\partial }_{D\left( \left. \beta \right\| {{\beta }^{*}} \right) }}\left( r \right) \) is the derivative of \(f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \).

Using (56), we define a stability parameter \(\delta \) to quantify the variation of the \({\left| \vec {\varphi }_{r} \right\rangle } \) stabilized system state of the r-th running sequence of the quantum computer, as

$$\begin{aligned} \delta \left( r\right) =\left( {\textstyle \frac{R}{2\pi }} \sqrt{\Delta \left( f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \right) } \right) ^{-1} . \end{aligned}$$
(57)

For analytical purposes, let us assume that \(f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \) oscillates between a minimal value \(\gamma \ge 0\), and a maximal value \(\gamma \le \lambda \le 1\), defined as

$$\begin{aligned} \gamma =\arg \mathop {\min }\limits _{\forall r} \left( f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \right) , \end{aligned}$$
(58)

and

$$\begin{aligned} \lambda =\arg \mathop {\max }\limits _{\forall r} \left( f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \right) , \end{aligned}$$
(59)

therefore \(f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \) can be rewritten as

$$\begin{aligned} f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) =c\sin \left( N2\pi {\textstyle \frac{r}{R}} \right) +{{\mathbb {E}}}\left( D\left( \left. \beta \right\| \beta ^{*} \right) \right) , \end{aligned}$$
(60)

where c is a constant, set as

$$\begin{aligned} c={\textstyle \frac{1}{2}} \left( \lambda -\gamma \right) , \end{aligned}$$
(61)

while \(0\le {{\mathbb {E}}}\left( D\left( \left. \beta \right\| \beta ^{*} \right) \right) \le 1\) is an expected value of (54), set as

$$\begin{aligned} {{\mathbb {E}}}\left( D\left( \left. \beta \right\| \beta ^{*} \right) \right) =c+\gamma , \end{aligned}$$
(62)

while N is the number of oscillations.

Therefore, (56) can be evaluated as

$$\begin{aligned} \begin{aligned} \Delta \left( {{f}_{D\left( \left. \beta \right\| {{\beta }^{*}} \right) }}\left( r \right) \right)&=\tfrac{1}{R}\int \limits _{1}^{R}{\tfrac{2{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}}{{\cos }^{2}}\left( N2\pi \tfrac{r}{R} \right) \mathrm{d}r} \\&=\tfrac{2{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}}\tfrac{1}{N2\pi }\int \limits _{1}^{N2\pi }{2{{\cos }^{2}}\left( {{r}'} \right) d{r}'} \\&=\tfrac{{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}}, \end{aligned} \end{aligned}$$
(63)

where \(r\in \left[ r_{0} ,r_{0} +R\right] \), with \(r_{0} =1\).

Then, by using (63), the quantity in (57) is as

$$\begin{aligned} \delta \left( r\right) =\left( {\textstyle \frac{R}{2\pi }} \sqrt{{\textstyle \frac{N^{2} 4\pi ^{2} }{R^{2} }} } \right) ^{-1} ={\textstyle \frac{1}{N}} , \end{aligned}$$
(64)

that identifies the inverse of the number of oscillations.

Therefore, (64) identifies the stability of the system state \({\left| \vec {\varphi }_{r} \right\rangle } \) of the quantum computer in the r-th running sequence if \(f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \) has the form of (60). For an arbitrary \(f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \), the stability parameter \(\delta \left( r\right) \) is evaluated via (57). The high value of \(\delta \left( r\right) \) indicates that the stabilized system \({\left| \vec {\varphi }_{r} \right\rangle } \) in (51) changes slowly. Particularly, if \(\delta \left( r\right) \ge \delta ^{*} \left( r\right) \), where \(\delta ^{*} \left( r\right) \) is a target value for \(\delta \left( r\right) \), then the system state \({\left| \vec {\varphi }_{r} \right\rangle } \) of the quantum computer is considered as stable.

The values of \(f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \) (60) and \(\delta \left( r\right) \) (64) for R running sequences are depicted in Fig. 2.

Fig. 2
figure 2

The \(f_{D\left( \left. \beta \right\| \beta ^{*} \right) } \left( r\right) \) relative entropy values between the gate parameters of the stabilized system \({\left| \vec {\varphi }_{r} \right\rangle } \) and target system \({\left| \vec {\varphi }_{r}^{*} \right\rangle } \) for R running sequences, \(r=1,\ldots R\), \(R=10\), \({{\mathbb {E}}}\left( D\left( \left. \beta \right\| \beta ^{*} \right) \right) =0.1\). a \(N=1\). b \(N=2\). c \(N=3\). d Stability parameter \(\delta \left( r\right) \) for the different relative entropy values

5.2 Gate parameter correlations

Let \({\left| \vec {\varphi }_{r} \right\rangle } \) be the stabilized state of the quantum computer in the r-th running sequence, with \(\vec {\varphi }_{r} =\left[ \varphi _{r,1} ,\ldots ,\varphi _{r,L} \right] ^{T} \), and let \({\left| \vec {\varphi }_{r}^{*} \right\rangle } \) be the target stabilized system state in the r-th running sequence, with \(\vec {\varphi }_{r}^{*} =\left[ \varphi _{r,1}^{*} ,\ldots ,\varphi _{r,L}^{*} \right] ^{T} \).

Then, let \(\mu \) be a correlation coefficient [47] that measures the correlation of the gate parameters \(\beta \) and \(\beta ^{*} \) of \({\left| \phi \right\rangle } \) (51) and \({\left| \phi ^{*} \right\rangle } \) (11), defined as

$$\begin{aligned} \mu \left( \beta ,\beta ^{*} \right) =\left| {\textstyle \frac{F\left( \left( f\left( \vec {\varphi }_{r} \right) -F\left( f\left( \vec {\varphi }_{r} \right) \right) \right) \left( f\left( \vec {\varphi }_{r}^{*} \right) -F\left( f\left( \vec {\varphi }_{r}^{*} \right) \right) \right) \right) }{\sqrt{F\left( \left( f\left( \vec {\varphi }_{r} \right) -F\left( f\left( \vec {\varphi }_{r} \right) \right) \right) ^{2} \right) F\left( \left( f\left( \vec {\varphi }_{r}^{*} \right) -F\left( f\left( \vec {\varphi }_{r}^{*} \right) \right) \right) ^{2} \right) } }} \right| , \end{aligned}$$
(65)

where \(\left| \cdot \right| \) is the absolute value, \(f\left( \vec {\varphi }_{r} \right) \) is a function of r that represents the values of the gate parameter vector \(\vec {\varphi }_{r} \), while \(F\left( \cdot \right) \) is defined over \(r\in \left[ 1,R\right] \), as

$$\begin{aligned} F\left( f\left( x \right) \right) =\tfrac{1}{R}\int \limits _{1}^{R}{f\left( x \right) \mathrm{d}r}. \end{aligned}$$
(66)

For illustration purposes, let us assume that \(L=1\), and \(f\left( \vec {\varphi }_{r} \right) \) is as

$$\begin{aligned} f\left( \vec {\varphi }_{r} \right) =X\cos ^{2} \left( CN2\pi {\textstyle \frac{r}{R}} \right) , \end{aligned}$$
(67)

where we set X as \(X={2C^{2} N^{2} 4\pi ^{2}/R^{2} } \), while \(C>0\) is a constant, thus (66) is evaluated as

$$\begin{aligned} \begin{aligned} F\left( f\left( {{{\vec {\varphi }}}_{r}} \right) \right)&=\tfrac{1}{R}\int \limits _{1}^{R}{\tfrac{2{{C}^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}}{{\cos }^{2}}\left( CN2\pi \tfrac{r}{R} \right) \mathrm{d}r} \\&=\tfrac{2{{C}^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}}\tfrac{1}{N2\pi }\int \limits _{1}^{N2\pi }{2{{\cos }^{2}}\left( {{r}'} \right) d{r}'} \\&=\tfrac{{{C}^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}}. \end{aligned} \end{aligned}$$
(68)

For the target system \({\left| \vec {\varphi }_{r}^{*} \right\rangle } \), the constant \(C^{*} \) is set as

$$\begin{aligned} f\left( \vec {\varphi }_{r}^{*} \right) ={\textstyle \frac{2\left( C^{*} \right) ^{2} N^{2} 4\pi ^{2} }{R^{2} }} \cos ^{2} \left( C^{*} N2\pi {\textstyle \frac{r}{R}} \right) , \end{aligned}$$
(69)

while for \({\left| \vec {\varphi }_{r} \right\rangle } \), we set C as \(C>C^{*} \), thus (65) can be evaluated as

$$\begin{aligned} \mu \left( \beta ,\beta ^{*} \right) =\left| {\textstyle \frac{F\left( \left( f\left( \vec {\varphi }_{r} \right) -{\textstyle \frac{C^{2} N^{2} 4\pi ^{2} }{R^{2} }} \right) \left( f\left( \vec {\varphi }_{r}^{*} \right) -{\textstyle \frac{\left( C^{*} \right) ^{2} N^{2} 4\pi ^{2} }{R^{2} }} \right) \right) }{\sqrt{F\left( \left( f\left( \vec {\varphi }_{r} \right) -{\textstyle \frac{C^{2} N^{2} 4\pi ^{2} }{R^{2} }} \right) ^{2} \right) F\left( \left( f\left( \vec {\varphi }_{r}^{*} \right) -{\textstyle \frac{\left( C^{*} \right) ^{2} N^{2} 4\pi ^{2} }{R^{2} }} \right) ^{2} \right) } }} \right| , \end{aligned}$$
(70)

where

$$\begin{aligned} \begin{aligned}&F\left( \left( f\left( {{{\vec {\varphi }}}_{r}} \right) -\tfrac{{{C}^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}} \right) \left( f\left( \vec {\varphi }_{r}^{*} \right) -\tfrac{{{\left( {{C}^{*}} \right) }^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}} \right) \right) \\&\quad =F\left( f\left( {{{\vec {\varphi }}}_{r}} \right) f\left( \vec {\varphi }_{r}^{*} \right) -f\left( {{{\vec {\varphi }}}_{r}} \right) \tfrac{{{\left( {{C}^{*}} \right) }^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}}-\tfrac{{{C}^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}}f\left( \vec {\varphi }_{r}^{*} \right) +\tfrac{{{C}^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}}\tfrac{{{\left( {{C}^{*}} \right) }^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}} \right) \\&\quad =\tfrac{1}{R}\left( \tfrac{2{{\pi }^{3}}{{C}^{2}}{{\left( {{C}^{*}} \right) }^{2}}{{N}^{3}}\left( \left( {{C}^{*}}-C \right) \sin \left( N4\pi \left( {{C}^{*}}+C \right) \right) +\left( {{C}^{*}}+C \right) \sin \left( N4\pi \left( {{C}^{*}}-C \right) \right) \right) }{\left( {{\left( {{C}^{*}} \right) }^{2}}-{{C}^{2}} \right) {{R}^{3}}} \right) , \end{aligned} \end{aligned}$$
(71)
Fig. 3
figure 3

Gate parameter values of \(f\left( \vec {\varphi }_{r} \right) \) and \(f\left( \vec {\varphi }_{r}^{*} \right) \) in function of running sequence r, \(r=1,\ldots ,R\), \(R=10\), \(L=1\), for different N, C and \(C^{*} \), \(C\in \left[ 0,1\right] \), \(C^{*} \in \left[ 0,1\right] \). a, b \(N=1\), \(C=0.125\), \(C^{*} =0.1\). c, d \(N=1\), \(C=0.3\), \(C^{*} =0.2\) e, f \(N=2\), \(C=0.5\), \(C^{*} =0.3\). g The \(\mu \left( \beta ,\beta ^{*} \right) \) correlation values between the gate parameters of af, S is an indexing parameter

and

$$\begin{aligned} \begin{aligned} F\left( {{\left( f\left( {{{\vec {\varphi }}}_{r}} \right) -\tfrac{{{C}^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}} \right) }^{2}} \right)&=F\left( f{{\left( {{{\vec {\varphi }}}_{r}} \right) }^{2}}-2f\left( {{{\vec {\varphi }}}_{r}} \right) \tfrac{{{C}^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}}+{{\left( \tfrac{{{C}^{2}}{{N}^{2}}4{{\pi }^{2}}}{{{R}^{2}}} \right) }^{2}} \right) \\&=\tfrac{1}{R}\left( \tfrac{{{C}^{4}}{{N}^{4}}8{{\pi }^{4}}}{{{R}^{3}}} \right) =\tfrac{{{C}^{4}}{{N}^{4}}8{{\pi }^{4}}}{{{R}^{4}}}, \end{aligned} \end{aligned}$$
(72)

thus (70) is simplified as

$$\begin{aligned} \mu \left( \beta ,\beta ^{*} \right) =\left| {\textstyle \frac{2\pi ^{3} C^{2} \left( C^{*} \right) ^{2} N^{3} \left( \left( C^{*} -C\right) \sin \left( N4\pi \left( C^{*} +C\right) \right) +\left( C^{*} +C\right) \sin \left( N4\pi \left( C^{*} -C\right) \right) \right) }{\left( \left( \left( C^{*} \right) ^{2} -C^{2} \right) R^{4} \right) \sqrt{{\textstyle \frac{C^{4} N^{4} 8\pi ^{4} }{R^{4} }} {\textstyle \frac{\left( C^{*} \right) ^{4} N^{4} 8\pi ^{4} }{R^{4} }} } }} \right| . \end{aligned}$$
(73)

The values of (73) are depicted in Fig. 3.

In Fig. 4, the distribution of \(\mu \left( \beta ,\beta ^{*} \right) \) in function of C and \(C^{*} \) is depicted, \(C\in \left[ 0,1\right] \), \(C^{*} \in \left[ 0,1\right] \) for different values of N, \(f\left( \vec {\varphi }_{r} \right) \) and \(f\left( \vec {\varphi }_{r}^{*} \right) \) are evaluated as given in (67) and (69), \(L=1\), and \(R=10\).

Fig. 4
figure 4

The distribution of \(\mu \left( \beta ,\beta ^{*} \right) \) in function of C and \(C^{*} \) at \(f\left( \vec {\varphi }_{r} \right) \) and \(f\left( \vec {\varphi }_{r}^{*} \right) \), \(L=1\), \(R=10\). a \(N=1\). b \(N=2\). c \(N=3\)

6 Conclusions

Here, we defined a method for the learning of stable quantum evolutions in gate-model quantum computer architectures. The model stabilizes an optimal state of a quantum computer to maximize the particular objective function of an arbitrary problem fed into the quantum computer. The model learns a stabilizer matrix that stabilizes the state of the quantum computer through an arbitrary number of run sequences. We also defined a scheme to characterize the stability of the stabilized states via unsupervised learning of the stability classes of the stabilized sequences. The results are particularly useful for gate-based quantum computations and gate-model quantum computer architectures.