Let's implement the same Hadamard-oracle-Hadamard circuit, but now for multiple solutions:

Since seemed to be the interesting state, we can plot how the probability of observing changes with the number of solutions.

Implement the circuit above for a set of solutions combos, and return probabilities. As before, you are given multisol_oracle_matrix(combos), which returns the associated oracle in matrix form.

Hitting submit will plot the probability of observing as a function of the size of the solution set; as for a single solution, this does not depend on the secret combinations themselves. What pattern do you observe?

or to submit your code

To interact with codercises, please switch to a larger screen size.

Learning Objectives:

  • Implement the Deutsch–Jozsa algorithm.
  • Compare the algorithmic performance of Deutsch–Jozsa to deterministic and classically random strategies.