Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Open Phys.

2019; 17:839–849

Research Article

Theerapat Tansuwannont, Surachate Limkumnerd, Sujin Suwanna, and Pruet Kalasuwan*

Quantum Phase Estimation Algorithm for Finding


Polynomial Roots
https://doi.org/10.1515/phys-2019-0087
Received Aug 14, 2019; accepted Oct 25, 2019
1 Introduction
Abstract: Quantum algorithm is an algorithm for solving Roots finding is a centuries-old problem that has contin-
mathematical problems using quantum systems encoded ued to attract considerable research interests and efforts
as information, which is found to outperform classical al- due to its relevance in many fields of mathematics and
gorithms in some specific cases. The objective of this study physics involving geometry, number theory, probability
is to develop a quantum algorithm for finding the roots and combinatorics. It is well known that for a polynomial
of n th degree polynomials where n is any positive integer. of degree 4 or less, there exists a formula or procedure to
In classical algorithm, the resources required for solving solve for its roots exactly [1]. However, such a task is im-
this problem increase drastically when n increases and it possible for a polynomial of degree 5 or greater [2]. Many
would be impossible to practically solve the problem when root-finding algorithms have been devised for obtain ap-
n is large. It was found that any polynomial can be re- proximated roots of a polynomial of arbitrary degree [3–5].
arranged into a corresponding companion matrix, whose The plausibility of a quantum computer—a new type
eigenvalues are roots of the polynomial. This leads to a pos- of computation, which embraces quantum mechanics into
sibility to perform a quantum algorithm where the number its information, algorithms, and output measurements—
of computational resources increase as a polynomial of n. has entailed quantum algorithms. A simple enhancement
In this study, we construct a quantum circuit representing by rather non-intuitive mathematics of quantum mechan-
the companion matrix and use eigenvalue estimation tech- ics like superposition, the uncertainty principle, and en-
nique to find roots of polynomial. tanglement, brings quantum algorithms forth to a new
level of computation unreachable before by conventional
Keywords: Quantum algorithm; Quantum phase estima-
computers with classical algorithms. For example, the
tion; Eigenvalue problems; Polynomial roots.
Shor’s algorithm, an algorithm to factorize a large integer
PACS: 02.90.+p,03.67.a into a product of primes, is proven in principles to over-
come the classical-algorithm limit in terms of speed [6]. A
breakthrough in quantum simulation is expected to bring
eminent impact into science and technology [7, 8]. Re-
*Corresponding Author: Pruet Kalasuwan: Department of cent progress on the actual quantum devices, such as a
Physics, Faculty of Science, Prince of Songkla University, Hat-Yai, successful small-molecule simulation [9–12] or probing
Songkhla, 90112, Thailand; Email: pruet.k@psu.ac.th the statistics of quantum systems [13–15], have yielded
Theerapat Tansuwannont: Institute for Quantum Computing and high promises and attracted immense interests. The ad-
Department of Physics and Astronomy, University of Waterloo,
vancement of computation and simulation in the afore-
Waterloo, Ontario, N2L 3G1, Canada, Department of Physics, Faculty
of Science, Chulalongkorn University, Phayathai Road, Patumwan, mentioned examples owes largely to a common underly-
Bangkok, 10330, Thailand, Collaborative Research Unit on Quantum ing method called phase estimation algorithm (PEA) [16].
Information, Department of Physics, Faculty of Science, Mahidol Still, PEA can be improved, especially at the fundamental
University, Rama VI Road, Ratchathewi, Bangkok, 10400, Thailand algorithm of finding roots of a polynomial.
Surachate Limkumnerd: Physics of Energy Materials Research
However, PEA is only applicable to unitary operators
Unit, Department of Physics, Faculty of Science, Chulalongkorn
University, Phayathai Road, Patumwan, Bangkok, 10330, Thailand,
which are not always the case for some quantum algo-
Thailand Center of Excellence in Physics, Ministry of Higher Edu- rithms; for instance, the phase measurement under the
cation, Science, Research and Innovation, 328 Si Ayutthaya Rd., circumstance where decoherence is present in the pro-
Bangkok 10400, Thailand cess [17]. In a measurement process of the quantum algo-
Sujin Suwanna: Collaborative Research Unit on Quantum Informa- rithm, the non-unitary matrices also play key roles as pro-
tion, Department of Physics, Faculty of Science, Mahidol University,
jective operators. In order to modify existing PEA to be
Rama VI Road, Ratchathewi, Bangkok, 10400, Thailand

Open Access. © 2019 T. Tansuwannont et al., published by De Gruyter. This work is licensed under the Creative Commons Attri-
bution 4.0 License
840 | T. Tansuwannont et al.

suitable for eigenvalue problems comprehensively, a pro- number of qubits which can be implemented is very lim-
grammable circuit, and measurement of the control and ited. Iterative Phase Estimation Algorithm (IPEA) is an al-
ancillary qubits are recently exploited to tailor-made any gorithm improved from the original PEA with an aim to
arbitrary matrix [18]. The great advantage of this proposed estimate ω j up to b th digit while using only one ancillary
scheme is that any matrix can be constructed and the con- qubit together with b iterations as a result of scalable in-
trol gate of the respective matrix can be realized, paving verse quantum Fourier transform in a semi-classical man-
ways to build a quantum computer which can calculate ner [25, 26]. In order to explain the algorithm as illustrated
eigenvalue of any matrix. However, some drawbacks exist in Figure 1, we first assume that the phase parameter ω j
as the algorithm itself may not be efficient for complicated has a binary expansion no more than b digits (written as
matrices, which quantum complexity arises following the ω j = 0.x1 x2 x3 . . . x b 000 . . .). Initially, all of the ancillary
increasing number of non-zero matrix elements [19]. Fur- qubits are prepared in state |0⟩ and the target register is
ther investigation on the algorithm in terms of appropriate prepared in the eigenstate |ψ j ⟩ of unitary operator U. A
complexity is still needed. Hadamard gate is applied to the control register in order to

