Next Article in Journal
A Spatially Correlated Model with Generalized Autoregressive Conditionally Heteroskedastic Structure for Counts of Crimes
Next Article in Special Issue
Construction of Binary Quantum Error-Correcting Codes from Orthogonal Array
Previous Article in Journal
The Trade-Offs between Optimality and Feasibility in Online Routing with Dedicated Path Protection in Elastic Optical Networks
Previous Article in Special Issue
Multi-User Measurement-Device-Independent Quantum Key Distribution Based on GHZ Entangled State
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Quantum Linear System Algorithm for General Matrices in System Identification

1
College of Information and Communication, National University of Defense Technology, Xi’an 710006, China
2
College of Intelligence Science and Technology, National University of Defense Technology, Changsha 410003, China
3
College of Liberal Arts and Sciences, National University of Defense Technology, Changsha 410003, China
*
Authors to whom correspondence should be addressed.
Entropy 2022, 24(7), 893; https://doi.org/10.3390/e24070893
Submission received: 28 April 2022 / Revised: 24 June 2022 / Accepted: 25 June 2022 / Published: 29 June 2022
(This article belongs to the Special Issue Quantum Information and Computation)

Abstract

:
Solving linear systems of equations is one of the most common and basic problems in classical identification systems. Given a coefficient matrix A and a vector b, the ultimate task is to find the solution x such that A x = b . Based on the technique of the singular value estimation, the paper proposes a modified quantum scheme to obtain the quantum state | x corresponding to the solution of the linear system of equations in O ( κ 2 r poly log ( m n ) / ϵ ) time for a general m × n dimensional A, which is superior to existing quantum algorithms, where κ is the condition number, r is the rank of matrix A and ϵ is the precision parameter. Meanwhile, we also design a quantum circuit for the homogeneous linear equations and achieve an exponential improvement. The coefficient matrix A in our scheme is a sparsity-independent and non-square matrix, which can be applied in more general situations. Our research provides a universal quantum linear system solver and can enrich the research scope of quantum computation.

1. Introduction

System identification [1,2,3] is a common method to determine the mathematical model describing the behavior of classical systems. Thus, the future evolution of the system can be predicted through the identified system model, which is widely applied to common weather forecast, flood forecast, market trend, etc. The traditional system identification method, namely the classical identification method, mainly includes least squares method [4], impulse response method and maximum likelihood method [5,6]. Existing studies [2,3] found that solving linear systems of equations is the basis of system identification problems. In fact, not only system identification problems, the application of linear equations involves various fields of science and engineering, including machine learning [7], partial differential equations [8], classic control system, and so on. Therefore, solving linear systems of equations for general matrices is of great significance.
Due to the importance of linear systems of equations in various fields, the solution of linear equations has become an enduring issue, and many algorithms derived therefrom. The classical solvers mainly include: matrix elimination method [9] and Kaczmarz method [10]. The most famous one of the former is the Gaussian elimination method, which is often used to solve small linear systems of equations and is suitable for a general coefficient matrix. The Kaczmarz method is generally more practical in the field of large-scale linear equations. The running time for these classical solvers scales as O ( n 3 ) , where n is the size of the matrix, which will cost a lot of computing resources in solving large-scale linear systems. However, quantum computation [11,12,13] is capable of greatly reducing the time complexity for matrix operation and numerical calculation, which can be regarded as a promising attempt as a computing tool to improve the identification efficiency.
Quantum computation is an emerging computing technology that regulates quantum information units to perform high-efficiency calculations based on the laws of quantum mechanics, including coherent superposition and entanglement [14]. In 1994, Shor proposed the algorithm for prime factorization [15] with exponential acceleration over classical algorithms, which shows the potential of quantum computation for the first time. Since then, quantum computation has reached an era of rapid development. In recent years, scholars have also made significant progress in quantum algorithm research, including Grover algorithm [16], quantum simulation [17,18,19], duality algorithm [20,21,22], linear systems of equations solver [23,24,25], matrix multiplication algorithm [26,27], and so on. For the high-dimensional linear systems of equations, there have been breakthroughs in the field of quantum computation. In 2009, Harrow, Hassidim and Lloyd [23] proposed the quantum linear system algorithm (HHL) to obtain the quantum state | x = | A 1 b corresponding to the solution of A x = b in time O ( poly log ( n ) ) , where the sparse matrix A R n × n and x , b R n , which can improve the computational efficiency with an exponential speed-up over classical algorithms. The HHL algorithm is of great significance in the field of quantum information processing and has a wide range of applications in big data, machine learning, numerical computing and other scenarios. In 2018, Wossnig et al. [28] proposed a sparsity-independent quantum linear system algorithm (QLSA) based on a quantum singular value estimation algorithm (QSVE). After that, Shao and Xiang [29] modified the QSVE algorithm to adapt to the non-Hermitian case. Current algorithms for linear systems have been widely applied in the emerging research area of quantum information processing. However, existing quantum algorithms have different restrictions on matrix A, such as the most typical one of HHL algorithm, which requires A to be a sparse Hermitian matrix so that the unitary transformation e i A t [30,31] can be realized in a constant time. At present, the quantum algorithm suitable for arbitrary linear system of equations has not been fully studied.
Without loss of generality, existing quantum algorithms assumed that the coefficient matrix A is Hermitian as it is well known that the general case can be reduced to the Hermitian case by embedding a general rectangular matrix M into a block antidiagonal Hermitian matrix with the elements of M and M in the lower and upper half, respectively [28]. Different from previous algorithms, we proposed a modified quantum scheme to solve the cases of general matrices directly, which can reduce the time complexity of solving the linear system of equations. Moreover, it may not be easy to expand A into a Hermitian matrix when A is given as quantum information. However, our scheme does not need such expansion and works well on the original non-Hermitian matrix, and hence it can be implemented more efficiently. Based on this idea, this paper considers three cases of the solution of linear systems and proposes a quantum linear system algorithm for general matrices, where A is not required to be sparse or square, which can effectively improve the computational efficiency and expand the application range of quantum computation. For the homogeneous linear equations, we design the corresponding quantum circuit to ensure the completeness of the solution, which supplies exponential speed-up over classical algorithms. Meanwhile, we modify the quantum phase estimation (QPE) circuit to determine the sign of the phase by setting a sign qubit, which can be widely applied to various quantum algorithms.
The rest of our paper is organized as follows. Section 2 analyzes a general model of classical identification system based on semi-tensor product and shows the detailed process of our quantum algorithms. In Section 3, we make a time complexity comparison between existing algorithms and our algorithms. Then, we perform a numerical simulation to clarify the process of quantum algorithm in Section 4. Finally, we conclude in Section 5.

