One important application of quantum algorithms is obtaining speedups for solving problems where we need to search inputs to a function we’re trying to learn about. Such functions could be obfuscated (such as hash functions) or computationally difficult to evaluate (common in studying mathematical problems). In either case, applying quantum computers to such problems requires us to understand how we program and provide input to quantum algorithms. To learn how to do so, we’ll program and run an implementation of the Deutsch–Jozsa algorithm, which will let us learn properties of unknown functions quickly using quantum devices.
When we talk about classical programming, we sometimes say that a program implements an algorithm: that is, a sequence of steps that can be used to solve a problem. For example, if we want to sort a list, we can talk about the quicksort algorithm independently of what language or operating system we are using. We often specify these steps at a high level. In the quicksort example, we might list the steps as something like the following: