Quantum algorithm and quantum circuit for A-Optimal Projection: dimensionality reduction
Bojia Duan, Jiabin Yuan, Juan Xu, Dan Li

TL;DR
This paper introduces a quantum algorithm and circuit for A-Optimal Projection, achieving exponential speedup over classical methods in dimensionality reduction tasks, with efficient complexity and broad applicability.
Contribution
The paper presents a novel quantum algorithm and circuit for A-Optimal Projection, improving efficiency and removing quantum-classical interactions compared to prior classical approaches.
Findings
Exponential speedup in feature space dimensions
Quantum circuit complexity scales logarithmically
High fidelity with reduced quantum-classical interaction
Abstract
Learning low dimensional representation is a crucial issue for many machine learning tasks such as pattern recognition and image retrieval. In this article, we present a quantum algorithm and a quantum circuit to efficiently perform A-Optimal Projection for dimensionality reduction. Compared with the best-know classical algorithms, the quantum A-Optimal Projection (QAOP) algorithm shows an exponential speedup in both the original feature space dimension and the reduced feature space dimension . We show that the space and time complexity of the QAOP circuit are and respectively, with fidelity at least . Firstly, a reformation of the original QAOP algorithm is proposed to help omit the quantum-classical interactions during the QAOP algorithm.…
Click any figure to enlarge with its caption.
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Quantum algorithm and quantum circuit for A-Optimal Projection: dimensionality reduction
Bojia Duan
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.
Jiabin Yuan
Juan Xu
Dan Li
College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, No.29 Jiangjun Avenue, 211106 Nanjing, China.
Abstract
Learning low dimensional representation is a crucial issue for many machine learning tasks such as pattern recognition and image retrieval. In this article, we present a quantum algorithm and a quantum circuit to efficiently perform A-Optimal Projection for dimensionality reduction. Compared with the best-know classical algorithms, the quantum A-Optimal Projection (QAOP) algorithm shows an exponential speedup in both the original feature space dimension and the reduced feature space dimension . We show that the space and time complexity of the QAOP circuit are and respectively, with fidelity at least . Firstly, a reformation of the original QAOP algorithm is proposed to help omit the quantum-classical interactions during the QAOP algorithm. Then the quantum algorithm and quantum circuit with performance guarantees are proposed. Specifically, the quantum circuit modules for preparing the initial quantum state and implementing the controlled rotation can be also used for other quantum machine learning algorithms.
Quantum machine learning, dimensionality reduction, A-Optimal Projection
pacs:
I Introduction
Learning low dimensional image representations has gained significant importance in many image processing tasks such as recognition and retrieval Chen et al. (2017); Wang et al. (2017); Song et al. (2017). A range of applications of this problem can be seen in the field of medical imaging such as liver cirrhosis, lung cancer classification and breast cancer diagnosis Song et al. (2017). Another typical example is face recognition which is typically used in security systems or as a commercial identification and marketing tool Song et al. (2018). Recent studies have shown that images are possibly sampled from a low dimensional manifold, however, the visual features, such as color, texture and shape, which are usually extracted for the image representation, are usually of very high dimensionality He et al. (2016). Therefore, a range of techniques have been developed for dimensionality reduction. For instance, principal component analysis (PCA) is guaranteed in terms of the linearly embedded manifold Bishop (2006). Moreover, Isomap, Locally Linear Embedding, and Laplacian Eigenmap are proposed for nonlinear embedded manifold Tenenbaum et al. (2000); Roweis and Saul (2000); Belkin and Niyogi (2001).
Different from all the aforementioned techniques which are not directly related to the regression task, X. He proposed a novel dimensionality reduction algorithm named A-Optimal Projection (AOP) which performs better regression performance in the reduced space He et al. (2016). This approach can be performed under either unsupervised or supervised mode, which is a more widely used algorithm compared to the unsupervised algorithm PCA or the supervised algorithm linear discriminant analysis (LDA) Bishop (2006). Moreover, different from most dimensionality reduction algorithms which are applied as pre-processing of the data, AOP can directly improve the performance of a regression model in the reduced space, therefore, the learned regression model can be as stable as possible.
Time complexity is a significant drawback in classical machine learning algorithms. A range of quantum algorithms have achieved exponentially speed up in machine learning compared with the classical ones Adcock et al. (2015); Wittek (2014). In particular, quantum algorithms for solving the problem of pattern classification and image classification problems were proposed, covering an important area of machine learning Schuld et al. (2016); Duan et al. (2017). Recently, a quantum generative algorithm which is more capable of representing probability distributions was proposed, generating an intriguing link among quantum many-body physics, quantum computational complexity theory and the machine learning frontier Gao et al. (2018). The relationship between feature maps, kernel methods in machine learning and quantum computing was also investigated, and the idea of embedding data into a quantum Hilbert space opens up a promising avenue to quantum machine learning Schuld and Killoran (2019). Moreover, small quantum computers, larger special purpose quantum simulators, annealers, etc., exhibit promising applications in machine learning, and the perspectives on the work of these hardware have also been discussed Biamonte et al. (2017). Quantum machine learning has also been combined with the information security. It was designed to protect private data during performing quantum machine learning, which has potential applications in the big data era Sheng and Zhou (2017).
In the application field of quantum dimensionality reduction, the quantum algorithm for PCA has been proposed for unsupervised mode Lloyd et al. (2014), and the quantum algorithm for LDA has been proposed for supervised mode and classification Cong and Duan (2016). In this paper, we focus on the new dimensionality reduction algorithm AOP which can be used both on unsupervised and supervised model, and propose a quantum algorithm for AOP, which achieves exponentially speedup compared with the classical polylogarithmic in both , the original feature space dimension, and , the reduced feature space dimension.
Our work has two major contributions. First, we present a quantum algorithm for solving the learning process of the AOP algorithm. A reformulation of the original classical AOP algorithm is introduced here which helps the QAOP algorithm be implemented more efficiently. The quantum algorithm is made of iterations, where each iteration mainly consists of phase estimation and a controlled rotation. The reformulated AOP and the partial trace technology can help omit the quantum-classical interactions during the quantum algorithm. Second, we design a detailed quantum circuit for the proposed QAOP algorithm which makes it possible to execute the QAOP algorithm on a universal quantum computer. The circuit for preparing the initial state is presented and the detailed circuit for the controlled rotation is designed. The space and time analysis of the quantum circuit also shows an exponential speedup 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 algorithm in Sec. II. In Sec. III, the quantum algorithm for AOP algorithm which is used in dimension reduction is presented. In Sec. IV, the overview and detailed quantum circuits for solving QAOP algorithm are designed. Finally we show the conclusions in Sec. V.
II 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 performance in the reduced space which preserves similarities between the data pairs. The AOP dimensionality reduction algorithm returns the directions of projections, and with this result, the data can be projected onto a lower-dimensional subspace which can be directly used for regression problem.
Let be a data matrix, where is the number of data points and is the number of features. In the graph based dimensionality reduction, we are given a nearest neighbor graph which represents the geometrical structure of the data manifold. Each vertex of the graph represents a data point. Let be the weight matrix of the graph and denote the nearest neighbors of . Then a simple example of can be defined as follows:
[TABLE]
AOP aims to find a projection matrix that maps the the points to , and , where . And using to train a linear regression model:
[TABLE]
where is the observation, is the weight vector and is an unknown error with Gaussian distribution.
Formally, the objective function of AOP is:
[TABLE]
where and are the regularization coefficients which are very small, and is the graph Laplacian ( is a vector of all ones).
To solve the objective function, Ref. He et al. (2016) introduces a variables B and the optimization problem (3) is equivalent to the following:
[TABLE]
where , and is from the cholesky decomposition: .
It tells us that the optimal can be obtained by iteratively computing and . Then the overall procedure of the AOP learning algorithm is depicted as follows:
-
Initialize the matrix by computing the PCA of the data .
-
Compute the matrix according to the Eq. (5):
[TABLE]
- Update the matrix according to the Eq. (6), and normalize such that .
[TABLE]
where is used as a constraint parameter to control the size of .
- Repeat steps 2 and 3 until convergence.
III Quantum A-Optimal Projection
In this section, we propose the quantum AOP algorithm for dimensionality reduction. We firstly reformulated the original classical AOP algorithm. And with the help of the reformulation, the proposed quantum AOP algorithm can then be implemented more efficiently.
III.1 Reformulation of the AOP algorithm
We reformulated the algorithm in Sec. II in terms of quantum mechanics. Firstly, we adjust the initialization of to make it closer to the optimal solution than the original algorithm. 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 during the iteration of the algorithm. Specifically, in one iteration of the original algorithm, a quantum state is needed to be computed and sampled as to reconstruct the matrix B, and then used to update A. In our methods, the elimination of the matrix B can help update the quantum state representing A without sampling and reconstruction in one of the iterations. Finally, by introducing the partial trace technology, quantum-classical interaction can also be omitted between the iterations.
(1) Initialization of . The original AOP algorithm compute PCA of the data to initialize the matrix . In contrast, we compute PCA of to obtain the initialization . As shown in Eq. (3), when and are set to zero, the objection function (3) is equivalent to the objection function of PCA referring to the data . And when is zero, the objection function (3) is equivalent to the objection function of PCA referring to the data . It is obvious 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 AOP algorithm in one of the iterations. Suppose the singular value decomposition of the matrix is , where is the rank of , and are the singular values of , with and being the left and right singular vectors. Obviously, we have and .
As is the PCA of , we have
[TABLE]
where is the rank of , and ’s are the basis states. Now we have the theorem 1 (and the proof is shown in Appendix A.).
Theorem 1:
- Given the matrix , the -th iteration of the AOP algorithm outputs the matrix :*
[TABLE]
*where and for all ’s. *
According to the theorem 1, the reformulated AOP algorithm is presented as follows:
-
Initialize the matrix by computing the PCA of according to Eq. (7).
-
Update the matrix according to Eq. (8).
-
Repeat step 2 until convergence.
The modeling of the AOP algorithm is shown in Fig. 1.
III.2 QAOP algorithm
The overall procedure of our QAOP algorithm is then proposed as follows.
Algorithm. .
-
Initialize , apply quantum PCA algorithm of to compute Lloyd et al. (2014).
-
Perform one iteration of the QAOP algorithm to compute , i.e. .
-
Set , and repeat step 2 until the number of iterations ; now the projection matrix can be obtained.
The quantum algorithm for -th iteration of the QAOP algorithm in Step 2 is presented as follows.
(1) Prepare four quantum registers in the state
[TABLE]
where the superscript represents the ancilla qubit, the superscripts represent the register and , respectively.
(2) Perform the unitary operation and on the state, then we have the state
[TABLE]
Here represents the unitary matrix for phase estimation which we fully characterized in Duan et al. (2017):
[TABLE]
where is the inverse quantum Fourier transform and is the conditional Hamiltonian evolution Harrow et al. (2009).
(3) Apply a controlled rotation to the ancilla qubit, controlled by both the register and . is defined as follows:
[TABLE]
where is a parameter used for normalization of the quantum state.
This rotation transforms the state to
[TABLE]
(4) Uncompute the registers , and , remove the register and , and measure the ancilla qubit to be . Then, we have the state proportional to
[TABLE]
Here, we can construct the matrix for the phase estimation in the next iteration by taking a partial trace of . Note that the eigenvectors of are and the corresponding eigenvalues are . Then the density matrix that represents can be obtained Schuld et al. (2016) :
[TABLE]
IV QAOP circuit
In this section, we study the QAOP algorithm in terms of the quantum circuit model. The quantum circuits provide the possibility to implement the quantum algorithm on a universal quantum computer. First, we present the overview model of the QAOP circuit. Second, we study in depth the realization of the initial state preparation and the controlled rotation in terms of the quantum circuit model. Finally, the space and time resources required for the quantum circuit are analyzed.
The overview of the circuit for solving QAOP is shown in Fig. 2. It provides one model to implement the QAOP algorithm. Take the -th iteration of the QAOP algorithm for example. It can be divided into three major steps: (1) Phase estimation: as the eigenspace of the unitary and are both spanned by the eigenvectors , they can be both implemented on the input state . And the Hadamard gates and the inverse QFT of and can be implemented in parallel. (2) Controlled rotation: it consists of and . Firstly the operation computes the function of the output eigenvalues of and as follows:
[TABLE]
And then the operation extracts the value of in the basic states of the register to the amplitude of the ancilla qubit. (3) Uncomputing: undo the Reg. and , and measure the top ancilla qubit. If the result returns to 1, then the Reg. of the quantum system collapses to the output state , which is also the input state of the -th iteration.
We now deal with the detailed QAOP circuit. In the following, we mainly investigate the quantum circuits for the initial state preparation and the controlled rotation in one iteration of the QAOP circuit.
IV.1 State preparation
At the very beginning, we present a detailed quantum circuit for preparing the initial state of the QAOP algorithm. Suppose each element of is given, and its corresponding quantum state is a -qubit quantum state, where . Following the approach in Mosca and Kaye (2001), the quantum circuit for the initial state preparation can be shown in Fig. 3. Here, we introduce quantum random access memory (QRAM) to omit the register in Mosca and Kaye (2001).
In Fig. 3, an register of qubits is used for storing the , where is short for satisfying:
[TABLE]
All the can be computed classically and they are supposed to be stored in the QRAM. Given the index , define being the address where the data stores, where is a hash function mapping to . Then define the unitary operation which implements the QRAM readout operation Giovannetti et al. (2008):
[TABLE]
specifically, outputs the content of the -th memory cell in QRAM. Ref. Hong et al. (2012) shows that this procedure can be implemented in time .
And the number of in the circuit for state preparation is , so the total memory calls of QRAM is . Therefore, an inverse in error rate suffices to achieve an overall constant error per QRAM look-up Arunachalam et al. (2015).
Moreover, we make further study on which is defined in Ref. Mosca and Kaye (2001):
[TABLE]
Define {R_{l}}=\left({\begin{array}[]{*{20}{c}}{{e^{{{2\pi i}\mathord{\left/{\vphantom{{2\pi i}{{2^{l}}}}}\right.\kern-1.2pt}{{2^{l}}}}}}}&0\\ 0&{{e^{{{-2\pi i}\mathord{\left/{\vphantom{{-2\pi i}{{2^{l}}}}}\right.\kern-1.2pt}{{2^{l}}}}}}}\end{array}}\right), then the controlled unitary implements the following transformation:
[TABLE]
where is the -th binary bit of , specifically, . Now achieves the function of :
[TABLE]
Therefore, the quantum circuit for can be implemented as shown in Fig. 4.
Now we can simply infer that the number of qubits needed for preparing the initial quantum state is , and the number of gates required is .
In summary, with V=\left({\begin{array}[]{*{20}{c}}1&0\\ 0&{-\iota}\end{array}}\right), the unitary implements the transformation:
[TABLE]
IV.2 The controlled rotation
The controlled rotation mainly involves the computation of and . In the stage of , Newton’s method is introduced for computing , where is used for normalization of the quantum state. The value of are computed out and stored in the basis state of the register , and the number of qubits for storing is . In the stage of , is used as controlled qubit controlling the top ancilla qubit in Fig. 2.
(1) For , let , then we have . Here we use Newton iteration to approximate , for . The quantum circuit for computing the initial approximation can be seen in Cao et al. (2012). Applying the Newton method to , we can get the Newton iteration function: . Then the detailed circuit for one iteration of Newton’s method is presented in Fig. 5. The number of qubits needed in the ancilla registers is . The number of fundamental quantum operations for implementing addition and multiplication is , where the degree of the polynomial is no more than Vedral et al. (1996); Parent et al. (2018), and the number of gates for implementing shift is .
The quantum circuit for can be simply realized as shown in Fig. 6. The circuit can be simply realized with the quantum circuits for addition and multiplication. Therefore, the number of qubits and gates needed in the circuit are and , respectively.
To sum up, the overall quantum circuit for can be designed as shown in Fig. 7. And we can simply infer that the number of qubits needed in these circuits is . Let the number of Newton iteration be , then the number of gates required in Fig. 7 is .
Now we analyze the error caused by Newton’s iteration. Similar to the error analysis in Duan et al. (2018); Cao et al. (2012), the error consists of two parts. One is error caused by the Newton’s iteration, the other is the roundoff error caused by truncating the result of one iteration to qubits of accuracy.
According to the Newton iteration function, we have . Then the error satisfies . Following the approach in Cao et al. (2012), the initial error satisfies , then for error we have , which implies , where denotes the desired error of Newton iteration without considering the truncation error. We can also follow the result in Cao et al. (2012) that the truncation error satisfies .
In short, with the number of the iteration steps being , the error caused by the unitary is , where .
(2) For , in order to make the output quantum state accurate, the rotation angle of satisfies . Since has a convergent Taylor series, we can approximate
[TABLE]
Then the quantum circuit for computing the rotation angle of can be implemented as shown in Fig. 8. This circuit also only consists of the operations for addition and multiplication, therefore the number of qubits and gates required are and respectively.
The quantum circuit for is shown in Fig. 9, where are the binary bits of the output in Fig. 8. Obviously, the space and time complexity are both .
IV.3 Complexity
We firstly analyze the space and time resources used in phase estimation. Let the efficient condition number of be . As is induced by PCA of , the condition number of is not greater than , and so as the for . Therefore, and , and the numbers of qubits to store in Reg. and in Reg. are both . Moreover, we can learn from Nielsen and Chuang (2010) that operations and two 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 iteration of the QAOP circuit, the number of qubits required for preparing the initial quantum state is . And phase estimation requires qubits, where the condition number is usually taken as . Therefore, the space complexity of phase estimation is . Taking the ancilla qubits in the controlled rotation into account, the number of qubits in this stage is . The number of qubits will not increase with the number of iterations of QAOP. To sum up, the total number of qubits required in the quantum circuit is .
Now turning to the time consumption. In one iteration , the number of gates for the initial state preparing stage is . And phase estimation requires operations and two calls to the controlled-unitary black boxes. The number of quantum gates in the controlled rotation is . The number of iteration is , therefore the total time complexity of the QAOP circuit is .
In summary, space and elementary operations allow us to implement the QAOP circuit with fidelity at least , when the number of iterations of the QAOP algorithm and the number of Newton’s iteration are both small constant numbers.
V Conclusions
We have shown that the proposed quantum algorithm QAOP can be used to speed up the learning process of an important dimensionality reduction algorithm in pattern recognition and machine learning. We firstly reformulated the original AOP algorithm, therefore the quantum-classical interactions during the quantum algorithm can be omitted. We then proposed the QAOP algorithm and investigated the quantum circuits for solving the QAOP algorithm. The detailed quantum circuits for preparing the input quantum state and the circuits for solving the controlled rotation are presented. The space and time complexity of the quantum circuit show that the number of the qubits and gates required are and , respectively. The result shows that the QAOP algorithm and QAOP circuit for dimensionality reduction may motivate to conduct new investigations in quantum machine learning.
Acknowledgements.
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 Postdoctoral Research Funds (Grant No. 1701139B), and the Nanjing University of Aeronautics and Astronautics PhD short-term visiting scholar project. The authors also acknowledge Michele Mosca for inspiring discussions.
Appendix A Proof of theorem 1
Proof: According to Eq. (7), we have the initialization of , where for all ’s. Obviously, when and when . In the following, we simplify as . Therefore, we have
[TABLE]
and . According to the Eq. (5), we have:
[TABLE]
Similarly, we have
[TABLE]
and .
According to the Eq. (6), we have:
[TABLE]
Eq. (27) shows that after one iteration of the algorithm, only the singular values of are updated while the singular vectors stay the same. Therefore, for -th iteration of the algorithm, let , where for all ’s according to Eq. (7). We can easily have .
∎
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Chen et al. (2017) P. Chen, L. Jiao, F. Liu, J. Zhao, Z. Zhao, and S. Liu, Pattern Recognition 61 , 361 (2017).
- 2Wang et al. (2017) R. Wang, F. Nie, R. Hong, X. Chang, X. Yang, and W. Yu, IEEE Transactions on Image Processing 26 , 5019 (2017).
- 3Song et al. (2017) Y. Song, Q. Li, H. Huang, D. Feng, M. Chen, and W. Cai, IEEE Transactions on Medical Imaging 36 , 1636 (2017).
- 4Song et al. (2018) Y. Song, Q. Li, H. Huang, D. Feng, M. Chen, and W. Cai, IEEE Transactions on Cybernetics 99 , 1 (2018).
- 5He et al. (2016) X. He, C. Zhang, L. Zhang, and X. Li, IEEE Transactions on Pattern analysis and machine intelligence 38 , 1009 (2016).
- 6Bishop (2006) C. M. Bishop, Pattern Recognition and Machine Learning (Information Science and Statistics) (Springer-Verlag New York, Inc., 2006).
- 7Tenenbaum et al. (2000) J. B. Tenenbaum, V. de Silva, and J. C. Langford, Science 290 , 2319 (2000).
- 8Roweis and Saul (2000) S. Roweis and L. Saul, Science 290 , 2323 (2000).