Our main aim in this paper is to propose a mod- prepare state (|0⟩ + |1⟩) / 2. In the first iteration (k = 1), a
b−1
ified quantum phase estimation algorithm for finding c-U 2 and [︃ ]︃
polynomial roots, where we present a benchmark imple- 1 0
Z (θ k ) = , (1)
mentation of quantum non-unitary eigenvalue calculation 0 e−iθ k
scheme for polynomials. This specific task represents the where θ1 = 0 are applied. After that, the second Hadamard
least complex eigenvalue, which the algorithm can be fruit- gate is applied on the control qubit and its state is mea-
ful without too much concern over the complexity. sured in the computational basis {|0⟩, |1⟩}. This results in
This article is organized as follows. The remaining state
subsections of this section will cover key concepts and
1 [︀
ideas about the phase estimate algorithm, and the iterated (1 + e2πi(0.x b ) )|0⟩ + (1 − e2πi(0.x b ) )|1⟩ ,
]︀
(2)
2
phase estimate algorithm (IPEA) for unitary operators, as
well as the quantum algorithm to find complex eigenval- whose measurement gives either 0 or 1, and is determined
ues of a general matrix. In Section II, we present our mod- by the majority probability between |0⟩ and |1⟩. This mea-
ified PEA and IPEA, together with the companion matrix surement result consequently dictates the value of x b . The
b−k
approach, and more importantly, the circuit design to esti- next iteration is performed with the c-U 2 and Z (θ k ),
mate roots of a polynomial of degree n. There we focus our where θ k = 2π (0.0x b−k+2 x b−k+3 . . . x b ) is calculated by the
presentation of the circuit operation and outputs, leaving feed-forwarded measurement result of the prior iterations
the discussion and complexity analysis in Section III. Fi- up to x b−k+1 . The algorithm is finished when the digit x1 is
nally, the conclusions are summarized in Section IV. obtained.

1.1 PEA and IPEA for Eigenvalue Problems of


Unitary Operators

In the original version of PEA, a phase φ arising after a uni-


tary evolution U with eigenvalue exp(2πφi) is operated on
its basis. Because a quantum evolution can be interpreted Figure 1: A circuit for the kth iteration of the IPEA where θ k is the
feedback from prior iterations.
by a phase factor U = exp(−iHt/~), where H is a Hamilto-
nian of a finite system, the phase as a result of the phase
estimation algorithm is indeed the eigenvalue of the Hamil-
The original IPEA has been used to determine only the
tonian. PEA has also been introduced as a potential quan-
phase parameter ω j of the eigenvalue λ j = e2πiω j of a uni-
tum tool to effectively solve various eigenvalue problems
tary matrix U. In general, however, an eigenvalue of a non-
involving unitary operators [20–23]. The unitary operators
unitary operator can be written as λ j = |λ j |e2πiω j . The stan-
play a central role in all of the quantum algorithms, as they
dard IPEA therefore cannot be applied without the knowl-
are required for universal quantum computations [24].
edge of modulus |λ j |.
In order to estimate the value of a phase parameter
ω j up to the b bit-precision using PEA, b ancillary qubits
in control register are required. In practice, however, the
Quantum Phase Estimation Algorithm for Finding Polynomial Roots | 841

1.2 Quantum Algorithm for Finding Complex eigenvalue problem of a non-unitary operator. First of all,
Eigenvalues of General Matrices consider

Recently, Daskin et al. have introduced their technique to p(x) = x n + a n−1 x n−1 + · · · + a1 x + a0 ; (6)
find the complex eigenvalues of general matrices [18]. In or-
it can be factorized into the form
der to employ the IPEA on the non-unitary operators, first
of all, the non-unitary operator O has to be controlled by p(x) = (x − z1 )(x − z2 ) · · · (x − z n ), (7)
b−k
a phase qubit and the c-U 2 in Figure 1 is replaced by c-
O2 .
b−k
where z1 , z2 , . . . , z n ∈ C are the roots of p(x). From gen-
In the scheme proposed by Daskin et al., the decompo- eral linear algebra [27], the roots of polynomial p(x) are
sition of the control gate of the non-unitary operator O of eigenvalues of its companion matrix defined as
size N = 2m uses the programmable circuit design, which ⎡
0 1 0

requires m +1 ancillary qubits and m main qubits [18]. The ⎢ 0 1 0 ⎥
operator O generally has a eigenvalue of the form |λ j |e2πiω j .
⎢ ⎥
Cp = ⎢
⎢ .. .. ⎥
(8)
In case that ω j = 0.x1 000 . . ., an operation of c-O followed ⎢ . . ⎥

