5 Selecting outcomes with quantum oracles
This chapter covers
- Specifying “good” outcomes of quantum computations with quantum oracles
- Implementing phase and bit quantum oracles
- Converting between phase and bit quantum oracles
In chapter 1, we discussed three main patterns of quantum computations:
- Sampling from probability distributions
- Searching for specific outcomes
- Estimating the probability of specific outcomes
We explored several examples of the first pattern: sampling from probability distributions encoded into quantum states. In this chapter, we will learn how to identify specific outcomes of a quantum computation. This is an essential component for implementing solutions to problems that involve searching for certain outcomes or estimating the probabilities of certain outcomes.
Depending on the problem context, the possible outcomes of a quantum computation may represent items in an unstructured database, choices in a binary optimization problem, or the possible prices of a stock at a specific point in time. To search for an item in a database, find an optimal selection, or estimate the probability of a price, we need to specify desired outcomes in each context. To specify desired outcomes, we will use a quantum oracle. An oracle is a quantum circuit that recognizes desired outcomes and “tags” or marks them in some way.