n 3
play

N 3 PDF Machine Learning PDFs QCD Introduction Introduction - PowerPoint PPT Presentation

Quantum simulation with hardware acceleration (arXiv:2009.01845) Stefano Carrazza 18th September 2020, QTI TH meeting, CERN. Universit` a degli Studi di Milano, INFN Milan, CERN, TII N 3 PDF Machine Learning PDFs QCD Introduction


  1. Quantum simulation with hardware acceleration (arXiv:2009.01845) Stefano Carrazza 18th September 2020, QTI TH meeting, CERN. Universit` a degli Studi di Milano, INFN Milan, CERN, TII N 3 PDF Machine Learning • PDFs • QCD

  2. Introduction

  3. Introduction From a practical point of view, we are moving towards new technologies, in particular hardware accelerators: Moving from general purpose devices ⇒ application specific 1

  4. Introduction From a practical point of view, we are moving towards new technologies, in particular hardware accelerators: Moving from general purpose devices ⇒ application specific From a hep-ph perspective we are transitioning from CPU to GPU , e.g. • Monte Carlo simulation, • Parton distribution function determination and evaluation, • ML models inspired on physics and ML models in general. 1

  5. Quantum research Structure of research field in quantum technologies: Example: qubits achieved by date and organization from 1998-2019 2

  6. Quantum advantage First quantum computation that can not be reproduced on a classical supercomputer from Google, Nature 574, 505-510(2019): 53 qubits (86 qubit-couplers) → Task of sampling the output of a pseudo-random quantum circuit (extract probability distribution). Classically the probability distribution is exponentially more difficult. 3

  7. NISQ era ⇒ We are in a Noisy Intermediate-Scale Quantum era ⇐ How can we contribute? • Develop new algorithms ⇒ using classical simulation of quantum algorithms • Adapt problems and strategies for current hardware ⇒ hybrid classical-quantum computation 4

  8. Quantum Algorithms There are three families of algorithms: Gate Circuits Variational (AI inspired) • Search (Grover) • Autoencoders • QFT (Shor) • Eigensolvers • Classifiers • Deutsch Annealing • Direct Annealing • Adiabatic Evolution • QAOA 5

  9. Quantum landscape 6

  10. Introducing Qibo

  11. Context Qibo is the open-source API for a new quantum hardware developed at: ⇒ Barcelona by UB, BSC, IFAE, QQT ⇒ Abu Dhabi by TII Expected machines based on different technologies for multiple qubits. 7

  12. Motivation Why a quantum middleware? Natural questions: 1 How to prepare and execute quantum algorithms? 2 How to make quantum hardware accessible to users? 8

  13. The middleware definition Computing framework Infrastructual setup Development of a quantum computing Development of an IT infrastructure framework which encodes quantum for users to execute and retrieve results algorithms in a programming API. from quantum hardware using Qibo. 9

  14. The Qibo framework

  15. Qibo module design Qibo is a general purpose quantum computing API specialized in: • Model simulation on classical hardware: CPUs and GPUs • Model execution on quantum hardware Furthermore Qibo provides the possibility to: • create a codebase for quantum algorithms • mix classical and quantum algorithms 10

  16. Qibo modules Modules supported by Qibo 0.1.0 : Modules are designed to work on simulation and quantum hardware. 11

  17. Qibo 0.1.0 main features • Circuit-based quantum processors R y R y • State wave-function propagation • • • Controlled gates R y R y • • • Measurements • Density matrices and noise R y R y • • • Callbacks R y R y • • • Gate Fusion • Distributed computation R y R y • • • Variational Quantum Eigensolver R y R y • • • Annealing quantum processors • Time evolution of quantum states • Adiabatic Evolution simulation • Scheduling determination i � ∂ ∂t | ψ ( t ) � = H ( s ) | ψ ( t ) � • Trotter decomposition • QAOA 12

  18. Qibo technical aspects 1 efficient simulation engine for: • multithreading CPU • single-GPU • multi-GPU 2 designed with modern standards: • installers ( pip install qibo ) • documentation • unit testing • continuous integration 3 released as an open-source code https://qibo.science 13

  19. Qibo language and technologies Project statistics: 10’000 lines of code in Python/C++ . The current simulation engine is based on: • TensorFlow 2: • Representation of quantum states, density matrices and gates. • Optimizes linear algebra operations on CPU/GPU. • Introduces an abstraction interface to hardware implementation. • Warning: requires custom operators and fine tuning for efficiency. • Numpy/Scipy: linear algebra object definition and optimizers. • Joblib: manages the computation distribution on multi-GPU . 14

  20. Circuit simulation with Qibo

  21. Quantum circuit simulation Qibo simulates the behaviour of quantum circuits using dense complex state vectors ψ ( σ 1 , σ 2 , . . . , σ N ) ∈ C in the computational basis where σ i ∈ { 0 , 1 } and N is the total number of qubits in the circuit. The final state of circuit evaluation is given by: � ψ ′ ( σ ) = G ( σ , σ ′ ) ψ ( σ 1 , . . . σ ′ i 1 , . . . , σ ′ i N targets , . . . , σ N ) , σ ′ where the sum runs over qubits targeted by the gate. • G ( σ , σ ′ ) is a gate matrix which acts on the state vector. • ψ ( σ ) from a simulation point of view is bounded by memory. 15

  22. Some useful quantum gates Rotations around the axis of the Bloch sphere: � � � � cos θ − i sin θ e − iθ/ 2 0 R x ( θ ) = 2 2 , R z ( θ ) = − i sin θ cos θ e iθ/ 2 0 2 2 The controlled-phase gate and Hadamard :   1 0 0 0 � � 0 1 0 0 1 1 1   √ C z =  , H =    0 0 1 0  1 − 1 2  0 0 0 − 1 Others examples are: Pauli X/Y/Z, Toffoli, Identity, Controlled-Not. 16

  23. Quantum Fourier Transform • The QFT is defined as: N − 1 1 � w xk | x � → √ N | k � N k =0 • The QFT can be represented by the circuit design : 17

  24. Benchmark configuration We benchmark Qibo with the following libraries: All computations are performed on the NVIDIA DGX workstation . • GPUs: 4x NVIDIA Tesla V100 with 32GB • CPU: Intel Xeon E5 with 20 cores with 256 GB of RAM 18

  25. QFT benchmark QFT (complex64) QFT (complex128) Qibo (GPU) Qibo (GPU) 10 4 Qibo (multi-GPU) Qibo (multi-GPU) 10 3 Qibo (CPU) Qibo (CPU) 10 3 Qibo (CPU-1) Qibo (CPU-1) QCGPU (GPU) Qulacs (GPU) 10 2 Qulacs (CPU) Total time (sec) QCGPU (CPU) Total time (sec) 10 1 Cirq (CPU) IntelQS (CPU) 10 1 TFQ (CPU) Qiskit (CPU) PyQuil (CPU) 10 0 10 -1 10 -1 10 -3 10 -2 10 -3 5 10 15 20 25 30 35 5 10 15 20 25 30 Number of Qubits Number of Qubits 4 4 Ratio to Qibo (GPU) Ratio to Qibo (CPU) Ratio to Qibo (GPU) Ratio to Qibo (CPU) 10 1 10 1 2 2 10 0 10 -1 0 10 20 30 10 20 30 10 20 30 10 20 30 Number of Qubits Number of Qubits Number of Qubits Number of Qubits Quantum Fourier Transform simulation performance comparison in single precision (left) and double precision (right). 19

  26. Variational circuit Variational circuits are inspired by the structure of variational circuits used in quantum machine learning . Standard Circuit Gate fusion R y R y • • R y R y • • R y R y • • R y R y • • R y R y • • R y R y • • Qibo implements the gate fusion of four R y and the controlled-phased gate, C z ⇒ applies them as a single two-qubit gate. 20

  27. Variational circuit benchmark Variational 5 layers (complex64) Variational 5 layers (complex128) Qibo (GPU) Qibo (GPU) 10 4 Qibo (CPU) Qibo (CPU) 10 3 Qibo (CPU-1) Qibo (CPU-1) 10 3 QCGPU (GPU) Qulacs (GPU) QCGPU (CPU) Qulacs (CPU) 10 2 IntelQS (CPU) Total time (sec) Cirq (CPU) Total time (sec) 10 1 TFQ (CPU) Qiskit (CPU) 10 1 PyQuil (CPU) 10 -1 10 0 10 -1 10 -3 10 -2 5 10 15 20 25 30 35 5 10 15 20 25 30 Number of Qubits Number of Qubits 10 2 6 Ratio to Qibo (GPU) Ratio to Qibo (GPU) Ratio to Qibo (CPU) Ratio to Qibo (CPU) 4 10 1 4 10 1 2 2 10 -1 10 0 0 10 20 30 10 20 30 10 20 30 10 20 30 Number of Qubits Number of Qubits Number of Qubits Number of Qubits Variational circuit simulation performance comparison in single precision (left) and double precision (right). 21

  28. Single vs double precision simulation GPU c64 10 3 GPU c128 CPU c64 10 2 CPU c128 Total Time (sec) 10 1 10 0 10 -1 10 -2 5 10 15 20 25 30 35 Number of Qubits 2.0 2.0 Ratio to GPU c64 Ratio to CPU c64 1.5 1.5 1.0 1.0 10 20 30 10 20 30 Number of Qubits Number of Qubits Comparison of simulation time when using single (complex64) and double (complex128) precision on GPU and multi- threading (40 threads) CPU. 22

  29. Measurement simulation Qibo simulates quantum measurements using its standard dense state vector simulator, followed by sampling from the distribution corresponding to the final state vector. DGX CPU DGX V100 10 1 N = 10 N = 10 10 1 N = 12 N = 12 N = 14 N = 14 10 0 N = 16 N = 16 10 0 Total time (sec) Total time (sec) N = 18 N = 18 N = 20 N = 20 10 -1 10 -1 N = 22 N = 22 N = 24 N = 24 N = 26 N = 26 10 -2 10 -2 N = 28 N = 28 N = 30 N = 30 10 -3 10 -3 10 1 10 2 10 3 10 4 10 5 10 6 10 1 10 2 10 3 10 4 10 5 10 6 Number of shots Number of shots Example of measurement shots simulation on CPU (left) and GPU (right). 23

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend