GPGPU Grover 1, 2 1 3 4 Grover Grover OpenMP GPGPU Grover qubit OpenMP GPGPU, 1.47 qubit On Large Scale Simulation of Grover s Algorithm by Using GPGPU Hiroshi Shibata, 1, 2 Tomoya Suzuki, 1 Seiya Okubo 3 and Tetsuro ishino 4 In this paper, we deal with parallel simulation methods of Grover s quantum search algorithm. Grover s algorithm is one of a well-known quantum search algorithms. On the other hand, the research on the efficient simulation of quantum algorithms is very important in order to understand the principle, behavior and application fields of quantum computing. We implemented a parallel simulator of Grover s search algorithm using OpenMP and GPGPU. We improved the execution time and the executable qubit size of simulation by revised of each method. As a result of computational experiments, by using GPGPU, the execution time of Grover s algorithm can be improved to 1.4 times as fast as that of OpenMP experiments. Also the executable qubit size of it can be inproved. 1. 1985 D.Deutsch Turing 1994 P.W.Shor 1996 L.K.Grover 5) Turing Turing Grover 4) 7) Grover OpenMP API(OpenMP Application Program Interface OpenMP ) GPU (Graphics Processing Unit) GPGPU (General Purpose Computation on Graphics Processing Unit) Grover GPGPU OpenMP 1 The Graduate School of Electro-Communications, The University of Electro-Communications 2 Department of Electronic Control Engineering, Hiroshima ational College of Maritime Technology 3 School of Administration and Informatics, The University of Shizuoka 4 Department of Information and Communication Engineering, The University of Electro- Communications 1 c 2009 Information Processing Society of Japan
GPGPU GPGPU 2. 2.1 Turing (Quantum Turing Machine QTM ) Turing QTM 1 0 1 1 8) Turing M 7 Q, Σ, Γ, δ, q 0, B, F Q Γ B Γ Σ Γ {B} q 0 Q F Q δ : Q Γ Γ Q {L, R} C (C ) M 1 δ(p, a, b, q, d) = c M p a q b d 1 2 QTM M δ 2.2 Grover Grover Grover : = 2 n : x 1, x 2 x x i 2 x 1, x 2 x f(x i ) : {0, 1} n {0, 1} f(x i ) = 1 x i α 1 x 1, 0 + α 2 x 2, 0 + + α x, 0 α 1 x 1, f (x 1 ) + α 2 x 2, f (x 2 ) + + α x, f (x ) 5) ( 1 ) ( ) 1 1, 1,, ( 2 ) O( ). ( a ) x f(x) = 1 f(x) = 0. ( b ) D D. D ij = 2 if i j and D ii = 1 + 2. ( 3 ). (( 2 ) Grover 1 O ( 2 ) O( ) ( 3 ) 1. 3. 3.1 OpenMP OpenMP CPU OpenMP OpenMP Architecture Review Board 1 for 10000 1 #pragma omp parallel for for OpenMP 3.2 GPGPU GPGPU GPU GPU GPU 2 GPU GPGPU GPU 2 c 2009 Information Processing Society of Japan
#pragma omp parallel for for(i=0;i<=10000;i++){... } 1 OpenMP Fig. 1 An example of a parallel program using OpenMP. 2 GPU CPU Fig. 2 Floating-Point Operations per Second for the CPU and GPU.. VIDIA GPU CUDA(Compute Unified Device Architecture) 9) CUDA GPGPU C. CUDA VIDIA GPU (Streaming Multi Processer, SM ) SM 8 (Scalar Processer, SP) SP SM CUDA (thread) (block) SP 1 SM 1 1 SP SM SP CUDA GPU (VRAM) Global SM Shared 4. 4.1 Grover ( 1 ) 1 2 n x ( 2 ) ( 3 ) 1 ( a ) 2 ( b ) 2 ( 4 ) ( a ) f(x) = 1 x ( b ) ( c ) ( d ) ( e ) 1 ( i ) 2 ( ii ) 2 (1) (3) (1) (4) (2) (2) (4d) α α α (Mersenne Twister) 4.2 OpenMP: OpenMP (4b) (4e) for OpenMP 3 c 2009 Information Processing Society of Japan
for (4(e)i) (4d) (4(e)ii) (4b) OpenMP GPU 4.3 GPGPU: GPGPU (2) (3) (4b) (4e) 1) 2) (4b) (4(e)i) GPU SP CPU CPU GPU VRAM GPU Global Global Shared Global Shared CUDA 1 1) 1 256 4.4 GPGPU: GPU GPGPU GPU VRAM GPU VRAM 1) 2) VRAM VRAM 3 GPU Fig. 3 Limitation of send data to GPU. 4 GPGPU Fig. 4 Divided execution of GPGPU. GPU VRAM 3 GPU VRAM CPU GPU GPU CPU CPU GPU GPU 4 GPU VRAM qubit qubit VRAM CPU GPU 5. 5.1 OpenMP 2006 2009 3000sec 1 500 5 3 OpenMP-US IV+ OpenMP-Core i7 Core i7 4 c 2009 Information Processing Society of Japan
Table 1 1 OpenMP Execution environment of OpenMP. (OpenMP-US IV+) Core i7 (OpenMP-Core i7) CPU UltraSparc IV+ 1.5GHz Core i7-920 2.66GHz 44 2 4 2 ( ) ( 88 ) ( 8 ) 352GB 9GB OS Solaris 9 Windows Vista x64 sp2 Sun Studio 12 Visual Studio 2005 Table 2 CPU GPU OS 2 GPGPU Execution environment of GPGPU. Intel Core i7-920 2.66GHz 9GB Tesla C1060 SM : 30 SP ( ): 240 VRAM: 4GB Windows Vista x64 sp2 CUDA 2.3 SDK 27qubit Core i7 26qubit qubit OpenMP-US IV+ OpenMP- Core i7 5.2 GPU GPGPU OpenMP 2 1 256 27qubit GPU 1 28qubit qubit 5 3 GPGPU-Div, GPGPU-Single 27qubit 29qubit 27qubit 28qubit 5 3 GPGPU OpenMP 1.47 OpenMP GPGPU-Div qubit qubit 6. 6.1 OpenMP 5.1 OpenMP CPU Core i7 [sec] 3000 2500 2000 1500 1000 500 OpenMP-US IV+ OpenMP-Core i7 GPGPU-Single GPGPU-Div 0 19 20 21 22 23 24 25 26 27 28 29 qubit 5 OpenMP GPGPU Fig. 5 Execution time of OpenMP and GPGPU. CPU 6.2 GPU 28qubit GPU VRAM VRAM 5 c 2009 Information Processing Society of Japan
3 OpenMP GPGPU Table 3 Execution time of OpenMP and GPGPU. Qubits OpenMP OpenMP GPGPU GPGPU -US IV+ [sec] -Core i7 [sec] -Div [sec] -Single [sec] 19 2.76 2.72-2.88 0.94 20 5.27 5.34-5.00 1.07 21 13.12 10.90-9.04 1.21 22 31.42 21.11-17.24 1.22 23 71.28 47.78-33.19 1.44 24 183.31 92.33-65.34 1.41 25 412.90 191.02-131.48 1.45 26 1086.78 383.44-260.30 1.47 27 2616.07-522.17-28 1485.17-29 2960.01 - OpenMP-Core i7 / GPGPU-Single 5 GPGPU-Single GPGPU-Div VRAM 6.3 OpenMP GPGPU 2 GPGPU CPU GPGPU 19 26qubit Grover OpenMP 1.5 GPGPU OpenMP GPGPU SM SP GPGPU 27qubit OpenMP-Core i7 27qubit 26qubit 1qubit 27qubit 766sec 28qubit 1532sec 29qubit 3064sec GPGPU-Div GPGPU OpenMP 7. Grover OpenMP GPGPU OpenMP GPGPU qubit Grover GPGPU qubit Grover GPGPU GPU 1) : Grover GPGPU, 21 QIT2009-58, pp.72-77(2008) 2) : GPGPU Grover,, 2008-AL-120 (5), pp.33-40(2008) 3) : Grover,, 2008-AL-116 (8), pp.55-62 (2008) 4) Biham, E., Biham, O., Biron, D., Grassl, M. and Lidar, D.: Grover s Quantum Search Algorithm for an Arbitrary Initial Amplitude Distribution, quantph/9807027 (1998) 5) Grover, L.: Quantum Mechanics Helps in Serching for a eedle in a Haystack, Physical Review Letters, Vol. 79, o. 2, pp. 325-328 (1997) 6) iwa, J., Matsumoto, K. and Imai, H.: General purpose parallel simulater for quantum computing, Physical Review A 66, 062317 (2002) 7) Pedro J. Salas.: oise effect on Grover algorithm, arxiv:0801.1261v1 [quant-ph] 8) :, (2002) 9) VIDIA Corporation: VIDIA CUDA Compute Unified Device Architexture Programming Guide, Version 2.3 (2009) 6 c 2009 Information Processing Society of Japan