⎢ ⎥
by the Hadamard gate gives an output state
⎣ 0 1 ⎦
[︁(︁ )︁ (︁ )︁ ]︁ −a0 −a1 · · · −a n−2 −a n−1
1 + |λ j |e2πi(0.x1 ) |0⟩p + 1 − |λ j |e2πi(0.x1 ) |1⟩p |ψ j ⟩m , (3)
2 n−1
{︀ }︀
where p and m denote phase qubit and main qubits, re- with respect to the basis 1, x, x , . . . , x .
b−k
spectively. As can be seen, the c-O2 can be realized by Daskin’s algorithm requires that the absolute value
the decomposition proposed by Daskin et al. It is also pos- of every coefficient a i must be less than or equal to 1,
sible to estimate its phase ω j via the IPEA from the prob- since rotation gates are used to simulate these coefficients.
ability shown in (3) in the same fashion as the phase es- Therefore, we introduce a scaling method to meet this re-
timation results determined by (2). However, the true nov- quirement. Let amax denote the greatest absolute value of
elty of the scheme is in the estimation of |λ j |—taking the a0 , a1 , . . . , a n . We choose a basis of circuit in the x-mode
calculation to a complete eigenvalue estimation for any or (1/x)-mode depending on whether |a n | or |a0 | is greater
non-unitary matrix. Following the result shown in (3), the to maximize the success probability of the circuit scheme.
value of |λ j | is related to the probability P0 or P1 of find- In case |a n | > |a0 |, the x-mode will be chosen, so the
ing the phase qubit in states |0⟩ or |1⟩, respectively. Let polynomial p(x) can be equivalently expressed in the form
P = max{P0 , P1 }, so that we can estimate |λ j | as a n n a n−1 n−1 a a
√ x + x + · · · + 1 x + 0 = 0. (9)
|λ j | = 2N 2 P − 1, (4) amax amax amax amax
Let µ = amax /a n be a scaling factor. Then the correspond-
where N is the dimension of matrix. In practice, |λ j | is de-
ing eigenvalue equation is written as
termined by the statistics of the measurement. We can also
improve the accuracy of the estimation by using the statis-
⎡ an ⎤⎡ ⎤
0 amax 0 1
tics from other iterations. For the kth iteration after which ⎢ 0 an
amax 0 ⎥⎢ x ⎥
b−k ⎢ ⎥⎢ ⎥
c-O2 is operated followed by Z(θ k ) and the Hadamard ⎢ .. .. ⎥⎢ . ⎥
. (10)
⎢ . . ⎥⎢ . ⎥
⎥ ⎢ ⎥
gate, the relationship between P(k) and |λ j | becomes

⎢ a ⎥ ⎢ n−2 ⎥
b−k
√︀ ⎣ 0 amax
n ⎦ ⎣x ⎦
|λ j |2 = 2N 2 P(k) − 1. (5) − aamax
0
− aamax
1
· · · − aamax
n−2
− aamax
n−1
x n−1
⎡ ⎤⎡
Since we can estimate both |λ j | and ω j , the complex eigen- 1
0 0

µ 1
value λ j can be determined. ⎢
0 1
0 ⎥⎢ x ⎥
⎥⎢
⎢ µ ⎥
⎥ ⎢ .. ⎥
⎢ ⎥⎢
=⎢
⎢ .. ..
. . . ⎥
⎥ ⎥
⎢ ⎥⎢
1 ⎥ ⎣ x n−2 ⎦
⎢ ⎥
0

µ ⎦
2 Quantum Algorithm for Finding

−a′0 −a′1 · · · −a′n−2 −a′n−1 x n−1
Polynomial Roots ⎡
1

⎢ x ⎥
⎢ ⎥
2.1 Companion Matrix Approach x⎢ . ⎥
= ⎢ .
. ⎥.

µ⎢ ⎢ n−2 ⎥
⎣x ⎦
As the aim of this study is to find roots of a generic poly-
nomial of degree n, we can formulate this problem as the x n−1
842 | T. Tansuwannont et al.

Figure 2: Polynomial Representative Circuit (PRC) which is used to represent an operation of a companion matrix.

where a′i = a i /amax . The eigenvalue of modified compan- However, the traditional companion matrix as de-
ion matrix is x/µ. scribed in (8) has 1’s in the upper diagonal entries but all of
On the other hand, if |a0 | > |a n |, the (1/x)-mode will such entries of the modified companion matrices as shown
be used. Dividing the polynomial p(x) by amax x n leads to in (10) and (12) have absolute values less than 1. To rec-
(︂ )︂n (︂ )︂n−1 tify this, we introduce a scaling gate S m,µ which will be
a0 1 a 1
+ 1 + ··· (11) explained in details later; see Equation (21).
amax x amax x
(︂ )︂
a 1 an
+ n−1 + = 0.
amax x amax
2.2 Quantum Circuit Design
In this case, a scaling factor is µ = amax /a0 , and the corre-
sponding eigenvalue equation is in the form Our design of the respective algorithm relies on Polyno-
⎡ a0 ⎤⎡ ⎤ mial Representative Circuit (PRC), a circuit to represent
0 amax 0 1
a0 this modified companion matrix as illustrated in Figure 2.
⎢ 0 amax 0 ⎥ ⎢ 1/x ⎥
⎢ ⎥⎢
⎥⎢ . ⎥
⎥ PRC requires m main qubits and 2 ancillary qubits where
⎢ .. ..
. . ⎥ ⎢ .. ⎥ (12) 2m = n is a degree of the polynomial. (Although it is in-
⎢ ⎥ ⎢ ⎥

a0 ⎦ ⎣
1/x n−2 ⎦ convenient, the circuit is also applicable for n ≠ 2m sim-
⎢ ⎥ ⎢ ⎥
⎣ 0 amax
− aamax
n
− aamax
n−1
· · · − aamax
2
− aamax
1
1/x n−1 ply by shifting the degree of polynomial up to the nearest
power of 2.) First, let the main qubit be prepared in the ini-
⎡ ⎤⎡
1
0 0 1

