Quantum Verification of Matrix Products Robert Spalek sr@cwi.nl - - PowerPoint PPT Presentation

quantum verification of matrix products
SMART_READER_LITE
LIVE PREVIEW

Quantum Verification of Matrix Products Robert Spalek sr@cwi.nl - - PowerPoint PPT Presentation

Quantum Verification of Matrix Products Robert Spalek sr@cwi.nl joint work with Harry Buhrman Centre for Mathematics and Computer Science Amsterdam, The Netherlands Robert Spalek, CWI Quantum Verification of Matrix Products


slide-1
SLIDE 1

Quantum Verification of Matrix Products

Robert ˇ Spalek

sr@cwi.nl

joint work with Harry Buhrman Centre for Mathematics and Computer Science Amsterdam, The Netherlands

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.1/13

slide-2
SLIDE 2

Matrix multiplication

Given n × n matrices A and B, compute C = AB.

  • School algorithm: time O(n3)

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.2/13

slide-3
SLIDE 3

Matrix multiplication

Given n × n matrices A and B, compute C = AB.

  • School algorithm: time O(n3)
  • [Strassen, 1969]

Divide and conquer method: time O(n2.807)

  • [Coppersmith & Winograd, 1987]

Arithmetic progression: time O(n2.376)

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.2/13

slide-4
SLIDE 4

Matrix multiplication

Given n × n matrices A and B, compute C = AB.

  • School algorithm: time O(n3)
  • [Strassen, 1969]

Divide and conquer method: time O(n2.807)

  • [Coppersmith & Winograd, 1987]

Arithmetic progression: time O(n2.376)

  • Best known lower bound is only Ω(n2)

The actual complexity is open

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.2/13

slide-5
SLIDE 5

Matrix verification

Given n × n matrices A, B, and C, decide whether C = AB.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.3/13

slide-6
SLIDE 6

Matrix verification

Given n × n matrices A, B, and C, decide whether C = AB.

  • [Freivalds, 1979]

Classical algorithm with time O(n2)

  • 1. Pick a random vector x
  • 2. Compute y = Cx and y′ = A(Bx)
  • 3. Compare y with y′
  • Matrix-vector products take time O(n2)
  • Constant success probability

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.3/13

slide-7
SLIDE 7

Quantum computing

Computers based on laws of quantum physics

  • quantum state is a superposition of classical states

|ψ =

2n−1

  • x=0

αx|x, where αx ∈ C and

x |αx|2 = 1

  • computational step is defined by

|ψ → U|ψ for a unitary (i.e. norm-preserving) operator U

  • outcome is observed by a measurement

the probability of seeing x is |αx|2 Pr[Ψ = x] = |αx|2

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.4/13

slide-8
SLIDE 8

Quantum algorithms for matrix verification

  • [Grover, 1996]

Searching an unsorted database in time O(√n)

  • [Ambainis, Buhrman, Høyer, Karpinski & Kurur, 2002]

Matrix verification in time O(n7/4) using Freivalds’s trick with a random vector, and Grover’s search

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.5/13

slide-9
SLIDE 9

Quantum algorithms for matrix verification

  • [Grover, 1996]

Searching an unsorted database in time O(√n)

  • [Ambainis, Buhrman, Høyer, Karpinski & Kurur, 2002]

Matrix verification in time O(n7/4) using Freivalds’s trick with a random vector, and Grover’s search

  • [our paper]

Matrix verification in time O(n5/3) using two random vectors and quantum random walks

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.5/13

slide-10
SLIDE 10

Quantum random walks

Similar to classical random walks, but with quantum coin flips instead of random coin flips.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.6/13

slide-11
SLIDE 11

Quantum random walks

Similar to classical random walks, but with quantum coin flips instead of random coin flips.

  • [Ambainis, 2004] used quantum walks to solve

element distinctness (i.e. deciding whether all n input numbers are distinct) in time O(n2/3)

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.6/13

slide-12
SLIDE 12

Quantum random walks

Similar to classical random walks, but with quantum coin flips instead of random coin flips.

  • [Ambainis, 2004] used quantum walks to solve

element distinctness (i.e. deciding whether all n input numbers are distinct) in time O(n2/3)

  • [Szegedy, 2004] generalized his technique to the problem of