2. Quantum Algorithms for System Identification

2.1. The Classical System Identification Problem

Consider a general discrete model of system identification as follows:
x ( i + 1 ) = A x ( i ) + B u ( i )
where x ( i ) is an n dimensional system state of the i-th sampling, u ( i ) is the input with dimension m, A is an n × n system matrix and B is an n × m matrix. The goal of system identification is to estimate the matrices A and B from a set of inputs { u ( i ) } and states { x ( i ) } .
System identification problems can be expressed in terms of the semi-tensor product method [32]. As a kind of special matrix multiplication, the semi-tensor product generalizes the ordinary matrix multiplication to the general case. T S denotes the Kronecker product of matrices T m × n and S p × q , which is expressed as
T S = t 1 , 1 S t 1 , 2 S t 1 , n S t 2 , 1 S t 2 , 2 S t 2 , n S t m , 1 S t m , 2 S t m , n S
Just as a computational tool for solving the model, T S denotes the semi-tensor product of matrices T and S:
T S = ( T I l / n ) ( S I l / p )
where l = lcm ( n , p ) is the least common multiple of n and p. The semi-tensor product is the generalization of matrix multiplication. When n = p , there are l = n = p and T S = T S .
Define V C ( S ) = s 1 s 2 s n , where s i is the ith column vector of the matrix S. Therefore, we may estimate A and B from a set of u ( i ) and x ( i ) .
x ( i + 1 ) = A x ( i ) + B u ( i ) = a 11 x 1 ( i ) + + a 1 n x n ( i ) a n 1 x 1 ( i ) + + a n n x n ( i ) + b 11 u 1 ( i ) + + b 1 m u m ( i ) b n 1 u 1 ( i ) + + b n m u m ( i ) = x ( i ) T I n · V C ( A ) + u ( i ) T I n · V C ( B ) = x ( i ) T V C ( A ) + u ( i ) T V C ( B ) = ( x ( i ) T , u ( i ) T ) V C ( A ) V C ( B )
where x ( i ) T is a 1 × n matrix and V C ( A ) is an n 2 × 1 matrix. According to Equation (3), the least common multiple lcm ( n , n 2 ) = n 2 , and x ( i ) T V C ( A ) = ( x ( i ) T I n ) ( V C ( A ) I 1 ) .
Suppose there are N + 1 observed samples, and
W = x ( 2 ) x ( N + 1 ) , H = x ( 1 ) T , u ( 1 ) T x ( N ) T , u ( N ) T , Y = V C ( A ) V C ( B ) .
Then we have
H Y = W ( H I n ) Y = W
The Equation (6) is a linear system of equations, and the task is to find the solution Y. In the Equation (6), H I n is an N n × ( m + n ) n matrix, where n is the dimension of system states, m is the dimension of the input, and N is the number of samples. For the high-dimensional identification system, the time complexity of classical algorithms is enormous and existing quantum algorithms can not directly solve the non-square linear systems of equations. In order to reduce the cost of computing resources, it is necessary to propose a quantum algorithm for general linear equations.

2.2. The Quantum Linear System Algorithm for General Matrices

