9.8 The Deutsch-Jozsa algorithm
Before we leave oracles, I want to walk you through one of the other early quantum algorithms that employs them. It also shows us another form in which oracles are expressed in quantum circuits.
Let’s begin with an example. Suppose I buy two standard decks of 52 playing cards. In a separate room where you cannot see me, I create a single deck of 52 cards where one of the following is true:
- All the cards are red or all the cards are black.
- Half the cards (26) are black and half are red.
The first option is called ‘‘constant’’ and the second is ‘‘balanced.’’
I now go to you and give you the problem of finding out which of the two possibilities is the case for the deck I am holding. You do so by looking at and then discarding the card at the top of the deck.
In the best case, the first card is one color and the second is the other. Therefore the...