finding a marked vertex in an undirected graph G in time O

  • Tinit +

1 √ δε · (Ttest + Twalk)

  • ,
  • Tinit is time of picking a uniform superposition of vertices
  • Ttest is time of testing whether a vertex is marked
  • Twalk is time of walking one step over G

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.6/13

slide-13
SLIDE 13

Quantum random walks

Similar to classical random walks, but with quantum coin flips instead of random coin flips.

  • [Ambainis, 2004] used quantum walks to solve

element distinctness (i.e. deciding whether all n input numbers are distinct) in time O(n2/3)

  • [Szegedy, 2004] generalized his technique to the problem of

finding a marked vertex in an undirected graph G in time O

  • Tinit +

1 √ δε · (Ttest + Twalk)

  • ,
  • δ is the spectral gap of G
  • ε is the fraction of marked vertices

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.6/13

slide-14
SLIDE 14

Quantum random walks

Similar to classical random walks, but with quantum coin flips instead of random coin flips.

  • [Ambainis, 2004] used quantum walks to solve

element distinctness (i.e. deciding whether all n input numbers are distinct) in time O(n2/3)

  • [Szegedy, 2004] generalized his technique to the problem of

finding a marked vertex in an undirected graph G in time O

  • Tinit +

1 √ δε · (Ttest + Twalk)

  • ,
  • Classical random walks converge in time proportional to

1 δε

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.6/13

slide-15
SLIDE 15

Quantum algorithm for matrix verification

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.7/13

slide-16
SLIDE 16

Verification of matrix product AB = C

× = A B C S T

  • 1. Init a superposition of subsets S, T ⊆ [n] of size k = n2/3.

Read the rows of A and columns of B specified by S, T.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.8/13

slide-17
SLIDE 17

Verification of matrix product AB = C

× = A B C S T

  • 1. Init a superposition of subsets S, T ⊆ [n] of size k = n2/3.

Read the rows of A and columns of B specified by S, T.

  • 2. Repeat n/

√ k times the following:

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.8/13

slide-18
SLIDE 18

Verification of matrix product AB = C

× = A B C S T

  • 1. Init a superposition of subsets S, T ⊆ [n] of size k = n2/3.

Read the rows of A and columns of B specified by S, T.

  • 2. Repeat n/

√ k times the following: (a) Test the matrix product restricted to S × T, and flip the quantum phase if a wrong entry is found.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.8/13

slide-19
SLIDE 19

Verification of matrix product AB = C

× = A B C S T

  • 1. Init a superposition of subsets S, T ⊆ [n] of size k = n2/3.

Read the rows of A and columns of B specified by S, T.

  • 2. Repeat n/

√ k times the following: (a) Test the matrix product restricted to S × T, and flip the quantum phase if a wrong entry is found. (b) Walk with S, T by replacing one row and one column.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.8/13

slide-20
SLIDE 20

Verification of matrix product AB = C

× = A B C S T

  • 1. Init a superposition of subsets S, T ⊆ [n] of size k = n2/3.

Read the rows of A and columns of B specified by S, T.

  • 2. Repeat n/

√ k times the following: (a) Test the matrix product restricted to S × T, and flip the quantum phase if a wrong entry is found. (b) Walk with S, T by replacing one row and one column.

  • 3. Measure S, T, and the submatrices,

and verify classically the restricted matrix product.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.8/13

slide-21
SLIDE 21

Graph used in the algorithm

  • Johnson graph J(n, k) has vertices

[n]

k

[n]

k+1

  • and edges between sets that differ in exactly one item

subsets of size k + 1 subsets of size k

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.9/13

slide-22
SLIDE 22

Graph used in the algorithm

  • Johnson graph J(n, k) has vertices

[n]

k

[n]

k+1

  • and edges between sets that differ in exactly one item

subsets of size k + 1 subsets of size k

  • The spectral gap of J(n, k) is δ = Θ( 1

k)

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.9/13

slide-23
SLIDE 23

Graph used in the algorithm

  • Johnson graph J(n, k) has vertices

[n]

k

[n]

k+1

  • and edges between sets that differ in exactly one item

subsets of size k + 1 subsets of size k

  • The spectral gap of J(n, k) is δ = Θ( 1

k)

  • Our algorithm walks on the strong product graph

J(n, k) × J(n, k), which has the same gap

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.9/13