Inspired by the singular value estimation algorithm [23,28,29], we propose a quantum algorithm for general linear systems of equations as follows.
Given a general linear equation A x = b , the singular value decomposition is
A = i σ i μ i ν i T
where A R m × n , x R n and b R m , σ i is the singular value of A, μ i R m and ν i R n are the left and right singular vectors, and μ i T μ i = ν i T ν i = 1 , μ i T μ j = ν i T ν j = 0 ( i j ) .
Let the rank of A be r ( r m , n ) and the rank of [ A b ] be q; the relation between the solution vector x of A x = b and the r , q is:
approximate solution x ^ , r = n and r < q ; unique solution x , r = n = q ; general solution x ¯ , r < n .
The linear system of equations A x = b can be solved by a mathematical optimization technique of minimizing the sum of squares of errors between the solution and the actual data, which is the so-called least squares method
e = A x b 2
In the Equation (7), { μ i } R m and { ν i } R n are a set of basis in m and n dimensional spaces. Therefore, x and b can be expressed as x = i n α i ν i , b = i m β i μ i , and
e = A x b 2 = i = 1 r σ i μ i ν i T i = 1 n α i ν i i = 1 m β i μ i 2 = i = 1 r ( σ i α i β i ) μ i i = r + 1 m β i μ i 2 = i = 1 r ( σ i α i β i ) 2 + i = r + 1 m β i 2
When α i = β i / σ i , e m = min A x b 2 = i = r + 1 m β i 2 .
Note that when r < n , α i ( i = r + 1 , , n ) is not assigned, and the equation A x = b has infinitely many solutions. In engineering, we usually want to find out the lowest energy solution state x with x | x minimality, that is
α i = β i / σ i , i [ 1 , r ] α i = 0 , i [ r + 1 , n ]
The goal is to convert the state b = i = 1 m β i μ i to x = i = 1 r β i / σ i ν i , whose detailed quantum process of our scheme is described as follows.
The following mappings to access to the data structure can be performed in O ( poly log ( m n ) ) time.
U P : | ξ | 0 = ξ i | i | 0 ξ i | i , A i U Q : | 0 | ξ = ξ j | 0 | j ξ j | A F , j
The data structure is based on an array of binary trees, each binary tree contains enough leaves that store the squared amplitudes of the corresponding matrix entry, which can be found in [28,33] with a detailed description of such a binary tree memory structure. In order to facilitate mathematical operation, we define two degenerate operators P and Q that operate only on valid input information | ξ , where the dimension of the input state | ξ | 0 is reduced to the dimension of valid information | ξ , so P and Q are called degenerate operators. The maps P and Q append an arbitrary input state | ξ to a register that encodes:
P : | ξ = ξ i | i ξ i | i , A i = | P ξ Q : | ξ = ξ j | j ξ j | A F , j = | Q ξ
where | i , A i = 1 A i j = 1 n A i j | i , j and | A F , j = 1 A F i = 1 m A i | i , j . That is, P = i = 1 m | i | A i i | and Q = j = 1 n | A F | j j | .
Based on the above definition, it is easy to obtain ( P Q ) i j = i , A i | A F , j = A i j A F . Similarly, it follows that P and Q have orthonormal columns and thus P P = I m and Q Q = I n . Let S = ( 2 P P I ) ( 2 Q Q I ) , when m = n , we can obtain
S Q | ν i = 2 σ i A F P | μ i Q | ν i S P | μ i = ( 4 σ i 2 A F 2 1 ) P | μ i 2 σ i A F Q | ν i
The eigenvalues of S are e ± 2 π i φ i , and the corresponding eigenvectors are ω i ± | w i ± = P | μ i + e 2 π i φ i Q | ν i , where φ i is the phase of eigenvalues and ω i ± is the norm of eigenvectors. Then, it can be obtained
Q | ν i = 1 2 i sin ( π φ i ) ( ω i + | w i + ω i | w i ) P | μ i = 1 2 i sin ( π φ i ) ( e π i φ i ω i + | w i + e π i φ i ω i | w i )
Through phase rotation, the process of i = 1 n β i | μ i i = 1 n β i | ν i is achievable [28,29]. It is worth noting that the above step is avoidable for the case of the coefficient matrix A being Hermitian. At this point, the singular value decomposition is A = i σ i μ i μ i T , and the task is to convert | b = i β i | μ i to the solution | x = i β i / σ i | μ i such that A x = b . However, for the case of non-Hermitian, it is necessary to realize the transformation of quantum states | μ i to | ν i .
For a general linear system of equations with m n , the above derivation will have some changes. For i [ 1 , r ] , Equations (14) and (15) are valid. While i > r , A | ν i = 0 , A | μ i = 0 , and we can obtain
S Q | ν i = ( 2 P P I ) ( 2 Q Q I ) Q | ν i = ( 2 P P I ) Q | ν i = 2 A F P A | ν i Q | ν i = Q | ν i ,
and
S P | μ i = ( 2 P P I ) ( 2 Q Q I ) P | μ i = ( 2 P P I ) ( 2 A F Q A | μ i P | μ i ) = ( 2 P P I ) ( P | μ i ) = P | μ i .
At this point, e 2 π i φ i = 1 is the eigenvalue of S, that is, φ i = ± 1 / 2 , and the corresponding eigenvectors are Q | ν i and P | μ i . In order to achieve | b = i = 1 m β i | μ i = i = 1 r β i | μ i + i = r + 1 m β i | μ i | x = i = 1 r β i / σ i | ν i , we first need to eliminate the formula i = r + 1 m β i | μ i .
Based on these definitions, we show the basic procedure of our algorithm:
  • Preparing the initial quantum state | b = Σ i = 1 m b i | i , which can be represented as:
    | b = i = 1 m β i | μ i
  • Apply P in the initial state | b
    P | b = i = 1 m β i P | μ i = i = 1 r β i 2 i sin ( π φ i ) ( e π i φ i ω i + | w i + e π i φ i ω i | w i ) + i = r + 1 m β i P | μ i
  • Perform phase estimation on input P | b for S = ( 2 P P I ) ( 2 Q Q I ) , as shown in Figure 1, then we obtain the following state
    i = 1 r β i 2 i sin ( π φ i ) ( e π i φ i ω i + | w i + , φ i e π i φ i ω i | w i , φ i ) + i = r + 1 m β i P | μ i | ± 1 2 ,
    where e 2 π i φ i is the eigenvalue of S and | 1 2 = | 01000 , | 1 2 = | 11000 .
  • Apply a phase shift operator controlled by the phase φ i , then we obtain
    i = 1 r β i 2 i sin ( π φ i ) ( ω i + | w i + , φ i ω i | w i , φ i ) + i = r + 1 m β i P | μ i | ± 1 2
  • Perform a controlled rotation on the ancillary qubit based on the register storing phase value φ i and will obtain
    i = 1 r β i 2 i sin ( π φ i ) ( ω i + | w i + , φ i ω i | w i , φ i ) t σ i | 0 + 1 t 2 σ i 2 | 1 + i = r + 1 m β i P | μ i | ± 1 2 | 1 ,
    where σ i = cos ( π φ i ) A F and t = m i n i | σ i | , i [ 1 , r ] .
  • Apply the inverse transformation of step 3 to obtain
    i = 1 r β i 2 i sin ( π φ i ) ( ω i + | w i + ω i | w i ) t σ i | 0 + 1 t 2 σ i 2 | 1 + i = r + 1 m β i P | μ i | | 1 = i = 1 r β i Q | ν i t σ i | 0 + 1 t 2 σ i 2 | 1 + i = r + 1 m β i P | μ i | 1
  • Measure the ancillary register. When the measurement result is | 0 , the quantum state will collapse to
    i = 1 r β i / σ i Q | ν i
  • Apply the inverse of Q and we will obtain the desired state
    i = 1 r β i / σ i | ν i ,
    which is the particular solution of the equation A x = b , that is, the lowest energy solution state.
The quantum gate circuit of our quantum algorithm is shown in Figure 2.
Note that the actual phase value is φ i ( 1 , 1 ) , which serves as the control qubits of the phase shift operation in the step 4, while the previous quantum phase estimation algorithm outputs phase value φ i ( 0 , 1 ) . Therefore, we design a modified quantum phase estimation circuit to determine the sign of the phase in Figure 1. In the modified QPE circuit, we can estimate the phase value in the range φ ( 1 , 1 ) .
For the case of φ [ 0 , 1 ) , φ = j = 1 k 2 j + 1 x j . Since 0 φ < 1 , it is easy to obtain x 1 = 0 .
While φ ( 1 , 0 ) , we can obtain e 2 π i 2 j φ = e 2 π i 2 j ( 2 + φ ) , where j = 1 , , k 1 . Let ϕ = 2 + φ ( 1 , 2 ) , the modified QSV circuit outputs ϕ = j = 1 k 2 j + 1 x j . It is known that ϕ ( 1 , 2 ) , thus we obtain x 1 = 1 and φ = j = 1 k 2 j + 1 x j 2 = j = 2 k 2 j + 1 x j 1 .
Therefore, we can obtain
φ = j = 1 k 2 j + 1 x j , x 1 = 0 j = 2 k 2 j + 1 x j 1 , x 1 = 1
that is, φ = j = 2 k 2 j + 1 x j x 1 .

2.3. The Quantum Algorithm for Homogeneous Linear Equations

For the condition of r < n , the equation A x = b has infinitely many solutions. Therefore, in order to obtain general solutions of the equation A x = b , we need to solve the homogeneous linear equation A x = 0 .
Since A = i = 1 n σ i μ i ν i T and x = i = 1 n α i ν i , we can obtain A x = i = 1 n σ i α i μ i . Let ν i ( i [ r + 1 , n ] ) be the right singular vector corresponding to σ i = 0 , when σ i = 0 or α i = 0 , A x = 0 is valid, that is, x = i = r + 1 n α i ν i . The description of solving homogeneous linear equations is essentially just finding the projection of a state onto the ground state for an operator [34]. Through the quantum circuit shown in Figure 3, we obtain the combination of the eigenvectors corresponding to σ i = 0 and make the solution of homogeneous linear equations complete.
Based on QSVE, our quantum algorithms are sparsity-independent and may be applied to non-square dense matrices.

3. Algorithms Complexity Analysis

Then, we analyse the time complexity of our quantum algorithms.
The time complexity of our scheme includes the following two parts: quantum data generation and the quantum algorithm process. On the one hand, relying on a binary tree memory structure detailed as described in [28,33], where the matrix entries associated with matrix A m × n are stored as suitable data structure, the oracle from classical data to quantum data can be implemented efficiently in time O ( log 2 m n ) and the data structure size is O ( w log m n ) where w is the number of non zero entries in A. On the other hand, based on the quantum singular value estimation algorithm, our algorithm achieves a runtime O ( κ poly log ( m n ) / δ ) , where κ is the condition number of the coefficient matrix A, and δ denotes the precision parameter.
Define that the additive error achieved in output state x ˜ is ϵ , which means if x is the exact result and x ˜ is the result obtained from quantum algorithms, then x x ˜ ϵ . In order to achieve accuracy ϵ , the precision parameter of our algorithm needs to reach δ = ϵ / ( κ A F ) . Assuming the spectral norm A * is bounded by a constant, since A F r A * , we have A F = O ( r ) , where r is the rank of matrix A. Therefore, our quantum algorithm has the time complexity of O ( κ 2 r poly log ( m n ) / ϵ ) . Remarkably, when A is sparse, exponential acceleration is achievable.
In the quantum algorithm of homogeneous linear equations, the time complexity of QSVE is O ( poly log ( m n ) / ϵ ) . In view of the success probability of the ancillary register collapses to | 1 , we need to repeat the coherent computation n / ( n r ) times on average. Therefore, the runtime of the quantum homogeneous linear equation algorithm is given by O ( n poly log ( m n ) / ( ( n r ) ϵ ) ) .
After obtaining the quantum state | x corresponding to the solution of A x = b , we need to simulate the subsequent system states through the identified system, where x = V C ( A ) V C ( B ) . According to Equations (4)–(6), we can obtain
x ( i + 1 ) = ζ ( i ) | x
where ζ ( i ) = [ x ( i ) T , u ( i ) T ] I n . The inner product between pairs of states can be implemented in time O ( ploy log ( m + n ) ) by the swap text algorithm [35]. Therefore, we can predict the system state at the next moment based on the known system state x ( i ) and input u ( i ) .
For the case of general matrix A m × n , previous quantum algorithms generally convert A to a Hermitian matrix:
H = 0 A A 0
Based on QSVE, the quantum algorithm of H 0 x = b 0 has the time complexity of O ( κ 2 H F poly log ( m + n ) 2 / ϵ ) . In addition, the time complexity of our scheme is O ( κ 2 A F poly log ( m n ) / ϵ ) , where H F = 2 A F . Let the runtime of our scheme be T, so the runtime of existing SVE-based quantum algorithms is T = 2 poly log ( m + n ) 2 poly log ( m n ) T . For the large-scale linear system of equations, there is T 2 T . Compared to existing quantum algorithms, our scheme can reduce the time complexity of the linear system of equations with a non-square dense matrix.

