Abstract
When faced with a quantum-solving problem for partial differential equations, people usually transform such problems into Hamiltonian simulation problems or quantum-solving problems for linear equation systems. In this paper, we propose a third approach to solving partial differential equations that differs from the two approaches. By using the duality quantum algorithm, we construct a quantum-solving algorithm for solving the first-order wave equation, which represents a typical class of partial differential equations. Numerical results of the quantum circuit have high precision consistency with the theoretical d’Alembert solution. Then the routine is applied to the wave equation with either a dissipation or dispersion term. As shown by complexity analysis for all these cases of the wave equation, our algorithm has a quadratic acceleration for each iteration compared to the classical algorithm.
1. Introduction
Most scientific problems can be solved by studying the laws governing the evolution of physical quantities in space and time. Therefore, partial differential equations undoubtedly play an extremely important role in the field of natural sciences. However, the problem of solving partial differential equations is extremely difficult. While if quantum algorithms are introduced and the problems of partial differential equations are solved on a quantum computer, it can achieve accelerated characteristics compared to classical algorithms.
The usual quantum algorithm for solving partial differential equations proceeds as follows. First, discretize the space so that the function becomes a vector and map its normalized components to the quantum state components, i.e., , where is the i-th component of the vector after normalization. Next, the vectors encoded onto the quantum states are mapped onto a fixed model. Most quantum algorithms for solving partial differential equations rely on Hamiltonian simulations [1,2,3,4] or a linear equation system-solving algorithm (HHL algorithm) [5].
In the following, the main ideas of the above two solution methods will be briefly reviewed with examples. The solution method based on Hamiltonian simulation [6,7,8] that maps partial differential equations to the Schrödinger equation will be introduced first. This method maps equations with a similar structure to the Schrödinger equation to the Schrödinger equation and transforms the equation solving problem into a Hamiltonian simulation problem. For example, solving the Black–Scholes equation [9]
The equation can be written in the following form
It is obvious that the equation is formally similar to the Schrödinger equation. Thus the A operator can be mapped to the Hamiltonian in Schrödinger’s equation in such a way that . One can split A into Hermitian and anti-Hermitian parts, i.e., , where
The vector , obtained by discretizing the function, is encoded onto the state vector , using the Trotter product formula
The problem of solving the partial differential equation is transformed into the problem of a Hamiltonian simulation. The process of simulating the action of the above Hamiltonian, i.e., the quantum state , evolves under the designed Hamiltonian to obtain the final state. The solution of the original equation at different moments can be obtained by measuring the final state for different iterations.
In fact, it is efficient to use a Hamiltonian simulation to construct quantum algorithms for solving partial differential equations, which can solve first-order partial differential equations (requiring that the Hermitian and anti-Hermitian parts of the matrix A decomposition commute with each other) and second-order partial differential equations such as the wave equation. However, not all partial differential equations have the algebraic structure of Schrödinger’s equation. The quantum algorithm [7,10,11,12] for solving partial differential equations is presented below using the HHL algorithm. For the partial differential equation with the following structure after spatial discretization
Using Euler’s method to discretize time gives
Let , the partial differential equation can be transformed into the following linear equation system; as an example, only the result of is given here,
This system of equations is then solved using the HHL algorithm to obtain the following quantum states
The quantum state contains the solution of the partial differential equation to moments. Therefore, are there any other efficient algorithms for solving partial differential equations besides the above two methods? In this article, a third method different from the above two, the duality quantum algorithm [13,14,15,16] with amplitude amplification [17,18,19,20], is used to construct a quantum algorithm for solving the partial differential equation. The duality quantum algorithm also brings a speed-up effect compared to the classical algorithm [21,22,23].
This paper is organized as follows. First of all, the duality quantum algorithm will be used to solve the first-order wave equation with the d’Alembert solution. In the second and third parts of this paper, we will use the duality quantum algorithm to construct a solution algorithm to the wave equations with dissipation and dispersion terms. In these three parts of the paper, for these three problems, we use numerical simulations and present the results of the quantum algorithm solutions in the form of pictures for comparison with the theoretical values. At the end of this paper, we will analyze the complexity of our algorithm for solving the wave equations.
2. Duality Quantum Algorithm for Solving the First-Order Wave Equation
When talking about the wave equation, people must first think of the second-order linear hyperbolic type equation
The general solution can be written as , where f, g are two arbitrary functions. and represent waves passing along the x-axis with constant velocity to the right and to the left. Since Equation (9) is a linear homogeneous equations, its solutions are superposed. Therefore, f and g are two traveling waves that propagate independently without interfering with each other. If one focuses on only one of these two waves, Equation (9) degenerates to a linear hyperbolic equation of the first-order
In this paper, we discretize the continuous independent variable x into N points, i.e., . Then the spatial part of the function at the moment is discretized into the vector
encode it onto the computational basis and define the quantum state as
In the following, we will give the quantum algorithm for solving Equation (10) based on the non-unitary evolution of the quantum system. First, the Taylor expansion for each order partial differential term of Equation (10) is
Pluging Equation (13) into Equation (10), the difference equation form of Equation (10) is obtained as
Its local truncation error is . When , , Equation (14) approximates the original Equation (10). Organizing Equation (14) leads to
Let , then the following iterative relation can be obtained from Equation (15).
Taking the periodic boundary condition that , the equation describing the whole system can be written in the following form
where
Then the state of the system at the next moment, i.e., the moment , can be expressed as . It is obvious that the A-matrix is not an unitary matrix, so there is no way to achieve it directly by the product of quantum logic gates. Instead, the A-matrix has to be split into linear combinations of the unitary operators by the duality model of quantum computation, i.e., , where is a unitary matrix of order N and
By introducing an auxiliary qubit, the operation of the linear combination of unitary operators can be realized and thus equivalently the non-unitary evolution, i.e., . Its quantum circuit is shown in Figure 1.
Figure 1.
Quantum circuit for solving the first-order wave equation.
Where the matrix can be decomposed into gates as well as X gates with . The specific quantum circuit that implements the operation is shown in Figure 2.
Figure 2.
Quantum circuit for realization operation.
According to Lemma 5.5 and Lemma 7.1 in article [24], a total of CNOT gates and single-qubit rotating gates are needed if the operation continues to be disassembled. The following will explain the duality quantum algorithm for the solution of the first-order wave equation according to Figure 1, where first the auxiliary qubit passes through the gate, which has the following effect
Next, after two controlled quantum gates and , the quantum state evolves as
Then the quantum state after the Hadamard transformation is
Finally, after the measurement to select the state of the auxiliary qubit as 0, the state of the working qubits at this time is , that is
Define the coefficients as
The amplitude under the computational basis of the quantum state is enlarged by a factor of to obtain the column vector , which is the state of the system at the moment . The analysis yields that the computational complexity of this algorithm is per iteration, while the complexity of the classical algorithm is . The specific calculation of the complexity is presented at the end of this paper.
The following equation will be used as an example
to show the duality quantum algorithm for the solution of the first-order wave equation. First of all, one period of the function, i.e., , is chosen, and this interval is discretized into 32 points, i.e., in Equation (15). Thus, the function value of 32 discrete points can be encoded using 5 qubits. Choose in Equation (16). Then , which represents the time interval for each iteration of the system evolution. According to Equation (20), the effect of the action of can be determined as
This gives as . Thus far, the quantum circuit for each iteration of the solution to Equation (25) can be given in Figure 3.
Figure 3.
Example of quantum circuit for solving the first-order wave equation, where .
Numerical simulation of the first 10 iterations of this quantum circuit, whose results are shown in Figure 4. Where the orange curve represents the theoretical value. The blue points represent the results given by the numerical simulation of the quantum solution algorithm.
Figure 4.
Numerical simulation of a quantum solution algorithm for the first-order wave equation.
3. Duality Quantum Algorithm for the Solution of the Traveling Wave Dissipation Problem
By adding the dissipation term to Equation (10), the traveling wave equation with dissipation is obtained as
The Taylor expansion for each term of Equation (27) is
Differentiating Equation (27) yields
The collation leads to
Let and , then the following iterative relation can be obtained
Take the periodic boundary condition that . Then, the equation describing the whole system can be written in the following form
In Equation (32)
in which
Following the encoding method of Equation (12), then the state of the system at the next moment, i.e., the moment , can be expressed as . The matrix , where . Thus the operation of a linear combination of unitary operators can be equivalently implemented by introducing two auxiliary qubits, whose quantum circuit is shown in Figure 5.
Figure 5.
Quantum circuit for solving the dissipation problem of the first-order wave equation.
In the following, the duality quantum algorithm for solving the dissipation problem of the first-order wave equation is explained in conjunction with the quantum circuit (Figure 5), where the first the auxiliary qubits pass through the gate, which has the following effect
Next, after three controlled quantum gates , and the quantum state evolves as
Then, the quantum state evolves after the Hadamard transformation of two auxiliary qubits as
Finally, the auxiliary qubits are measured to select the state of the auxiliary qubit as 00; then the state of the working qubit at this time is , that is
Define the coefficient as
The column vector , which is the state of the system at moments, is obtained by amplifying the amplitude under the computational basis of the quantum state by a factor of .
According to Lemma 5.5 and Lemma 7.1 in article [24] and combined with Figure 5, the computational complexity of this algorithm per iteration is , while the complexity of the classical algorithm is . Thus, the present algorithm has the property of speeding up in each iteration compared to the classical algorithm. The specific calculation of the complexity is presented at the end of this paper.
The following equation will be used as an example
to show the duality quantum algorithm for the solution of the dissipation problem of the first-order wave equation. First, one period of the function is chosen, i.e., , and this interval is discretized into 32 points, i.e., in Equation (28). Thus, the function value of 32 discrete points can be encoded using 5 qubits. Choose and in Equation (31). Then , which represents the time interval for each iteration of system evolution. According to Equation (35), the effect of the action of can be determined as
It is constructed as shown in Figure A1 with Equations (A1) and (A2). The revolving gate of the first auxiliary qubit is constructed according to Equation (A1), such that
It is obtained that is . According to Equation (A3), the controlled operator is to achieve the following action
The controlled operator can be obtained as . At this point, we can give the quantum circuit for each iteration of the solution Equation (40), as shown in Figure 6
Figure 6.
Example of a quantum circuit for solving the dissipation problem of the first-order wave equation, where , .
Numerical simulation of the first 10 iterations of this quantum circuit results in Figure 7. The orange curve represents the resolved theoretical value. The blue points represent the values solved by the numerical simulation of the quantum algorithm.
Figure 7.
Numerical simulation of the quantum solution algorithm for the traveling wave dissipation problem of the first-order wave equation.
4. Duality Quantum Algorithm for Solving Traveling Wave Dispersion Problems
By adding the dispersion term to Equation (10), the traveling wave equation with dispersion is obtained as
Taylor expansion of the terms of Equation (44)
Differentiating Equation (44) yields
Let , , and the following iterative relation can be obtained
Take the periodic boundary condition that . Then the equation describing the whole system can be written in the following form
where
in which
It can be seen that , where
Therefore, the operation of the linear combination of unitary operators can be equivalently implemented by introducing two auxiliary qubits, whose quantum circuit is shown in Figure 8.
Figure 8.
Quantum circuit for solving the dispersion problem of the first-order wave equation.
It is not difficult to find , and the following will be combined with the quantum circuit (Figure 8) to explain the duality quantum algorithm for the solution of the dispersion problem of the first-order wave equation. First, the auxiliary qubits pass through the gate, the effect of which is as follows
Next, after four controlled quantum gates, , , and , the quantum state evolves as
Then, the Hadamard transform is performed for the two auxiliary qubits, and the quantum state evolves as
Finally, the state of the auxiliary qubit is selected as 00 after measurement, then the state of the working qubits at this time is , that is
Define the coefficient as
The amplitude under the computational basis of the quantum state is enlarged times to obtain the column vector , which is the state of the system at the moment . According to Lemma 5.5 and Lemma 7.1 in article [24], and combined with the analysis of Figure 8, we can obtain that the computational complexity of this algorithm for each iteration is , while the complexity of the classical algorithm is . The specific calculation of the complexity is presented at the end of this paper.
The following equation will be used as an example
to show the duality quantum algorithm for the solution of the dispersion problem of the first-order wave equation. Firstly, one period of the function is chosen, i.e., , and this interval is discretized into 32 points, i.e., in Equation (47). Thus, the function value of 32 discrete points can be encoded using 5 qubits. Choose and in Equation (47). Then , which represents the time interval for each iteration of the system evolution. According to Equation (52), the effect of the action of can be determined as
It is constructed as shown in Figure A1 with Equations (A1) and (A2). Construct the revolving gate of the first auxiliary qubit according to Equation (A1), such that
It is obtained that is .
According to Equation (A3), two controlled operators , are to be realized as follows
The controlled operator can be obtained as and as . The quantum circuit for each iteration of the solution Equation (57) so far is given in Figure 9.
Figure 9.
Example of a quantum circuit for solving the dispersion problem of the first-order wave.
Figure 10.
The specific quantum circuit of the R-operation, where , , .
The result of numerically simulating the first 10 iterations of this quantum circuit is shown in Figure 11. The orange curve represents the theoretical value. The blue points represent the values solved by the numerical simulation quantum algorithm.
Figure 11.
Numerical simulation of a quantum solution algorithm for the dispersion problem of the first-order wave equation.
5. Discussion
For a quantum algorithm that solves a d-dimensional partial differential equation (meaning that there are d spatial variables) with a spatial discretization number of N, the output is an approximation of the function f with an error . In fact, for the problem of quantum algorithms solving partial differential equations, the number of discrete points N and the error are interrelated [12,25]. The correlations are as follows
For the preparation of the initial state, its complexity is . The complexity of each iteration of the algorithm in this paper will be given below. First, according to Lemma 5.5 and Lemma 7.1 in article [24], it can be obtained that the controlled gate for n qubits having control qubits can be split into CNOT gates and single-qubit gates for a total of , where . For the quantum circuit in Figure 1, the total number of elementary quantum gates required is
For the quantum circuit in Figure 5, the total number of elementary quantum gates required is
For the quantum circuit in Figure 8, the total number of elementary quantum gates required is
It can be found that the quantum-solving algorithm given in this paper has a quadratic acceleration for each iteration compared to the classical algorithm. However, the state of the auxiliary qubits needs to be selected after measurement at the end of each iteration. This result is probabilistic, and the overall success rate of the algorithm decreases exponentially as the number of iterations increases if the selection is made after each iteration. Therefore, ensuring an overall higher success rate requires the use of the quantum search algorithm [17,18,19,20] to amplify the amplitude of the target state before measurement. Under ideal conditions of the device, it is proved that the Grover–Long algorithm can achieve a 100% success rate in all cases [17,26,27]. Thus, using the Grover–Long algorithm under ideal conditions to amplify the amplitude, it is possible to obtain a 100% success rate every time. If the complexity of each iteration step is considered synthetically, then the complexity of each iteration step is , where M is the dimension of the auxiliary qubits space.
In the future, our quantum algorithms are expected to be combined with finite element methods to solve complex practical problems, such as those related to fluid dynamics [28].
Funding
This research was funded by the National Natural Science Foundation of China under Grants No. 11974205, and No. 11774197; the National Key Research and Development Program of China (2017YFA0303700).
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Not applicable.
Conflicts of Interest
The authors declare no conflict of interest.
Appendix A
The quantum circuit for the preparation of two-qubit arbitrary quantum states is as follows in Figure A1.
Figure A1.
Preparation of two-qubit arbitrary quantum states.
Figure A1.
Preparation of two-qubit arbitrary quantum states.