slide-24
SLIDE 24

Query complexity of the algorithm

The fraction of subsets S, T containing a wrong entry is ε ≥ k2

n2 ;

the worst case is exactly one entry.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13

slide-25
SLIDE 25

Query complexity of the algorithm

The fraction of subsets S, T containing a wrong entry is ε ≥ k2

n2 ;

the worst case is exactly one entry. Hence we need 1 √ δε ≤ 1

  • 1

k · k2 n2

= n √ k iterations of the quantum walk of [Szegedy, 2004]

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13

slide-26
SLIDE 26

Query complexity of the algorithm

The fraction of subsets S, T containing a wrong entry is ε ≥ k2

n2 ;

the worst case is exactly one entry. Hence we need 1 √ δε ≤ 1

  • 1

k · k2 n2

= n √ k iterations of the quantum walk of [Szegedy, 2004]

  • Init: 2kn + k2

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13

slide-27
SLIDE 27

Query complexity of the algorithm

The fraction of subsets S, T containing a wrong entry is ε ≥ k2

n2 ;

the worst case is exactly one entry. Hence we need 1 √ δε ≤ 1

  • 1

k · k2 n2

= n √ k iterations of the quantum walk of [Szegedy, 2004]

  • Init: 2kn + k2
  • Repeat n/

√ k times:

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13

slide-28
SLIDE 28

Query complexity of the algorithm

The fraction of subsets S, T containing a wrong entry is ε ≥ k2

n2 ;

the worst case is exactly one entry. Hence we need 1 √ δε ≤ 1

  • 1

k · k2 n2

= n √ k iterations of the quantum walk of [Szegedy, 2004]

  • Init: 2kn + k2
  • Repeat n/

√ k times:

  • Test: 0

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13

slide-29
SLIDE 29

Query complexity of the algorithm

The fraction of subsets S, T containing a wrong entry is ε ≥ k2

n2 ;

the worst case is exactly one entry. Hence we need 1 √ δε ≤ 1

  • 1

k · k2 n2

= n √ k iterations of the quantum walk of [Szegedy, 2004]

  • Init: 2kn + k2
  • Repeat n/

√ k times:

  • Test: 0
  • Walk: 2n + 2k

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13

slide-30
SLIDE 30

Query complexity of the algorithm

The fraction of subsets S, T containing a wrong entry is ε ≥ k2

n2 ;

the worst case is exactly one entry. Hence we need 1 √ δε ≤ 1

  • 1

k · k2 n2

= n √ k iterations of the quantum walk of [Szegedy, 2004]

  • Init: 2kn + k2
  • Repeat n/

√ k times:

  • Test: 0
  • Walk: 2n + 2k
  • Verify: 0

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13

slide-31
SLIDE 31

Query complexity of the algorithm

The fraction of subsets S, T containing a wrong entry is ε ≥ k2

n2 ;

the worst case is exactly one entry. Hence we need 1 √ δε ≤ 1

  • 1

k · k2 n2

= n √ k iterations of the quantum walk of [Szegedy, 2004]

  • Init: 2kn + k2
  • Repeat n/

√ k times:

  • Test: 0
  • Walk: 2n + 2k
  • Verify: 0

               Since k ≤ n, the query complexity is Q = O(kn + n2/ √ k)

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13

slide-32
SLIDE 32

Query complexity of the algorithm

The fraction of subsets S, T containing a wrong entry is ε ≥ k2

n2 ;

the worst case is exactly one entry. Hence we need 1 √ δε ≤ 1

  • 1

k · k2 n2

= n √ k iterations of the quantum walk of [Szegedy, 2004]

  • Init: 2kn + k2
  • Repeat n/

√ k times:

  • Test: 0
  • Walk: 2n + 2k
  • Verify: 0

               Since k ≤ n, the query complexity is Q = O(kn + n2/ √ k) Q is minimal for k = n2/3, and then it is O(n5/3)

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13

slide-33
SLIDE 33

Improving the running time

The original running time is higher than the number of queries due to multiplications of submatrices.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.11/13

slide-34
SLIDE 34

Improving the running time

The original running time is higher than the number of queries due to multiplications of submatrices. To fix it,

  • We multiply both sides of the equation AB = C by random

vectors p, q from left and right. We thus verify pABq = pCq.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.11/13