4. Numerical Simulation

To clarify the process of our algorithm and prove the feasibility of algorithms, we perform simulation on an illustrative example.
For simplicity, we consider a first-order discrete model of classical system as follows:
x ( i + 1 ) = a x ( i ) + d u ( i )
where x ( i ) is the system state of the i-th sampling and u ( i ) is the input state. The goal of system identification is to estimate coefficients a and d from a set of u ( i ) and x ( i ) . Assuming that the initial system state x ( 1 ) = 3 , the input states u = { 4 , 3 , 0 } and the evolved system states x ( 2 ) = 4 , x ( 3 ) = x ( 4 ) = 0 , the mathematical model can be transformed into a general linear systems of equations A x = b , where A = 3 4 4 3 0 0 , b = 4 0 0 . The maps U P and U Q append an arbitrary input state to a register that encodes the Equation (12), which can be realized by quantum gate circuits in Figure 4, and matrix forms of these maps are P = 1 5 3 0 0 4 0 0 0 4 0 0 3 0 0 0 5 2 2 0 0 5 2 2 , Q = 2 2 1 0 0 1 1 0 0 1 0 0 0 0 .
The following shows the detailed procedure of the numerical simulation:
  • Preparing the initial state | b = | 0 .
  • Apply P in the initial state | b , P | b = 3 5 | 0 + 4 5 | 1 .
  • Perform phase estimation on P | b for S = ( 2 P P I ) ( 2 Q Q I ) = 1 25 0 0 7 24 0 0 0 0 24 7 0 0 7 24 0 0 0 0 24 7 0 0 0 0 0 0 0 0 0 25 0 0 0 0 25 0 , then we obtain the following state
    3 2 i 10 e 1 4 π i ω 1 | w 1 , 1 4 e 1 4 π i ω 2 | w 2 , 1 4 2 2 i 5 e 3 4 π i ω 3 | w 3 , 3 4 e 1 4 π i ω 4 | w 4 , 3 4 ,
    where the eigenvalues of S are λ i = i , i , i , i , 1 , 1 , and ω i | w i is the corresponding eigenvector.
  • Change the phase, then we obtain
    3 2 i 10 ω 1 | w 1 , 1 4 ω 2 | w 2 , 1 4 2 2 i 5 ω 3 | w 3 , 3 4 ω 4 | w 4 , 3 4
  • Perform a controlled rotation on the ancillary qubit based on the register storing phase value:
    3 2 i 10 ω 1 | w 1 , 1 4 ω 2 | w 2 , 1 4 1 5 | 0 + 2 6 5 | 1 2 2 i 5 ω 3 | w 3 , 3 4 ω 4 | w 4 , 3 4 1 5 | 0 + 2 6 5 | 1
    where σ 1 = cos ( ± 1 4 π ) A F = 5 , σ 2 = cos ( ± 3 4 π ) A F = 5 .
  • Apply the inverse transformation of step 3 to obtain
    3 2 i 10 ( ω 1 | w 1 ω 2 | w 2 ) 1 5 | 0 + 2 6 5 | 1 2 2 i 5 ( ω 3 | w 3 ω 4 | w 4 ) 1 5 | 0 + 2 6 5 | 1
  • Apply the inverse of Q and we will obtain the desired state
    3 5 | 0 1 5 | 0 + 2 6 5 | 1 4 5 | 1 1 5 | 0 + 2 6 5 | 1
  • Measure the ancillary register. When the result is | 0 , the quantum state will collapse to
    3 5 | 0 + 4 5 | 1
    that is proportional to the solution of the equation A x = b , so we obtain a = 3 5 C and d = 4 5 C . Substituting a and d into Equation (29), we obtain C = 4 5 . So far, the first-order discrete identification model is:
    x ( i + 1 ) = 12 25 x ( i ) 16 25 u ( i )
