A Quantum Algorithm For Solving Systems of Nonlinear Algebraic Equations
A Quantum Algorithm For Solving Systems of Nonlinear Algebraic Equations
Received:
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
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
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
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
f¯
( Mji |ji i hji |)Uf¯i Ufi }, (8)
i
i=0 ji =0
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.
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
∂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.
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)
Fig. 2 comparison
5 Conclusion
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
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.