filmov
tv
Introduction to Quantum Computing (17) - Grover's Algorithm: Problem Statement

Показать описание
Grover's algorithm solves the problem of finding a special input to a function. Specifically, suppose we have a function f whose value is 0 for all inputs, except for some special input, x*, for which its value is 1. Grover's algorithm finds x*. Given no additional information about f (that is, all we can do is evaluate it), the most efficient way to find x* is to sequentially test all inputs until one returns 1. Here's an implementation in Python. Now you may be thinking this seems very silly. We can see what x* is. It's 8. We don't need an algorithm to tell us that. It's right there. There are two ways to address this. One: this is just a toy example. In reality, Grover's algorithm assumes f is a black box. We can't look inside to see its internals. We just give it an input and get an output. This explanation isn't very compelling to me. It makes Grover's algorithm seem impractical. The explanation I like better is that this problem is equivalent to function inversion, which is very practical; there are many functions we know how to compute but don't know how to invert. The security of password storage relies on this fact. In this context these difficult to invert functions are called hash functions. Password cracking is inverting a hash function. It's straight-forward to modify the initial implementation of Grover's algorithm I gave to invert functions, and specifically invert a hash function and crack my password.
Комментарии