We simulated a 6-qubit quantum circuit diagram on the Origin Cloud, as shown in Figure 5.
According to the simulation result in Figure 6, when the ancillary qubit q[5] = 0 and the register storing phase information is restored to q[0] = q[1] = q[2] = 0, the probabilities of the output qubit q[4] are P { | 0 } = 0.086 and P { | 1 } = 0.16 . Therefore, the amplitudes of q[4] are A { | 0 } = P { | 0 } / ( P { | 0 } + P { | 1 } ) = 0.59 and A { | 1 } = P { | 1 } / ( P { | 0 } + P { | 1 } ) = 0.81 , and the solution quantum state is q [ 4 ] = 0.59 | 0 + 0.81 | 1 , which is consistent with the expected quantum state based on our algorithm.
As a comparison, we simulated a second-order discrete system identification model x ( i + 1 ) = A x ( i ) + B u ( i ) , where A is a 2 × 2 matrix and B is a 2 × 1 matrix. Assuming that the initial system state x ( 1 ) = 1 0 , the input u = { 1 , 2 , 3 } and the evolved system states x ( 2 ) = 1 1 , the mathematical model can be transformed into A x = b , where A = 1 0 0 0 1 0 0 1 0 0 0 1 and b = 1 1 . Due to insufficient samples, the linear equation has infinite solutions. Consider the structural features of the coefficient matrix A, which is reduced to 1 0 1 0 0 1 0 1 .
When the ancillary qubit q[6] = 0 and the register q[5] is restored to 0, the probabilities of the output qubits q[4] and q[3] are shown in the Figure 7. Thus, the solution quantum state is | x = 0.493 | 00 + 0.5 | 01 + 0.516 | 10 + 0.485 | 11 , which is the lowest energy solution among infinitely many solutions. So far, according to the existing samples, the second-order discrete identification model with the lowest energy is: x ( i + 1 ) = 0.493 0 0.5 0 x ( i ) + 0.516 0.485 u ( i ) .

5. Conclusions

This paper develops a quantum algorithm of general linear equations for solving classical system identification problems. Our scheme can be finished in time O ( κ 2 r poly log ( m n ) / ϵ ) for an m × n dimensional linear systems of equations A x = b , where κ is the condition number of the linear equation, r is the rank of the matrix A and ϵ is the precision parameter, which is superior to existing algorithms. For the linear equation with non-square coefficient matrix, we discuss three cases of solutions, including the unique solution, approximate solution and infinitely many solutions. Our algorithm can obtain the unique solution, the approximate solution with the minimum error and the lowest energy solution among infinitely many solutions, which adapts to all cases of linear systems of equations. For the case of infinitely many solutions, we design a quantum circuit to obtain general solutions in time O ( n poly log ( m n ) / ( ( n r ) ϵ ) ) , which can achieve an exponential improvement over classical algorithms. In addition, we design a modified QPE circuit to obtain a wider range of phase values, which can expand the application range of quantum phase estimation.
Based on QSVE, our algorithms is sparsity-independent compared with HHL algorithm. Meanwhile, we have extended the existing quantum linear system algorithms to general equations, which can effectively enrich the application area of linear systems of equations. For large-scale linear systems, such as machine learning, numerical calculation of partial differential equations, etc., our algorithms will have a wider range of applications and is of research significance. In the future work, we will focus on how our algorithms are implemented on quantum computers and how to apply on them to real practical problems.

Author Contributions

Conceptualization, M.Z. and K.L.; methodology, K.L.; validation, X.L., Y.L. and C.D.; investigation, M.Z. and K.L.; resources, M.Z. and C.D.; writing—original draft preparation, M.Z. and K.L.; writing—review and editing, K.L., H.D., C.D. and Y.Z.; supervision, C.D.; project administration, C.D.; funding acquisition, C.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China (No.61673389, No. 61273202 and No. 62101559), in part by the National University of Defense Technology under Grant (No.19-QNCXJ and No.ZK21-37), in part by the National Defense Science and technology 173 program technical field Fund (No.2021-JCJQ-JJ-0510), in part by the Innovative Key Projects Promotion in Information and Communication College (No.YJKT-ZD-2105), and in part by the Innovative Talents Promotion in Information and Communication College (No.YJKT-RC-2113).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Goodwin, G.; Payne, R. Dynamic System Identification; Academic Press: New York, NY, USA, 1977. [Google Scholar]
  2. Mehra, R.K.; Lainiotis, D.G. System Identification; Academic Press: New York, NY, USA, 1976. [Google Scholar]
  3. Ljung, L. System Identification: Theory for The User; Tsinghua University Press: Beijing, China, 2002. [Google Scholar]
  4. Marquardt, D. An algorithm for least-Squares estimation of nonlinear parameters. J. Soc. Ind. Appl. Math. 1963, 11, 431–441. [Google Scholar] [CrossRef]
  5. Kohout, R.B. Hedged maximum likelihood quantum state estimation. Phys. Rev. Lett. 2010, 105, 200504. [Google Scholar] [CrossRef] [PubMed]
  6. Teo, Y.; Zhu, H.; Englert, B.; Rehacekand, J.; Hradil, Z. Quantum-state reconstruction by maximizing likelihood and entropy. Phys. Rev. Lett. 2011, 107, 020404. [Google Scholar] [CrossRef] [Green Version]
  7. Bishop, C. Pattern Recognition and Machine Learning; Springer: New York, NY, USA, 2006; p. 4. ISBN 9780387310732. [Google Scholar]
  8. Childs, A.M.; Liu, J.P.; Ostrander, A. High-precision quantum algorithms for partial differential equations. arXiv 2020, arXiv:2002.07868. [Google Scholar] [CrossRef]
  9. Magnus, J.; Neudecker, H. The elimination matrix: Some lemmas and applications. SIAM J. Algebr. Discret. Methods 1980, 1, 422–449. [Google Scholar] [CrossRef] [Green Version]
  10. Haddock, J.; Needell, D.; Rebrova, E.; Swartworth, W. Quantile-based iterative methods for corrupted systems of linear equations. arXiv 2020, arXiv:2107.05554. [Google Scholar] [CrossRef]
  11. Nielsen, M.A.; Chuang, I.L. Quantum Computation and Quantum Information; Cambridge University Press: Cambrige, MA, USA, 2000. [Google Scholar]
  12. Emily, G.; Mark, H. Quantum Computing: Progress and Prospects; The National Academy Press: Washington, DC, USA, 2018. [Google Scholar]
  13. Adedoyin, A.; Ambrosiano, J.; Anisimov, P.; Bärtschi, A.; Casper, W.; Chennupati, G.; Coffrin, C.; Djidjev, H.; Gunter, D.; Karra, S.; et al. Quantum algorithm implementations for beginners. arXiv 2018, arXiv:1804.03719. [Google Scholar]
  14. Wiebe, N.; Braun, D.; Lloyd, S. Quantum algorithm for data fitting. Phys. Rev. Lett. 2012, 109, 50505. [Google Scholar] [CrossRef] [Green Version]
  15. Shor, P. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM Rev. 1999, 41, 303–332. [Google Scholar] [CrossRef]
  16. Grover, L.K. A fast quantum mechanical algorithm for database search. In Proceedings of the 28th ACM Symposium on Theory of Computing, Philadelphia, PA, USA, 22–24 May 1996; pp. 212–219. [Google Scholar]
  17. Feynman, R.P. Simulating physics with computers. Int. J. Theor. Phys. 1982, 21, 467–488. [Google Scholar] [CrossRef]
  18. Lloyd, S. Universal quantum simulators. Science 1996, 273, 1073–1078. [Google Scholar] [CrossRef] [PubMed]
  19. Berry, D.W.; Childs, A.M. Black-box Hamiltonian simulation and unitary implementation. Quantum Inf. Comput. 2012, 12, 29–62. [Google Scholar]
  20. Long, G.L. General quantum interference principle and duality computer. Commun. Theor. Phys. 2006, 45, 825–844. [Google Scholar]
  21. Long, G.L.; Liu, Y. Duality computing in quantum computers. Commun. Theor. Phys. 2009, 50, 1303. [Google Scholar]
  22. Long, G.L.; Liu, Y.; Wang, C. Allowable generalized quantum gates. Commun. Theor. Phys. 2009, 51, 65. [Google Scholar]
  23. Harrow, A.W.; Hassidim, A.; Lloyd, S. Quantum algorithm for linear systems of equations. Phys. Rev. Lett. 2009, 103, 150502. [Google Scholar] [CrossRef]
  24. Kerenidis, I.; Prakash, A. Quantum recommendation system. Lipics Leibniz Int. Proc. Inform. 2017, 49, 1–21. [Google Scholar]
  25. Li, K.; Dai, H.; Jing, F.; Gao, M.; Xue, B.; Wang, P.; Zhang, M. Quantum algorithms for solving linear regression equation. J. Phys. Conf. Ser. 2021, 1738, 012063. [Google Scholar] [CrossRef]
  26. Shao, C.P. Quantum algorithms to matrix multiplication. arXiv 2018, arXiv:1803.01601. [Google Scholar]
  27. Li, K.; Dai, H.Y.; Zhang, M. Quantum algorithms of state estimators in classical control systems. Sci. China Inf. Sci. 2020, 63, 1–12. [Google Scholar] [CrossRef]
  28. Wossnig, L.; Zhao, Z.K.; Prakash, A. A quantum linear system algorithm for dense matrices. Phys. Rev. Lett. 2018, 120, 050502. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  29. Shao, C.P.; Xiang, H. Quantum circulant preconditioner for a linear system of equations. Phys. Rev. A 2018, 98, 062321. [Google Scholar] [CrossRef] [Green Version]
  30. Childs, A.M.; Wiebe, N. Hamiltonian simulation using linear combinations of unitary operations. Quantum Inf. Comput. 2012, 12, 901–924. [Google Scholar] [CrossRef]
  31. Berry, D.W.; Ahokas, G.; Cleve, R. Efficient quantum algorithms for simulating sparse Hamiltonians. Commun. Math. Phys. 2007, 270, 359–371. [Google Scholar] [CrossRef] [Green Version]
  32. Cheng, D.Z. On semi-tensor product of matrices and its applications. Acta Math. Appl. Sin. 2003, 19, 219–228. [Google Scholar] [CrossRef]
  33. Kerenidis, I.; Prakash, A. Quantum Recommendation Systems. In Proceedings of the 8th Innovations in Theoretical Computer Science Conference, Berkeley, CA, USA, 9–11 January 2017; Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik: Dagstuhl, Germany, 2017. [Google Scholar]
  34. Lin, L.; Tong, Y. Near-Optimal Ground State Preparation. Quantum 2020, 4, 372. [Google Scholar] [CrossRef]
  35. Buhrman, H.; Cleve, R.; Watrous, J.; Wolf, R. Quantum Fingerprinting. Phys. Rev. Lett. 2001, 87, 167902. [Google Scholar] [CrossRef] [PubMed] [Green Version]
