Quantum Coin Method for Numerical Integration
Total Page:16
File Type:pdf, Size:1020Kb
Quantum Coin Method for Numerical Integration N. H. Shimada T. Hachisuka The University of Tokyo Figure 1: Experiment with supersampling. We supersample 8 × 8 subpixels of "Original image". "Ideal sampling" shows the ground truth, which takes an average of 8×8 subpixels. Monte Carlo and our method (QCoin) take samples from subpixels to approximate this average for each pixel. The images show the results of numerical experiments using Monte Carlo, Quantum Supersampling [Joh16](QSS) on a noiseless simulator, QCoin on a noiseless simulator, and QCoin on an actual quantum computer with the equal sample counts of 240 queries (only QSS is done by 255 queries). The table shows mean absolute error of 5 colored rectangular regions (black, gray, and white) in the bottom of supersampling images and of gradation regions on the right half of the images. QCoin produces more accurate results than Monte Carlo does because of its accurate estimation using quantum computers. While QSS is comparable to QCoin, it works well only on a noiseless simulator as reported by Johnston [Joh16]. QCoin, on the other hand, works well even on an actual quantum computer for the first time. Abstract Light transport simulation in rendering is formulated as a numerical integration problem in each pixel, which is commonly estimated by Monte Carlo integration. Monte Carlo integration approximates an integral of a black-box function by taking the average of many evaluations (i.e., samples)p of the function (integrand). For N queries of the integrand, Monte Carlo integration achieves the estimation error of O(1= N). Recently, Johnston [Joh16] introduced quantum supersampling (QSS) into renderingp as a numerical integration method that can run on quantum computers. QSS breaks the fundamental limitation of the O(1= N) convergence rate of Monte Carlo integration and achieves the faster convergence rate of approximately O(1=N) which is the best possible bound of any quantum algorithms we know today [NW99]. We introduce yet another quantum numerical integration arXiv:1910.00263v2 [quant-ph] 24 Apr 2020 algorithm, quantum coin (QCoin) [AW99], and provide numerical experiments that are unprecedented in the fields of both quantum computing and rendering. We show that QCoin’s convergence rate is equivalent to QSS’s. We additionally show that QCoin is fundamentally more robust under the presence of noise in actual quantum computers due to its simpler quantum circuit and the use of fewer qubits. Considering various aspects of quantum computers, we discuss how QCoin can be a more practical alternative to QSS if we were to run light transport simulation in quantum computers in the future. 1. Introduction time and suggested many interesting directions for further research. Their main focus is on Grover’s database search algorithm [Gro96], The use of quantum computers for computer graphics is a fasci- and they showed how its application could lead to fundamentally nating idea and potentially leads to a whole new field of research. more efficient algorithms than those on classical computers for var- Lanzagorta and Uhlmann [LU05] mentioned this idea for the first ious tasks in rendering, such as rasterization, ray casting, and ra- diosity. Since Lanzagorta and Uhlmann, however, there has been in a classical case. This process is probabilistic and the probability little effort put into this direction, mostly due to the limited avail- is given by a squared value of its amplitude. For example, in the ability of actual quantum computers at that time. case of Equation1, the measurement of jyi returns j0i with the 2 2 Recently, Johnston [Joh16] introduced a quantum algorithm probability a and j1i with the probability 1 − a . called Quantum SuperSampling (QSS) into computer graphics. Johnston proposed to use this algorithm to perform supersampling Quantum logic gates. Just like logic gates for bits on classical of sub-pixels in rendering. This problem is essentially a numeri- computers, there are several known quantum logic gates that are cal integration problem in each pixel, which is commonly done by used to manipulate qubits. We summarize some of them here. Monte Carlo integration on classical computers. Johnston showed that the performance of this quantum algorithm is fundamentally Identity gate Iˆ Pauli Xˆ ;Zˆ gates better than classical Monte Carlo integration in terms of time com- Iˆj0i = j0i Xˆ j0i = j1i; Zˆ j0i = j0i plexity. On the other hand, his experiments on an actual quantum Iˆj1i = j1i Xˆ j1i = j0i; Zˆ j1i = −j1i computer are not as successful as the simulated results due to the presence of noise in quantum computers. Since noise is essentially unavoidable in the current architecture of quantum computers, this Hadamard gate Hˆ Rotation gate Uˆ issue restricts the use of QSS in practice. q j0i + j1i Hˆ j0i = p Uq j0i = cosqj0i + sinqj1i We introduce yet another quantum algorithm for numerical in- 2 U j1i = −sinqj0i + cosqj1i tegration which runs well also on actual quantum computers; the j0i − j1i q Hˆ j1i = p Quantum Coin method (QCoin). We show that the performance of 2 (q is a rotation angle) QCoin is equivalent to QSS both theoretically and numerically, in- cluding its convergence rate. We discuss the difference between two algorithms in terms of their implementations on a quantum com- Multi-qubits. We express a multi-qubit state by concatenating puter. Unlike QSS, QCoin can be regarded as a hybrid of quantum- ∗ single-qubit states. For example, a two-qubits state whose qubits classical algorithm [KMT 17]. Being a hybrid algorithm, we show are both j0i are expressed as j0i ⊗ j0i or j00i. The symbol ⊗ rep- how QCoin is much more practical than QSS in the presence of resents a tensor product which means the concatenation of qubits noise and the various restrictions on actual quantum computers. in this case. In the following, we omit the symbol ⊗ for simplicity We tested our QCoin on a real quantum computer and confirmed when it is obvious. In general, a two-qubits state whose qubits are that QCoin already shows better performance than classical Monte both superposition states as Equation1 can be written as Carlo integration. Figure1 shows one experiment where we com- pared Monte Carlo and QCoin with the equal sample counts. QCoin jyia = a0 j0i + a1 j1i; jyib = b0 j0i + b1 j1i achieves more accurate estimation both on a simulator and an ac- ! jyia ⊗ jyib = (a0 j0i + a1 j1i) ⊗ (b0 j0i + b1 j1i) tual quantum computer. We also discuss several open problems for = a0b0 j00i + a0b1 j01i + a1b0 j10i + a1b1 j11i: running rendering tasks on quantum computers in the future. Since this explicit binary notation quickly becomes tedious for many qubits, we use another notation ji) for a decimal number i in the binary representation in−1 ···i1i0 as 2. Background ji) ≡ jin−1i ⊗ ··· ⊗ ji1i ⊗ ji0i: (2) Before diving into the details of our method, we first summarize For example, in the case of 4 qubits, we write as some basic concepts of quantum computing for readers who are not familiar with them. While we do cover the basics that are nec- j0) = j0000i;j1) = j0001i;j2) = j0010i;··· ;j15) = j1111i: essary to understand our method in this paper, for some further details, readers might want to refer to a standard textbook of quan- tum computing [NC11] or an introductory textbook for readers with Quantum operation as a tensor product. In quantum computing, computer science background [JHS19]. tensor products are also used to represent logic gate operations. For example, given the initial two-qubits state j0i⊗j0i, the application Single-qubit and superposition. On a classical computer, all the of the Hadamard Hˆ gate for the first qubit and the Pauli Zˆ gate for information is stored as a set of bits where each bit represents only the second qubit can be written as a binary number 0 or 1. We represent a state of a bit having 0 as j0i and 1 as j1i. The notation of ji is called "bra-ket", which is (Hˆ ⊗ Zˆ)(j0i ⊗ j0i) = Hˆ j0i ⊗ Zˆ j0i: (3) commonly used in the field of quantum computing. On a quantum If we only operate the Hˆ gate for the first qubit and leave the second computer, a single qubit can represent a superposition of both j0i qubit unchanged, we can use the identity gate Iˆ: and j1i. For example, we can represent a superposition state, sup- posing the real number a 2 [−1;1] as an amplitude of j0i: (Hˆ ⊗ Iˆ)j0i ⊗ j0i: (4) p jyi = aj0i + 1 − a2 j1i: (1) When we apply the same gate to all the qubits, we omit the ⊗ sym- bol and simplify the notation as If we measure (read out) a qubit, the state converges to either side of ˆ ˆ ˆ j0i or j1i. That is, the only information we can get is either 0 or 1 as H j00i ≡ H j0i ⊗ H j0i: (5) 2 This notation is also adopted in the case of the decimal representa- tion in Equation2. For the 4 qubits case, Hˆ j0) ≡ Hˆ j0000i = Hˆ j0i ⊗ Hˆ j0i ⊗ Hˆ j0i ⊗ Hˆ j0i j0i + j1i j0i + j1i j0i + j1i j0i + j1i = p ⊗ p ⊗ p ⊗ p 2 2 2 2 1 1 15 = p (j0000i + j0001i + ···j1111i) = p ji): (6) 4 4 ∑ 2 2 i=0 Oracle gate. In quantum computing, it is usually assumed that we have a (quantum) circuit which converts the information of an input data for each specific application as a quantum state. This circuit is commonly called an oracle gate. For example, in a database-search ˆ problem [Gro96] with the input data [a0;a1;a2;a3], the oracle Oˆ Figure 2: Amplitude amplification from jyi to Gjyi. The am- gate works as using a normalization constant C: plitude of jbi is amplified from cosq to cos3q in the case that q is a small value.