Playground
判定 Deutsch-Jozsa
Determine if a function is constant or balanced in one query
Quantum Circuit
|0⟩
H
Uf
H
M
|1⟩
H
SuperpositionQuery OracleInterferenceMeasure
Classical Approach
f(0)?
f(1)?
Queries needed: 2 (worst case)
Quantum Approach
|ψ⟩
Ready to run
Queries needed: 1 (always)
Oracle Function
Truth Table
| Input (x) | Output f(x) |
|---|---|
| 0 | 0 |
| 1 | 1 |
The Problem
Given a black-box function f(x), determine if it's constant (same output for all inputs) or balanced (different outputs).
Classical: 2 queriesQuantum: 1 query