Page 1
This content has been downloaded from IOPscience. Please scroll down to see the full text.
Download details:
IP Address: 189.84.209.251
This content was downloaded on 10/10/2013 at 18:06
Please note that terms and conditions apply.
Quantum algorithm and circuit design solving the Poisson equation
View the table of contents for this issue, or go to the journal homepage for more
2013 New J. Phys. 15 013021
(http://iopscience.iop.org/1367-2630/15/1/013021)
HomeSearchCollectionsJournalsAbout Contact usMy IOPscience
Page 2
Quantum algorithm and circuit design solving the
Poisson equation
Yudong Cao1, Anargyros Papageorgiou2, Iasonas Petras2,
Joseph Traub2and Sabre Kais3,4
1Department of Mechanical Engineering, Purdue University, West Lafayette,
IN 47907, USA
2Department of Computer Science, Columbia University, New York,
NY 10027, USA
3Department of Chemistry, Physics, and Computer Science, Birck
Nanotechnology Center, Purdue University, West Lafayette, IN 47907, USA
E-mail: kais@purdue.edu
New Journal of Physics 15 (2013) 013021 (29pp)
Received 10 July 2012
Published 11 January 2013
Online at http://www.njp.org/
doi:10.1088/1367-2630/15/1/013021
Abstract.
engineering. Here we focus on its numerical solution for an equation in d
dimensions. In particular we present a quantum algorithm and a scalable
quantum circuit design which approximates the solution of the Poisson equation
on a grid with error ε. We assume we are given a superposition of function
evaluations of the right-hand side of the Poisson equation. The algorithm
produces a quantum state encoding the solution. The number of quantum
operations and the number of qubits used by the circuit is almost linear in d and
polylog in ε−1. We present quantum circuit modules together with performance
guarantees which can also be used for other problems.
The Poisson equation occurs in many areas of science and
4Author to whom any correspondence should be addressed.
Content from this work may be used under the terms of the Creative Commons Attribution-NonCommercial-
ShareAlike 3.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title
of the work, journal citation and DOI.
New Journal of Physics 15 (2013) 013021
1367-2630/13/013021+29$33.00© IOP Publishing Ltd and Deutsche Physikalische Gesellschaft
Page 3
2
Contents
1. Introduction
2. Overview
3. Discretization
3.1. One dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2. Two dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3. d dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4. Quantum circuit
4.1. Error analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2. Computation of λ−1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3. Controlled rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5. Hamiltonian simulation of the Poisson matrix
5.1. One-dimensional case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2. Multidimensional case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.3. Simulation cost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6. Total cost
7. Conclusion and future directions
Acknowledgments
Appendix A
Appendix B
References
2
3
5
5
5
7
8
9
11
13
15
15
19
20
21
22
23
23
23
28
1. Introduction
Quantum computers take advantage of quantum mechanics to solve certain computational
problems faster than classical computers. Indeed in some cases the quantum algorithm is
exponentially faster than the best classical algorithm known [1–12].
In this paper we present a quantum algorithm and circuit solving the Poisson equation.
The Poisson equation plays a fundamental role in numerous areas of science and engineering,
such as computational fluid dynamics [13, 14], quantum mechanical continuum solvation [15],
electrostatics [16], the theory of Markov chains [17–19] and is important for density functional
theory and electronic structure calculations [20].
Any classical numerical algorithm solving the Poisson equation with error ε has cost
bounded from below by a function that grows as ε−αd, where d denotes the dimension or the
number of variables, and α > 0 is a smoothness constant [21, 22]. Therefore the cost grows
exponentially in d and the problem suffers from the curse of dimensionality.
We show that the Poisson equation can be solved with error ε using a quantum algorithm
with a number of quantum operations which is almost linear in d and polylog in ε−1. A number
of repetitions proportional to ε−4αguarantees that this algorithm succeeds with probability
arbitrarily close to 1. Hence the quantum algorithm breaks the curse of dimensionality and,
with respect to the dimension of the problem d, enjoys exponential speedup relative to classical
algorithms.
On the other hand, we point out that the output of the algorithm is a quantum state that
encodes the solution on a regular grid rather than a bit string that represents the solution. It can
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 4
3
be useful if one is interested in computing a function of the solution rather than the solution
itself. In general, the quantum circuit implementing the algorithm can be used as a module in
other quantum algorithms that need the solution of the Poisson equation to achieve their main
task.
In terms of the input of the algorithm, we assume that a quantum state encoding a
superposition of function evaluations of the right-hand side of the Poisson equation is available
to us, and we do not account for the cost of preparing this superposition. In general, preparing
arbitraryquantumstatesisaveryhardproblem.Nevertheless,incertaincasesonecanefficiently
prepare superpositions of function evaluations using the techniques in [23, 24]. We do not deal
with the implementation of such superpositions in this paper.
There are many ways to solve the Poisson equation. We choose to discretize it on a regular
grid in Cartesian coordinates and then solve the resulting system of linear equations. For this
we use the quantum algorithm of [25] for solving linear equation systems. The solution of
differential and partial differential equations (PDEs) is a natural candidate for applying that
algorithm, as already stated in [25]. It has been applied to the solution of differential equations
in [26, 27]. In the case of the Poisson equation that we consider in this paper there is no need,
however, to assume that the matrix is given by an oracle. Indeed, a significant part of our work
deals with the Hamiltonian simulation of the matrix of the Poisson equation. Moreover, it is an
open problem to determine when it is possible to simulate a Hamiltonian with cost polynomial
in the logarithm of the matrix size and the logarithm of ε−1[28]. Our results show that in the
case of the Hamiltonian for the Poisson equation the answer is positive.
Our analysis of the implementation includes all the numerical details and will be helpful
to researchers working on other problems. All calculations are carried out in fixed precision
arithmetic and we provide accuracy and cost guarantees. We account for the qubits, including
ancilla qubits, needed for the different operations. We provide quantum circuit modules for the
approximation of trigonometric functions, which are needed in the Hamiltonian simulation of
the matrix of the Poisson equation. We show how to obtain a quantum circuit computing the
reciprocal of the eigenvalues using Newton iteration and modular addition and multiplication.
We show how to implement quantum mechanically the inverse trigonometric function needed
forcontrolledrotations.Asweindicated,ourresultsarenotlimitedtothesolutionofthePoisson
equation but can be used in other quantum algorithms. Our simulation module can be combined
with splitting methods to simulate the Hamiltonian −?+V, where ? is the Laplacian and
V is a potential function. The trigonometric approximations can be used by algorithms dealing
with quantum walks. The reciprocal of a real number and a controlled rotation by an angle
obtained by an inverse trigonometric approximation are needed for implementing the linear
system’s algorithm [25] regardless of the matrix involved.
2. Overview
We consider the d-dimensional Poisson equation with Dirichlet boundary conditions.
Definition 1.
−?u(x) = f (x),
u(x) = 0,
x ∈ Id:= (0,1)d,
x ∈ ∂Id,
(1)
where f : Id→ R is a sufficiently smooth function; e.g. see [21, 29, 30] for details.
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 5
4
For simplicity we study this equation over the unit cube but a similar analysis applies to
more general domains in Rd. Often one solves this equation by discretizing it and solving the
resulting linear system. A finite difference discretization of the Poisson equation on a grid with
mesh size h, using a (2d +1) stencil for the Laplacian, yields the linear system
−?h? v =?fh,
where fhis the vector obtained by sampling the function f on the interior grid points [30–32].
The resulting matrix is symmetric positive definite.
To solve the Poisson equation with error O(ε) both the discretization error and the error on
the solution of the system should be O(ε). This implies that ?his a matrix of size proportional
to ε−αd×ε−αd, where α > 0 is a constant that depends on the smoothness of the solution which,
in turn, depends on the smoothness of f [21, 30, 33]. For example, when f has uniformly
bounded partial derivatives up to order four then α = 1/2.
There are different ways for solving this system using classical algorithms. Demmel [31,
table 6.1] lists a number of possibilities. The conjugate gradient algorithm [34] is an example.
Its cost for solving this system with error ε is proportional to
ε−αd√κ logε−1,
where κ denotes the condition number of ?h. We know κ = ε−2α, independently of d. The
resulting cost is proportional to ε−αd−αlogε−1. For details about the solution of large linear
systems see [35]. Observe that the factor ε−αdin the cost is the matrix size and its contribution
cannot be overcome. Any direct or iterative classical algorithm solving this system has a cost
of at least ε−αd, since the algorithm must determine all unknowns. So any algorithm solving the
system has a cost exponential in d. In fact a much stronger result holds, namely, the cost of any
classical algorithm solving the Poisson equation in the worst case must be exponential in d [21].
We present a scalable quantum circuit for the solution of (2) and thereby for the
solution of the Poisson equation with error O(ε) that uses a number of qubits proportional
to max{d,log2ε−1}(log2d +log2ε−1)2and a number of quantum operations proportional to
max{d,log2ε−1}(log2d +log2ε−1)3. It can be shown that log2d = O(log2ε−1) and the above
expressionsaresimplifiedtomax{d,log2ε−1}(log2ε−1)2qubitsandmax{d,log2ε−1}(log2ε−1)3
quantumoperations.Ameasurementoutcomeatthefinalstatedetermineswhetherthealgorithm
hassucceededornot.Anumberofrepetitionsproportionaltothesquareoftheconditionnumber
yields a success probability arbitrarily close to one.
In section 3 we deal with the discretization of the Poisson equation showing the resulting
matrix. We also describe how the matrix in the multidimensional case can be expressed in terms
oftheone-dimensionalmatrixusingKroneckerproducts.This,aswewillsee,isimportantinthe
simulation of the Poisson matrix. In section 4 we show the quantum circuit solving the Poisson
equation. We perform the error analysis and show the quantum circuit modules computing the
reciprocal of the eigenvalues and from those the controlled rotation needed at the end of the
linear system’s algorithm [25]. In section 5 we deal with the Hamiltonian simulation of the
matrix of the Poisson equation. The exponential of the multidimensional Hamiltonian is the
d-fold tensor product of the exponential of the one-dimensional Hamiltonian. It is possible
to diagonalize the one-dimensional Hamiltonian using the quantum Fourier transform. Thus it
suffices to approximate the eigenvalues in a way leading to the desired accuracy in the result.
We show the quantum circuit modules performing the eigenvalue approximation and derive the
overall simulation cost. In section 6 we derive the total cost for solving the Poisson equation.
Section 7 is the conclusion. In appendix A we list a number of elementary quantum gates
(2)
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 6
5
and in appendix B we present a series of results concerning the accuracy and the cost of the
approximations we use throughout the paper.
3. Discretization
3.1. One dimension
We start with the one-dimensional case to introduce the matrix Lhthat we will use later in
expressing the d-dimensional discretization of the Laplacian, using Kronecker products. We
have
−d2u(x)
dx2
= f (x),
x ∈ (0,1),
(3)
u(0) = u(1) = 0,
where f is a given smooth function and u is the solution we want to compute. We discretize
the problem with mesh size h = 1/M and we compute an approximate solution v at M +1 grid
points xi= ih, i = 0,..., M. Let ui= u(xi) and fi= f (xi), i = 0,..., M.
Using finite differences at the grid points to approximate the second derivative (3) becomes
−d2u(x)
dx2
????
x=xi
=2ui−ui−1−ui+1
h2
−ξi,
(4)
where ξi is the truncation error and can be shown to be O(h2?d4u
derivative uniformly bounded by a constant [31].
Ignoring the truncation error, we solve
h−2(−vi−1+2vi−vi+1) = fi,
With boundary conditions v0= 0 and vM= 0, we have M −1 equations and M −1
unknowns v1,...,vM−1:
vM−1
where Lhis the tridiagonal (M −1)×(M −1) matrix above; for the properties of this matrix,
including its eigenvalues and eigenvectors see [31, section 6.3].
dx4?∞) if f has the fourth
0 < i < M.
(5)
h−2Lh
v1
...
...
:= h−2
2
−1
...
...
0
−1
...
...
−1
−1
20
v1
...
...
vM−1
=
f1
...
...
fM−1
,
(6)
3.2. Two dimensions
In two dimensions the Poisson equation is
−∂2u(x, y)
∂x2
−∂2u(x, y)
∂y2
= f (x, y),(x, y) ∈ (0,1)2,
u(x,0) = u(0, y) = u(x,1) = u(1, y) = 0,
x, y ∈ [0,1].
(7)
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 7
6
Figure 1. Discretization of the square domain and notation for indexing the
nodes.
We discretize this equation using a grid with mesh size h = 1/M; see figure 1. Each node is
indexed uj,k, j,k ∈ {1,2,..., M} (figures 1(a) and (b)). We approximate the second derivatives
using
∂2u
∂x2(x, y) ≈u(x −h, y)−2u(x, y)+u(x +h, y)
h2
,
∂2u
∂y2(x, y) ≈u(x, y −h)−2u(x, y)+u(x, y +h)
h2
.
Omitting the truncation error, and denoting the discretized Laplacian by −?hwe are led
to solve
h−2?(−vj−1,k+2vj,k−vj+1,k)+(−vj,k−1+2vj,k−vj,k+1)?= fj,k,
where fj,k= f (jh,kh), j,k = 1,2,..., M −1 and vj,k= 0 if j or k ∈ {0, M} i.e. when we
have a point that belongs to the boundary.
Using the fact that the solution is zero at the boundary, we reindex (8) to obtain
(8)
h−2(4vi−vi−1−vi+1−vi−M+1−vi+M−1) = fi,
Equivalently, we denote this system by
i = 1,2,...,(M −1)2.
(9)
−?h? v =?fh,
where ?his the discretized Laplacian.
For example, when M = 4, as in figure 1, we have that ? v = [v1,...,v9]T. Furthermore (9)
becomes
h−2A
v1
...
v9
:= h−2
B
−I
B
−I
−I
−I
B
v1
...
v9
=
f1
...
f9
,
(10)
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 8
7
where I is the 3×3 identity matrix, B is
4
−1
4
−1
−1
−1
4
.
A is a Hermitian matrix with a particular block structure that is independent of M.
In particular, on a square grid with mesh size h = 1/M we have
−?h= h−2A
and A can be expressed in terms of Lhas follows:
00
(11)
A =
Lh+2I
−I
0
...
...
−I
0
···
0
...
...
···
···
0
0
0
...
Lh+2I
−I
0
...
−I
...
...
−I
0
0
−I
0
Lh+2I
−I
−I
···
Lh+2I
(12)
and its size is (M −1)2×(M −1)2[31].
Recall that Lh is the (M −1)×(M −1) matrix shown in (6) and I is the (M −1)
×(M −1) identity matrix. Moreover, A can be expressed using Kronecker products as follows:
A = Lh⊗ I + I ⊗ Lh.
(13)
3.3. d dimensions
We now consider the problem in d dimensions. Consider the Laplacian
? =
d
?
k=1
∂2
∂x2
k
.
We discretize ? on a grid with mesh size h = 1/M using divided differences.
As before, this leads to a system of linear equations
−?h? v =?fh.
Note that −?h= h−2A is a symmetric positive definite matrix and A is given by
A = Lh⊗ I ⊗···⊗ I
?
the (M −1)×(M −1) identity matrix. See [31] for details.
Observe that the matrix exponential has the form
eiAγ= eiLhγ⊗···⊗eiLhγ
?
the linear system.
(14)
?? ?
d matrices
+I ⊗ Lh⊗ I ⊗···⊗ I +···+ I ⊗···⊗ I ⊗ Lh,
and has size (M −1)d×(M −1)d. Lhis the (M −1)×(M −1) matrix shown in (6) and I is
???
d matrices
,
(15)
for all γ ∈ R, where i =√−1. We will use this fact later to derive the quantum circuit solving
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 9
8
Anc.
|0?
|0?
Ry
˜hj|1? +
|0?
1 −˜h2
j|0?
Reg.L
/
INV
|ˆhj?
•
U†
b=3?logε−1? qubits
Reg.C
|0?
/ W
•
FT†
|kj?
/
|0?
n=O(log(E/ε)) qubits
Reg.B
fh
/
HAM-SIM
jβjuj
b
Figure 2. Overview of the circuit for solving the Poisson equation. Wires with
‘/’ represent registers or groups of qubits. W denotes the Walsh–Hadamard
transform which applies a Hadamard gate on every qubit of the register. FT
represents the quantum Fourier transform. ‘HAM-SIM’ is the Hamiltonian
simulation subroutine that implements the operation e−2πi?h/E. ‘INV’ is the
subroutine that computes λ−1. U†represent uncomputation, which is the adjoint
of all the operations before the controlled Ryrotation.
4. Quantum circuit
We derive a quantum circuit solving the system −?h? v =?fh, where h = 1/M and without loss
of generality we assume that M is a power of two. We obtain a solution of the system with error
O(ε). The steps below are similar to those in [25].
(i) Asin[25]assumetheright-handsidevector?fhhasbeenpreparedquantummechanicallyas
a quantum state | fh? and stored in the quantum register B. Note | fh? =?(M−1)d−1
(ii) Perform phase estimation using the state | fh? in the bottom register and the unitary matrix
e−2πi?h/E, where log2E = ?logd?+log(4M2). The number of qubits in the top register of
phase estimation is n = O(log(E/ε)).
(iii) Compute an approximation of the inverse of the eigenvalues λj. Store the result on a
register L composed of b = 3?logε−1? qubits (figure 2). The approximation error of the
reciprocals is at most ε.
(iv) Introduce an ancilla qubit to the system. Apply a controlled rotation on the ancilla qubit.
The rotation operation is controlled be the register L which stores the reciprocals of
the eigenvalues of −?h(figure 2). The controlled rotation results in?1−(Cd/λj)2|0?+
(v) Uncompute all other qubits on the system except the qubit introduced on the previous item.
(vi) Measure the ancilla qubit. If the outcome is 1, the bottom register of phase estimation
collapses to the state?(M−1)d−1
outcome is 0, the algorithm has failed and we have to repeat it. An alternative would be to
include amplitude amplification to boost the success probability. Amplitude amplification
has been considered in the literature extensively and we do not deal with it here.
j=0
βj|uj?,
where |uj? denote the eigenstates of −?hand βjare the coefficients.
(Cd/λj)|1?, where Cdis a constant.
j=0
βjλj−1|uj? up to a normalization factor, where |uj? denote
the eigenstates of −?h. This is equal to the normalized solution of the system. If the
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 10
9
4.1. Error analysis
We carry out the error analysis to obtain the implementation details. For d = 1 the eigenvalues
of the second derivative are
4M2sin2(jπ/(2M)),
j = 1,..., M −1.
For d > 1, the eigenvalues of −?hare given by sums of the one-dimensional eigenvalues, i.e.
d
?
We consider them in non-decreasing order and denote them by λj, j = 1,...,(M −1)d.
Then λ1= 4dM2sin2(π/(2M)) is the minimum eigenvalue and λ(M−1)d = 4dM2sin2(π(M −
1)/(2M)) ? 4dM2is the maximum eigenvalue.
Define E by
log2E = ?log2d?+log2(4M2).
Then the eigenvalues are bounded from above by E. Recall that we have already assumed
that M is a power of two. Then E = 2?log2d?4M2∈ N.
Note that the implementation accuracy of the eigenvalues determines the accuracy of the
system solution.
Our algorithm uses approximationsˆλj, such that |λj−ˆλj| ?17E
in appendix B. We use n = log2E +ν bits to represent each eigenvalue, of which the most
significant log2E bits hold each integer part and the remaining bits hold each fractional
part. Without loss of generality, we can assume that 2ν? E. More precisely, we consider an
approximationˆ?hof matrix ?hsuch that the two matrices have the same eigenvectors while
their eigenvalues differ by at most ε.
We use phase estimation with the unitary matrix e−iˆ?ht0/Ewhose eigenvalues are
e2πiˆλjt0/(E2π). Setting t0= 2π we obtain the phases φj=ˆλj/E ∈ [0,1). The initial state of phase
estimation is (figure 2)
k=1
?4M2sin2(jkπ/(2M))?,
jk= 1,..., M −1,
k = 1,...,d.
(16)
2ν ? ε; see theorem B.2
|0?⊗n| fh? =
(M−1)d
?
j=1
βj|0?⊗n|uj?,
where |uj? is the jth eigenvector of −?hand βj=?uj| fh
φj=
Then φj2nis an integer and phase estimation succeeds with probability 1 (see [36,
section 5.2, p 221] for details).
ThestatepriortotheapplicationoftheinverseFouriertransforminthephaseestimationis
?, for j = 1,2,...,(M −1)d. Since
we are using finite bit approximations of the eigenvalues, we have
ˆλj
E=
ˆλj2ν
2n.
(M−1)d
?
j=1
βj
1
2n/2
2n−1
?
k=0
e2πiφjk|k?|uj?.
(17)
After the application of the inverse Fourier transform to the first n qubits we obtain
(M−1)d
?
j=1
βj|kj?|uj?,
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 11
10
where
kj= 2nφj= 2nˆλj/E =ˆλj2ν∈ N.
Now we need to compute the reciprocals of the eigenvalues. Observe that
λ1/d = 4M2sin2(π/(2M)) = 4M2(π/(2M)+ O(M−3))2
= π2+ O(M−2) > 5,
where the last inequality holds trivially for sufficiently large M. This impliesˆλj/Cd?ˆλ1/
Cd? 4, where Cd= 2?log2d?, for sufficiently large M. We obtain kj= 2nˆλj/E ?ˆλ1? 4Cd.
Append b qubits initialized to |0? on the left (Reg. L in figure 2), to obtain
(M−1)d
?
Note that from (18) kj,ˆλjandˆλj/Cdhave the same bit representation. The difference between
the integer kjand the other two numbers is the location of the decimal point; it is located after
the most significant log2E bit inˆλj, and after the most significant log2(E/Cd) bit inˆλj/Cd.
Therefore, we can use the labels |kj?, |ˆλj? and |ˆλj/Cd? interchangeably, and write the state
above as
(M−1)d
?
Now we need to compute hj:= h(ˆλj/Cd) = Cd/ˆλj. We do this using Newton iteration. We
explain the details in section 4.2. We obtain an approximationˆhjsuch that
???ˆhj−hj
b = 3?log2ε−1
This leads to the state
(M−1)d
?
We append, on the left, a qubit initialized at |0? (Anc. in figure 2). We get
(M−1)d
?
We need to perform the conditional rotation
?
For this, we will approximate the first qubit by
?
with |ω−ω?| ? ε2
approximation in section 4.3.
(18)
j=1
βj|0?⊗b|kj?|uj?.
j=1
βj|0?⊗b|ˆλj/Cd?|uj?.
??? ? ε2
0,
(19)
where ε0= min{ε, E−1}. We store this approximation in the register composed of the leftmost
0? qubits.
j=1
βj|ˆhj?|ˆλj/Cd?|uj?.
j=1
βj|0?|ˆhj?|ˆλj/Cd?|uj?.
R|0?|ω? =
ω|1?+
?
1−ω2|0?
?
|ω?,
0 < ω < 1.
ω?|1?+1−(ω?)2|0?,
1, ε1= min{ε,1/(4M2)}. We discuss the cost of implementing this
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 12
11
The result of approximating the conditional rotation is to obtain |˜hj?, where˜hj is a
q = ?(log2ε−1
|˜hj−hj| ? ε2
for each j = 1,...,(M −1)d.
Ignoring the ancilla qubits needed for implementing the approximation of the conditional
rotation, we have the state
?
Uncomputing all the qubits except the leftmost gives the state
?
Let P1= |1??1|⊗ I be the projection acting non-trivially on the first qubit. The system
−?h? v =?fhhas solution?(M−1)d
C−1
d
j=1
??????
= C−1
j=1
??????
fact that
????
by the algorithm is O(log2(E/ε)). Therefore, if we measure the first qubit of the state |ψ? and
the outcome is 1 the state collapses to a normalized solution of the linear system.
1) bit number less than 1 satisfying |˜hj−ˆhj| ? ε2
0+ε2
1and, therefore,
1,
(20)
(M−1)d
?
j=1
βj
˜hj|1?+
?
1−˜h2
j|0?
?
|ˆhj?|ˆλj/Cd?|uj?.
|ψ? :=
(M−1)d
?
j=1
βj
˜hj|1?+
?
1−˜h2
j|0?
?
|0?⊗b|0?⊗n|uj?.
j=1
βj
1
λj|uj?. We derive the error as follows:
??????
d
(M−1)d
?
bjCd
λj
|1?|0?⊗(b+n)|uj?− P1|ψ?
??????
= C−1
(M−1)d
?
(M−1)d
?
j=1
βjCd
λj
|uj?−
(M−1)d
?
(M−1)d
?
??????
j=1
βj˜hj|uj?
??????
d
??????
βjCd
λj
|uj?−
j=1
βj(˜hj−hj+hj)|uj?
??????
?
(M−1)d
?
j=1
βj
?
1
λj
−1
ˆλj
?
|uj?
+ε2
0+ε2
1?17E
2ν+ε2
0+ε2
1,
(21)
where the second from last inequality is obtained using (20) and the last inequality is due to the
1
λ−1
ˆλ
????? |λ−ˆλ|,λ,ˆλ > 1.
Setting ν = ?log2(17E/ε)? gives error ε(1+o(1)) and the number of matrix exponentials used
4.2. Computation of λ−1
In this part we deal with the computation of the reciprocals of the eigenvalues, which is marked
as the ‘INV’ module in figure 2. For this we use Newton iteration to approximate v−1, v > 1.
We perform s iterative steps and obtain the approximation ˆ xs. The input and the output of each
iterative step are b bit numbers. All of the calculations in each step are performed in fixed
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 13
12
|ub−1= 0?
•
...
b
|ub?+1= 0?
•
...
|x0?
|ub? = 0?
...
b?=b−2−log2
E
Cd
...
|u0= 0?
...
|0?
···
X
|0?
|vn−1?
•
...
|vn−2?
•
...
|v?
n
...
|vn??
...
•
n?=n+2−log2
E
Cd
...
v0
...
Figure 3. The quantum circuit computing the initial approximation ˆ x0= 2−p
of Newton iteration for approximating v−1, 2p−1? v ? 2p. See appendix A for
definitions of the basic gates.
precision arithmetic. The initial approximation is ˆ x0= 2−p, 2p−1< v ? 2p. (We use the notation
ˆ xito emphasize that these values have been obtained by truncating a quantity xito b bits of
accuracy, i = 0,...,s.)
Theorem B.1 of appendix B gives the error of Newton iteration which is
|ˆ xs−v−1| ? ε2
where we have ε0= min{ε, E−1}, s = ?log2log2(2/ε2
2?log2ε−1
Therefore, it suffices that the module of the quantum circuit that computes 1/λjcarries
each iterative step with 3?log2ε−1
The quantum circuit computing the initial approximation ˆ x0, of the Newton iteration
is given in figure 3. The second register holds |v? and is n qubits long, of which the first
log2(E/Cd) qubits represent the integer part of v and the remaining ones its fractional part.
The first register is b qubits long. Recall thatˆλj/Cd? 4. So input values below 4 do not
correspond to meaningful eigenvalue estimates and we do not need to compute their reciprocals
altogether; they can be ignored. Hence the circuit implements the unitary transformation
0? ε,
0)? and the number of bits satisfies b ?
0?+ O(log2log2log2ε−1
0).
0? qubits of accuracy.
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 14
13
|ˆ xi?
−vx2
i+ 2xi
|ˆ xi+1?
vv
Figure 4. Circuit implementing each iterative step of the Newton method.
|0?⊗b|v? → |0?⊗b|v?, if the first log2(E/Cd)−2 bits of v are all zero. Otherwise, it implements
the initial approximation ˆ x0through the transformation |0?⊗b|v? → |ˆ x0?|v?.
Each iteration step xi+1= −vx2
shown in figure 4 that computes |ˆ xi?|v? → |ˆ xi+1?|v?. This involves quantum circuits for addition
and multiplication which have been studied in the literature [37].
The register holding |v? is n qubits long and the register holding the |ˆ xi? and |ˆ xi+1? is b
qubits long. Note that internally the modules performing the iteration steps may use more than
b qubits, say, double precision, so that the addition and multiplication operations required in the
iteration are carried out exactly and then return the most significant b qubits of the result. The
total number of qubits required for the implementation of each of these modules is O(logε−1
and the total number of gates is a low degree polynomial in logε−1
i+2xiis implemented using a quantum circuit of the form
0)
0.
4.3. Controlled rotation
We now consider the implementation of the controlled rotation
?
Assume for a moment that we have obtained |θ?, a q qubit state, corresponding to an angle θ
such that sinθ approximates ω. Then we can use controlled rotations Ryabout the y-axis to
implement R. We consider the binary representation of θ and have
R|0?|ω? =
ω|1?+
?
1−ω2|0?
?
|ω?,
0 < ω < 1.
θ = θ1...θq=
q
?
j=1
θj2−j,θj∈ {0,1}.
Then
Ry(2θ) = e−iθY=
??
1−sin2θ
sinθ
−sinθ
1−sin2θ
?21−j?,
?
?
=
q?
j=1
e−iYθj/2j=
q?
j=1
Rθj
y
where Y is the Pauli Y operator and θ ∈ [0,π/2]. The detailed circuit is shown in figure 5.
We now turn to the algorithm that calculates |θ? from |ω?. Since ω corresponds to the
reciprocal of an approximate eigenvalue of the discretized Laplacian, we know that sin−1(ω)
belongs to the first quadrant and sin−1(ω) = ?(1/M2). Therefore, we can find an angle θ such
that |sin(θ)−ω| ? ε2
function.
In appendix B we show the error in approximating the sine function using fixed precision
arithmetic. In section 5 we show the details of the resulting quantum algorithm computing the
1, ε1= min{1/(4M2),ε}, using bisection and an approximation of the sine
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 15
14
|0?
Ry(1)Ry(1/2)
...
Ry(1/2q−1)
|θ1?
...
|θ2?
...
...
θb
...
Figure 5. Circuit for executing the controlled Ryrotation. See appendix A for
definitions of basic gates.
approximation to the sine function. These results, with a minor adjustment in the number of bits
needed can be used here. We will not deal with the details of the quantum algorithm for the
sine function in this section since we present them in section 5 that deals with the simulation of
Poisson’s matrix. We will only describe the steps of the algorithm and its cost.
Algorithm
(i) Take as an initial approximation of θ the value π/4.
(ii) Approximate the sin(θ) with error ε2
in section 5 and appendix B). Let sθdenote this approximation.
(iii) If sθ< ω−ε2
(iv) If sθ> ω+ε2
(v) Repeat the steps 2–4 ?log2ε−2
An evaluation at the midpoint of an interval yields a value that satisfies either the condition
of step 3, or that of step 4, or |sθ−ω| ? ε2
and 4 are false then θ will not change its value until the end. Then, at the end, we have
|sin(θ)−ω| ? |sin(θ)−sθ|+|sθ−ω| ? ε2
other hand, if θ is updated until the very end of the algorithm the final value of theta also satisfies
|sin(θ)−w| ? ε2
In a way similar to that of propositions 1 and 2 of appendix B we carry out the steps of the
algorithm in q bit fixed precision arithmetic, q = max{2ν +9,13+ν +2log2M} and sufficiently
large ν to satisfy the accuracy requirements. (The last expression for q is slightly different form
that in proposition 2 because it accounts for the fact that in the case we are dealing with here
the angle is ?(1/M2).) This gives us an approximation to the sine with error 2−(ν−1). We set
1/2 using our algorithm for the sine function (details
1/2, set θ to be the midpoint of the right subinterval.
1/2, set θ to be the midpoint of the left subinterval.
1?+1 times.
1/2. If at any time both the conditions of steps 3
1, since the error in computing the sine is ε2
1/2. On the
1, because in the final interval we have |sin(θ)−ω| ? |θ −sin−1(ω)| ? ε2
1.
ν = ?log2ε−2
1?+1.
Thus ν and q are both ?(log2ε1).
The algorithm for the sine function is based on an approximation of the exponential
function using repeated squaring. Each square requires O(q2) quantum operations and O(q)
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 16
15
qubits. This is repeated ν times before the approximation to the sine is obtained. Thus the cost
of one bisection step requires O(νq2) quantum operations and O(νq) qubits. So, in terms of
ε1, the total cost of bisection is proportional to (log2ε−1
qubits.
1)4quantum operations and (log2ε−1
1)3
5. Hamiltonian simulation of the Poisson matrix
In this section we deal with the implementation of the ‘HAM-SIM’ module (figure 2) which
effectively applies e−iˆ?ht0onto register B. In our case the eigenvectors of the discretized
Laplacian are known and we use approximations of the eigenvalues. From (11) and (15) we
have
e−i?hγ= eih−2Lhγ⊗···⊗eih−2Lhγ
?
Thus it suffices to implement eih−2Lhγ, for certain γ ∈ R, ? = 2?·2t/E, t = 0,1,...,log2E −1
that are required in phase estimation. This can be accomplished by considering the spectral
decomposition S?S of the matrix Lh, where S is the matrix of the sine transform [31, 40].
Then S can be implemented using the quantum Fourier transform. We will implement an
approximation of ?.
We remark that the quantum circuits presented here can be used in the simulation of the
Hamiltonian −?+V using splitting formulas. For results concerning Hamiltonian simulation
using splitting formulas see [9, 28, 41].
???
d matrices
.
(22)
5.1. One-dimensional case
We start with the implementation of eih−2Lhγ, γ = 2π2t/E, E = 4M2when d = 1 and
t = 0,1,...,n −1, where n is the number of qubits in register C; see (17). The form of
Lh is shown in (6) and is positive definite. It is a Toeplitz matrix and it is known that this
type of matrix can be diagonalized via the sine transform S [42]. We have Lh= S?S, where
? is an (M −1)×(M −1) diagonal matrix containing the eigenvalues 4sin2(jπ/(2M)),
j = 1,..., M −1,
Si,j=
eih−2Lhγ= S eih−2?γS.
The relationship between the sine and cosine transforms and the Fourier transform can be found
in [40, theorem 3.10].
In particular, using the notation in [40], we have
of
Lh
and
S = {Si,j}i,j=1,2,...,M−1
isthesinetransformwhere
?
2
Msin (πij
M), i, j=1, ..., M −1. Thus
(23)
T†
MF2MTM= CM+1⊕(−iSM−1) =
?CM+1
0
0
−iSM−1
?
,
(24)
where CM+1, SM−1denote the cosine and sine transforms, and the subscripts M −1 and M +1
emphasize the size of the respective matrix. F2M is the 2M ×2M matrix of the Fourier
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 17
16
transform. The matrix TMhas size 2M ×2M and is given by (25)
The quantum circuits for implementing the unitary transformation TMis discussed in [38].
The action of TMcan be described by [38]
1
√2|0x?+
i
√2|0x?−
where i2= −1, x is an n-bit number ranging 1 ? x < 2nand x?denotes its complement of 2 i.e.
x?= 2n−x. The basic idea of implementing TMis to separate its operation into an operator D,
which ignores the complement of 2 in TM, and a controlled permutation π, which transforms
the state |bx? to |bx?? only if b is 1. Therefore the action of D and π can be written as
D|0x? =
TM=
1
1
√2
i
√2
... ...
1
√2
i
√2
1
1
√2
−
i
√2
......
1
√2
−
i
√2
.
(25)
TM|0x? =
1
√2|1x??,
i
√2|1x??,
TM|1x? =
(26)
1
√2|0x?+
i
√2|0x?−
1
√2|1x?,
i
√2|1x?,
D|1x? =
π|0x? = |0x?,
π|1x? = |1x??.
(27)
Clearly, TM= Dπ and the overall circuit for implementing operation TMis shown in figure 8.
By (24) the sine transform S can be implemented by cascading the quantum circuits in
figure 8 with the circuit for the Fourier transform [36]. An ancilla bit is added to register b. It is
kept in the state |1? in order to select the lower-right block
?a
0
0 −iSM−1
?
(28)
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 18
17
|1?
eih−2Lhγ
|j1?
//
|1?
eih−2Lhγ
|j2?
//
Figure 6. Quantum circuit for implementing e−i?hγ, γ ∈ R for the two-
dimensional discrete Poisson equation. The subroutine of eih−2Lhγis shown in
figure 7. The registers holding |j1?, |j2? are m qubits each.
|1?
T†
M
FT2M
TM
eih−2Λγ
T†
M
FT2M
TM
eih−2Lhγ
////////
????
= /
SM−1
Figure 7. Quantum circuit for implementing eih−2Lhγ, γ ∈ R, where Lh is
the matrix in (6). SM−1represents the sine transform matrix of size (M −1)
×(M −1), M = 2m. This circuit acts on m +1 qubits.
from the unitary operation T†
to the right-hand side of (6), and for bi= ?i| fh? we have
(0,b1,b2,...,bM−1
?
then the element a in equation (28) has no effect, and the circuit in figure 6 is equivalent to
applying (SM−1e2πi?2t/ESM−1) onto the (M −1) elements of | fh?. This is also equivalent to
simulating the Hamiltonian e2πih−2?2t/Ewith the state | fh? stored in register b.
We implement e2πih−2ˆ?2t/Ewhereˆ? = {ˆλj}j=1,...,M−1is a diagonal matrix approximating
? = {λj}j=1,...,M−1.
We obtain eachˆλj, j = 1,..., M −1 by the following algorithm. The general idea is to
approximate sinx = ?(eix) = ?((eix/r)r) with Wrwhere W = 1−ix/r +x2/r2is the Taylor
expansion of eix/rup to the second order term. Wris computed efficiently in fixed point
arithmetic using repeated squaring. The detailed steps are the following.
MF2MTM(24), a ∈ C. Considering the state | fh?, that corresponds
???
values on the
(M −1) nodes
),
(29)
Eigenvalue simulation algorithm (ESA)
(i) Let r = 2ν+7where ν is positive integer which is related to the accuracy of the result.
The inputs and the outputs of the modules below are s = max{2ν +9,11+ν +log2M} bit
numbers. Internally the modules may carry out calculations in higher precision O(s), but
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 19
18
|1?
?
????
???
B
B†
•
X
•
Pm
|1?
TM
...
...
=
/
/
X
D
π
(a)
B
=
H
S
X
···
Pm
•
X
···
••
X
···
··· ······
...
=
•
••
···
X
X
(b)
Figure 8. Quantum circuit for implementing TM in equations (24) and (25).
In (b), Pmdenotes the map |x? → |x +1 mod 2n? on n qubits. Its implementation
is described in [39]. See appendix A for the definitions of basic gates. (a) Generic
circuit for TM= Dπ, for details refer to [38]. (b) Implementation of B and Pm
gates in (a).
the results are returned using s bits. This value of s follows from the error estimates in
proposition B.2.
(ii) We perform the transformation
|j?|0?⊗s→ |j?|ˆ yj= ˆ xj/r?
?
where ˆ xjis the s bit truncation of xj=
truncationof yj.Recallthatr ? 2and2M arepowersof2.Calculationsaretobeperformed
???
s qubits
,
πj
2M. Note that yj= xj/r ∈ (0,1) and ˆ yjis the s bit
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 20
19
in fixed precision arithmetic, so division does not actually need to be performed. All one
needs to do is multiply j by π with O(s) bits of accuracy, keeping in track the position of
the decimal point and then take the most significant s bits of the result.
(iii) We compute the real and imaginary parts of the complex number ˆW1by truncating, if
necessary, the respective parts of ˆW0= 1− ˆ y2+iˆ y to s bits of accuracy; see (B.7) in
proposition B.1. This is expressed by the transformation
|ˆ yj?|0?⊗s|0?⊗s→ |ˆ yj?|?(ˆW1)?|?(ˆW1)?.
Note that since |ˆ yj? is s qubits long,ˆW0can be computed exactly using double precision
and ancilla qubits and the final result can be returned in s qubits.
Complex numbers are implemented using two registers, holding the real and imaginary
parts. Complex arithmetic is performed by computing the real and imaginary parts of the
result.
(iv) We computeˆWrapproximatingˆWr
accomplished by the transformation
|?(ˆW2j)?|?(ˆW2j)?|0?⊗s|0?⊗s→ |?(ˆW2j)?|?(ˆW2j)?|?(ˆW2j+1)?|?(ˆW2j+1)?,
which describes the steps in (B.7). The registers holding real and imaginary parts of the
numbers are s qubits long.
(v) ?(ˆWr) approximates sin(πj/(2M)) with error 2−(ν−1). Hence ?2(ˆWr) approximates the
sin2(πj/(2M)). We compute the square of ?(ˆWr) exactly and multiply it by 4M2(this
involves only shifting). We keep the most significant ν +log2(4M2) bits of the result, which
we denote by ?j. This means that the log2(4M2) bits of the binary string representing
?j compose the integer part and the last ν bits compose the fractional parts of the
approximation to λj. Then
|λj−?j| ? 17×2−νM2.
For details of the error estimate see proposition B.2. When d = 1, n (the number of qubits
in register C) and ν are related by n = ν +log2(4M2). Moreover, in the one-dimensional
caseˆλj= ?j.
(vi) Let kjbe the binary string representing ?j. For a fixed t, we implement the transformation
1using repeated squaring. Each step of this procedure is
|kj?
????
n qubits
|0?⊗n→ |kj?|kj2t?
? ?? ?
n qubits
.
(30)
This is accomplished using CNOTs with the circuit shown in figure 9, since t ? n the total
number of quantum operations and qubits required to implement the circuit for all the
values of t is O(n2).
(vii) Finally, we use phase kickback (see e.g. [43]) to obtain e2πiφj2tfrom the |kj2t? state where
φjis the phase corresponding to the eigenvalue ?jthat approximates λj; see (18).
5.2. Multidimensional case
To implement e−i?hγ, γ = 2π2t/E, E defined in (16) and t = 0,...,n −1 we use
e−i?hγ= eih−2Lhγ⊗···⊗eih−2Lhγ
??? ?
d matrices
.
(31)
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 21
20
n − 1
n − t
...
•
n − t − 1
•
...
0
•
|0?n−1
|0?n−2
...
|0?t−1
...
00
Figure 9. Quantum circuit for implementing the transformation in equation (30).
Therefore the quantum circuit implementing e−i?hγin d dimensions is obtained by the
replication and parallel application of the circuit simulating eih−2Lhγ. For example, when d = 2
we have the circuit in figure 6. The register B of figure 2 contains dm qubits, m = log2M and
its initial state is assumed to have the form
(0,...,0
? ???
Md−(M−1)d
,b1,b2,...,b(M−1)d)
????
values on the nodes of
(M −1)(×d)grid
,
(32)
where bi= ?i| fh?. This way we select the SM−1block in T†
eih−2Lhγ. Recall that | fh? corresponds to the right-hand side of (14).
The eigenvalues in the d-dimensional case are given as sums of the one-dimensional
eigenvalues. We do not need to form the sums explicitly for the simulation of −?h; they
are computed by the tensor products. The difference between the d-dimensional and one-
dimensional cases is that the register C in figure 2 has ?log2d? additional qubits; i.e n =
?log2d?+log24M2+ν. Accordingly, we generate the one-dimensional approximations to the
eigenvalues using steps 1–5 of the eigenvalue estimation algorithm of the previous section.
Then we append ?log2d? qubits initialized to |0?⊗?log2d?to the left of the register holding the
|?j? and carry out the remaining two steps, 6 and 7, with n = ?log2d?+log24M2+ν. The error
in the approximate eigenvalues is equal to 17M2d/2ν; see theorem B.2.
MF2MTMin (24) in each circuit for
5.3. Simulation cost
Simulatingthesineandcosinetransforms(24)requires O(m2),m = log2M quantumoperations
and O(m) qubits [38]. The diagonal eigenvalue matrix of the one-dimensional case (23) is
simulated by ESA. Its steps 1–3 and 5 require O(s2) quantum operations and O(s) qubits.
In step 4 repeated squaring is performed ν +7 times. Each repetition or step of the procedure
requires O(s2) quantum operations and O(s) qubits. The total cost of step 4 is proportional
to ν · O(s2) quantum operations and ν · O(s) qubits, accounting for any ancilla qubits used in
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 22
21
repeated squaring. Step 6 requires O(n +t) quantum operations and qubits for fixed t. Step 7
requires O(n2) quantum operations, due to the Fourier transform, and O(n) qubits.
Using theorem B.2, and requiring error ε in the approximation of the eigenvalues, we have
17E
2ν
? ε,
ν =
?
log2
17E
ε
?
,
i.e. ν = ?(log2d +m +log2ε−1). We also have n = ?(ν) and s = ?(n).
We derive the simulation cost taking the following facts into account.
• Steps 1–5 deal with the approximation of the eigenvalues. These computations are not
repeated for every t = 0,...,n −1. The total cost of these steps is O(n3) quantum
operations and O(n2) qubits.
• The total cost of step 6, resulting from all the values of t, is O(n2) quantum operations and
qubits.
• The total cost of step 7, that applies phase kickback for all values of t, does not exceed
O(n3) quantum operations and O(n2) qubits.
Therefore the total cost to simulate eih−2Lhγ, γ = 2π2t/E, for all t = 0,...,n −1, is O(n3)
quantumoperationsand O(n2)qubits.From(22)weconcludethatthecosttosimulatePoisson’s
matrix for the d-dimensional problem is d · O(n3) quantum operations and d · O(n2) qubits.
Finally, we remark that the dominant component of the cost is the one resulting from the
approximation of the eigenvalues (i.e. the cost of steps 1–5).
6. Total cost
We now consider the total cost for solving the Poisson equation (1). Discretizing the second
derivative operator on a grid with mesh size h = 1/M results in a system of linear equations,
where the coefficient matrix is (M −1)d×(M −1)d, i.e. exponential in the dimension d ? 1.
Solving this system using classical algorithms has a cost that grows at least as fast as the number
of unknowns (M −1)d. For the case d = 2, [31, table 6.1] summarizes the cost of direct and
iterative classical algorithms solving this system.
For simulating Poisson’s matrix we need dO(n3) quantum operations and dO(n2) qubits,
where n = O(log2d +m +log2ε−1) and m = log2M. To this we add the cost for computing
the reciprocal of the eigenvalues which is O((log2ε−1
and O((log2ε−1
min{ε, E−1}. Finally, we add the cost of the conditional rotation which is proportional to
(log2ε−1
From the above we conclude that the quantum circuit implementing the algorithm requires
an order of dO(n3)+(log2ε−1
The relation between the matrix size and the accuracy is very important in assessing
the performance of the quantum algorithm solving a linear system, since its cost depends
0)2log2log2ε−1
0) quantum operations
0) Newton steps, ε0=
0)log2log2ε−1
0) qubits, accounting for the O(log2log2ε−1
1)4quantum operations and (log2ε−1
1)3qubits, ε1= min{1/(4M)2,ε}.
1)4quantum operations and dO(n2)+(log2ε−1
1)3qubits.
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 23
22
on both of these quantities [25]. In particular, for the Poisson equation we have ignored, so
far, the effect of the discretization error of the Laplacian ?. If the grid is too coarse the
discretization error will exceed the desired accuracy. If the grid is too fine, the matrix will
be unnecessarily large. Thus the mesh size and, therefore, the matrix size should depend on
ε, i.e. M = M(ε). This dependence is determined by the smoothness of the solution u, which,
in turn, depends on the smoothness of the right-hand side function f . For example, if f has
uniformly bounded partial derivatives up to order four, then the discretization error is O(h2)
and we set M = ε−1/2; see [30, 31] for details. In general, we have M = ε−α, where α > 0 is a
parameter depending on the smoothness of the solution. This yields n = O(log2d +log2ε−1),
since m = log2M = α log2ε−1. The resulting number of the quantum operations for the circuit
is proportional to
max{d,log2ε−1}(log2d +log2ε−1)3,
and the number of qubits is proportional to
max{d,log2ε−1}(log2d +log2ε−1)2.
It can be shown that log2d = O(log2ε−1) and the number of quantum operations and qubits
become proportional to
max{d,log2ε−1}(log2ε−1)3
and
max{d,log2ε−1}(log2ε−1)2,
respectively.
Observe that the condition number of the matrix is proportional to ε−2αand is independent
of d. Therefore a number of repetitions proportional to ε−4αleads to a success probability
arbitrarily close to one, regardless of the value of d. This follows because repeating an algorithm
many times increases its probability of succeeding at least according to the Chernoff bounds
[36, box 3.4, p 154]. In contrast to this, the cost of any deterministic classical algorithm solving
the Poisson equation is exponential in d. Indeed, for error ε the cost is bounded from below by
a quantity proportional to ε−d/rwhere r is a smoothness parameter [21].
7. Conclusion and future directions
We present a quantum algorithm and a circuit for approximating the solution of the Poisson
equation in d dimensions. The algorithm breaks the curse of dimensionality and in terms of d
yields an exponential speedup relative to classical algorithms. The quantum circuit is scalable
and has been obtained by exploiting the structure of the Hamiltonian for the Poisson equation
to diagonalize it efficiently. In addition, we provide quantum circuit modules for computing
the reciprocal of eigenvalues and trigonometric approximations. These modules can be used in
other problems as well.
The successful development of the quantum Poisson solver opens up entirely new horizons
in solving structured systems on quantum computers, such as those involving Toeplitz matrices.
Hamiltonian simulation techniques [9, 28, 41] can also be combined with our algorithm to
extend its applicability to PDEs, signal processing, time series analysis and other areas.
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 24
23
Acknowledgments
SK and YC would like to thank the NSF CCI Center, ‘Quantum Information for Quantum
Chemistry (QIQC)’, award number CHE-1037992 and Army Research Office (ARO) for partial
support. AP, IP and JFT thank the NSF for financial support.
Appendix A
In this paper, X, Y and Z are Pauli matrices σx, σyand σz. I represents the identity matrix. H
is the Hadamard gate and W, in figure 2, represents H⊗nwhere n is the number of qubits in the
register. The matrix representations of other quantum gates used are the following:
V†=1
2
1+i1−i
22
?1−i1+i
?
,
Rzz(θ) = eiθ
?1 0
0 1
?
,
(A.1)
Rx(θ) =
cos
?θ
?θ
2
?
?
isin
?θ
?θ
2
?
?
?
isin cos
,
Ry(θ) =
cos
?θ
?θ
?
2
?
?
−sin
?θ
?θ
2
?
?
sin
2
cos
2
,(A.2)
S =
?1 0
0i
?
,
T =
?10
0 eiπ
4
,
Rz(θ) =
?10
0 eiθ
.
(A.3)
Appendix B
Theorem B.1. Consider the approximation ˆ xsto v−1, v > 1, using s steps of Newton iteration,
with initial approximation ˆ x0= 2−p, 2p−1< v ? 2p. Assume that each step takes b bit numbers
as inputs and produces b bit outputs and that all internal calculations are carried out in fixed
precision arithmetic. Then the error is
|ˆ xs−v−1| ? εN+s2−b,
where εNdenotes the desired error of Newton iteration without considering the truncation error,
εN? 2−2s. The truncation error is given by the second term and s ? ?log2log2ε−1
N?, b > p.
Proof. Consider the function g(x) = 1/x −v, x > 0, where g(1/v) = 0. The Newton iteration
for approximating the zero of g is given by
xs+1= ϕ(xs) = 2xs−vx2
The error es= |xs−1/v| satisfies es+1= ve2
es? (ve0)2s.
Let x0= 2−p. Now consider the lowest power of 2 that is greater than or equal to v, i.e.
2p−1< v ? 2p.Clearly p > 1sincev > 1andve0< 1/2.ForerrorεNwehave2−2s? εN,which
implies s ? ?log2log2ε−1
s,
s = 0,1,....
s. Unfolding the recurrence we get
N?.
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 25
24
The derivative of the iteration function is decreasing and we have |ϕ?| ? 2(1−ax0) ? 1.
We will implement the iteration using fixed precision arithmetic. We first calculate the round
off error. We have
ˆ x0= x0,
ˆ x1= ϕ(ˆ x0)+ξ1,
ˆ x2= ϕ(ˆ x1)+ξ2,
...
ˆ xs= ϕ(ˆ xs−1)+ξs,
where the ξidenotes truncation error at the respective steps. Thus
ˆ xs−xs= ϕ(ˆ xs−1)+ξs−ϕ(xs−1),
and using the fact |ϕ?| ? 1 we obtain
|ˆ xs−xs| ? |ˆ xs−1−xs−1|+|ξs| ?
s?
i=1
|ξi| ? s2−b,
assuming that we truncate the intermediate results to b bits of accuracy.
? ?
Lemma B.1. Let x ∈ [π/(2M),π/2) and W = 1+ix
??eix−Wr??? 27/r.
Proof. eix= (eix/r)r= (W + E(x/r))r, where for y = x/r, E(y) =?
?
r−x2
r2. Then
k?3
(iy)k
k!and
?????
k?3
(iy)k
k!
??????
?|y|3
?
k?3
|y|k
k!
= |y|3?
k?3
|y|k−3
k!
= |y|3?
k?0
k!
(k +3)!
? ?? ?
1
(k+1)(k+2)(k+3)?1
6
|y|k
k!
6
e|y|< |y|3,
(B.1)
where the last inequality holds for |y| = |x
??E(x
|W| =
r| < 1, which is true due to our assumptions. Hence
r)??? |x
r|3for |x| < r.
We then turn our attention to the powers of W,
????1+ix
?
r−x2
r2
????? 1+x
?k
r+x2
r2.
(B.2)
For all k ∈ {1,2,...,r} we have
|W|k?
1+x
r+x2
r2
? e
?
x
r+x2
r2
?
k= e
|x|
rke
|x|2
r2k? e|x|e
|x|2
r ? e2x? eπ
(B.3)
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 26
25
where we have used the fact thatk
k ∈ Z+. Indeed,
k?
r< 1. The second inequality is due to (1+a)k? eka, a ∈ R,
(1+a)k=
l=0
?k
l
?
k?
ak−l=
k?
l=0
k!
l!(k −l)!ak−l=
k?
(ka)k−l
(k −l)!?
l=0
k!
l!(k −l)!
(ka)k−l
kk−l
=
l=0
k(k −1)···(l +1)
kk−l
????
?1
l ···1
l!
? ?? ?
?1
k?
l=0
(ka)k−l
(k −l)!=
k?
l=0
(ka)l
l!
? eka.
(B.4)
Finally we look at the approximation error. Note that
?
= Wr+
?
Consider the kth term in the error series. According to (B.1) we have
?r
eix=
W + E
?x
?
r
??r
Wr−1E
=
r?
?x
k=0
?r
?
error in r-th power
k
?
Wk?
E
?x
W0?
r
??r−k
?r
l
r
+···+
??
?r
?r
r
?
E
?x
r
??r
?
|x|3k
r3k
|x|3k
r2k
.
(B.5)
k
?
|W|r−k???E
?x
r
????
k
? C
k
????x
r
???
3k
= C
r!
k!(r −k)!
= Cr(r −1)···(r −k +1)
? C|x|k
k!
k!
1
rk
|x|2k
r2k?π
2C
?|x|
r
?2k
?π
2eπ
?|x|
θ
12k
r
?2k
,
where C = eπand we use Stirling’s formula k! =√2πkk+1/2exp?−k +
error is bounded by
?r
?, θ ∈ (0,1), [44,
p 257] to obtain |x|k/k! ? 5−kxkek? 1 for k ? 5, since |x| ?π
2. So the total approximation
|eix−Wr| ?
r?
k=1
k
?
|W|r−k???x
r
???
3k
?π
2eπr
?|x|
r
?2
? eπ?π
2
?31
r? 27×1
r.
(B.6)
? ?
Lemma B.2. Under the assumptions of lemma B.1
|sinx −?(Wr)| ? 27/r
and
|cosx −?(Wr)| ? 27/r.
The proof is trivial and we omit it.
Proposition B.1. Let r = 2ν+7for ν ? 1 and consider the procedure computing Wr, as defined
in lemma B.1 using repeated squaring. Assume each step computing a square carries out the
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 27
26
calculation using fixed precision arithmetic and that its inputs and outputs are s bit numbers.
LetˆWrbe the final result. Then the error is
???Wr−ˆWr
??? ?2ν+9
2s,
fors ? 11+ν +log2M,where1/M isthemeshsizeinthediscretizationofthePoissonequation.
Proof. We are interested in estimating sin(jπ/(2M)), for j = 1,2,..., M −1. We consider x ∈
[π/(2M),π/2). We approximate eixand from this sinx, which is the imaginary part of eix. Let
y =x
|W|2= 1− y2+ y4< 1. LetˆW0= 1− ˆ y2+iˆ y, y − ˆ y ? 2−s. Then |ˆW0|2? |W|2+4y2−s< 1, for
s ? 11+ν +log2M. This value of s follows by solving
4y2−s? y2/2,
which ensures thatˆW2
????
????
ˆW1=ˆW0+e1,
ˆW2=ˆW2
...
?
where r = 2ν+7and the error terms e1,e2,...,erare complex numbers denoting that the real
and imaginary parts of the results are truncated to s bits of accuracy.
Observe that if |ˆW2j−1| < 1 then |ˆW2j| < 1, since |ˆW2j−1|2< 1 and truncation of real and
imaginary parts does not increase the magnitude of a complex number. Since |ˆW0| < 1, all the
numbers in the sequence (B.7) belong to the unit disc S in the complex plane.
Let z = a +bi. Then the function that computes z2can be understood as a vector valued
function of two variables, h : S → S, such that h(a,b) = (a2−b2,2ab). The Jacobian of h is
J = 2
ba
and its Euclidean norm satisfies ?J?? 2, since a2+b2? 1. Using this bound we obtain
|Wr−ˆWr| ? |Wr−(ˆWr/2)2|+|er|
? 2{2|Wr/4−ˆWr/4|+|er/4|}+|er|
? 2ν+7|W −ˆW1|+2ν+7−1|e2|+···+20|e2ν+7|
= 2ν+7???W −ˆW0
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
r? 2−7. We truncate it to s bits of accuracy to obtain ˆ y. Note that W = 1− y2+iy satisfies
0? 1. In addition,
???? ? 2y2−s+2−2s
ˆW0−W
?
?
ˆW0−W
and
???? ? 2−s.
Define the sequence of approximations
1+e2,
ˆWr=
ˆWr/2
?2
+er,
(B.7)
?a −b
?
,(a,b) ∈ S
???+2ν+7|e1|+···+|e2ν+7|
Page 28
27
? 2ν+7???W −ˆW0
? 2ν+7
???+
√2
2s
ν+7
?
j=0
2ν+7−j
??
2y1
2s+
1
22s
?2
+
1
22s+
√2
2s
?2ν+8−1?
? 42ν+7
2s,
(B.8)
where the last inequality follows since 2y +2−s? 2−6+2−11.
? ?
Proposition B.2. Under the assumptions of proposition B.1 we approximate sinx by ?(ˆWr),
x ∈ [π/(2M),π/2), with s = max{2ν +9,11+ν +log2M} bits and r = 2ν+7. Then the error is
|sinx −?(ˆWr)| ? 2−(ν−1).
Moreover, we note the following.
• Denoting byˆWr,jthe approximations to sin(πj/(2M)), j = 1,2,..., M −1, we have the
following error bound:
????4M2sin2(jπ/(2M))−4M2?
derivative operator, using mesh size h = 1/M.
• Letting ?jbe the truncation of 4M2(?(ˆWr,j))2to ν bits after the decimal point (the length
of ?jis ν +log2(4M2) bits, and ν is sufficiently large to satisfy the accuracy requirements)
we have
??4M2sin2(jπ/(2M))−?j
?(ˆWr,j)
?2????? 2−(ν−4)M2,
j = 1,2,..., M −1, for the eigenvalues of the matrix h−2Lhthat approximates the second
??? 17×2−νM2,
for j = 1,2,..., M −1.
Proof. We have???eix−ˆWr
??? ?
?
??eix−Wr??+
???Wr−ˆWr
???
27
2ν+7+2ν+9
= 2−ν+2ν+9
2s
2s=
1
2ν−1,
(B.9)
for s = max{2ν +9,11+ν +log2M}, which completes the proof of the first part. The proof of
the second and third parts follows immediately.
? ?
Theorem B.2. Consider the eigenvalues
λj1,...,jd= 4M2
d?
k=1
sin2
?jkπ
2M
?
,
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 29
28
jk= 1,2,..., M −1, k = 1,2,...,d of −?h, h = 1/M. Let
d
?
where ?jkare defined in proposition B.2, jk= 1,2,..., M −1, k = 1,2,...,d. Then
|λj1,...jd−ˆλj1,...,jd| ?17M2d
2ν
The proof follows from proposition B.2 and the fact that the d-dimensional eigenvalues are
sums of the one-dimensional eigenvalues.
ˆλj1,...,jd=
k=1
?jk,
.
References
[1] Abrams D S and Lloyd S 1997 Simulation of many-body Fermi systems on a quantum computer Phys. Rev.
Lett. 79 2586–9
[2] Abrams D S and Lloyd S 1999 Quantum algorithm providing exponential speed increase for finding
eigenvalues and eigenvectors Phys. Rev. Lett. 83 5162–5
[3] Aspuru-Guzik A, Dutoi A D, Love P J and Head-Gordon M 2005 Simulated quantum computation of
molecular energies Science 379 1704–7
[4] Dowling J P 2006 To compute or not to compute Nature 439 919
[5] Lidar D and Wang H 1999 Calculating the thermal rate constant with exponential speed-up on a quantum
computer Phys. Rev. E 59 2429–38
[6] Lloyd S 1996 Universal quantum simulators Science 273 1073–8
[7] Papageorgiou A, Petras I, Traub J F and Zhang C A fast algorithm for approximating the ground state energy
on a quantum computer Math. Comput. to appear
[8] Shor P W 1994 Algorithms for quantum computation: discrete logarithm and factoring Proc. 35th Annual
Symp. Foundations of Computer Science ed S Goldwasser (New York: IEEE Computer Society Press)
pp 124–34
[9] Papageorgiou A and Zhang C 2012 On the efficiency of quantum algorithms for hamiltonian simulation
Quantum Inform. Process. 11 541–61
[10] Wang H, Ashhab S and Nori F 2012 Quantum algorithm for obtaining the energy spectrum of a physical
system Phys. Rev. A 85 062304
[11] Wang H, Kais S, Aspuru-Guzik A and Hoffmann M R 2008 Quantum algorithm for obtaining the energy
spectrum of molecular systems Phys. Chem. Chem. Phys. 10 5388–93
[12] You J Q and Nori F 2011 Atomic physics and quantum optics using superconducting circuits Nature 474 589
[13] Batchelor G K 2000 An Introduction to Fluid Dynamics (Cambridge: Cambridge University Press)
[14] Fletcher C A J 1991 Computational Techniques for Fluid Dynamics vol 1, 2nd edn (Berlin: Springer)
[15] Tomasi J, Mennucci B and Cammi R 2005 Quantum mechanical continuum solvation models Chem. Rev.
105 2999–3094
[16] Griffiths D J 1999 Introduction to Electrodynamics (Upper Saddle River, NJ: Prentice-Hall)
[17] Meyn S P 2007 Control Techniques for Complex Networks (Cambridge: Cambridge University Press)
[18] Meyn S P and Tweedie R L 2009 Markov Chains and Stochastic Stability (Cambridge: Cambridge University
Press)
[19] Asmussen S and Glynn P W 2007 Stochastic Simulation: Algorithms and Analysis (Stochastic Modelling and
Applied Probability vol 57) (Berlin: Springer) pp 103–5
[20] Engel E and Dreizler R M 2011 Density Functional Theory: An Advanced Course (New York: Springer)
[21] Werschulz A G 1991 The Computational Complexity of Differential and Integral Equations: An Information-
Based Approach (New York: Oxford University Press)
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Page 30
29
[22] Ritter K and Wasilkowski G W 1996 On the average case complexity of solving poisson equations (Lectures
in Applied Mathematics vol 32) ed J Renegar, M Shub and S Smale (University Park, PA: The Pennsylvania
State University) pp 677–87
[23] Grover L and Rudolph T 2002 Creating superpositions that correspond to efficiently integrable probability
distributions arXiv:quant-ph/0208112v1
[24] Soklakov A N and Schack R 2006 Efficient state preparation for a register of quantum bits Phys. Rev. A
73 012307
[25] Harrow A W, Hassidim A and Lloyd S 2009 Quantum algorithm for linear systems of equations Phys. Rev.
Lett. 15 150502
[26] Berry D W 2010 Quantum algorithms for solving linear differential equations arXiv:1010.2745v1 [quant-ph]
[27] Leyton S K and Osborne T J 2008 A quantum algorithm to solve nonlinear differential equations
arXiv:0812.4423 [quant-ph]
[28] Childs A M and Wiebe N 2012 Hamiltonian simulation using linear combinations of unitary operations
arXiv:1202.5822 [quant-ph]
[29] Evans L C 1998 Partial Differential Equations (Providence, RI: American Mathematical Society)
[30] Forsythe G E and Wasow W R 2004 Finite-Difference Methods for Partial Differential Equations (New York:
Dover)
[31] Demmel J W 1997 Applied Numerical Linear Algebra (Philadelphia, PA: SIAM)
[32] LeVeque R J 2007 Finite Difference Methods for Ordinary and Partial Differential Equations (Philadelphia,
PA: SIAM)
[33] Bramble J H and Hubbard B E 1962 On the formulation of finite difference analogues of the Dirichlet problem
for Poisson’s equation Numer. Math. 4 313–27
[34] Saad Y 2003 Iterative Methods for Sparse Linear Systems (Philadelphia, PA: SIAM)
[35] Traub J F and Wo´ zniakowski H 1984 On the optimal solution of large linear systems J. ACM 31 545–59
[36] Nielsen M A and Chuang I L 2000 Quantum Computation and Quantum Information (Cambridge: Cambridge
University Press)
[37] Vedral V, Barenco A and Ekert A 1996 Quantum networks for elementary arithmetic operations Phys. Rev. A
54 147–53
[38] Klappenecker A and Roetteler M 2001 Discrete cosine transforms on quantum computers arXiv:quant-
ph/0111038
[39] Pueschel M, Roetteler M and Beth T 1998 Fast quantum fourier transforms for a class of non-Abelian groups
arXiv:quant-ph/9807064v1
[40] Wickerhauser M V 1994 Adapted Wavelet Analysis from Theory to Software (Wellesley, MA: A K Peters)
[41] Berry D W, Ahokas G, Cleve R and Sanders B S 2007 Efficient quantum algorithms for simulating sparse
Hamiltonians Commun. Math. Phys. 270 359–71
[42] di Benedetto F 1997 Preconditioning of block Toeplitz matrices by sine transforms SIAM J. Sci. Comput.
18 499–515
[43] Jordan S P 2005 Fast quantum algorithm for numerical gradient estimation Phys. Rev. Lett. 95 050501
[44] Abramowitz M and Stegun I A 1972 Handbook of Mathematical Functions (New York: Dover)
New Journal of Physics 15 (2013) 013021 (http://www.njp.org/)
Download full-text