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
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
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
Matrix multiplication
Given n × n matrices A and B, compute C = AB.
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.2/13
Matrix multiplication
Given n × n matrices A and B, compute C = AB.
Divide and conquer method: time O(n2.807)
Arithmetic progression: time O(n2.376)
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.2/13
Matrix multiplication
Given n × n matrices A and B, compute C = AB.
Divide and conquer method: time O(n2.807)
Arithmetic progression: time O(n2.376)
The actual complexity is open
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.2/13
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
Matrix verification
Given n × n matrices A, B, and C, decide whether C = AB.
Classical algorithm with time O(n2)
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.3/13
Quantum computing
Computers based on laws of quantum physics
|ψ =
2n−1
αx|x, where αx ∈ C and
x |αx|2 = 1
|ψ → U|ψ for a unitary (i.e. norm-preserving) operator U
the probability of seeing x is |αx|2 Pr[Ψ = x] = |αx|2
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.4/13
Quantum algorithms for matrix verification
Searching an unsorted database in time O(√n)
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
Quantum algorithms for matrix verification
Searching an unsorted database in time O(√n)
Matrix verification in time O(n7/4) using Freivalds’s trick with a random vector, and Grover’s search
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
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
Quantum random walks
Similar to classical random walks, but with quantum coin flips instead of random coin flips.
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
Quantum random walks
Similar to classical random walks, but with quantum coin flips instead of random coin flips.
element distinctness (i.e. deciding whether all n input numbers are distinct) in time O(n2/3)
finding a marked vertex in an undirected graph G in time O
1 √ δε · (Ttest + Twalk)
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.6/13
Quantum random walks
Similar to classical random walks, but with quantum coin flips instead of random coin flips.
element distinctness (i.e. deciding whether all n input numbers are distinct) in time O(n2/3)
finding a marked vertex in an undirected graph G in time O
1 √ δε · (Ttest + Twalk)
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.6/13
Quantum random walks
Similar to classical random walks, but with quantum coin flips instead of random coin flips.
element distinctness (i.e. deciding whether all n input numbers are distinct) in time O(n2/3)
finding a marked vertex in an undirected graph G in time O
1 √ δε · (Ttest + Twalk)
1 δε
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.6/13
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.7/13
Verification of matrix product AB = C
× = A B C S T
Read the rows of A and columns of B specified by S, T.
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.8/13
Verification of matrix product AB = C
× = A B C S T
Read the rows of A and columns of B specified by S, T.
√ k times the following:
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.8/13
Verification of matrix product AB = C
× = A B C S T
Read the rows of A and columns of B specified by S, T.
√ 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
Verification of matrix product AB = C
× = A B C S T
Read the rows of A and columns of B specified by S, T.
√ 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
Verification of matrix product AB = C
× = A B C S T
Read the rows of A and columns of B specified by S, T.
√ 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.
and verify classically the restricted matrix product.
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.8/13
Graph used in the algorithm
[n]
k
[n]
k+1
subsets of size k + 1 subsets of size k
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.9/13
Graph used in the algorithm
[n]
k
[n]
k+1
subsets of size k + 1 subsets of size k
k)
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.9/13
Graph used in the algorithm
[n]
k
[n]
k+1
subsets of size k + 1 subsets of size k
k)
J(n, k) × J(n, k), which has the same gap
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.9/13
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
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
k · k2 n2
= n √ k iterations of the quantum walk of [Szegedy, 2004]
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13
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
k · k2 n2
= n √ k iterations of the quantum walk of [Szegedy, 2004]
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13
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
k · k2 n2
= n √ k iterations of the quantum walk of [Szegedy, 2004]
√ k times:
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13
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
k · k2 n2
= n √ k iterations of the quantum walk of [Szegedy, 2004]
√ k times:
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13
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
k · k2 n2
= n √ k iterations of the quantum walk of [Szegedy, 2004]
√ k times:
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13
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
k · k2 n2
= n √ k iterations of the quantum walk of [Szegedy, 2004]
√ k times:
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13
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
k · k2 n2
= n √ k iterations of the quantum walk of [Szegedy, 2004]
√ k times:
Since k ≤ n, the query complexity is Q = O(kn + n2/ √ k)
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.10/13
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
k · k2 n2
= n √ k iterations of the quantum walk of [Szegedy, 2004]
√ k times:
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
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
Improving the running time
The original running time is higher than the number of queries due to multiplications of submatrices. To fix it,
vectors p, q from left and right. We thus verify pABq = pCq.
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.11/13
Improving the running time
The original running time is higher than the number of queries due to multiplications of submatrices. To fix it,
vectors p, q from left and right. We thus verify pABq = pCq.
e.g. in GF(2). However, this can be handled.
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.11/13
Improving the running time
The original running time is higher than the number of queries due to multiplications of submatrices. To fix it,
vectors p, q from left and right. We thus verify pABq = pCq.
e.g. in GF(2). However, this can be handled.
memory, we update matrix-vector products pA and Bq, and the number pCq.
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.11/13
Improving the running time
The original running time is higher than the number of queries due to multiplications of submatrices. To fix it,
vectors p, q from left and right. We thus verify pABq = pCq.
e.g. in GF(2). However, this can be handled.
memory, we update matrix-vector products pA and Bq, and the number pCq.
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.11/13
Improving the running time
The original running time is higher than the number of queries due to multiplications of submatrices. To fix it,
vectors p, q from left and right. We thus verify pABq = pCq.
e.g. in GF(2). However, this can be handled.
memory, we update matrix-vector products pA and Bq, and the number pCq.
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.11/13
Matrix multiplication
O(n5/3/w1/3).
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.12/13
Matrix multiplication
O(n5/3/w1/3).
Compute C as follows:
recomputing wrong entries.
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.12/13
Matrix multiplication
O(n5/3/w1/3).
Compute C as follows:
recomputing wrong entries.
w
n5/3 ℓ1/3 = O(n5/3w2/3) = O(n2) for w ≤ √n .
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.12/13
Matrix multiplication
O(n5/3/w1/3).
Compute C as follows:
recomputing wrong entries.
w
n5/3 ℓ1/3 = O(n5/3w2/3) = O(n2) for w ≤ √n .
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
Summary and open problems
random vectors
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.13/13
Summary and open problems
random vectors
Robert ˇ Spalek, CWI – Quantum Verification of Matrix Products – p.13/13