First, the rotation operator is constructed, such that
In the second step, construct the controlled quantum gates and , such that
where
References
- Lloyd, S. Universal Quantum Simulators. Science 1996, 273, 1073–1078. [Google Scholar] [CrossRef] [PubMed]
- Aharonov, D.; Ta-Shma, A. Adiabatic quantum state generation and statistical zero knowledge. In Proceedings of the Thirty-Fifth Annual ACM Symposium on Theory of Computing, San Diego, CA, USA, 9–11 June 2003. [Google Scholar]
- Berry, D.W.; Childs, A.M.; Cleve, R.; Kothari, R.; Somma, R.D. Simulating Hamiltonian dynamics with a truncated Taylor series. Phys. Rev. Lett. 2015, 114, 090502. [Google Scholar] [CrossRef] [PubMed]
- Low, G.H.; Chuang, I.L. Hamiltonian Simulation by Qubitization. Quantum 2019, 3, 163. [Google Scholar] [CrossRef]
- Harrow, A.W.; Hassidim, A.; Lloyd, S. Quantum algorithm for linear systems of equations. Phys. Rev. Lett. 2009, 103, 150502. [Google Scholar] [CrossRef] [PubMed]
- Leyton, S.K.; Osborne, T.J. A quantum algorithm to solve nonlinear differential equations. arXiv 2008, arXiv:0812.4423. [Google Scholar]
- Berry, D.W. High-order quantum algorithm for solving linear differential equations. J. Phys. A Math. Theor. 2014, 47, 105301. [Google Scholar] [CrossRef]
- Costa, P.C.S.; Jordan, S.P.; Ostrander, A. Quantum algorithm for simulating the wave equation. Phys. Rev. A 2019, 99, 012323. [Google Scholar] [CrossRef]
- Gonzalez-Conde, J.; Rodríguez-Rozas, Á.; Solano, E.; Sanz, M. Pricing financial derivatives with exponential quantum speedup. arXiv 2021, arXiv:2101.0402. [Google Scholar]
- Berry, D.W.; Childs, A.M.; Ostrander, A.; Wang, G. Quantum Algorithm for Linear Differential Equations with Exponentially Improved Dependence on Precision. Commun. Math. Phys. 2017, 356, 1057–1081. [Google Scholar] [CrossRef]
- Childs, A.M.; Liu, J.P. Quantum Spectral Methods for Differential Equations. Commun. Math. Phys. 2020, 375, 1427–1457. [Google Scholar] [CrossRef]
- Cao, Y.; Papageorgiou, A.; Petras, I.; Traub, J.F.; Kais, S. Quantum algorithm and circuit design solving the Poisson equation. New J. Phys. 2013, 15, 013021. [Google Scholar] [CrossRef]
- Gui-lu, L. General Quantum Interference Principle and Duality Computer. Commun. Theor. Phys. 2006, 45, 825–844. [Google Scholar] [CrossRef]
- Long, G.L.; Liu, Y. Duality quantum computing. Front. Comput. Sci. China 2008, 2, 167–178. [Google Scholar] [CrossRef]
- Gui-lu, L.; Yang, L.; Chuan, W. Allowable Generalized Quantum Gates. Commun. Theor. Phys. 2009, 51, 65–67. [Google Scholar] [CrossRef]
- Gudder, S.P. Mathematical Theory of Duality Quantum Computers. Quantum Inf. Process. 2007, 6, 37–48. [Google Scholar] [CrossRef]
- Long, G.L. Grover algorithm with zero theoretical failure rate. Phys. Rev. A 2001, 64, 022307. [Google Scholar] [CrossRef]
- Guilu, L.; Weilin, Z.; Yansong, L.; Li, N. Arbitrary phase rotation of the marked state cannot be used for Grover’s quantum search algorithm. Commun. Theor. Phys. 1999, 32, 335. [Google Scholar] [CrossRef][Green Version]
- Long, G.L.; Li, Y.S.; Zhang, W.L.; Niu, L. Phase matching in quantum searching. Phys. Lett. A 1999, 262, 27–34. [Google Scholar] [CrossRef]
- Zhu, Y.; Wang, Z.; Yan, B.; Wei, S. Robust Quantum Search with Uncertain Number of Target States. Entropy 2021, 23, 1649. [Google Scholar] [CrossRef]
- Berry, D.W.; Childs, A.M.; Kothari, R. Hamiltonian Simulation with Nearly Optimal Dependence on all Parameters. In Proceedings of the 2015 IEEE 56th Annual Symposium on Foundations of Computer Science, Berkeley, CA, USA, 17–20 October 2015; pp. 792–809. [Google Scholar]
- Wei, S.; Ruan, D.; Long, G.L. Duality quantum algorithm efficiently simulates open quantum systems. Sci. Rep. 2016, 6, 30727. [Google Scholar] [CrossRef]
- Childs, A.M.; Kothari, R.; Somma, R.D. Quantum Algorithm for Systems of Linear Equations with Exponentially Improved Dependence on Precision. SIAM J. Comput. 2017, 46, 1920–1950. [Google Scholar] [CrossRef]
- Barenco, A.; Bennett, C.H.; Cleve, R.; DiVincenzo, D.P.; Margolus, N.; Shor, P.; Sleator, T.; Smolin, J.A.; Weinfurter, H. Elementary gates for quantum computation. Phys. Rev. A At. Mol. Opt. Phys. 1995, 52, 3457–3467. [Google Scholar] [CrossRef]
- Montanaro, A.; Pallister, S. Quantum algorithms and the finite element method. Phys. Rev. A 2016, 93, 032324. [Google Scholar] [CrossRef]
- Yoder, T.J.; Low, G.H.; Chuang, I.L. Fixed-point quantum search with an optimal number of queries. Phys. Rev. Lett. 2014, 113, 210501. [Google Scholar] [CrossRef] [PubMed]
- Toyama, F.; Van Dijk, W.; Nogami, Y. Quantum search with certainty based on modified Grover algorithms: Optimum choice of parameters. Quantum Inf. Process. 2013, 12, 1897–1914. [Google Scholar] [CrossRef]
- Kondrashuk, I.; Notte-Cuello, E.A.; Poblete-Cantellano, M.; Rojas-Medar, M.A. On the time-dependent grade-two model for the magnetohydrodynamic flow: 2D case. arXiv 2015, arXiv:1506.00670. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2022 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).










