/ quantum course Back to lab
PATHWAY PROGRESS0/27 passed

05 / Algorithms · LESSON 11 / 27 · 18 MIN

Deutsch's algorithm and phase kickback.

See how an oracle can store a property in the phase.

Defining the oracle

A reversible Boolean oracle acts as U_f|x,y⟩ = |x,y⊕f(x)⟩. When the target is |−⟩, flipping it just contributes a minus sign: U_f|x,−⟩ = (−1)ᶠ⁽ˣ⁾|x,−⟩. This is phase kickback; it does not read out f for free.

Asking a global question

With one input bit, f is constant when f(0)=f(1) and balanced otherwise. Prepare |+⟩|−⟩, apply the oracle once, then H on the input. The input ends up as |0⟩ if f is constant and |1⟩ if it is balanced.

Counting queries fairly

In the ideal case the algorithm makes one quantum query, against two for a deterministic classical method. Building and running the oracle costs resources as well. The gain is about queries under one particular oracle model, not about every practical task.

LIVE EXPERIMENT / 1 OF 4

q0|0⟩q1|0⟩XHHH

Initialize the register

Every qubit starts in zero.

BasisAmplitudeProbability
|00⟩1.000100.0%

TEST YOURSELF

Lesson quiz

Get all 2 questions right to pass. Retry as often as you like.

0/2 answered

1. The input is measured as 1. What does that say about f?
2. Which target state does phase kickback use?

Sign in with email or a wallet to check your answers and keep your lesson progress in sync.

Your account

Sign in to pick up your progress on any device.

or

Wallet sign-in uses a free signature (EIP-4361) on whatever EVM network your wallet is on. No gas, no transaction.