🌱Aadam's Garden

Search

Search IconIcon to open search

Deutsch-Jozsa algorithm

Last updated Jun 23, 2022

This algorithm is used to determine if a function is constant or balanced.

The Deutsch-Jozsa algorithm is very similar to Deutsch’s Algorithm, but we now have $n$ qubits (plus an answer qubit, which we ignore by using a Phase Oracle). These $n$ qubits are initially each in the $|0⟩$ state, and we apply H gates to put them in a Superposition of all $n$-bit strings. Then, we query the oracle on this superposition. Finally, we apply Hadamards to all the qubits to create a state that we measure, and whose measurement outcome allows us to distinguish whether the function is constant or balanced. If we get $|0\dots00⟩$, the function is constant, and if we get anything else, the function is balanced.

For a detailed explanation/derivation, refer to the book section specified below. 1