QuMat_ Apache Mahout's Quantum Computing Interface.pptx

AndrewMusselman 89 views 28 slides Oct 09, 2024
Slide 1
Slide 1 of 28
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28

About This Presentation

Apache Mahout (https://mahout.apache.org) is a linear algebra library for building machine learning solutions, and up until this year focused on compute back-ends such as Spark and Flink for processing training data into predictions. More recently the project has adopted quantum compute back-ends as...


Slide Content

QuMat Apache Mahout's Quantum Computing Interface Andrew Musselman FOSSY Portland OR Aug 2024

Intro to Mahout Intro to Quantum Motivation for Quantum in Mahout Distributed Matrix Arithmetic Rationale for QuMat Logic Gates in QuMat Notebook Demo Circuits and Diagrams Next Steps How to Get Involved Agenda

Apache Mahout is a distributed linear algebra framework and mathematically expressive Scala DSL designed to let mathematicians, statisticians, and data scientists quickly implement their own algorithms. Mathematically Expressive Scala DSL Support for Multiple Distributed Backends (including Apache Spark) Modular Native Solvers for CPU/GPU/CUDA Acceleration Intro to Mahout

2008: Lucene sub-project with analytics including clustering 2010: Apache top-level project recommender system Taste: ( https://svn.apache.org/repos/asf/lucene/mahout/site/publish/taste.pdf?p=836600 ) 2015: Samsara (back-end independent programming environment) 2017: Hadoop MapReduce back-end deprecated 2020: 14.1 released 2022: Zeppelin integration and algorithm development framework 2024: QuMat quantum computing interface Intro to Mahout

Intro to Quantum

Intro to Quantum Classical bit 2 1 states, ("0" or "1") Quantum bit ("qubit") 2 n states, ("it's complicated")

Intro to Quantum * https://en.wikipedia.org/wiki/Quantum_logic_gate Quantum states are typically represented by "kets," from a notation known as bra–ket. The vector representation of a single qubit is | a ⟩ = v |0 ⟩ + v 1 |1 ⟩ → where v and v 1 are the complex probability amplitudes of the qubit, and the values zero and one are represented by the kets |0 ⟩ = and |1 ⟩ = v v 1

|0 ⟩ = and |1 ⟩ = These kets are basis vectors for a complex vector space. Logic gates in quantum computing are matrices which take actions on qubits. For example, the identity gate (identity matrix) performs no action on any qubit: = = Intro to Quantum v * 1 + v 1 * 0 v v 1 v * 0 + v 1 * 1 v v 1

Motivation for Quantum in Mahout Core capabilities of Mahout Matrix arithmetic and operations Linear algebra Back-end agnostic, distributed or in-core CPU or GPU Simplified syntax in matrix math DSL (Samsara) Management of large-scale vectors and matrices Quantum compute in essence is matrix arithmetic Circuits are composed by multiplying matrices Vectors and matrices are complex-valued instead of binary or real

Samsara DSL and Syntax Samsara A’A val C = A.t %*% A MLLib A’A val C = A.transpose().multiply(A)

Samsara DSL and Syntax Computation in distributed stochastic PCA (dSPCA): In Samsara DSL: val G = B %*% B.t - C - C.t + (xi.t dot xi) * (s_q.t cross s_q)

// Dense matrices: val A = dense(( 1 , 2 , 3 ) , ( 3 , 4 , 5 )) // Sparse matrices: val A = sparse( ( 1 , 3 ) :: Nil , ( , 2 ) :: ( 1 , 2.5 ) :: Nil ) Instantiating Matrices

Arithmetic and Assignment // Plus/minus: a + b a - b a + 5.0 a - 5.0 // Hadamard (elementwise) product: a * b a * 0.5 // Operations with assignment: a += b a -= b a += 5.0 a -= 5.0 a *= b a *= 5

Other Operators // Optimized right and left multiply with a diagonal matrix: diag( 5 , 5 ) :%*% b A %*%: diag( 5 , 5 ) // Second norm, of a vector or matrix: a.norm // Transpose: val Mt = M.t // Dot product: a dot b // Cross product: a cross b // Matrix multiply: a %*% b

Distributed Matrix Arithmetic: Optimization of A'A A

Distributed Matrix Arithmetic: Optimization of A'A x A A T

Distributed Matrix Arithmetic: Optimization of A'A x = x A A T a 1 T a 1

Distributed Matrix Arithmetic: Optimization of A'A x = x + x A A T a 1 T a 1 a 2 T a 2

Distributed Matrix Arithmetic: Optimization of A'A x = x + x A A T a 1 T a 1 a 2 T a 2 + x a 3 T a 3

Distributed Matrix Arithmetic: Optimization of A'A x = x + x A A T a 1 T a 1 a 2 T a 2 + x a 3 T a 3 + x a 4 T a 4

Rationale for QuMat Multiple frameworks for programming quantum circuits Qiskit (IBM) Braket (AWS) Cirq (Google) TKET (Honeywell) Qsharp (Microsoft) Pyquil (Rigetti) Multiple vendor platforms for running on simulated or real quantum hardware IBM ( https://quantum.ibm.com ) AWS ( https://aws.amazon.com/braket ) Google ( https://quantumai.google/quantumcomputer ) Honeywell ( https://www.honeywell.com/us/en/company/quantum/quantum-computer ) Multiple frameworks and back-ends is a Mahout core value One interface with no code change across tools provides flexibility

Logic gates implemented Qiskit Cirq Braket Next steps Draw Measure Execute QuMat Current State Samsara QuMat Spark Flink … Qiskit Cirq Braket Mahout

Logic Gates in QuMat Function definitions in Python

Notebook Demo

Circuits and Diagrams

Next Steps Draw, measure, and execute methods Use cases More examples Quantum machine learning methods (QML)

How to Get Involved Try it out using Docker Subscribe to the [email protected] and [email protected] mailing lists Get a binary or source build Run a notebook straight out of GitHub Contribute some documentation, fix some bugs, add some features

Q&A Thank You!