|0⟩⊗n|−⟩H⊗n⊗I⎛⎝∑x={0,1}n12n/2|x⟩⎞⎠|−⟩=12n/2(|0⟩+|1⟩)⊗n|−⟩.
UfUf⎛⎝∑x={0,1}n12n/2|x⟩⎞⎠|−⟩=∑x={0,1}n12n/2|x⟩|−⊕f(x)⟩.
⊕ ⎛⎝∑x={0,1}n12n/2(−1)f(x)|x⟩⎞⎠|−⟩.
Uf|x⟩(|0⟩−|1⟩)=|x⟩|f(x)⟩−|1⊕f(x)⟩=(−1)f(x)|x⟩(|0⟩−|1⟩)
xx=∏ixiH|xi⟩=12–√(|0⟩+(−1)xi|1⟩)=12–√∑y={0,1}(−1)xi.y|y⟩.
H⊗n|x⟩=12n/2∑y∈{0,1}n(−1)x.y|y⟩.
12n⎛⎝∑x,y={0,1}n(−1)f(x)⊕x.y|y⟩⎞⎠|−⟩.
f(x)=u.x=x.u(−1)f(x)⊕x.y=(−1)x.(u⊕y)x∑x(−1)x.(u⊕y)=0,∀u⊕y≠0u⊕y=0u=y|u⟩|−⟩u
|+⟩⊗n|u⟩
关键是,使用叠加,我们可以同时对所有量子位执行此操作,而不必像传统情况那样单独检查每个量子位。