Computers, Materials & Continua DOI:10.32604/cmc.2021.016663 | |
Article |
Learning Unitary Transformation by Quantum Machine Learning Model
1School of Information and Software Engineering, University of Electronic Science and Technology of China, Chengdu, 610054, China
2School of Physics, University of Electronic Science and Technology of China, Chengdu, 610054, China
3Department of Chemistry, Physics and Atmospheric Sciences, Jackson State University, Jackson, MS, 39217, USA
*Corresponding Author: Xiao-Yu Li. Email: xiaoyuuestc@uestc.edu.cn
Received: 08 January 2021; Accepted: 09 February 2021
Abstract: Quantum machine learning (QML) is a rapidly rising research field that incorporates ideas from quantum computing and machine learning to develop emerging tools for scientific research and improving data processing. How to efficiently control or manipulate the quantum system is a fundamental and vexing problem in quantum computing. It can be described as learning or approximating a unitary operator. Since the success of the hybrid-based quantum machine learning model proposed in recent years, we investigate to apply the techniques from QML to tackle this problem. Based on the Choi–Jamiołkowski isomorphism in quantum computing, we transfer the original problem of learning a unitary operator to a min–max optimization problem which can also be viewed as a quantum generative adversarial network. Besides, we select the spectral norm between the target and generated unitary operators as the regularization term in the loss function. Inspired by the hybrid quantum-classical framework widely used in quantum machine learning, we employ the variational quantum circuit and gradient descent based optimizers to solve the min-max optimization problem. In our numerical experiments, the results imply that our proposed method can successfully approximate the desired unitary operator and dramatically reduce the number of quantum gates of the traditional approach. The average fidelity between the states that are produced by applying target and generated unitary on random input states is around 0.997.
Keywords: Machine learning; quantum computing; unitary transformation
With the enormous variety of applications, machine learning has already impacted modern life [1,2]. It not only provides powerful tools for mining the potential information from massive data but also helps us explore the laws of nature from a new perspective. In recent years, machine learning has caught the attention of researchers from various fields such as physics and chemistry [3,4]. They intend to develop new tools based on machine learning techniques for scientific research. Quantum machine learning is one such rising and promising branch that combines the approaches of data processing from machine learning with the outperformance of quantum computing. As well known, there is computational difficulty in simulating a quantum system by classical methods. As the size of a quantum system increases, the resources required for simulating will increase exponentially.
Based on this fact, quite a lot of quantum machine learning models that harness the quantum advantages have been proposed in recent years. Quantum support vector machine (QSVM) and its physical implementation that runs on a small-scale quantum device result in an exponential speed-up over the corresponding classical one [5]. Quantum principal component analysis (QPCA) is more than a quantum extension of the classical algorithm. It also provides a technique to construct unitary transformation efficiently [6]. Quantum generative adversarial networks (QGAN) inherit the framework of classical models, consisting of a generator and a discriminator. However, the components of QGAN can be constructed by variational quantum circuits such that generating quantum data is more efficient like quantum state preparation [7–10]. These quantum machine learning models are classified into two categories. One category is full quantum that the models only rely on full quantum algorithms including quantum Fourier transformation, quantum phase estimation and HHL algorithm etc. [11,12]. The representative works are QSVM, QPCA, and so on. Another category is hybrid that the models consist of the classical part and quantum part. That is the reason why it is called the hybrid quantum-classical model. These models are formalizing the problem of interest as a variational optimization problem and finding an approximate solution by parametrized quantum circuit and classical optimizer [13]. Compared to the full quantum-based model, the hybrid quantum-classical model requires fewer resources to build, particularly the size of the quantum system, the number of quantum gates, etc. Meanwhile, the well-developed optimization techniques can be naturally employed, which means that we are able to make use of well-maintained open-source optimization libraries such as Tensorflow and Pytorch as the optimizing backend [14,15].
In this work, relying on the advantages of the hybrid-based quantum machine learning model, we intend to exploit it for a unitary learning problem that is an essential task in quantum computing. One reason why learning unitary matrices matters a lot is that the dynamics of a quantum system can be described by a unitary transformation, exploring the efficient way to implement the unitary transformation is fundamental. Since we are still in the early stages of quantum computing with the limitation of quantum resources for computation, it is necessary to investigate how to control or manipulate the quantum system efficiently. Besides, various tasks will benefit from the results of the study on learning unitary transformation. For instance, unitary matrix compiling, that is the task of ‘compiling’ a known unitary transformation into a quantum circuit constructed by a sequence of gates chosen from the specific quantum gate set. A large amount of existing works has been focused on how to implement unitary transformations efficiently. Such works provide theoretic analysis of approximate error and gate or time complexity for implementing target unitary transformation [16,17]. Recently, some work investigated the ideas from machine learning for simulating a desired unitary transformation [18,19]. Similar to these related literatures, we formulate the learning of a given target unitary operator as an optimization problem, and employ the hybrid-based quantum machine learning model to approximate the solution. From our numerical experiments, the results show that the proposed method provides a reasonable approximation while the number of required quantum gates is much less than those of traditional approach.
We organized this paper as follows. In Section 2, we formalize the learning problem of unitary transformation. In Section 3, we give a brief introduction of the techniques in hybrid quantum-classical framework and quantum generative adversarial networks (QGAN). In Section 4, we propose a method by which a quantum machine learning model can be used for solving the formulized unitary learning problem. In Section 5, we provide the numerical experiments which demonstrate the advantages of the proposed model. We also introduce the background of quantum computing in the appendix.
2 Learning Problem of Unitary Transformation
In quantum mechanics, we have two pictures for the dynamics of a quantum system. One is the Hamiltonian picture; another is the unitary operator picture. In the Hamiltonian picture, given the Hamiltonian, a Hermitian operator, that is the total energy function of the closed system, we can describe the evolution of the system by Schrödinger equation as follow,
It can be verified that the solution of Eq. (1) can be,
Because the Hamiltonian H is a Hermitian operator, the operator U is unitary. Thus, in the unitary operator picture, we use this unitary transformation to formulate the quantum dynamics.
In the following, our discussion is mainly under the unitary operator picture. As shown in Eq. (2), the manipulation of a quantum system is equivalent to manipulating corresponding unitary matrices. Once there is an efficient way to implement the desired unitary operator, we can effectively imitate the behavior, that is the dynamics, of a quantum mechanical system, which is an intractable task for classical methods [20]. This learning unitary problem introduced above is related to Hamiltonian simulation, which suppose given a Hamiltonian H, time t and precision
Plenty of methods were proposed in past years. Lloyd [20] first invented the quantum algorithm by using Lie-Trotter product formula for simulating Hamiltonian which only includes the local interactions. Berry et al. [21] based on Trotter–Suzuki algorithm gave a method for simulating sparse Hamiltonian. As the unitary operator can be rewritten by the Taylor series expansion, Berry et al. [22] gave an algorithm for approximating the unitary operator with the truncated Taylor series in the same year. Low et al. [23] proposed a quantum signal processing for simulating. Being different from these approaches by quantum algorithm, some works intended to build a unitary operator by neural network or parametrized quantum gate sequence to approximate the target [19,24]. They formulize the approximation of the target evolution operator as an optimization problem. The loss function is the square of Frobenius norm between desired unitary operator and parametrized alternating operator sequences [19].
In this section, we will introduce the hybrid-based quantum machine learning model. The hybrid quantum-classical framework is derived from the quantum approximate optimization algorithm (QAOA) [25]. The QAOA was proposed for solving the MAX-CUT problem, which can be viewed as minimizing the expectation value of a specific observable A that encodes the subjective function in the parametrized quantum state generated by applying alternating operators
where we are able to program the
By calculating the derivative, in terms of parameters
The framework of hybrid-based model is shown in Fig. 1, where VQC is responsible for calculating the gradient of the loss function L respect to parameters
The works listed above form the problem as a non-convex optimization problem, such as minimizing or maximizing a composite function
where the observable O is the Hermitian operator of interest. In general, the density matrix
where
By virtue of the success of QAOA, the non-convex optimization of the loss function
Variational quantum circuit (VQC), known as the parametrized quantum circuit, plays the core role in the hybrid quantum-classical framework. It can be viewed as the quantum black-box model that is capable of approximating any given unitary operator with a small error like neural networks in classical machine learning [13]. Unlike neural networks using weight matrices (parameters) between layers that are adjusted by back-propagation methods, VQC achieves a similar work in the quantum setting by utilizing a sequence of fixed and parametrized quantum gates to construct a circuit model with a specific structure, that is
where
In subgraph (a) of Fig. 2, each square represents the universal two-qubits gate which can be implemented by 15 rotation gates and 3 CNOT gates [27]. All these universal two-qubits gates are applied on nearest-neighbor qubits. If the size of the quantum system is n qubits and number of the layer is l, this type of structure requires
Different from the methods introduced to solve the problem of learning a unitary transformation in Section 2, we reformulate the problem from another perspective. According to Choi–Jamiołkowski isomorphism in quantum information theory [11], there is the correspondence between a quantum mapping
where
Since the unitary transformation UT can be regarded as a mapping
where the quantum state
The learning problem of Eq. (13) stands for finding the unitary operator which minimizes the average output fidelity when feed the maximally mixed state as the input to
There are many choices for
Given two quantum state
• Trace distance:
It can be viewed as a generalization of the total variation distance on probability distribution that satisfies the symmetry and triangle inequality. It is also related to the maximum probability of distinguish different quantum state. The variational form of trace distance is shown in the second line of Eq. (16) [28].
• Fidelity:
Although the fidelity is not a metric, it has many good properties, such as it is invariant unitary transformation, the value of fidelity lies within 0 and 1. It also can be interpreted as the angle between states on a unit sphere. If
• Quantum Optimal Transport Distance:
It is the quantum extension of classical optimal transport distance [10]. However, it is semi-metric which does not satisfy the triangle inequality of metric on quantum states. It inherits the nice property of classical optimal transport distance including smoothness and continues.
Because the quantum optimal transport distance can naturally be implemented by hybrid quantum-classical framework on quantum device, we select quantum optimal transport distance as
Given a unitary operator U, the norm of operator U can be represented in a general form, namely Schatten p-norm,
• Trace norm (p = 1):
• The Frobenius norm (p = 2):
• The Spectral norm (
where
There are many nice properties of Schatten p-norm, such as the inequality between the different norms. For any operator X, if
The related work employed the square of Frobenius norm as the loss function for learning unitary transformation [19]. In this work, we utilize the typically stronger norm, spectral norm, to estimate the error between approximate and desired unitary operator. Consequently, we can rewrite Eq. (15), the loss function of learning a unitary operator, in the following concrete way,
Since the min-max problem of Eq. (23) can be considered as quantum GAN with regularization term. As directly solving the problem of Eq. (23) is intractable, we intend to tackle the dual form of this problem by the Lagrange multiplier technique.
As the spectral norm of matrix A is to find the unit vector x which maximize the Euclidean norm of
In this section, we provide the experiments of applying the quantum machine learning model for learning the unitary transformation. We apply the quantum machine learning model discussed above to the task of learning the unitary transformation of one dimensional Heisenberg spin model which is also considered in reference [29]. The target unitary operator UT on N-qubit system is given by,
In which the Hamiltonian H is described as,
where
In Figs. 3 and 4, we provide the changes of trace norm, Frobenius norm and spectral norm between target and generated unitary operator during the training process. The solid black line represents the average norm for 10 runs with random initialization of parametrized quantum circuit, and the shaded area refers to the range of variation of the norm. In all case, the norm will approximate to zero which means the generated unitary operator is close to the target. In addition, the small system will lead to faster convergence, which is same as we expected.
We select fidelity between the generated and target quantum states to evaluate the performance of our model. In Fig. 5, we show the fidelity between the quantum states which are generated by applying
Learning unitary transformation is an important and vexing task in quantum computing, which is related to controlling a quantum system or implementing a quantum algorithm with fewer resources. In this work, we investigate the use of promising techniques from quantum machine learning for learning a unitary transformation of a quantum system. Instead of the related works which formulate the learning problem as minimizing the norms between target and generated unitary operator, we express the problem as a quantum generative adversarial network with regularization term from the other perspective based on Choi–Jamiołkowski isomorphism. Comparing the trace norm and Frobenius norm used in related works, we add an intuitively stronger norm, spectral norm, as the regularization term to the loss function. Our numerical experiments demonstrate that the operator generated by our proposed model can successfully approximate the desired target unitary operator. The average spectral norm error of 10-replication runs is 0.1, and the average fidelity between the states produced by applying target and generated operators on the random input is around 0.997. Meanwhile, compared to the traditional method using product formulas for Hamiltonian simulation, our proposed model can significantly reduce the number of quantum gates for implementation. There are some potential applications of our proposed model such as providing help for assisting us in implementing quantum algorithms or compiling quantum circuits.
Acknowledgement: Thanks for constructive suggestion and helpful discussions from professor Xiaodi Wu.
Funding Statement: This work has received support from the National Key Research and Development Plan of China under Grant No. 2018YFA0306703.
Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.
1. B. Indira and K. Valarmathi. (2020). “A perspective of the machine learning approach for the packet classification in the software defined network,” Intelligent Automation & Soft Computing, vol. 26, no. 4, pp. 795–805. [Google Scholar]
2. A. Alhussain, H. Kurdi and L. Altoaimy. (2019). “A neural network-based trust management system for edge devices in peer-to-peer networks,” Computers, Materials & Continua, vol. 59, no. 3, pp. 805–815. [Google Scholar]
3. B. S. Rem, N. Käming, M. Tarnowski, L. Asteria, N. Fläschner et al. (2019). , “Identifying quantum phase transitions using artificial neural networks on experimental data,” Nature Physics, vol. 15, no. 9, pp. 917–920. [Google Scholar]
4. A. Tkatchenko. (2020). “Machine learning for chemical discovery,” Nature Communications, vol. 11, no. 1, pp. 4125. [Google Scholar]
5. P. Rebentrost, M. Mohseni and S. Lloyd. (2014). “Quantum support vector machine for big data classification,” Physical Review Letters, vol. 113, no. 13, pp. 130503. [Google Scholar]
6. S. Lloyd, M. Mohseni and P. Rebentrost. (2014). “Quantum principal component analysis,” Nature Physics, vol. 10, no. 9, pp. 631–633. [Google Scholar]
7. P. L. Dallaire-Demers and N. Killoran. (2018). “Quantum generative adversarial networks,” Physical Review A, vol. 98, no. 1, pp. 12324. [Google Scholar]
8. C. Zoufal, A. Lucchi and S. Woerner. (2019). “Quantum generative adversarial networks for learning and loading random distributions,” NJP Quantum Information, vol. 5, no. 1, pp. 1–9. [Google Scholar]
9. L. Hu, S. H. Wu, W. Cai, Y. Ma, X. Mu et al. (2019). , “Quantum generative adversarial learning in a superconducting quantum circuit,” Science Advances, vol. 5, no. 1, pp. eaav2761. [Google Scholar]
10. S. Chakrabarti, H. Yiming, T. Li, S. Feizi and X. Wu. (2019). “Quantum wasserstein generative adversarial networks,” in Proc. the Neural Information Processing Systems, Vancouver, BC, Canada, pp. 6781–6792. [Google Scholar]
11. M. A. Nielsen and I. L. Chuang. (2010). “The quantum Fourier transform and its applications,” in Quantum Computation and Quantum Information, 10th Anniversary Edition, 2nd ed., vol. 1. New York, NY, USA: Cambridge University Press. [Google Scholar]
12. A. W. Harrow, A. Hassidim and S. Lloyd. (2009). “Quantum algorithm for linear systems of equations,” Physical Review Letters, vol. 103, no. 15, pp. 150502. [Google Scholar]
13. M. Benedetti, E. Lloyd, S. Sack and M. Fiorentini. (2019). “Parameterized quantum circuits as machine learning models,” Quantum Science and Technology, vol. 4, no. 4, pp. 43001. [Google Scholar]
14. M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis et al. (2016). , “TensorFlow: A system for large-scale machine learning,” in Proc. the Operating Systems Design and Implementation, Savannah, GA, USA, pp. 265–283. [Google Scholar]
15. A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury et al. (2019). , “PyTorch: An imperative style, high-performance deep learning library,” in Proc. the Neural Information Processing Systems, Vancouver, BC, Canada, pp. 8026–8037. [Google Scholar]
16. A. Bisio, G. Chiribella, G. M. D’Ariano, S. Facchini and P. Perinotti. (2010). “Optimal quantum learning of a unitary transformation,” Physical Review A, vol. 81, no. 3, pp. 32324. [Google Scholar]
17. S. L. Hyland and G. Rätsch. (2016). “Learning unitary operators with help from u(n),” in Proc. the National Conf. on Artificial Intelligence, New York, NY, USA, pp. 2050–2058. [Google Scholar]
18. S. Lloyd and R. Maity. (2019). “Efficient implementation of unitary transformations,” Arxiv Quantum Physics, arXiv: 1901.03431. [Google Scholar]
19. B. T. Kiani, S. Lloyd and R. Maity. (2001). “Learning unitaries by gradient descent,” Arxiv Quantum Physics, arXiv: 2001.11897. [Google Scholar]
20. S. Lloyd. (1996). “Universal quantum simulators,” Science, vol. 273, no. 5278, pp. 1073–1078. [Google Scholar]
21. D. W. Berry, A. M. Childs and R. Kothari. (2015). “Hamiltonian simulation with nearly optimal dependence on all parameters,” in Proc. the Foundations of Computer Science, Berkeley, CA, USA, pp. 792–809. [Google Scholar]
22. D. W. Berry, A. M. Childs, R. Cleve, R. Kothari and R. D. Somma. (2015). “Simulating hamiltonian dynamics with a truncated Taylor series,” Physical Review Letters, vol. 114, no. 9, pp. 90502. [Google Scholar]
23. G. H. Low and I. L. Chuang. (2017). “Optimal hamiltonian simulation by quantum signal processing,” Physical Review Letters, vol. 118, no. 1, pp. 10501. [Google Scholar]
24. B. T. Kiani. (2020). “Quantum artificial intelligence: Learning unitary transformations,” M.S. Disssertation, Massachusetts Institute of Technology, USA. [Google Scholar]
25. E. Farhi, J. Goldstone and S. Gutmann. (2014). “A quantum approximate optimization algorithm,” Arxiv Quantum Physics, arXiv: 1411.4028. [Google Scholar]
26. J. G. Liu and L. Wang. (2018). “Differentiable learning of quantum circuit Born machines,” Physical Review A, vol. 98, no. 6, pp. 62324. [Google Scholar]
27. V. V. Shende, I. L. Markov and S. S. Bullock. (2004). “Minimal universal two-qubit controlled-NOT-based circuits,” Physical Review A, vol. 69, no. 6, pp. 62321. [Google Scholar]
28. P. J. Coles, M. Cerezo and L. Cincio. (2019). “Strong bound between trace distance and Hilbert-Schmidt distance for low-rank states,” Physical Review A, vol. 100, no. 2, pp. 22103. [Google Scholar]
29. A. M. Childs, D. Maslov, Y. S. Nam, N. J. Ross and Y. Su. (2018). “Toward the first quantum simulation with quantum speedup,” Proc. of the National Academy of Sciences of the United States of America, vol. 115, no. 38, pp. 9456–9461. [Google Scholar]
Appendix A. Preliminary of Quantum Computing
A.1 Quantum State
Instead of storing a certain state in one classical bit, a qubit, the counterpart of classical bit, is in a superposition of two basic state
A.2 Quantum Gates and Quantum Circuit Model
The widely used model for quantum computation is the quantum circuit model that is constructed by a sequence of reversible quantum logic gates. In quantum mechanics, the time evolution of a quantum system can be described by a unitary transformation. Thus, the quantum logic gates are equivalent to the unitary transformations in the quantum circuit model. The followings are commonly used one-qubit and multiple-qubits quantum gates,
• Puali Gates,
• Rotation Gates,
• Entangling Gates,
Controlled-NOT gate,
Ising XX Coupling Gates,
An example of quantum circuit is shown in Fig. A.1, each solid line through quantum gates represents one qubit, which is corresponding to the passage of time. The square box denotes the quantum gates, i.e., the revolution of the quantum system. The quantum states are passed through the quantum gates from left to right.
A.3 Qubit Measurement
The classical data stored in quantum states cannot be directly read out. To extract the data, we have to perform the quantum measurement on the state. Due to the measurement involve the distraction from the exterior environment, the system will collapse after the measurement which is an irreversible action. The operation of measurement can be described by a group of measurement operator
This work is licensed under a Creative Commons Attribution 4.0 International License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. |