µ 1
1 tial state :
0 0 1/x ⎥
⎢ ⎥
⎢ µ ⎥⎢
⎥⎢ ⎥
⎥ ⎢ .. ⎥

.. ..
⎢ ⎡ ⎤
=⎢

. . α0
. ⎥
⎥ ⎥
⎢ ⎥⎢ ⎢ α ⎥
1 ⎥ ⎣1/x n−2 ⎦ ⎢ 1 ⎥
⎢ ⎥
0

⎣ µ ⎦ ⎢ . ⎥
−a′0 −a′1 · · · −a′n−2 −a′n−1 1/x n−1 ⎢ .. ⎥ ,
|α⟩ = ⎢ (13)

⎢ ⎥
⎡ ⎤ ⎣α n−2 ⎦
1
⎢ 1/x ⎥ α n−1
⎢ ⎥
1 ⎢ ⎢ .. ⎥ ,

= . and we define |β⟩ as a result of C p operating on |α⟩; i.e.
µx ⎢ ⎢ ⎥
⎣1/x n−2 ⎦

C p |α⟩ = |β⟩. (14)
1/x n−1

where a′i = a n−i /amax in this case. Note that the eigenvalue
of the modified companion matrix is 1/µx.
Quantum Phase Estimation Algorithm for Finding Polynomial Roots | 843

Multiplying |α⟩ by the modified companion matrix from by a matrix as follows:


(10) or (12) gives |β⟩ in the form: ⎡ √︁ ⎤
a′i 1 − a′i 2
R i = ⎣ √︁ ⎦, (17)
⎡ ⎤
α1
⎢ α ⎥ − 1 − a′i 2 a′i
⎢ 2 ⎥
⎢ . ⎥
⎢ .. ⎥ ,
|β⟩ = ⎢ (15) where i = 0, 1, 2, . . . , n − 1. Accordingly, the array of R i

forms the block matrix F µ as follows:
⎢ ⎥
⎣ α n−1 ⎦
−a⃗′ · ⃗α ⎡ ⎤
R1
where a⃗′ · ⃗α = a′0 α0 + a′1 α1 + · · · + a′n−1 α n−1 . Similar to the
⎢ .. ⎥
Fµ = ⎢

⎢ . ⎥
⎥. (18)
circuit introduced by Daskin et al., our circuit consists of ⎣ R n−1


Input Modification Block, Formation Block, and Combina- R0
tion Block. The main ingredient of the Input Modification
Block is a cyclic-swap gate C s applied on the main qubits. The operation of F µ can be simulated by a sequence of
The matrix representation of the gate is controlled-rotation gates as in Figure 4. The operation of
⎡ ⎤ F µ will be performed on main qubits and the second ancil-
0 1 0 ··· 0 lary qubit in case that the state of first ancillary qubit is |1⟩.
⎢ 0 0 1 · · · 0⎥
⎢ ⎥
Cs = ⎢

⎢ . .. . ..

⎥, (16)

⎢ ⎥
⎣0 0 · · · 0 1 ⎦
1 0 ··· 0 0

which can be implemented by the Toffoli gates as shown


in Figure 3.

Figure 4: The formation block can be simulated by a sequence of


controlled-rotation gates.

Next step, in the combination block, we define the op-


erator C as follows:

C = (XH )⊗m ⊗ I (19)


Figure 3: The cyclic-swap gate can be implemented by a sequence of ⎡ ⎤
• • • • ··· • •
Toffoli gates. ⎢•
⎢ • • • · · · • •⎥ ⎥
⎢. .. .. .. . . .. .. ⎥
⎢. . . .⎥
=⎢ . . . . ⎥.
The aim of the operator C s is to generate the matrix ⎢• • • • · · · • •⎥
⎢ ⎥
element of the companion matrix from row 1 to row n − 1. ⎢
⎣1

0 1 0 · · · 1 0⎦
Since the operation is underpinned by the presences of the
• • •
• ··· • •
sequences of Toffoli gates, the algorithm will be plagued
by the huge complexity. The complexity of the algorithm where "•" represents the elements we can neglected be-
is quite large, and yet still smaller than that of Daskin’s cause they will be filter out by post-selection at the final
scheme, as their matrix elements are generated by the for- stage of the algorithm.
mation block which incurs more complexity. There are three sub-tasks to undertake in the combi-
The formation block in our version plays a role of the nation block. First, a controlled-C gate with the operator
controlled gate of an operator F µ , which represents the C is operated on the main qubits conditioning to the state
components in the last row of the modified companion ma- of the first ancillary qubit as |1⟩ to create the a⃗′ · ⃗α compo-
trix C p as in (10) or (12). The rotation gate R i is represented nent. As a result, the operation of C s , F µ , and C on main
844 | T. Tansuwannont et al.

Figure 5: A circuit scheme for finding polynomial roots.