slide-35
SLIDE 35

Improving the running time

The original running time is higher than the number of queries due to multiplications of submatrices. To fix it,

  • We multiply both sides of the equation AB = C by random

vectors p, q from left and right. We thus verify pABq = pCq.

  • This complicates analysis, because errors can cancel out,

e.g. in GF(2). However, this can be handled.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.11/13

slide-36
SLIDE 36

Improving the running time

The original running time is higher than the number of queries due to multiplications of submatrices. To fix it,

  • We multiply both sides of the equation AB = C by random

vectors p, q from left and right. We thus verify pABq = pCq.

  • This complicates analysis, because errors can cancel out,

e.g. in GF(2). However, this can be handled.

  • Instead of keeping the submatrices of A and B in the

memory, we update matrix-vector products pA and Bq, and the number pCq.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.11/13

slide-37
SLIDE 37

Improving the running time

The original running time is higher than the number of queries due to multiplications of submatrices. To fix it,

  • We multiply both sides of the equation AB = C by random

vectors p, q from left and right. We thus verify pABq = pCq.

  • This complicates analysis, because errors can cancel out,

e.g. in GF(2). However, this can be handled.

  • Instead of keeping the submatrices of A and B in the

memory, we update matrix-vector products pA and Bq, and the number pCq.

  • This decreases both
  • 1. running time of testing (pA)(Bq) = pCq

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.11/13

slide-38
SLIDE 38

Improving the running time

The original running time is higher than the number of queries due to multiplications of submatrices. To fix it,

  • We multiply both sides of the equation AB = C by random

vectors p, q from left and right. We thus verify pABq = pCq.

  • This complicates analysis, because errors can cancel out,

e.g. in GF(2). However, this can be handled.

  • Instead of keeping the submatrices of A and B in the

memory, we update matrix-vector products pA and Bq, and the number pCq.

  • This decreases both
  • 1. running time of testing (pA)(Bq) = pCq
  • 2. space complexity

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.11/13

slide-39
SLIDE 39

Matrix multiplication

  • With 1 < w ≤ √n wrong entries, the running time is faster

O(n5/3/w1/3).

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.12/13

slide-40
SLIDE 40

Matrix multiplication

  • With 1 < w ≤ √n wrong entries, the running time is faster

O(n5/3/w1/3).

  • Let AB = C contain w non-zero entries.

Compute C as follows:

  • 1. Set C to a zero matrix.
  • 2. Run verification until it outputs “correct”,

recomputing wrong entries.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.12/13

slide-41
SLIDE 41

Matrix multiplication

  • With 1 < w ≤ √n wrong entries, the running time is faster

O(n5/3/w1/3).

  • Let AB = C contain w non-zero entries.

Compute C as follows:

  • 1. Set C to a zero matrix.
  • 2. Run verification until it outputs “correct”,

recomputing wrong entries.

  • Total running time is

w

  • ℓ=1

n5/3 ℓ1/3 = O(n5/3w2/3) = O(n2) for w ≤ √n .

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.12/13

slide-42
SLIDE 42

Matrix multiplication

  • With 1 < w ≤ √n wrong entries, the running time is faster

O(n5/3/w1/3).

  • Let AB = C contain w non-zero entries.

Compute C as follows:

  • 1. Set C to a zero matrix.
  • 2. Run verification until it outputs “correct”,

recomputing wrong entries.

  • Total running time is

w

  • ℓ=1

n5/3 ℓ1/3 = O(n5/3w2/3) = O(n2) for w ≤ √n .

  • However, for w > √n, the speedup of verification is smaller,

and the classical algorithm by [Indyk, 2005] with time O(n2 + nw) takes over.

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.12/13

slide-43
SLIDE 43

Summary and open problems

  • Matrix verification in O(n5/3) queries using quantum walks
  • Improved running time and space complexity using two

random vectors

  • Verification is faster with many wrong entries
  • Fast matrix multiplication

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.13/13

slide-44
SLIDE 44

Summary and open problems

  • Matrix verification in O(n5/3) queries using quantum walks
  • Improved running time and space complexity using two

random vectors

  • Verification is faster with many wrong entries
  • Fast matrix multiplication
  • Can we multiply dense matrices faster than classically?
  • Matching lower bound?

Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.13/13