Implementing the Deutsch-Jozsa algorithm
The Deutsch-Jozsa algorithm refers to a quantum algorithm designed by Richard Cleve, Artur Ekert, Chiara Macchiavello, and Michele Mosca in 1998, improving on the 1992 version from David Deutsch and Richard Jozsa. It was created with the idea of showing that the power of state superposition in a quantum algorithm could significantly reduce the number of computation steps needed compared to its classical counterpart.
In this section, you will learn how to solve a Deutsch-Jozsa problem theoretically both in a classical and in a quantum way. You will then practically implement a quantum algorithm solving that problem while gaining intuition of some of Silq's core features.
Problem statement
Let's start by defining a problem that can be solved by the Deutsch-Jozsa algorithm. The objective is to determine the nature of a function, , which takes as input an n-bit integer and returns either 0 or 1. We are guaranteed that this function...