qubits and second ancillary qubit conditioning to the first and −a⃗′ · ⃗α in (22) using the Toffoli gate in Figure 2, which
ancillary state |1⟩ give the following output: results in
1
|0⟩ ⊗ |β⟩ ⊗ |0⟩ + |ψ⊥ ⟩
⎡ ⎤
• |Ψ2 ⟩ = √ (23)
⎢ • ⎥ 2m+1 µ
⎢ ⎥
⎢ . ⎥
1 ⎢ .. ⎥ where |ψ⊥ ⟩ refers to the case that the ancillary qubits do
√ ⎢ ⎥ (20)
2m ⎢
⎢ • ⎥
⎥ not all give the result ‘0’. Finally, the post-selection only
the results of both ancillary qubits gives ‘0’, the output of
⎢ ⎥
⎣⃗a · ⃗α⎦
• the algorithm becomes |β⟩ with the success probability of
√ 1/(2m+1 µ2 ).
with the probability amplitude 1/ 2m . This amplitude is
required to be balanced with the case where the state of the
first ancillary qubit is |0⟩. At this stage of the algorithm, the 2.3 Polynomial Root-finding by Eigenvalue
scaling gate S m,µ is introduced to balance this probability Estimation Technique
and generate 1/µ in the upper diagonal entries of the mod-
ified companion matrix. It is defined as In order to find roots of the polynomial, we will use the cir-
[︃ √︀ ]︃ cuit shown in Figure 5. A controlled operation of the PRC
1 1 2m µ 2 − 1
S m,µ = √ √︀ . (21) by the phase qubit is denoted by c-C p in the figure. To de-
2m µ − 2m µ 2 − 1 1
scribe the operation, we will firstly assume that the main
This gate √ is, in fact, a rotation gate R y (θ), where θ = qubits are initially prepared in an eigenstate |ψ j ⟩ of the
2 cos−1 (1/ 2m µ). Scaling gate S m,µ is to be operated on companion matrix. An expected state from the operation
the second ancillary qubit in case that first ancillary qubit will be in the form
is in state |0⟩. After the controlled-S m,µ gate, the state is
transformed into the following, |β⟩ = |λ j |e2πiω j |ψ j ⟩. (24)
1 {︁ [︁ (︀ ]︁
|Ψ1 ⟩ = √ |0⟩ ⊗ I ⊗m ⊗ S m,µ (C s ⊗ I) (|α⟩ ⊗ |0⟩) (22)
)︀
Here we will assume that ω j has a binary expansion
2
}︁ in the form ω j = 0.x1 x2 x3 . . . x b , where b is bit-precision.
− |1⟩ ⊗ CF µ (C s ⊗ I) (|α⟩ ⊗ |0⟩)
As in IPEA, the c-C p will be operated 2b−k times in the kth
1 [︁
= √ |0⟩ ⊗ [α1 • α2 • · · · α n−1 • α0 •] iteration as illustrated in Figure 6. The result of the first
2 m+1 µ
]︁ iteration is given by
+ |1⟩ ⊗ [• • · · · • −a⃗′ · ⃗α •] .
(︁ )︁2b−1
(︁ b−1
)︁
1 √1
2 2m µ |0⟩|0⟩|ψ j ⟩|0⟩ + |λ j |2 e2πi(0.x b ) |1⟩|0⟩|ψ j ⟩|0⟩ . (25)

However, referring to (22), the final state is not exactly


|β⟩. The last task is just to swap between the coefficient α0
Quantum Phase Estimation Algorithm for Finding Polynomial Roots | 845

Figure 6: In order to estimate polynomial roots up to b bit-precision, c-C p must be operated 2b−k times in the kth iteration.

Similarly, for the kth iteration, we have now be obtained and the corresponding root of the polyno-
(︂ )︂2b−k (︁ mial can be calculated depending on which mode (x-mode
1 1 or 1/x-mode) is being used.
√ |0⟩|0⟩|ψ j ⟩|0⟩ (26)
2 2m µ However, in general, the eigenstates of the compan-
b−k
)︁
+ |λ j |2 e2πi(0.x b−k+1 x b−k+2 ...x b ) |1⟩|0⟩|ψ j ⟩|0⟩ . ion matrix are unknown. The following approach is to esti-
mate the greatest eigenvalue |λmax |. Suppose that an initial
After the operation of Z(θ k ) with θ1 = 0 and θ k = state is prepared in a mixed state, the density operator can
2π (0.0x b−k+2 x b−k+3 . . . x b ) followed by the Hadamard be expressed as
gate, the phase qubit will be in the following state, ∑︁
ρ= A j |ψ j ⟩⟨ψ j |, (31)
(︂ )︂2b−k {︁ j
1 1 b−k
1+ |λ j |2 e2πi(0.x b−k+1 ) |0⟩
[︀ ]︀
√ √ (27)
2 2 m
2 µ where A j is a probability of preparing the initial state in
b−k ]︀ }︁
+ 1− |λ j |2 e2πi(0.x b−k+1 ) |1⟩ .
[︀ the eigenstate |ψ j ⟩. The operation of c-C p when the phase
qubit is in state |1⟩ transforms the density operator as
The value of x b−k+1 can be either 0 or 1. Therefore, the prob- (︁ )︁
ρ ↦→ (C p ) ρ C†p . (32)
abilities of finding the phase qubit in states |0⟩ or |1⟩ given
that the both ancillary qubits give result 0 depend on the b−k
For the kth iteration after which c-C2p is operated and fol-
value of x b−k+1 ; namely,
lowed by Z(θ k ) and the Hadamard gate, the probabilities
b−k b−k+1
1 + 2 cos(2π0.x b−k+1 )|λ j |2 + |λ j |2 of finding phase qubit in states |0⟩ or |1⟩ given that both
P0 = (︀ )︀2b−k , (28) ancillary qubits give result 0 are
8 2m µ 2
∑︁ (︁ b−k b−k+1
)︁
A j 1 ± 2| λ j | 2 + | λ j | 2
b−k b−k+1
1 − 2 cos(2π0.x b−k+1 )|λ j |2 + | λ j |2 P0 = /κ, (33)
P1 = (︀ )︀2b−k . (29) j
8 2m µ 2 (︁ b−k b−k+1
)︁
A j 1 ∓ 2|λ j |2 + |λ j |2
∑︁
P1 = (34) /κ.
Since x b−k+1 can be either 0 or 1, the value of j
cos(2π0.x b−k+1 ) is either +1 or −1. In practice, x b can
)︀2b−k
be obtained by comparing P0 and P1 [25], i.e., x b = 0 if where κ = 8 2m µ2
(︀
. In Equations (33) and (34), the
and only if P0 > P1 ; and x b = 1 if and only if P0 < P1 . terms with the largest eigenvalue |λmax | will dominate if
In addition, the value of |λ j | from the kth iteration can be the number of iterations is large enough. Hence, the prob-
calculated from the equation abilities P0 and P1 will be reduced to the following forms:
b−k+1 b−k
[︁ (︁ )︁]︁
2b−k+1
(︁
m 2
)︁2b−k P0 ≈ 1 + Amax |λmax |2 ± 2|λmax |2 /κ, (35)
|λ j | =4 2 µ |P0 + P1 | − 1. (30)
b−k+1 b−k
[︁ (︁ )︁]︁
P1 ≈ 1 + Amax |λmax |2 ∓ 2|λmax |2 /κ. (36)
It should be emphasized that in later iterations, the pa-
rameter θ k used in Z(θ k ) is constructed from x b−k+1 from The value of x b−k+1 can be found by comparing P0 and
the prior iterations as in IPEA. Finally, an estimate of λ j can P1 . Even without knowing the probability Amax , an esti-
846 | T. Tansuwannont et al.

mate of |λmax | can be obtained from In order to apply this corollary with the root-finding cir-
(︂ )︂ cuit, we need one more ancillary qubit and set its initial
2b−k P0 + P1 − 2/κ
|λmax | =2 . (37) value to state |0⟩. Note that this ancillary qubit can also be
|P0 − P1 |
reused to simulate several controlled-unitary operations.
After the largest root is found, it can be factorized from the In order to compute the overall complexity of the whole
polynomial, and the same technique and procedure can be circuit, a complexity of each part may be found separately.
repeated to calculate the other roots. The cyclic-swap gate can be simulated by m CNOT gates.
Number of control qubits of each gate varies from 0 to m−1.
For other CNOT gates with multiple control qubits, its op-
eration can be simulated by O(i +2) operations where i > 1
3 Discussion is the number of control qubits. Therefore the overall com-
plexity of the cyclic-swap gate is 2 + m−1 2
∑︀
i=2 i ∼ O(m ).
In order to justify the efficiency of the quantum algorithm m
The formation gate consists of 2 controlled rotation gates.
for finding roots of a polynomial, we have to compare it
Each gate, which is further controlled by m qubits, can be
with the classical algorithm for solving the same problem.
simulated by O(m + 2) basic operations. Hence the total
One of the most efficient classical algorithms for finding
complexity of the formation gate is O(2m m). The combina-
roots of a polynomial was created by Pan in 2002 [28]. We
tion gate consists of m Hadamard gates and m NOT gates
shall compare these two versions of the algorithm based
which brings its overall complexity to O(m). Finally, the
on (i) resources required for calculation and (ii) algorith-
complexity of the (m + 1)-qubit CNOT gate before the appli-
mic complexity.
cation of the last Hadamard gate can be readily computed
We start by comparing the number of bits and qubits
by the corollary above, which amounts to O(m).
required by the computations. In order to find roots of
The total complexity of the complete circuit is the sum
an nth degree polynomial, the quantum algorithm re-
of complexity of each part as described above. However, in
quires O(log n) qubits. In contrast, the Pan’s classical root-
the complexity calculation, only the greatest term is kept.
finding algorithm requires O(n) or O(n log n) bits. This
In the case of large n (where n is the degree of a polyno-
makes it obvious that the quantum algorithm requires sig-
mial), we can clearly see that the dominant term comes
nificantly fewer bits than its classical counterpart. In this
from the formation gate. Therefore, the complexity of the
way, especially for larger n, the quantum version of algo-
circuit in terms of the degree of a polynomial is
rithm is capable for finding roots of a much higher order
degree than the classical one. O(2m m) ∼ O(n log n), (39)
Next, we will compare their algorithmic complexities.
In Pan’s algorithm, the number of operations required to for one iteration, or
find the roots is
O(kn log n), (40)
O((n log2 n)(log2 n + log b)) (38)
for k iterations. Compared with the classical case for b-bit
where b is the bit precision of the solutions. In contrast, precision, our approach needs k = 2b and the total com-
since any m-qubit unitary gates can be simulated using plexity of the quantum version is
only single-qubit gates and CNOT gates [29], it is appro- O(2b n log n). (41)
priate to compute the complexity of a quantum circuit in
terms of the number of single-qubit gates and CNOT gates Comparing between (38) and (41) (see Figure 7), at
required to construct the circuit. From polynomial root- certain values of b with increasing n, the quantum algo-
finding circuit, many unitary operations are controlled by rithm performs faster than the classical one at high n. How-
several qubits. We will use the following corollary to calcu- ever, there are some disadvantage influences of b, when
late complexity of these gates (See Corollary 7.12 in Barenco the computation is undertaken with higher bit-precision
et al. [24]). requirements on low degree polynomials.
In addition, the rising complexity of the algorithm for
Corollary: For any unitary U, the corresponding c-U gate high degree polynomials can possibly be inflicted by its
controlled by (m − 2)-qubit can be simulated by O(m) basic inscalable success probability. Following (22), the success
operations in m-qubit network, where the initial value of one probability is diminished to 1/2m µ and will require more
qubit is fixed and incurs no net change. iterations to maintain the precision. As a consequence, the
increase iterations will effectively raise the complexity.
Quantum Phase Estimation Algorithm for Finding Polynomial Roots | 847

Figure 7: We compare the number of operations needed for our quantum algorithm (magenta for b = 3, red for b = 8) and the best known
classical algorithm (blue for b = 3, green for b = 8), with the increasing n. Our algorithm clearly outperforms the classical one for the
calculation with high n for both values of b (upper figure), especially at low bit-precision. For low n, the bit-precision b increases the
number of operations exponentially, instead of linearly as in the Pan’s classical algorithm.

However, here we can validate that the quantum ver- ever, to implement this algorithm in further application
sion of the algorithm is less complex than the classical efficiently, some requirements of the particular task must
version in the case where the polynomial has a high de- be considered. In summary, we have provided a quantum
gree.On the contrary, the quantum algorithm may be an algorithm for finding roots of the nth degree polynomial
overkill when finding the roots, with high-bit precision, of partially based on Daskin et al.’s circuit for finding com-
a low degree polynomial. plex eigenvalues of a general matrix [18]. To make a com-
parison with classical version of the algorithm, resources
and algorithmic complexities are considered. The quan-
tum version requires significantly fewer number of (quan-
4 Conclusion tum) bits than its classical counterpart for a high degree
polynomial. In terms of algorithm complexities, the quan-
Polynomials are the key foundation of various calcula-
tum algorithm also trumps the classical algorithms for a
tions in mathematics and physics. The computational ad-
high degree polynomial, requiring low bit-precision solu-
vantages provided by this quantum-based algorithm could
tions. The growth in complexity stems from a larger num-
be very useful for a broad field of studies [30–37]. How-
848 | T. Tansuwannont et al.

ber of iterations needed to achieve the desired precision. [11] Brown K.R., Clark R.J., Chuang I.L.,Limitations of Quantum Sim-
Although our result clearly shows that finding the roots ulation Examined by Simulating a Pairing Hamiltonian Using
Nuclear Magnetic Resonance, Phys. Rev. Lett., 2006, 97, 050504
of polynomials using quantum information scheme is pos-
[12] Negrevergne C., Somma R., Ortiz G., Knill E., Laflamme R., Liquid-
sible, the most important challenge, however, remains in
state NMR simulations of quantum many-body problems, Phys.
strengthening the algorithm to overcome the classical al- Rev. A, 2005, 71, 032344
gorithm both in the utilized resources and the chosen pre- [13] Matthews J.C.F., Poulios K., Meinecke J.D.A., Politi A., Peruzzo A.,
cisions. Another challenge lies of course in the practical is- Ismail N., Wörhoff K., Thompson M.G., O’Brien J.L.,Observing
sue of a working quantum computer. It is well known that fermionic statistics with photons in arbitrary processes, Sci.
Rep., 2013, 3, 1539
the current quantum computer technology still falls short
[14] Ovidiu I.P., Correlation functions and momentum distribution of
of the theoretical requirement of the algorithm, especially one-dimensional hard-core anyons in optical lattices, Journal of
in terms of the number of entangled qubits and multiple- Statistical Mechanics: Theory and Experiment, 2015, 1, P01004
qubit quantum operations. [15] Crespi A., Suppression laws for multiparticle interference in
Sylvester interferometers, Phys. Rev. A, 2015, 91, 013811
[16] A.Y. Kitaev, Quantum measurements and the Abelian Stabilizer
Acknowledgement: We would like to thank As-
Problem, Coll. Comput. Complex., 1996, 3, 3
sist. Prof. Dr. Kwan Arayathanitkul for helpful discus-
[17] Kacprowicz M., Demkowics-Dobrzanski R., Wasilewski w., Ban-
sions.T.T. acknowledges the support of The Queen Sirikit szek K., Walmsley I.A., Experimental quantum-enhanced estima-
Scholarship under The Royal Patronage of Her Majesty tion of a lossy phase shift, Nature Photonics, 2010, 4, 357–360
Queen Sirikit of Thailand. This work is a collaboration [18] Daskin A., Grama A., Kais S., A universal quantum circuit scheme
of Collaborative Research Unit on Quantum Information, for finding complex eigenvalues, Quantum Information Process-
ing, 2014, 13, 333–353.
Mahidol University and Optical and Quantum Communica-
[19] Daskin A., Grama A., Kollias G., Kais S., Universal programmable
tion (OQC) Laboratory, National Electronics and Computer quantum circuit schemes to emulate an operator, J. Chem. Phys.,
Technology Center (NECTEC). Grant No. 035/2557 from the 2012, 137, 234112
Development and Promotion of Science and Technology [20] Abrams D.S., Lloyd S., Quantum Algorithm Providing Exponential
Talents project (DPST) scholarship, research fund for DPST Speed Increase for Finding Eigenvalues and Eigenvectors, Phys.
Rev. Lett., 1999, 83, 5162
graduate with first placement is acknowledged.
[21] Zhou X.Q., Kalasuwan P.,Ralph T.C., O’Brien J.L., Calculating un-
known eigenvalues with a quantum algorithm, Nature Photonics,
2013, 7, 223–228
[22] Wang H., Wu L.A., Liu Y.x., Nori F., Measurement-based quan-
References tum phase estimation algorithm for finding eigenvalues of non-
unitary matrices, Phys. Rev. A, 2010, 82, 062303
[1] Weisstein E.W., CRC encyclopedia of mathematics, 2nd ed., CRC [23] Barz S., Kassal I., Ringbauer M., Lipp Y.O., Dakic B., Aspuru-Guzik
Press Taylor & Francis, Boca Raton, Florida, 2009 A., Walther P., Univariate Polynomials: Nearly Optimal Algorithms
[2] Jacobson N.,Basic algebra 1, 2nd ed.,Dover, 2009 for Numerical Factorization and Root-finding, Scientific Reports,
[3] McNamee J.M., Numerical Methods for Roots of Polynomials, Part 2014, 4, 611EP
1, Elsevier, Amsterdam, The Netherlands, 2007 [24] Barenco A., Bennett C.H., Cleve R., Vincenzo D.P.D., Margolus N.,
[4] Mekwi W.R., Iterative methods for roots of polynomials, Master’s Shor P., Sleator T., Smolin J.A., Weinfurter H., Elementary gates
thesis, University of Oxford, Oxford, UK, 2001 for quantum computation, Phys. Rev. A, 1995, 52,3457
[5] Pan V.Y., Solving a Polynomial Equation: Some History and Recent [25] Griflths R.B., Niu C.S., Semiclassical Fourier Transform for Quan-
Progress, SIAM Review,1997, 39, 187-220 tum Computation, Phys. Rev. Lett., 1996, 76, 3228
[6] Shor P.W., Algorithms for quantum computation: discrete loga- [26] Chiaverini J., Britton J., Leibfried D., Knill E., Barrett M.D.,
rithms and factoring, In: Goldwasser S.(Ed.), Proceedings 35th Blakestad R.B., Itano W.M., Jost J.D., Langer C., Ozeri R., Schaetz
Annual Symposium on Foundations of Computer Science (20-22 T., Wineland D.J., Implementation of the Semiclassical Quantum
Nov 1994, Santa Fe, NM, USA), IEEE Comput. Soc. Press, 1994, Fourier Transform in a Scalable System, Science, 2005, 308, 997–
124–134 1000
[7] Lloyd S., Universal Quantum Simulators, Science, 1996, 273, [27] Buchberger B., An algorithmic method in polynomial ideal theory,
1073–1078 D. Reidel Publishing Company, Dordrecht, Boston Langcaster,
[8] Feynman R.P., Simulating Physics with Computers, Int. J. Thy. 1985
Phys., 1982, 21, 467–488 [28] Pan V.Y., Univariate Polynomials: Nearly Optimal Algorithms for
[9] Aspuru-Guzik A., Dutoi A.D., Love P.J., Head-Gordon M., Sim- Numerical Factorization and Root-finding, Journal of Symbolic
ulated Quantum Computation of Molecular Energies, Science, Computation, 2002, 33, 701–733
2005, 309, 1704–1707 [29] Barenco A., A universal two-bit gate for quantum computation,
[10] Ma X.S., Dakic B., Naylor W., Zeilinger A., Walther P., Quantum Proc. R. Soc. Lond. A, 1995, 449, 679
simulation of the wavefunction to probe frustrated Heisenberg [30] Hoffmann C.M., Geometric and Solid Modeling, San Mateo, Cali-
spin systems, Nature Phys., 2011, 7, 399–405 fornia, 1989
Quantum Phase Estimation Algorithm for Finding Polynomial Roots | 849

[31] Go N., Scherga H.A., Ring Closure and Local Conformational De- [35] Baleanu D., Asad J.H., Jajarmi A., Classical and fractional aspects
formations of Chain Molecules, Macromolecules, 1970, 3, 178– of two coupled pendulums, ROM REP PHYS, 2019, 71, 103
187 [36] Massey J., Step-by-step Decoding of the Bose-Chadhuri-
[32] Faugeras O., Three-Dimensional Computer Vision : A Geometric Hocquenghem Codes, IEEE Trans. Inf. Theory, 1965, 11, 580–585
Viewpoint, MIT Press, Cambridge, Massachusate, 1993 [37] Hong J., Vetterli M., Simple ALgorithms for BCH Decoding, IEEE
[33] Bishop G., Fuchs H, Research directions in virtual environments, Trans. Commun., 1995, 43, 2324–2333
Computer Graphics, 1992, 26, 153
[34] Baleanu D., Asad J.H., Jajarmi A., New aspects of the motion of
a particle in a circular cavity, P ROMANIAN ACAD A, 2018, 19,
361–367

You might also like