Figure 1. The modified quantum circuit for phase estimation. Set the | x 1 to be the sign bit, | x 1 = | 0 means φ i is a positive value, otherwise it is negative. The state | φ i = | x 1 1 | x 2 2 | x k k and the phase value φ i = j = 2 k 2 j + 1 x j x 1 . The quantum circuit can estimate the phase value φ i ( 1 , 1 ) .
Figure 1. The modified quantum circuit for phase estimation. Set the | x 1 to be the sign bit, | x 1 = | 0 means φ i is a positive value, otherwise it is negative. The state | φ i = | x 1 1 | x 2 2 | x k k and the phase value φ i = j = 2 k 2 j + 1 x j x 1 . The quantum circuit can estimate the phase value φ i ( 1 , 1 ) .
Entropy 24 00893 g001
Figure 2. The quantum gate circuit of the particular solution of the equation A x = b . The operator R is a quantum controlled rotation gate. When the phase φ i = ± 1 2 , R is a NOT gate, otherwise R = R ( σ i 1 ) = 1 / σ i 1 1 / σ i 2 1 1 / σ i 2 1 / σ i , where σ i = cos ( π φ i ) A F .
Figure 2. The quantum gate circuit of the particular solution of the equation A x = b . The operator R is a quantum controlled rotation gate. When the phase φ i = ± 1 2 , R is a NOT gate, otherwise R = R ( σ i 1 ) = 1 / σ i 1 1 / σ i 2 1 1 / σ i 2 1 / σ i , where σ i = cos ( π φ i ) A F .
Entropy 24 00893 g002
Figure 3. The quantum gate circuit of homogeneous linear equation A x = 0 . The input state is | c = i = 1 n c i | ν i and the output state is | x = i = r + 1 n c i | ν i , where | x is the combination of right singular vectors corresponding to the singular value 0 of A contained in | c . When the phase φ i = ± 1 / 2 , the output of the controlled-NOT gate R N is | 1 , otherwise it outputs | 0 . We can obtain the solution of the A x = 0 when an arbitrary input | c contains right singular vectors of A. In order to ensure that the output | x is complete, we input n linearly independent | c = | 0 , | 1 | n . In addition, the arbitrary r linearly independent x i can form the solution vector basis of the homogeneous linear equation.
Figure 3. The quantum gate circuit of homogeneous linear equation A x = 0 . The input state is | c = i = 1 n c i | ν i and the output state is | x = i = r + 1 n c i | ν i , where | x is the combination of right singular vectors corresponding to the singular value 0 of A contained in | c . When the phase φ i = ± 1 / 2 , the output of the controlled-NOT gate R N is | 1 , otherwise it outputs | 0 . We can obtain the solution of the A x = 0 when an arbitrary input | c contains right singular vectors of A. In order to ensure that the output | x is complete, we input n linearly independent | c = | 0 , | 1 | n . In addition, the arbitrary r linearly independent x i can form the solution vector basis of the homogeneous linear equation.
Entropy 24 00893 g003
Figure 4. Quantum circuits implementation of U P and U Q . The maps U P and U Q consist of quantum control gates, where R 1 = 1 5 3 4 4 3 , R 2 = 1 5 4 3 3 4 , R 3 = R 4 = R 5 = H = 2 2 1 1 1 1 and the X = 0 1 1 0 is the quantum inverse gate.
Figure 4. Quantum circuits implementation of U P and U Q . The maps U P and U Q consist of quantum control gates, where R 1 = 1 5 3 4 4 3 , R 2 = 1 5 4 3 3 4 , R 3 = R 4 = R 5 = H = 2 2 1 1 1 1 and the X = 0 1 1 0 is the quantum inverse gate.
Entropy 24 00893 g004
Figure 5. The 6-qubit quantum circuit diagram on the Origin Cloud. The quantum circuit is based on quantum phase estimation, where q[5] is the ancillary qubit and q[4] is the register storing input and output information. From left to right, the controlled rotation gate is R Y 1 = 1 5 3 4 4 3 that generates the initial state P | b , R Y 2 = 1 σ 1 t σ 1 2 t 2 σ 1 2 t 2 t and R Y 3 = 1 σ 2 t σ 2 2 t 2 σ 2 2 t 2 t , where t = 5 2 2 . The controlled gates s 1 = 1 25 7 24 24 7 , s 2 = 1 25 7 24 24 7 , z 1 = e 1 4 π i 0 0 e 1 4 π i and r z = e 3 4 π i 0 0 e 3 4 π i are applied on the register q[4].
Figure 5. The 6-qubit quantum circuit diagram on the Origin Cloud. The quantum circuit is based on quantum phase estimation, where q[5] is the ancillary qubit and q[4] is the register storing input and output information. From left to right, the controlled rotation gate is R Y 1 = 1 5 3 4 4 3 that generates the initial state P | b , R Y 2 = 1 σ 1 t σ 1 2 t 2 σ 1 2 t 2 t and R Y 3 = 1 σ 2 t σ 2 2 t 2 σ 2 2 t 2 t , where t = 5 2 2 . The controlled gates s 1 = 1 25 7 24 24 7 , s 2 = 1 25 7 24 24 7 , z 1 = e 1 4 π i 0 0 e 1 4 π i and r z = e 3 4 π i 0 0 e 3 4 π i are applied on the register q[4].
Entropy 24 00893 g005
Figure 6. The simulation result of the quantum circuit.
Figure 6. The simulation result of the quantum circuit.
Entropy 24 00893 g006
Figure 7. Quantum circuit and simulation result of the two-dimensional discrete system identification model.
Figure 7. Quantum circuit and simulation result of the two-dimensional discrete system identification model.
Entropy 24 00893 g007
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Li, K.; Zhang, M.; Liu, X.; Liu, Y.; Dai, H.; Zhang, Y.; Dong, C. Quantum Linear System Algorithm for General Matrices in System Identification. Entropy 2022, 24, 893. https://doi.org/10.3390/e24070893

AMA Style

Li K, Zhang M, Liu X, Liu Y, Dai H, Zhang Y, Dong C. Quantum Linear System Algorithm for General Matrices in System Identification. Entropy. 2022; 24(7):893. https://doi.org/10.3390/e24070893

Chicago/Turabian Style

Li, Kai, Ming Zhang, Xiaowen Liu, Yong Liu, Hongyi Dai, Yijun Zhang, and Chen Dong. 2022. "Quantum Linear System Algorithm for General Matrices in System Identification" Entropy 24, no. 7: 893. https://doi.org/10.3390/e24070893

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop