0% found this document useful (0 votes)
66 views10 pages

A Quantum Algorithm For Solving Systems of Nonlinear Algebraic Equations

The document proposes a quantum algorithm to solve systems of nonlinear algebraic equations. The algorithm searches the space of computational basis states to find approximate solutions to the equations. In the ideal case, the complexity of the algorithm is linear in the number of variables n, which is less than the O(n^3) complexity of classical algorithms for many variables. The algorithm represents results in the computational basis for direct readability, unlike most quantum algorithms that use the state vector. It uses the "duality quantum computing" paradigm to enhance the probability amplitude of computational basis states corresponding to solutions.

Uploaded by

ivi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views10 pages

A Quantum Algorithm For Solving Systems of Nonlinear Algebraic Equations

The document proposes a quantum algorithm to solve systems of nonlinear algebraic equations. The algorithm searches the space of computational basis states to find approximate solutions to the equations. In the ideal case, the complexity of the algorithm is linear in the number of variables n, which is less than the O(n^3) complexity of classical algorithms for many variables. The algorithm represents results in the computational basis for direct readability, unlike most quantum algorithms that use the state vector. It uses the "duality quantum computing" paradigm to enhance the probability amplitude of computational basis states corresponding to solutions.

Uploaded by

ivi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Noname manuscript No.

(will be inserted by the editor)

A quantum algorithm for solving systems of nonlinear


algebraic equations

Peng Qian · Weicong Huang · Guilu


Long
arXiv:1903.05608v2 [quant-ph] 14 Mar 2019

Received:

Abstract We propose a quantum algorithm to solve systems of nonlinear


algebraic equations. In the ideal case the complexity of the algorithm is linear
in the number of variables n, which means our algorithm’s complexity is less
than O(n3 ) of the corresponding classical ones when the set of equations has
many variables and not so high orders. Different with most popular way of
representing the results by state vector, we get the results in computation
basis which is readable directly.

Keywords nonlinear algebraic equations · quantum algorithm · dual


quantum computing · quantum searching

1 Introduction

As one of the most important technology in the future of human beings, quan-
tum computation has attracted more and more attention for its way to perform
computation by harnessing quantum mechanics that classical computations

Peng Qian · Weicong Huang


State Key Laboratory of Low-dimensional Quantum Physics and Department of Physics,
Tsinghua University, Beijing 100084, China
Beijing National Research Center for Information Science and Technology, Beijing 100084,
China
Collaborative Innovation Center of Quantum Matter, Beijing 100084, China
Beijing Academy of Quantum Information Sciences, Beijing 100193, China
E-mail: [email protected],[email protected]
Guilu Long
State Key Laboratory of Low-dimensional Quantum Physics and Department of Physics,
Tsinghua University, Beijing 100084, China
Beijing National Research Center for Information Science and Technology, Beijing 100084,
China
School of Information and Technology, Tsinghua University, Beijing 100084, China
E-mail: [email protected]
2 Peng Qian et al.

can not. It is well known that in some problems quantum algorithm sup-
ply a remarkable speedup over their classical counterpart, for example, Shor’s
factoring algorithm[1], Grover’s searching algorithm[2,3], simulating various
quantum systems[4,5,6], HHL’s algorithm for linear equations system[7] and
so on.
In recent years, a number of researches concentrate on simulating Hamilto-
nian or solving linear system problems by quantum algorithm[8,9,10]. Notice
that these algorithms solving linear systems tend to represent results by the
state vector evolved by quantum computer instead of computation basis used
in early times. On one hand this way saves amounts of computing resource for
saving lots of qubits. On the other hand it is hard to extract and read out nu-
merical information. More than that, it’s hard to realize nonlinear functions
acted on these state vector since unitary operators transform the probabil-
ity amplitudes linearly. Therefore for nonlinear problems, we still do not get
appropriate algorithms yet.
In fact Shor in his famous and great algorithm used computation basis to
represent results to solve the nonlinear problem — order finding[1]. We learn
that in this way it is easy to realize nonlinear function operation and extract
results by just measuring computation basis and reading out digital numbers.
Based on these, we develop a new methods to solve systems of nonlinear al-
gebra equations. In essence it searches the whole space of computation basis
to find approximation solutions to equations. However thanks to superposi-
tion principle it finds solution much faster than ever. It’s kind of similar with
Grover’s algorithm while our method finds out multi-variables that satisfy
multiple conditions.
Actually, our method is an application of duality quantum computation
paradigm proposed first by Long[11,12] which realizes the non-unitary oper-
ator by combining several unitary gates through a number of ancilla qubits.
The main idea comes from Double-slit interference. It imagines the state in
quantum computation is a wave function in real space, passing through the
multi-slits each of which corresponds to one unitary operator acting on the
wave function, then intervening at some point behind multi-slits. Many al-
gorithms can be realized through this paradigm, especially for non-unitary
operator that can be decomposed into sum of unitary ones[13,14,15]. We use
this paradigm to make solution found quickly and enhance the probability
amplitude of the corresponding computation basis in total state vector. We
also use some oracles based on the equations to be solved. In general, basic
arithmetic operations have been realized in computation basis[16]. We treat
them as feasible and reliable. What we concern is complexity of them and how
they influence the total speed of the algorithm.
The rest of article is organized as follows: we first give the details of our
algorithm. Then we analyze the complexity of our algorithm and compare it
with the classical ones. In the end we will discuss possible extension of our
algorithm and potential problems in practice before conclusion.
A quantum algorithm for solving systems of nonlinear algebraic equations 3

2 Main algorithm

Assume we want to solve a group of algebraic equations:

{fi (x0 , x1 , · · · , xn−1 ) = 0} , i = 0, 1, 2, · · · , n − 1 (1)

First, we prepare n registers to represent every variable xi , i = 0, 1, · · · , n−


1, that is, for initial state we set it as:
N + N +

z }| { z }| {
|ψ0 i = 0 · · · 0 · · · 0 · · · 0 (2)

| {z }
n

Here, we make this set according to what accuracy we need and the range
for finding the solutions. If range is (0, 2m ), then every register represents an
integer if N < m and a rational number if N > m and latter N − m digits
represent decimal. N
We apply Hadamard matrix H N n to transform initial state to:
r !n N
2X −1
N 1
Nn
|ψ1 i = H |ψ0 i = |x0 i · · · |xn−1 i (3)
2N x0 ···xn−1 =0

We now add an ancilla register to make preparation for computation of


oracle in the later computation:
r !n r N
NX
 2X −1 0 −1
1 1
|ψ1 i → |x0 i · · · |xn−1 i ei2πa/N0 |ai (4)
2N N0 0 a=0

This register can be prepared by applying a quantum fourier transformation


on a log N0 qubits state |0 · · · 0i which is easy to see.
For some oracle, we apply it on one state to get:
r x r N0 −1
1X 1 X
Uf |Φi → |xi ei2πa/N0 |a ⊕ f (x)i (5)
x N0 a=0

and redefine a and get a extra common phase which reads:


r x r N0 −1
1X 1 X
|xi ei2πf (x)/N0 ei2πa/N0 |ai (6)
x N0 a=0

The procedure described above is so-called ”phase kickback”[17], in which N0


is chosen to be fit with our computation.
Now we put this aside for a moment and apply Ufi into the initial state
for i = 0, · · · , n − 1. Before doing that we first insert two zero registers into
4 Peng Qian et al.

the state for storage of the computation results. Besides we add some control
qubits for further application of oracles. Here, we take N0 = 2:

r !n r !n+1 2N −1 1 1 1
1 1 X X X X
|ψ1 i → |x0 i · · · |xn−1 i |0i|0i eiπa |ai |η0 i · · · |ηn−1 i
2N 2 0 a=0 η =0 η =0 0 n−1

(7)
and then apply the unitary operator:

n−1
O 1
X
{Uf−1
i
U −1

( Mji |ji i hji |)Uf¯i Ufi }, (8)
i
i=0 ji =0

where each i corresponds a equation. For distinction we will write ”I” as


imaginary unit and ”i” as index number.
Here, we take Ufi which makes computation of corresponding equation
function fi and put the result into the first zero register, which reads Ufi |xi|yi · · · |0i =
|xi|yi · · · |fi (x, y, · · · )i. We take a oracle f¯i we name with ”check oracle” which
counts whether the first few λ digits of results are zero on range of solution
and power of equation. If it is, the second zero register will not change. If not,
the second zero register becomes |1i. Mj i adds this result to ancilla register
P1 P1 
a=0 e
Iπa
|ai, changing it to a=0 eIπa (a ⊕ ji ∗ f¯i i. Then we use Uf¯i and
Uf−1
i
to restore the zero register.
We use ”phase kickback” and give the detailed process:

N
2X −1 1
X 1
X 1
X
Uf0
|ψ1 i −−→ |x0 i · · · |xn−1 i |f0 (x0 · · · xn−1 )i|0i eiπa |ai |η0 i · · · |ηn−1 i
0 a=0 η0 =0 ηn−1 =0
N
2X −1 1 1 1
Uf¯ X X X
0
−−→ |x0 i · · · |xn−1 i |f0 (x0 · · · xn−1 )i|f¯0 (x0 · · · xn−1 )i eiπa |ai |η0 i · · · |ηn−1 i
0 a=0 η0 =0 ηn−1 =0
P1
j =0 Mj0 |j0 ihj0 |
−−−0−−−−−−−−−→
X X1 1
X 1
X

|x0 i · · · |xn−1 i |f0 i|f¯0 i( eiπa a ⊕ 0 ∗ f¯0 |0i + eiπa a ⊕ 1 ∗ f¯0 |1i) |η1 i · · · (9)
a=0 a=0 η1 =0

X 1
X 1
X
¯
→ |x0 i · · · |xn−1 i |f0 i|f¯0 i eiπa |ai (|0i + eIπf0 |1i) |η1 i · · ·
a=0 η1 =0
P1 P1
Uf−1 Uf−1
¯ Uf−1 Uf−1
¯ ( j1 =0 Mj1 |j1 ihj1 |)Uf¯1 Uf1 Uf−1 Uf−1
¯ ( jn−1 =0 Mjn−1 |jn−1 ihjn−1 |)Uf¯n−1 Ufn−1
0 0 1 1 1 1
· · · −−−−−→ · · · −−−−−−−−−−−−−−−−−−−−−−−→ · · · −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−→
X 1
X ¯ ¯
→ |x0 i · · · |xn−1 i |0i|0i eiπa |ai (|0i + eIπf0 |1i) · · · (|0i + eIπfn−1 |1i)
a=0
A quantum algorithm for solving systems of nonlinear algebraic equations 5

Fig. 1 circuit

N
We again apply a Hadamard operator H n on ancilla qubits |j0 i · · · |jn−1 i.
For those qubits satisfy f¯0 · · · f¯n−1 = 0, it looks like this:

N
2X −1 1
X
|x∗0 i · · · |x∗n−1 i|0i|0i eIπa |ai |0i. (10)
0 a=0

While qubits presenting other variable values will get an zero amplitude in
this ancilla |0i for orthogonality. This can be seen easily that (|0i+|1i) · · · (|0i+
|1i)(solutions’ ancilla qubits) is orthogonal to others like (|0i + |1i) · · · (|0i −
|1i · · · ) and Hadamard rotation will not change this orthogonality so that
qubits presenting other variable values will in ancilla qubits other than |0i.
Actually, process above is a dual quantum computation in which we realize a
complicated linear combination of unitary operators that cancel the undesired
state and get the state we want.
Now we have to get into |0i in register so that only solution states are
left behind. This can be done with amplitude amplification[18] or measure-
ment(repeating until success). Obviously the best way is amplitude amplifica-
tion.
N
We repeat acting U0 = I − 2I |0i h0| and U1 = I − 2|Ψ ihΨ | where |Ψ i is
the state we get in last step until we have a relatively large chance to measure
|0i in ancilla qubits. If we first require the equations
√ to be zero in first few
λ
λ qubits then we loop these operations about 2 and measure the ancilla
qubits to make sure it is in |0i,
However, we only get to approximation solution. We will then use gradient
descent to find accuracy solutions. For simplicity we ignore all the normalized
factors and add l−(N −m) zero qubits to every variable register if our accuracy
requirement is 2−l .
X ′
|x∗0 i |0 · · · 0i · · · |x∗n−1 i |0 · · · 0i eiπa/N |ai. (11)
| {z } | {z } ′
l−(N −m) l−(N −m) N
6 Peng Qian et al.

We add every register |x∗i i to corresponding |yi i, which is a complete set


of corresponding accuracy, and rewrite variable register |x∗i i |0 · · · 0i as |x∗i i.
| {z }
l+m−N
We apply UF to get:
X X X ′
|y0 + x∗0 i · · · |yn−1 + x∗n−1 i eiπa/N |ai, (12)
y0 yn−1 N′

P ′
where F = i fi2 , N is a parameter suited with accuracy[17]. We use ”phase
kickback” and do the quantum fourier transformation to get

2m+l ∂F 2m+l ∂F
| ix∗0 · · · | ix∗ (13)
s ∂x0 s ∂xn−1 n−1

where s stands a range we set in oracle UF to bound derivatives of F . We mul-


tiply this by a small negative constant α and add it to register |x∗0 i · · · |x∗n−1 i
to get new value |x∗∗ ∗∗
0 i · · · |xn−1 i.

∂F ∂F
|x∗0 + α ix∗0 · · · |x∗n−1 ix∗ (14)
∂x0 ∂xn−1 n−1

We repeat the same procedure as above again and again until convergence.
This is analogous to classical gradient descent. At last we just need measure
register and read out the results.

3 One simple example

Here, we take a simple example to see how our method works. We take a
ternary nonlinear systems of equations:

3 2
x + y − y + 2z = 35

y 3 − x + 2zx = 50 (15)

 3
z − z 2 + 2x − 2y = 20

In real range {0, 23 } with four decimal accuracy we have one solution {2.7689, 3.2834, 3.1370}.
In our method, we first set accuracy to inter part which means we take λ = 3
just need the inter part bits of equation to be zero. That is to say we take f
to check the inter part of results of function oracle are whether all equal to
zero. We set N = 6, m = 3. Then we take three equation function oracle to
act N
on, for example, the state |010.110i|011.010i|011.001i|0i|0i(|0i − |1i)(|0i +
|1i) 3 (in decimal system{2.75, 3.25, 3.125}, an approximation solution). We
found the qubit is unchanged after action. Here, we drop the normalization
constant for simplicity. Then after Hadamard gate acted on last three ancilla
qubits to get |010.110i|011.010i|011.001i|0i|0i(|0i−|1i)|0i. While for the other
A quantum algorithm for solving systems of nonlinear algebraic equations 7

N
3
state, for example, |011.010i|010.010i|011.100i|0i|0i(|0i − |1i)(|0i + |1i) (in
decimal system{3.25, 2.25, 3.125})
N
3
|011.010i|010.010i|011.100i|0i|0i(|0i − |1i)(|0i + |1i)
Uf N
1 3
−−→ |011.010i|010.010i|011.100i|10001.1011i|0i(|0i − |1i)(|0i + |1i) (16)
Uf¯1 N
3
−−→ |011.010i|010.010i|011.100i|10001.1011i|1i(|0i − |1i)(|0i + |1i)

M1 |1ih1|+M0 |0ih0|
−−−−−−−−−−−−→
N
|011.010i|010.010i|011.100i|10001.1011i|1i(|0i − |1i)|0i(|0i + |1i) 2 (17)
N
2
+ |011.010i|010.010i|011.100i|10001.1011iM1|1i(|0i − |1i)|1i(|0i + |1i)

f¯1 checks |10001.1011i to see if the inter part is zero. Obviously, |10001.1011i
is not. Therefore the second zero register becomes |1i. M1 add this result to
ancilla (|0i − |1i), changing it to −(|0i − |1i) while M0 is equivalent to I:
N
2
→ |011.010i|010.010i|011.100i|10001.1011i|1i(|0i − |1i)|0i(|0i + |1i)
N
2
+ |011.010i|010.010i|011.100i|10001.1011i|1i(|1i − |0i)|1i(|0i + |1i)
N
2
→ |011.010i|010.010i|011.100i|10001.1011i|1i(|0i − |1i)(|0i − |1i)(|0i + |1i)
Uf−1 −1
N
(18)
¯ ,Uf
1 1 2
−−− −−−→ |011.010i|010.010i|011.100i|0i|0i(|0i − |1i)(|0i − |1i)(|0i + |1i)
···
N
3
→ |011.010i|010.010i|011.100i|0i|0i(|0i − |1i)(|0i − |1i)

After Hadamard gate action, the state becomes |011.010i|010.010i|011.100i|0i|0i(|0i−


|1i)|111i. Obviously, as we have proposed, all approximation solutions are in
subspace |0i. If it is not, then it will be in other subspace. From this we find
we can quickly find approximation solution after amplitude amplification we
describe above. Then we just need to run few iteration of gradient descent to
get accurate solution.

4 Complexity of the algorithm

For discussing the complexity of our algorithm, we need to count computing


source each oracle costs. For basic arithmetic oracles like multiply we treat its
complexity as O(N 2 ) [16] where N is the size of our input. Note the highest
order of group of equation is h and the maximum number of terms of equa-
tions t, then the total number of basic operations we need for one equation
oracle is O(thN 2 ). The operator (8) will need O(nthN 2 ) elementary oper-
ations. Of course this analysis depends on how the elementary operation is
defined and which oracle for f¯i we choose. Here we just estimate the complex-
ity order in ideal cases. After this we use amplitude amplification to get the
8 Peng Qian et al.

Fig. 2 comparison

approximate value. We need about O(2λ/2 ) rotations. Therefore we need total


O(2λ/2 nthN 2 ) operations.
In gradient descent process, oracle UF costs O(nth(l + m)2 ). We may set
iteration times as a small number c since we have got approximation solution.
At last we find that the total number of elementary operations in procedure
will be O(2λ/2 nthN 2 + cnth(l + m)2 ). λ is close to hm. Therefore complexity is
linear in n but exponential in h. For high order systems of equations we need
to lower down approximation in first process to reduce complexity.
Now let’s get a look at number of qubits our algorithm needs. For gradient
descent process, we need 2n(l + m) qubits for registers. The ancilla qubits for

oracle to make ”phase kick-back” depend on oracle UF . We note it as log N .
For accuracy it needs to be almost equal to O(2h(m + l)). Also for temporary
store of results of F we need O(2h(m + l)). The control qubits corresponding
to the operator (8) need about O(n) qubits. What’s more, there is a need of
O(hN ) qubits for temporary store for computation results of function oracle
of equations fi . In sum, we need O(4h(m + l) + hN ) qubits for total store.
The number depends heavily on the highest order of equations and accuracy
requirement. Therefore for large order equations we may not obtain solution
because computation result of function oracle is out of our computation source.
However this situation is not so common for it means relatively large solution.
What about classical ones? The most common numerical method to solve
these equations is Newton’s iterative method which requires to solve the inverse
matrix of Jacobian matrix for derivatives of each function with respect to
each variable. This will cost about O(n3 ) operators for n variables. For further
consideration, we still need to count complexity for each operator consisting of
elementary arithmetic computation as for our quantum one. Then one will cost
O(ht(l + m)2 ) computations. In total it will have a complexity of O(htn3 (l +
m)2 ) at one iteration. Considering that it will iterate many times until it
converges to some point and this depends on choice of initial values sensitively,
we think our algorithm will have a better performance when we have many
number of variables.
In general our algorithm is similar to Grover’s searching algorithm[2]. While
in his algorithm it searches one solution to one condition. We think we extend
to multi-variable problems. Notice that when the highest order is 1, equations
reduce to linear equations which have been researched frequently in recent
year. In this case our algorithm will have a complexity of O(ntN 2 ) better
than classical ones, although it is not so well as HHL’s[7].
A quantum algorithm for solving systems of nonlinear algebraic equations 9

We show a suitable way to solve nonlinear equations. However we know


that there are many possible solution for one group of nonlinear equations
and we may also meet the situation that we don’t get the solution at all. In
the former case, we have to repeat computation and measurement to get full
solution. While in the latter case we may need to change the range for our
initial register. That may cost more sources and we will hope that future’s
quantum computer may give us a enough powerful computation source.

5 Conclusion

In this paper we give a new algorithm to solve systems of nonlinear algebraic


equations. Since we get a complexity linear in number of variable in systems
of equations, we think our algorithm is better than classical ones. We can also
change storage for results to adjust accuracy for results if we need as classical
ones. Moreover, Based on computation basis we can read solution directly. One
can also treat our algorithms as a multi-conditions and multi-variables search
method. But for practice use we require future quantum computers to have
enough qubits to store data in our algorithm. And for high order functions
we’re going to improve our algorithm and the related research is undertaken.

Acknowledgements This work was supported by the National Basic Research Program
of China under Grant Nos. 2017YFA0303700 and 2015CB921001, National Natural Science
Foundation of China under Grant Nos. 61726801, 11474168 and 11474181.

References

1. P. W. Shor. Polynomial-time algorithms for prime factorization and discrete logarithms


on a quantum computer. SIAM Review, 41:1484–1509, 1997.
2. K. L. Grover. A fast quantum mechanical algorithm for database search. Proceedings of
the 28th Annual ACM Symposium on the Theory of Computing, pages 212–219, 1996.
3. G. L. Long. Grover algorithm with zero theoretical failure rate. Physical Review A,
64:022307, 2001.
4. S Lloyd. Universal quantum simulators. Science, 273(5278):1073–1078, 1996.
5. R Gerritsma, G Kirchmair, F Zahringer, E Solano, R Blatt, and C. F. Roos. Quantum
simulation of the dirac equation. Nature, 463(7277):68–71, 2010.
6. S. P. Jordan, K. S. Lee, and J Preskill. Quantum algorithms for quantum field theories.
Science, 336(6085):1130, 2011.
7. A. W. Harrow, A Hassidim, and S Lloyd. Quantum algorithm for linear systems of
equations. Physical Review Letters, 103(15):150502, 2009.
8. S Lloyd, M Mohseni, and P Rebentrost. Quantum principal component analysis. Nature
Physics, 10(9):108–113 vol. 1, 2014.
9. D. W. Berry, A. M. Childs, R Cleve, R Kothari, and R D. Somma. Exponential improve-
ment in precision for simulating sparse hamiltonians. In Forty-Sixth ACM Symposium
on Theory of Computing, pages 283–292, 2014.
10. D. W. Berry, A. M. Childs, A Ostrander, and G. M. Wang. Quantum algorithm for
linear differential equations with exponentially improved dependence on precision. Com-
munications in Mathematical Physics, 356(3):1057–1081, 2017.
11. G. L. Long. The general quantum interference principle and the duality computer.
Communications in Theoretical Physics, 45(5):825–844, 2006.
10 Peng Qian et al.

12. G. L. Long. Duality quantum computing and duality quantum information processing.
International Journal of Theoretical Physics, 50:1305–1318, 2011.
13. S. J. Wei, D Ruan, and G. L. Long. Duality quantum algorithm efficiently simulates
open quantum systems. Scientific Reports, 6:30727, 2016.
14. S. J. Wei, Z. R. Zhou, D Ruan, and G. L. Long. Realization of the algorithm for sys-
tem of linear equations in duality quantum computing. In IEEE Vehicular Technology
Conference: Vtc2017-Spring, pages 1–4, 2017.
15. S. J. Wei, T Wang, D Ruan, and G. L. Long. Quantum computing. In Scientia Sinica
Informationis, pages 1277–1299, 2017.
16. V Vedral, A Barenco, and A Ekert. Quantum networks for elementary arithmetic op-
erations. Physical Review A, 54(1):147, 1996.
17. S. P. Jordan. Fast quantum algorithm for numerical gradient estimation. Physical
Review Letters, 95(5):050501, 2005.
18. G Brassard, P Hoyer, M Mosca, and A Tapp. Quantum amplitude amplication and
estimation. arXiv:quant-ph/0005055, 2000.

You might also like