Algorithm
Deutsch-Jozsa
Problem: decide whether a hidden Boolean function is constant or balanced in a toy setting.
Expected output
The balanced sample should favor measuring 1 on the query qubit.
Algorithm
Problem: decide whether a hidden Boolean function is constant or balanced in a toy setting.
The balanced sample should favor measuring 1 on the query qubit.
The oracle writes information into phase, then the final H converts it into a measurable bit.
Prepare, query with CX, unprepare, then measure q0.
It is a clean first example of phase kickback and query advantage.
This demo is educational, not a practical workload.
# Deutsch-Jozsa (balanced oracle f(x)=x xor 1) qubits 2 H 0 X 1 H 1 CX 0 1 H 0 H 1 MEASURE 0
What does the final H help reveal?