13Stage 5 · 1/3AlgorithmsIntermediate12 min

Deutsch–Jozsa algorithm

With the promise that a function is constant or balanced, decide which using one quantum query.

Back to learning pathQuantum algorithms
3 Qubits5 · Circuit story

Why this experiment matters

What you will do

Use interference to see a simple, exact example of quantum query advantage.

  1. 01

    Prepare two input qubits in |+⟩ and one auxiliary qubit in |−⟩.

  2. 02

    Query the promised reversible oracle once and use phase kickback.

  3. 03

    Interfere the paths and measure the two input qubits.

04 · PREDICT

Predict before you measure

Choose one answer to unlock the measurement.

Which result will be most likely at the current setting?Prediction options

INTERACTIVE

Interactive model

Move the control, then run a measurement. This is a teaching simulation—not hardware output.

Simulated locally
Circuit story
|+⟩×2|−⟩OracleH×2M×2

Measurement results

Make a prediction, then run the measurement to reveal the expected and sampled results.

06 · CHECK

Check what you learned

Measurement results

Make a prediction, then run the measurement to reveal the expected and sampled results.