A talk on quantum algorithms for evaluating MIN-MAX trees given at TQC (Workshop on Theory of Quantum Computation, Communication, and Cryptography) 2008 in Tokyo, Japan.
1. Quantum Algorithms for
Evaluating MIN-MAX Trees
Richard Cleve Dmitry Gavinsky D. L. Yonge-Mallo
Institute for Quantum Computing,
University of Waterloo
January 30, 2008
TQC – Tokyo, Japan
2. Motivation
● Why do we care about algorithms for MIN-
MAX trees, anyway?
trees
● What is so special about the quantum
algorithms for MIN-MAX trees that I'm
about to present?
– The ideas behind them don't work in a
classical setting!
– Conversely, the classical ideas don't work in
a quantum setting!
2
3. Why do we care about MIN-MAX trees?
MIN-MAX trees arise in the analysis
of deterministic games of perfect
information between two players who
alternate taking turns
3
4. Why do we care about MIN-MAX trees?
MIN-MAX trees arise in the analysis
of deterministic games of perfect
information between two players who
alternate taking turns
MIN
MAX MAX MAX
4 1 2 5 7 8 6 9 3
4
5. What is a MIN-MAX tree?
● internal nodes are MIN and MAX gates at alternating levels;
● leaves x1,...,xN take on values from some ordered set;
● value is value of root as a function of x1,...,xN.
MIN
MAX MAX MAX
4 1 2 5 7 8 6 9 3
5
8. MIN-MAX trees and AND-OR trees
● An AND-OR tree is just a MIN-MAX tree
restricted to the values {0,1}!
{0,1}
● So MIN-MAX is at least as hard as AND-OR.
0
MIN
0 1 1
MAX MAX MAX
0 0 0 1 1 1 1 1 0
8
9. MIN-MAX trees and AND-OR trees
● An AND-OR tree is just a MIN-MAX tree
restricted to the values {0,1}!
{0,1}
● So MIN-MAX is at least as hard as AND-OR.
0
AND
0 1 1
OR OR OR
0 0 0 1 1 1 1 1 0
9
10. You can also turn MIN-MAX
trees into AND-OR trees
root root ⩾ v?
MIN AND
threshold v
MAX OR
xk xk ⩾ v
10
11. You can also turn MIN-MAX
trees into AND-OR trees
4 root 0
root ⩾ 5?
MIN AND
threshold 5
4 8 9 0 1 1
MAX MAX MAX OR OR OR
4 1 2 5 7 8 6 9 3 0 0 0 1 1 1 1 1 0
This immediately suggests binary search...
11
12. Combining AND-OR and binary search
4 root 0
root ⩾ 5?
MIN AND
threshold 5
4 8 9 0 1 1
MAX MAX MAX OR OR OR
4 1 2 5 7 8 6 9 3 0 0 0 1 1 1 1 1 0
● Is root ⩾ 5? No.
12
13. Combining AND-OR and binary search
4 root 1
root ⩾ 3?
MIN AND
threshold 3
4 8 9 1 1 1
MAX MAX MAX OR OR OR
4 1 2 5 7 8 6 9 3 1 0 0 1 1 1 1 1 1
● Is root ⩾ 5? No.
● Is root ⩾ 3? Yes.
13
14. Combining AND-OR and binary search
4 root 1
root ⩾ 4?
MIN AND
threshold 4
4 8 9 1 1 1
MAX MAX MAX OR OR OR
4 1 2 5 7 8 6 9 3 1 0 0 1 1 1 1 1 0
}
● Is root ⩾ 5? No.
● Is root ⩾ 3? Yes. root = 4
● Is root ⩾ 4? Yes.
14
15. Combining AND-OR and binary search
We can consider two models of ordered
non-binary data...
● in the input value query model, we have direct
access to x1,...,xN through a black box;
● in the comparison query model, we are
restricted to making comparisons of the form
[xj < xk].
15
16. Problems with combining AND-OR
and binary search
We need to find the midpoint of subintervals
of the form [α, β].
In the comparison query model, the midpoint
of an interval cannot be directly computed.
In the input query model, if the numerical
range is too large, the binary search may
not converge in a logarithmic number of
steps.
16
17. Saks-Wigderson algorithm
Saks and Wigderson [SW86] showed that...
● the optimal classical randomized
algorithm for AND-OR tree evaluation
makes Θ(N0.7537...) queries;
● there is an algorithm for MIN-MAX tree
evaluation which makes this number of
queries, using AND-OR tree evaluation as
a subroutine.
17
18. Saks-Wigderson algorithm
MAX
v
MIN MIN AND
MAX OR
xk xk ⩾ v
TN = 3/2 TN/2 + O(N0.7537...)
This implies a Θ(N0.7537...) algorithm. 18
19. Quantum algorithm for AND-OR trees
●
There is a lower bound of Ω(N1/2) [BS04]
● There is a “more-or-less” matching
1/2+ε
algorithm that makes O(N ) queries
[FGG07, CCJY07, A07+CRŠZ07]
19
20. Quantum algorithm for AND-OR trees
●
There is a lower bound of Ω(N1/2) [BS04]
● There is a “more-or-less” matching
1/2+ε
algorithm that makes O(N ) queries
[FGG07, CCJY07, A07+CRŠZ07]
The “obvious question”...
Do these results generalize to
MIN-MAX tree evaluation?
20
21. “Quantum Saks-Wigderson”
MAX
v
MIN MIN AND
MAX OR
xk xk ⩾ v
0.5
0.7537...
TN = 3/2 TN/2 + O(N )
This implies an O(N0.5850...) algorithm. 21
22. Can we do better?
● We could try to analyze the AND-OR tree algorithm
and try to apply it directly to MIN-MAX trees...
● A better idea:
idea
perform a binary search...
search
root root ⩾ v?
MIN AND
pivot v
MAX OR
xk xk ⩾ v 22
23. Can we do better?
But haven't we already
● We could try to analyze the Aestablished that this
ND-OR tree algorithm
and try to apply it directlyapproach isAX trees...
to MIN-M full of problems?
● A better idea:
idea
perform a binary search...
search
root root ⩾ v?
MIN AND
pivot v
MAX OR
xk xk ⩾ v 23
24. Solution: use random pivots
● A better idea:
idea
perform a binary search using random pivots.
pivots
● Classically, finding a random pivot is as
hard as searching, which can take Ω(N)
queries to do even once!
● We have a quantum algorithm to find a
pivot with cost O(√N): Grover's search!
search
24
25. Quantum algorithm for
evaluating MIN-MAX trees
● A better idea:
idea
perform a binary search using random pivots.
pivots
root root ⩾ v?
MIN AND
random pivot v
MAX OR
xk xk ⩾ v
25
26. Quantum algorithm for
evaluating MIN-MAX trees
● The algorithm runs for O(log N) stages.
● Each stage costs O(√N loglog N).
To amplify the subroutines to lower
the error probability to O(1/log(N))...
26
27. Quantum algorithm for
evaluating MIN-MAX trees
● The algorithm runs for O(log N) stages.
● Each stage costs O(√N loglog N).
It turns out that this is unnecessary!
(Using a trick involving a stack...)
27
28. Quantum algorithm for
evaluating MIN-MAX trees
● The algorithm runs for O(log N) stages.
● Each stage costs O(√N).
This gives a quantum algorithm for
evaluating MIN-MAX trees...
Total cost: O(√N log N)
This is O(N1/2+ε) for an arbitrarily small constant ε.
28
29. Obtaining the optimal move
● If the values of the leaves x1,...,xN are distinct,
this is easy.
● Otherwise, we can use the quantum
minimum/maximum finding algorithm [DH96].
MIN
MAX MAX MAX
4 1 2 5 7 8 6 9 3
29
30. Summary
● Classically, the Saks-Wigderson reduction
Classically
from MIN-MAX to AND-OR uses ϴ(N0.7537...)
queries.
● Calling the quantum AND-OR subroutine
results in an O(N0.5850...) algorithm, which is
not optimal!
● The classical algorithms are based on
examining the subtrees of the tree.
30
31. Summary
● Our quantum algorithm performs a binary
search using random pivots and requires
1/2+ε
O(N ) queries, which is (close to)
optimal.
optimal
● Conversely, binary search is too costly for
a classical algorithm.
– The ideas behind the quantum algorithm
don't work in the classical setting!
31
32. Summary (chart)
Classical: ϴ(N0.7537...) Quantum: O(N1/2+ε)
● Binary search is too ● Uses binary search
costly
● Based on evaluating ● Based on evaluating
subtrees of the MIN-MAX the entire tree as an
tree AND-OR tree, with
different thresholds
● Doesn't get full ● Gets full speedup from
speedup from quantum quantum AND-OR and
AND-OR subroutine Grover's search
subroutines
32
33. The Moral of the Story
What works in the classical setting may fail
to work in the quantum setting.
What fails to work in the classical setting
may work very well in the quantum setting.
To develop quantum algorithms, one must
be willing to abandon classical intuitions!
33
34. Thanks!
References:
● [CGY07] Quantum Algorithms for Evaluating
MIN-MAX Trees.
arXiv:quant-ph/0710.5794
● [FGG07] A Quantum Algorithm for the
Hamiltonian NAND Tree.
arXiv:quant-ph/0702144
● [A+CRŠZ07] Every NAND formula on N
variables can be evaluated in time O(N1/2+ε).
arXiv:quant-ph/0703015
34