Quantum algorithm and quantum circuit for A-Optimal Projection: dimensionality reduction
QQuantum algorithm and quantum circuit for A-OptimalProjection: dimensionality reduction
Bojia Duan,
1, 2, ∗ Jiabin Yuan, † Juan Xu, and Dan Li College of Computer Science and Technology,Nanjing University of Aeronautics and Astronautics,No.29 Jiangjun Avenue, 211106 Nanjing, China. Institute for Quantum Computing, University of Waterloo,200 University Ave W, Waterloo, ON N2L 3G1, Canada. (Dated: March 12, 2019)
Abstract
Learning low dimensional representation is a crucial issue for many machine learning tasks suchas pattern recognition and image retrieval. In this article, we present a quantum algorithm and aquantum circuit to efficiently perform A-Optimal Projection for dimensionality reduction. Com-pared with the best-know classical algorithms, the quantum A-Optimal Projection (QAOP) algo-rithm shows an exponential speedup in both the original feature space dimension n and the reducedfeature space dimension k . We show that the space and time complexity of the QAOP circuit are O [log ( nk/(cid:15) )] and O [log ( nk ) poly (cid:0) log (cid:15) − (cid:1) ] respectively, with fidelity at least 1 − (cid:15) . Firstly, areformation of the original QAOP algorithm is proposed to help omit the quantum-classical in-teractions during the QAOP algorithm. Then the quantum algorithm and quantum circuit withperformance guarantees are proposed. Specifically, the quantum circuit modules for preparing theinitial quantum state and implementing the controlled rotation can be also used for other quantummachine learning algorithms. ∗ [email protected] † [email protected] a r X i v : . [ qu a n t - ph ] M a r . INTRODUCTION Learning low dimensional image representations has gained significant importance inmany image processing tasks such as recognition and retrieval [1–3]. A range of applica-tions of this problem can be seen in the field of medical imaging such as liver cirrhosis,lung cancer classification and breast cancer diagnosis [3]. Another typical example is facerecognition which is typically used in security systems or as a commercial identification andmarketing tool [4]. Recent studies have shown that images are possibly sampled from a lowdimensional manifold, however, the visual features, such as color, texture and shape, whichare usually extracted for the image representation, are usually of very high dimensionality[5]. Therefore, a range of techniques have been developed for dimensionality reduction. Forinstance, principal component analysis (PCA) is guaranteed in terms of the linearly embed-ded manifold [6]. Moreover, Isomap, Locally Linear Embedding, and Laplacian Eigenmapare proposed for nonlinear embedded manifold [7–9].Different from all the aforementioned techniques which are not directly related to the re-gression task, X. He proposed a novel dimensionality reduction algorithm named A-OptimalProjection (AOP) which performs better regression performance in the reduced space [5].This approach can be performed under either unsupervised or supervised mode, which is amore widely used algorithm compared to the unsupervised algorithm PCA or the supervisedalgorithm linear discriminant analysis (LDA) [6]. Moreover, different from most dimension-ality reduction algorithms which are applied as pre-processing of the data, AOP can directlyimprove the performance of a regression model in the reduced space, therefore, the learnedregression model can be as stable as possible.Time complexity is a significant drawback in classical machine learning algorithms. Arange of quantum algorithms have achieved exponentially speed up in machine learningcompared with the classical ones [10, 11]. In particular, quantum algorithms for solving theproblem of pattern classification and image classification problems were proposed, coveringan important area of machine learning [12, 13]. Recently, a quantum generative algorithmwhich is more capable of representing probability distributions was proposed, generatingan intriguing link among quantum many-body physics, quantum computational complexitytheory and the machine learning frontier [14]. The relationship between feature maps,kernel methods in machine learning and quantum computing was also investigated, and2he idea of embedding data into a quantum Hilbert space opens up a promising avenue toquantum machine learning [15]. Moreover, small quantum computers, larger special purposequantum simulators, annealers, etc., exhibit promising applications in machine learning, andthe perspectives on the work of these hardware have also been discussed [16]. Quantummachine learning has also been combined with the information security. It was designedto protect private data during performing quantum machine learning, which has potentialapplications in the big data era [17].In the application field of quantum dimensionality reduction, the quantum algorithm forPCA has been proposed for unsupervised mode [18], and the quantum algorithm for LDAhas been proposed for supervised mode and classification [19]. In this paper, we focus on thenew dimensionality reduction algorithm AOP which can be used both on unsupervised andsupervised model, and propose a quantum algorithm for AOP, which achieves exponentiallyspeedup compared with the classical polylogarithmic in both n , the original feature spacedimension, and k , the reduced feature space dimension.Our work has two major contributions. First, we present a quantum algorithm for solvingthe learning process of the AOP algorithm. A reformulation of the original classical AOPalgorithm is introduced here which helps the QAOP algorithm be implemented more effi-ciently. The quantum algorithm is made of iterations, where each iteration mainly consistsof phase estimation and a controlled rotation. The reformulated AOP and the partial tracetechnology can help omit the quantum-classical interactions during the quantum algorithm.Second, we design a detailed quantum circuit for the proposed QAOP algorithm which makesit possible to execute the QAOP algorithm on a universal quantum computer. The circuitfor preparing the initial state is presented and the detailed circuit for the controlled rotationis designed. The space and time analysis of the quantum circuit also shows an exponentialspeedup in the size of the feature space than the classical counterparts.This paper is arranged as follows: We give a brief overview of the classical AOP algorithmin Sec. II. In Sec. III, the quantum algorithm for AOP algorithm which is used in dimensionreduction is presented. In Sec. IV, the overview and detailed quantum circuits for solvingQAOP algorithm are designed. Finally we show the conclusions in Sec. V.3 I. REVIEW OF CLASSICAL A-OPTIMAL PROJECTION
In this section, we briefly review the AOP model and learning algorithm.The classical AOP dimensionality reduction aims to improve the regression performancein the reduced space which preserves similarities between the data pairs. The AOP dimen-sionality reduction algorithm returns the directions of projections, and with this result, thedata can be projected onto a lower-dimensional subspace which can be directly used forregression problem.Let X = ( x , · · · , x m ) be a n × m data matrix, where m is the number of data points and n is the number of features. In the graph based dimensionality reduction, we are given anearest neighbor graph G which represents the geometrical structure of the data manifold.Each vertex of the graph represents a data point. Let S ∈ R m × m be the weight matrix ofthe graph and N k ( x ) denote the k nearest neighbors of x . Then a simple example of S canbe defined as follows: S ij = , if x i ∈ N k ( x j ) or x j ∈ N k ( x i )0 , otherwise (1)AOP aims to find a projection matrix A ∈ R n × k that maps the the points x i to y i ∈ R k ( i = 1 , ..., m , and k (cid:28) n ), where y i = A T x i . And using y i to train a linear regression model: z = β T y + (cid:15) (2)where z is the observation, β is the weight vector and (cid:15) is an unknown error with Gaussiandistribution.Formally, the objective function of AOP is:min A T r (cid:16)(cid:0) A T X ( I + λ L ) X T A + λ I (cid:1) − (cid:17) (3)where λ and λ are the regularization coefficients which are very small, and L = diag ( S1 ) − S is the graph Laplacian ( is a vector of all ones).To solve the objective function, Ref. [5] introduces a variables B and the optimizationproblem (3) is equivalent to the following:min A , B (cid:13)(cid:13)(cid:13) I − A T (cid:101) XB (cid:13)(cid:13)(cid:13) + λ (cid:107) B (cid:107) (4)where (cid:101) X = X Σ, and Σ is from the cholesky decomposition: I + λ L = ΣΣ T .4t tells us that the optimal A can be obtained by iteratively computing A and B . Thenthe overall procedure of the AOP learning algorithm is depicted as follows:1) Initialize the matrix A by computing the PCA of the data X .2) Compute the matrix B according to the Eq. (5): ∂φ∂ B T = 0 ⇒ B = (cid:16) (cid:101) X T AA T (cid:101) X + λ I (cid:17) − (cid:101) X T A (5)3) Update the matrix A according to the Eq. (6), and normalize A such that (cid:107) A (cid:107) F ≤ ρ . ∂φ∂ A = 0 ⇒ A = (cid:16) (cid:101) XBB T (cid:101) X T (cid:17) − (cid:101) XB (6)where ρ is used as a constraint parameter to control the size of A .4) Repeat steps 2 and 3 until convergence. III. QUANTUM A-OPTIMAL PROJECTION
In this section, we propose the quantum AOP algorithm for dimensionality reduction. Wefirstly reformulated the original classical AOP algorithm. And with the help of the refor-mulation, the proposed quantum AOP algorithm can then be implemented more efficiently.
A. Reformulation of the AOP algorithm
We reformulated the algorithm in Sec. II in terms of quantum mechanics. Firstly, weadjust the initialization of A to make it closer to the optimal solution than the originalalgorithm. Secondly, we combine the steps 2 and 3 into one step and remove the variable B . The advantage of eliminating B is to help avoid quantum-classical transformation duringthe iteration of the algorithm. Specifically, in one iteration of the original algorithm, aquantum state is needed to be computed and sampled as to reconstruct the matrix B , andthen used to update A . In our methods, the elimination of the matrix B can help update thequantum state representing A without sampling and reconstruction in one of the iterations.Finally, by introducing the partial trace technology, quantum-classical interaction can alsobe omitted between the iterations.(1) Initialization of A . The original AOP algorithm compute PCA of the data X toinitialize the matrix A . In contrast, we compute PCA of (cid:101) X to obtain the initialization A (0) .5s shown in Eq. (3), when λ and λ are set to zero, the objection function (3) is equivalentto the objection function of PCA referring to the data X . And when λ is zero, the objectionfunction (3) is equivalent to the objection function of PCA referring to the data (cid:101) X . It isobvious that the later one is closer to the optimal solution than the former one.(2) Reformulation of the AOP algorithm. Now turning to the steps 2 and 3 of the AOPalgorithm in one of the iterations. Suppose the singular value decomposition of the matrix (cid:101) X is (cid:101) X = (cid:80) rj =1 σ j | u j (cid:105) (cid:104) v j | , where r ≤ min ( m, n ) is the rank of (cid:101) X , and σ k ( σ > · · · > σ r > (cid:101) X , with u j and v j being the left and right singular vectors.Obviously, we have (cid:101) X T = (cid:80) rj =1 σ j | v j (cid:105) (cid:104) u j | and (cid:101) X (cid:101) X T = (cid:80) rj =1 σ j | u j (cid:105) (cid:104) u j | .As A (0) is the PCA of (cid:101) X , we have A (0) = pca (cid:16) (cid:101) X (cid:17) = k (cid:88) j =1 | u j (cid:105) (cid:104) j | , (7)where k is the rank of A , and | j (cid:105) ’s are the basis states. Now we have the theorem 1 (andthe proof is shown in Appendix A.). Theorem 1 : Given the matrix (cid:101) X = (cid:80) rj =1 σ j | u j (cid:105) (cid:104) v j | , the i -th iteration of the AOPalgorithm outputs the matrix A ( i ) : A ( i ) = k (cid:88) j =1 β ( i ) j | u j (cid:105) (cid:104) j | = k (cid:88) j =1 (cid:16) σ j β ( i − j (cid:17) + λ σ j β ( i − j | u j (cid:105) (cid:104) j | (8) where ≤ i ≤ s and β (0) j = 1 for all j ’s. According to the theorem 1, the reformulated AOP algorithm is presented as follows:1) Initialize the matrix A (0) by computing the PCA of (cid:101) X according to Eq. (7).2) Update the matrix A according to Eq. (8).3) Repeat step 2 until convergence.The modeling of the AOP algorithm is shown in Fig. 1. B. QAOP algorithm
The overall procedure of our QAOP algorithm is then proposed as follows.
Algorithm. A ( s ) = QAOP (cid:16) (cid:101) X , λ (cid:17) .1. Initialize i = 1 , apply quantum PCA algorithm of (cid:101) X to compute A (0) [18].6IG. 1: Reformulation of the AOP algorithm.2. Perform one iteration Q of the QAOP algorithm to compute A ( i ) , i.e. A ( i ) = Q (cid:16) (cid:101) X , A ( i − (cid:17) .3. Set i = i + 1, and repeat step 2 until the number of iterations i = s ; now the projectionmatrix A ( s ) can be obtained.The quantum algorithm for i -th iteration Q of the QAOP algorithm in Step 2 is presentedas follows.(1) Prepare four quantum registers in the state | ψ (cid:105) = | (cid:105) a ( | (cid:105) | (cid:105) · · · | (cid:105) ) C ( | (cid:105) | (cid:105) · · · | (cid:105) ) B ( | ψ A ( i − (cid:105) ) A . (9)where the superscript a represents the ancilla qubit, the superscripts C, B, A represent theregister
C, B and A , respectively.(2) Perform the unitary operation U P E (cid:16) (cid:101) X (cid:101) X † (cid:17) and U P E (cid:16) A ( i − A ( i − † (cid:17) on the state,then we have the state | ψ (cid:105) = 1 √ N | (cid:105) a k (cid:88) j =1 β ( i − j (cid:12)(cid:12) σ j (cid:11) C (cid:12)(cid:12)(cid:12)(cid:12)(cid:16) β ( i − j (cid:17) (cid:29) B | u j (cid:105) | v j (cid:105) A . (10)Here U P E represents the unitary matrix for phase estimation which we fully characterizedin [13]: U P E ( X ) = (cid:16) F † T ⊗ I (cid:17) (cid:16)(cid:88) T − τ =0 | τ (cid:105) (cid:104) τ | ⊗ e i X τt / T (cid:17) (cid:0) H ⊗ t ⊗ I (cid:1) , (11)where F † T is the inverse quantum Fourier transform and (cid:80) T − τ =0 | τ (cid:105) (cid:104) τ | C ⊗ e i A τt / T is theconditional Hamiltonian evolution [20]. 73) Apply a controlled rotation R f to the ancilla qubit, controlled by both the register C and B . R f is defined as follows: R f : | (cid:105) a (cid:12)(cid:12) σ j (cid:11) C (cid:12)(cid:12)(cid:12)(cid:12)(cid:16) β ( i − j (cid:17) (cid:29) B → ρ λ (cid:16) σ j β ( i − j (cid:17) | (cid:105) + (cid:118)(cid:117)(cid:117)(cid:117)(cid:117)(cid:116) − ρ λ (cid:16) σ j β ( i − j (cid:17) | (cid:105) a (cid:12)(cid:12) σ j (cid:11) C (cid:12)(cid:12)(cid:12)(cid:12)(cid:16) β ( i − j (cid:17) (cid:29) B , (12)where ρ < | ψ (cid:105) = 1 √ N ρ λ (cid:16) σ j β ( i − j (cid:17) | (cid:105) + (cid:118)(cid:117)(cid:117)(cid:117)(cid:117)(cid:116) − ρ λ (cid:16) σ j β ( i − j (cid:17) | (cid:105) a ⊗ k (cid:88) j =1 β ( i − j (cid:12)(cid:12) σ j (cid:11) C (cid:12)(cid:12)(cid:12)(cid:12)(cid:16) β ( i − j (cid:17) (cid:29) B | u j (cid:105) | v j (cid:105) A . (13)(4) Uncompute the registers C , B and A , remove the register C and B , and measure theancilla qubit to be | (cid:105) . Then, we have the state proportional to (cid:12)(cid:12)(cid:12) ψ ( i ) A (cid:69) = 1 √ N k (cid:88) j =1 (cid:16) σ j β ( i − j (cid:17) + λ σ j β ( i − j | u j (cid:105) | v j (cid:105) A . (14)Here, we can construct the matrix A ( i ) A ( i ) † for the phase estimation in the next iterationby taking a partial trace of (cid:12)(cid:12)(cid:12) ψ ( i ) A (cid:69) (cid:68) ψ ( i ) A (cid:12)(cid:12)(cid:12) . Note that the eigenvectors of A ( i ) A ( i ) † are u j andthe corresponding eigenvalues are (cid:16) β ( i ) j (cid:17) . Then the density matrix that represents A ( i ) A ( i ) † can be obtained [12] : tr (cid:16)(cid:12)(cid:12)(cid:12) ψ ( i ) A (cid:69) (cid:68) ψ ( i ) A (cid:12)(cid:12)(cid:12)(cid:17) = 1 (cid:80) rk =1 (cid:16) β ( i ) j (cid:17) (cid:88) rk =1 (cid:16) β ( i ) j (cid:17) | u k (cid:105) (cid:104) u k | = A ( i ) A ( i ) † tr (cid:16) A ( i ) A ( i ) † (cid:17) . (15) IV. QAOP CIRCUIT
In this section, we study the QAOP algorithm in terms of the quantum circuit model. Thequantum circuits provide the possibility to implement the quantum algorithm on a universal8uantum computer. First, we present the overview model of the QAOP circuit. Second, westudy in depth the realization of the initial state preparation and the controlled rotation interms of the quantum circuit model. Finally, the space and time resources required for thequantum circuit are analyzed.The overview of the circuit for solving QAOP is shown in Fig. 2. It provides one modelto implement the QAOP algorithm. Take the i -th iteration of the QAOP algorithm forexample. It can be divided into three major steps: (1) Phase estimation: as the eigenspaceof the unitary e − i (cid:101) X (cid:101) X T t and e − i A ( i − ( A ( i − ) T t are both spanned by the eigenvectors | u j (cid:105) ,they can be both implemented on the input state (cid:12)(cid:12)(cid:12) ψ ( i − A (cid:69) . And the Hadamard gates andthe inverse QFT of U P E (cid:16) (cid:101) X (cid:101) X † (cid:17) and U P E (cid:16) A ( i − A ( i − † (cid:17) can be implemented in parallel.(2) Controlled rotation: it consists of U β,σ and c − R y . Firstly the operation U β,σ computesthe function y j of the output eigenvalues of (cid:101) X (cid:101) X † and A ( i − A ( i − † as follows: y j = 1 + λ (cid:16) σ j β ( i − j (cid:17) . (16)And then the operation c − R y extracts the value of y j in the basic states of the register L to the amplitude of the ancilla qubit. (3) Uncomputing: undo the Reg. B, C and L , andmeasure the top ancilla qubit. If the result returns to 1, then the Reg. A of the quantumsystem collapses to the output state (cid:12)(cid:12)(cid:12) ψ ( i ) A (cid:69) , which is also the input state of the ( i + 1)-thiteration.FIG. 2: Overview of the quantum circuit for solving the reformulated AOP. Wires with ’/’represent the groups of qubits. The label Q in the dotted box represents one iteration ofQAOP algorithm.We now deal with the detailed QAOP circuit. In the following, we mainly investigate the9uantum circuits for the initial state preparation and the controlled rotation in one iterationof the QAOP circuit. A. State preparation
At the very beginning, we present a detailed quantum circuit for preparing the initial stateof the QAOP algorithm. Suppose each element of A (0) ∈ R n × k is given, and its correspondingquantum state | ψ A (0) (cid:105) = | a a · · · a q (cid:105) is a q -qubit quantum state, where q = O [log ( nk )].Following the approach in [21], the quantum circuit for the initial state preparation can beshown in Fig. 3. Here, we introduce quantum random access memory (QRAM) to omit theregister (cid:12)(cid:12) ¯ ψ (cid:11) in [21]. FIG. 3: The circuit for state preparation.In Fig. 3, an register of p = O (log (cid:15) − ) qubits is used for storing the ω ( i ) , where ω ( i ) isshort for ω a ··· a i − ( i = 1 , , , ..., q ) satisfying:cos (cid:0) πω a ··· a i − (cid:1) = (cid:18) α a a ··· a i − α a a ··· a i − (cid:19) + O ( poly ( (cid:15) )) . (17)All the ω a ··· a i − can be computed classically and they are supposed to be stored in theQRAM. Given the index a a · · · a i − , define j = h ( a a · · · a i − ) being the address wherethe data ω a a ··· a i − stores, where h ( · ) is a hash function mapping a a · · · a i − to j . Thendefine the unitary operation U i which implements the QRAM readout operation [22]: U i : (cid:88) a ,a , ··· ,a i − ∈{ , } α a a ··· a i − | a a · · · a i − (cid:105) | j (cid:105) | (cid:105) QRAM → (cid:88) a ,a , ··· ,a i − ∈{ , } α a a ··· a i − | a a · · · a i − (cid:105) | j (cid:105) (cid:12)(cid:12) ω a a ··· a i − (cid:11) . (18)10pecifically, U i outputs the content ω a a ··· a i − of the j -th memory cell in QRAM. Ref. [23]shows that this procedure can be implemented in time O ( p ).And the number of U i in the circuit for state preparation is q , so the total memory callsof QRAM is O ( pq ). Therefore, an inverse in pq error rate suffices to achieve an overallconstant error per QRAM look-up [24].Moreover, we make further study on c − S ω ( i ) which is defined in Ref. [21]: c − S ω ( i ) : (cid:12)(cid:12) ω ( i ) (cid:11) | (cid:105) → (cid:12)(cid:12) ω ( i ) (cid:11) e πiω ( i ) | (cid:105) , (cid:12)(cid:12) ω ( i ) (cid:11) | (cid:105) → (cid:12)(cid:12) ω ( i ) (cid:11) e − πiω ( i ) | (cid:105) . (19)Define R l = e πi / l e − πi / l , then the controlled unitary c − R l implements the followingtransformation: (cid:12)(cid:12)(cid:12) ω ( i ) l (cid:69) | (cid:105) → e πiω ( i ) l (cid:46) l (cid:12)(cid:12)(cid:12) ω ( i ) l (cid:69) | (cid:105) (cid:12)(cid:12)(cid:12) ω ( i ) l (cid:69) | (cid:105) → e − πiω ( i ) l (cid:46) l (cid:12)(cid:12)(cid:12) ω ( i ) l (cid:69) | (cid:105) (20)where ω ( i ) l is the l -th binary bit of ω ( i ) , specifically, ω ( i ) = 2 − ω ( i )1 + 2 − ω ( i )2 + · · · + 2 − p ω ( i ) p =0 .ω ( i )1 ω ( i )2 · · · ω ( i ) p . Now p (cid:81) l =1 ( c − R l ) achieves the function of c − S ω ( i ) : (cid:12)(cid:12)(cid:12) ω ( i )1 (cid:69) (cid:12)(cid:12)(cid:12) ω ( i )2 (cid:69) · · · (cid:12)(cid:12) ω ( i ) p (cid:11) | (cid:105) → e i π (cid:16) .ω ( i )1 ω ( i )2 ··· ω ( i ) p (cid:17) (cid:12)(cid:12)(cid:12) ω ( i )1 (cid:69) (cid:12)(cid:12)(cid:12) ω ( i )2 (cid:69) · · · (cid:12)(cid:12) ω ( i ) p (cid:11) | (cid:105) (cid:12)(cid:12)(cid:12) ω ( i )1 (cid:69) (cid:12)(cid:12)(cid:12) ω ( i )2 (cid:69) · · · (cid:12)(cid:12) ω ( i ) p (cid:11) | (cid:105) → e − i π (cid:16) .ω ( i )1 ω ( i )2 ··· ω ( i ) p (cid:17) (cid:12)(cid:12)(cid:12) ω ( i )1 (cid:69) (cid:12)(cid:12)(cid:12) ω ( i )2 (cid:69) · · · (cid:12)(cid:12) ω ( i ) p (cid:11) | (cid:105) (21)Therefore, the quantum circuit for c − S ω ( i ) can be implemented as shown in Fig. 4.FIG. 4: The circuit for c − S ω ( i ) , where | a i (cid:105) = α a ··· ai − α a ··· ai − | (cid:105) + α a ··· ai − α a ··· ai − | (cid:105) .Now we can simply infer that the number of qubits needed for preparing the initialquantum state | ψ A (0) (cid:105) is O ( p + q ), and the number of gates required is O ( pq ).11n summary, with V = − ι , the unitary ( I ⊗ V ) ( I ⊗ H ) ( c − S ω ) ( I ⊗ H ) imple-ments the transformation: (cid:12)(cid:12) ω ( i ) (cid:11) | (cid:105) I ⊗ H → (cid:12)(cid:12) ω ( i ) (cid:11) | (cid:105) + | (cid:105)√ c − S ω → (cid:12)(cid:12) ω ( i ) (cid:11) e πιω ( i ) | (cid:105) + e − πιω ( i ) | (cid:105)√ I ⊗ H → (cid:12)(cid:12) ω ( i ) (cid:11) (cid:2) cos (cid:0) πω ( i ) (cid:1) | (cid:105) + ι sin (cid:0) πω ( i ) (cid:1) | (cid:105) (cid:3) I ⊗ V → (cid:12)(cid:12) ω ( i ) (cid:11) (cid:2) cos (cid:0) πω ( i ) (cid:1) | (cid:105) + sin (cid:0) πω ( i ) (cid:1) | (cid:105) (cid:3) = (cid:12)(cid:12) ω ( i ) (cid:11) | a i (cid:105) (22) B. The controlled rotation
The controlled rotation mainly involves the computation of U β,σ and c − R y . In the stage of U β,σ , Newton’s method is introduced for computing y j = y (cid:0) σ j , β j (cid:1) = ρ ( σ j β j + λ ) σ j β j = ρ + ρλ σ j β j ,where ρ < y j are computedout and stored in the basis state of the register L , and the number of qubits for storing y j is d = O (log κ ). In the stage of c − R y , y j is used as controlled qubit controlling the topancilla qubit in Fig. 2.(1) For U β,σ , let z j = z (cid:0) σ j β j (cid:1) = 1 (cid:14)(cid:0) σ j β j (cid:1) , then we have y j = ρ + ρλ z ( s (cid:48) ) j . Here weuse Newton iteration to approximate 1 (cid:14)(cid:0) σ j β j (cid:1) , for σ j β j >
1. The quantum circuit forcomputing the initial approximation z (0) j can be seen in [25]. Applying the Newton methodto f ( z j ) = 1/ z j − σ j β j , we can get the Newton iteration function: z ( i +1) j = g (cid:16) z ( i ) j (cid:17) = z ( i ) j − f (cid:16) z ( i ) j (cid:17) f (cid:48) (cid:16) z ( i ) j (cid:17) = − σ j β j (cid:16) z ( i ) j (cid:17) + 2 z ( i ) j . Then the detailed circuit for one iteration of Newton’smethod is presented in Fig. 5. The number of qubits needed in the ancilla registers is O ( d ). The number of fundamental quantum operations for implementing addition andmultiplication is O [ poly ( d )], where the degree of the polynomial is no more than 3 [26, 27],and the number of gates for implementing shift is O ( d ).The quantum circuit for y j = ρ + ρλ z ( s (cid:48) ) j can be simply realized as shown in Fig. 6. Thecircuit can be simply realized with the quantum circuits for addition and multiplication.Therefore, the number of qubits and gates needed in the circuit are O ( d ) and O [ poly ( d )],12IG. 5: The circuit for z ( i +1) j = − σ j β j (cid:16) z ( i ) j (cid:17) + 2 z ( i ) j .respectively. FIG. 6: The circuit for y j .To sum up, the overall quantum circuit for U β,σ can be designed as shown in Fig. 7.And we can simply infer that the number of qubits needed in these circuits is O ( d + b ).Let the number of Newton iteration be s (cid:48) , then the number of gates required in Fig. 7 is O [ s (cid:48) poly ( d )].Now we analyze the error caused by Newton’s iteration. Similar to the error analysis in[25, 28], the error consists of two parts. One is error e s (cid:48) caused by the Newton’s iteration,the other is the roundoff error ˆ e s (cid:48) caused by truncating the result of one iteration to d qubitsof accuracy.According to the Newton iteration function, we have g (cid:16) z ( i ) j (cid:17) − σ j β j = − σ j β j (cid:16) z ( i ) j − σ j β j (cid:17) .Then the error e s (cid:48) satisfies e s (cid:48) := (cid:12)(cid:12)(cid:12) z ( s (cid:48) ) j − σ j β j (cid:12)(cid:12)(cid:12) = σ j β j e s (cid:48) − = σ j β j (cid:0) σ j β j e (cid:1) s (cid:48) . Followingthe approach in [25], the initial error e satisfies σ j β j e < /
2, then for error ε N we have2 − s (cid:48) ≤ ε N , which implies s (cid:48) ≥ (cid:6) log log ε − N (cid:7) , where ε N denotes the desired error of Newtoniteration without considering the truncation error. We can also follow the result in [25] thatthe truncation error ˆ e s (cid:48) satisfies ˆ e s (cid:48) := (cid:12)(cid:12) ˆ z ( s (cid:48) ) − z ( s (cid:48) ) (cid:12)(cid:12) ≤ s (cid:48) − d .13n short, with the number of the iteration steps being s (cid:48) = O (log d ), the error caused bythe unitary U σ,τ is (cid:12)(cid:12)(cid:12) z ( s (cid:48) ) j − σ j β j (cid:12)(cid:12)(cid:12) ≤ ε N + s (cid:48) − d , where ε N ≥ − s (cid:48) .FIG. 7: The circuit for the unitary U β,σ .(2) For c − R y , in order to make the output quantum state accurate, the rotation angle θ of R y satisfies θ = arc sin ( y ). Since arcsin has a convergent Taylor series, we can approximate θ = arcsin ( y ) ≈ y + 16 y + 340 y + 5112 y + · · · . (23)Then the quantum circuit for computing the rotation angle of c − R y can be implementedas shown in Fig. 8. This circuit also only consists of the operations for addition andmultiplication, therefore the number of qubits and gates required are O ( d ) and O [ poly ( d )]respectively. FIG. 8: The circuit for computing the rotation angle of c − R y .The quantum circuit for c − R y is shown in Fig. 9, where θ , · · · , θ d are the binary bitsof the output θ in Fig. 8. Obviously, the space and time complexity are both O ( d ).14IG. 9: The circuit for c − R y . C. Complexity
We firstly analyze the space and time resources used in phase estimation. Let the efficientcondition number of (cid:101) X (cid:101) X † be κ . As A (0) is induced by PCA of (cid:101) X , the condition numberof A (0) A (0) † is not greater than κ , and so as the A ( i ) A ( i ) † for i = 1 , · · · , s −
1. Therefore, σ j ∈ [1 /κ,
1] and β j ∈ [1 /κ, σ j in Reg. B and β j inReg. C are both b = O (log κ ). Moreover, we can learn from [29] that O ( b ) operations andtwo calls to the controlled-unitary black boxes are needed in the stage of phase estimation.We now analyze the space and time complexity of the whole QAOP circuit. In one itera-tion Q of the QAOP circuit, the number of qubits required for preparing the initial quantumstate | ψ A (0) (cid:105) is O ( p + q ) = O [log ( nk/(cid:15) )]. And phase estimation requires O (log κ ) qubits,where the condition number κ is usually taken as κ = O (1 /(cid:15) ). Therefore, the space complex-ity of phase estimation is O (log (cid:15) − ). Taking the ancilla qubits in the controlled rotationinto account, the number of qubits in this stage is O ( d + b ) = O (log κ ) = O (log (cid:15) − ). Thenumber of qubits will not increase with the number of iterations of QAOP. To sum up, thetotal number of qubits required in the quantum circuit is O [log ( nk/(cid:15) )].Now turning to the time consumption. In one iteration Q , the number of gates for theinitial state preparing stage is O ( pq ) = O [log ( nk ) log (cid:15) − ]. And phase estimation requires O ( b ) = O (cid:2) (log κ ) (cid:3) = O (cid:104) (log (cid:15) − ) (cid:105) operations and two calls to the controlled-unitaryblack boxes. The number of quantum gates in the controlled rotation is O [ s (cid:48) poly ( d )] = O [ s (cid:48) poly (log κ )] = O [ s (cid:48) poly (log (cid:15) − )]. The number of iteration Q is s , therefore the totaltime complexity of the QAOP circuit is O [ ss (cid:48) log ( nk ) poly (log (cid:15) − )].In summary, O [log ( nk/(cid:15) )] space and O [log ( nk ) poly (log (cid:15) − )] elementary operations15llow us to implement the QAOP circuit with fidelity at least 1 − (cid:15) , when the number ofiterations of the QAOP algorithm s and the number of Newton’s iteration s (cid:48) are both smallconstant numbers. V. CONCLUSIONS
We have shown that the proposed quantum algorithm QAOP can be used to speed up thelearning process of an important dimensionality reduction algorithm in pattern recognitionand machine learning. We firstly reformulated the original AOP algorithm, therefore thequantum-classical interactions during the quantum algorithm can be omitted. We thenproposed the QAOP algorithm and investigated the quantum circuits for solving the QAOPalgorithm. The detailed quantum circuits for preparing the input quantum state and thecircuits for solving the controlled rotation are presented. The space and time complexity ofthe quantum circuit show that the number of the qubits and gates required are O [log ( nk/(cid:15) )]and O [log ( nk ) poly (log (cid:15) − )], respectively. The result shows that the QAOP algorithm andQAOP circuit for dimensionality reduction may motivate to conduct new investigations inquantum machine learning. ACKNOWLEDGMENTS
This work was supported by the Funding of National Natural Science Foundation of China(Grants No. 61571226 and No. 61701229), Natural Science Foundation of Jiangsu Province,China (Grant No. BK20170802), China Postdoctoral Science Foundation funded Project(Grants No. 2018M630557 and No. 2018T110499), Jiangsu Planned Projects for Postdoc-toral Research Funds (Grant No. 1701139B), and the Nanjing University of Aeronauticsand Astronautics PhD short-term visiting scholar project. The authors also acknowledgeMichele Mosca for inspiring discussions.
Appendix A: Proof of theorem 1
Proof:
According to Eq. (7), we have the initialization of A (0) = k (cid:80) j =1 β (0) j | u j (cid:105) (cid:104) j | , where β (0) j = 1 for all j ’s. Obviously, (cid:104) u j | u j (cid:48) (cid:105) = 0 when j (cid:54) = j (cid:48) and (cid:104) u j | u j (cid:48) (cid:105) = 1 when j = j (cid:48) . In16he following, we simplify A (0) as A . Therefore, we have (cid:101) X T A = (cid:32) r (cid:88) j =1 σ j | v j (cid:105) (cid:104) u j | (cid:33) (cid:32) k (cid:88) j (cid:48) =1 β (0) j (cid:48) | u j (cid:48) (cid:105) (cid:104) j (cid:48) | (cid:33) = k (cid:88) j =1 k (cid:88) j (cid:48) =1 σ j β (0) j (cid:48) | v j (cid:105) (cid:104) u j | u j (cid:48) (cid:105) (cid:104) j (cid:48) | = k (cid:88) j =1 σ j β (0) j | v j (cid:105) (cid:104) j | (A1)and (cid:101) X T AA T (cid:101) X = k (cid:80) j =1 (cid:16) σ j β (0) j (cid:17) | v j (cid:105) (cid:104) v j | . According to the Eq. (5), we have: B = (cid:16) (cid:101) X T AA T (cid:101) X + λ I (cid:17) − (cid:101) X T A = (cid:32) k (cid:88) j =1 (cid:16) σ j β (0) j (cid:17) | v j (cid:105) (cid:104) v j | + λ r (cid:88) j =1 | v j (cid:105) (cid:104) v j | (cid:33) − (cid:32) k (cid:88) j (cid:48) =1 σ j (cid:48) β (0) j (cid:48) | v j (cid:48) (cid:105) (cid:104) j (cid:48) | (cid:33) = (cid:32) k (cid:88) j =1 (cid:18)(cid:16) σ j β (0) j (cid:17) + λ (cid:19) | v j (cid:105) (cid:104) v j | (cid:33) − (cid:32) k (cid:88) j (cid:48) =1 σ j (cid:48) β (0) j (cid:48) | v j (cid:48) (cid:105) (cid:104) j (cid:48) | (cid:33) = (cid:32) k (cid:88) j =1 (cid:18)(cid:16) σ j β (0) j (cid:17) + λ (cid:19) − | v j (cid:105) (cid:104) v j | (cid:33) (cid:32) k (cid:88) j (cid:48) =1 σ j (cid:48) β (0) j (cid:48) | v j (cid:48) (cid:105) (cid:104) j (cid:48) | (cid:33) = k (cid:88) j =1 k (cid:88) j (cid:48) =1 (cid:18)(cid:16) σ j β (0) j (cid:17) + λ (cid:19) − σ j (cid:48) β (0) j (cid:48) | v j (cid:105) (cid:104) v j | v j (cid:48) (cid:105) (cid:104) j (cid:48) | = k (cid:88) j =1 σ j β (0) j (cid:16) σ j β (0) j (cid:17) + λ | v j (cid:105) (cid:104) j | (A2)Similarly, we have (cid:101) XB = (cid:32) k (cid:88) j =1 σ j | u j (cid:105) (cid:104) v j | (cid:33) k (cid:88) j (cid:48) =1 σ j (cid:48) β (0) j (cid:48) (cid:16) σ j (cid:48) β (0) j (cid:48) (cid:17) + λ | v j (cid:48) (cid:105) (cid:104) j (cid:48) | = k (cid:88) j =1 σ j β (0) j (cid:16) σ j β (0) j (cid:17) + λ | u j (cid:105) (cid:104) j | (A3)and (cid:101) XBB T (cid:101) X T = k (cid:80) j =1 (cid:32) σ j β (0) j (cid:16) σ j β (0) j (cid:17) + λ (cid:33) | u j (cid:105) (cid:104) u j | .According to the Eq. (6), we have: 17 (1) = (cid:16) (cid:101) XBB T (cid:101) X T (cid:17) − (cid:101) XB = k (cid:88) j =1 (cid:16) σ j β (0) j (cid:17) + λ σ j β (0) j | u j (cid:105) (cid:104) u j | k (cid:88) j (cid:48) =1 σ j (cid:48) β (0) j (cid:48) (cid:16) σ j (cid:48) β (0) j (cid:48) (cid:17) + λ | u j (cid:48) (cid:105) (cid:104) j (cid:48) | = k (cid:88) j =1 k (cid:88) j (cid:48) =1 (cid:16) σ j β (0) j (cid:17) + λ σ j β (0) j σ j (cid:48) β (0) j (cid:48) (cid:16) σ j (cid:48) β (0) j (cid:48) (cid:17) + λ | u j (cid:105) (cid:104) u j | u j (cid:48) (cid:105) (cid:104) j (cid:48) | = k (cid:88) j =1 (cid:16) σ j β (0) j (cid:17) + λ σ j β (0) j | u j (cid:105) (cid:104) j | (A4)Eq. (A4) shows that after one iteration of the algorithm, only the singular values of A are updated while the singular vectors stay the same. Therefore, for i -th iteration of thealgorithm, let A ( i ) = k (cid:80) j =1 β ( i ) j | u j (cid:105) (cid:104) j | , where β (0) j = 1 for all j ’s according to Eq. (7). We caneasily have β ( i ) j = (cid:16) σ j β ( i − j (cid:17) + λ σ j β ( i − j . [1] P. Chen, L. Jiao, F. Liu, J. Zhao, Z. Zhao, and S. Liu, Pattern Recognition , 361 (2017).[2] R. Wang, F. Nie, R. Hong, X. Chang, X. Yang, and W. Yu, IEEE Transactions on ImageProcessing , 5019 (2017).[3] Y. Song, Q. Li, H. Huang, D. Feng, M. Chen, and W. Cai, IEEE Transactions on MedicalImaging , 1636 (2017).[4] Y. Song, Q. Li, H. Huang, D. Feng, M. Chen, and W. Cai, IEEE Transactions on Cybernetics , 1 (2018).[5] X. He, C. Zhang, L. Zhang, and X. Li, IEEE Transactions on Pattern analysis and machineintelligence , 1009 (2016).[6] C. M. Bishop, Pattern Recognition and Machine Learning (Information Science and Statistics) (Springer-Verlag New York, Inc., 2006).[7] J. B. Tenenbaum, V. de Silva, and J. C. Langford, Science , 2319 (2000).[8] S. Roweis and L. Saul, Science , 2323 (2000).
9] M. Belkin and P. Niyogi, in
International Conference on Neural Information Processing Sys-tems: Natural and Synthetic (MIT Press, Vancouver, British Columbia, Canada, 2001) pp.585–591.[10] J. Adcock, E. Allen, M. Day, S. Frick, J. Hinchliff, M. Johnson, S. Morleyshort, S. Pallister,A. Price, and S. Stanisic, arXiv:1512.02900 (2015).[11] P. Wittek,
Quantum machine learning what quantum computing means to data mining (Else-vier (Singapore) Pte Ltd., 2014).[12] M. Schuld, I. Sinayskiy, and F. Petruccione, Phys.Rev.A , 022342 (2016).[13] B. Duan, J. Yuan, Y. Liu, and D. Li, Phys. Rev. A. , 032301 (2017).[14] X. Gao, Z. Zhang, and L. Duan, Science Advances , eaat9004 (2018).[15] M. Schuld and N. Killoran, Phys. Rev. Lett. , 040504 (2019).[16] J. Biamonte, P. Wittek, N. Pancotti, P. Rebentrost, N. Wiebe, and S. Lloyd, Nature ,195 (2017).[17] Y.-B. Sheng and L. Zhou, Science Bulletin , 1025 (2017).[18] S. Lloyd, M. Mohseni, and P. Rebentrost, Nature Physics , 108 (2014).[19] I. Cong and L. Duan, New Journal of Physics , 073011 (2016).[20] A. W. Harrow, A. Hassidim, and S. Lloyd, Phys. Rev. Lett. , 150502 (2009).[21] M. Mosca and P. Kaye, in Optical Fiber Communication Conference and International Con-ference on Quantum Information (Optical Society of America, Rochester, New York, UnitedStates, 2001) p. 28.[22] V. Giovannetti, S. Lloyd, and L. Maccone, Phys. Rev. Lett. , 160501 (2008).[23] F. Y. Hong, Y. Xiang, Z. Y. Zhu, L. Z. Jiang, and L. N. Wu, Phys. Rev. A. , 010306 (2012).[24] S. Arunachalam, V. Gheorghiu, T. Jochym-O’Connor, M. Mosca, and P. V. SrinivasanS, NewJournal of Physics , 123010 (2015).[25] Y. Cao, A. Papageorgiou, I. Petras, J. Traub, and S. Kais, New Journal of Physics , 013021(2012).[26] V. V. Vedral, A. Barenco, and A. Ekert, Phys. Rev. A. , 147 (1996).[27] A. Parent, M. Roetteler, and M. Mosca, in , Leibniz International Proceedingsin Informatics (LIPIcs), Vol. 73, edited by M. M. Wilde (Schloss Dagstuhl-Leibniz-Zentrumfuer Informatik, Dagstuhl, Germany, 2018) pp. 7:1–7:15.
28] B. Duan, J. Yuan, Y. Liu, and D. Li, Phys. Rev. A. , 012308 (2018).[29] M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information: 10thAnniversary Edition (Cambridge University Press, 2010) pp. 1–59.(Cambridge University Press, 2010) pp. 1–59.