the oracle
-
搜索空间: N 元素
-
只关心[0,N−1]的索引,不关注元素本身
-
假设N=2n,这样索引用n−bits存储
-
有M个解
-
假如我们有一个 a quantum oracle, with the ability to recognize solutions to the search problem.
- The oracle is a unitary operator, O, defined by its action on the computational basis:
- ∣x⟩∣q⟩⟶O∣x⟩∣q⊕f(x)⟩
- ∣x⟩:index register
- f(x)=1的话oracle qubit q就翻转
- 如果一开始oracle qubit 是2∣0⟩−∣1⟩,那么末态就是:
- ∣x⟩∣∣∣2∣0⟩−∣1⟩⟩⟶O(−1)f(x)∣x⟩∣∣∣2∣0⟩−∣1⟩⟩
- 看到 oracle qubit总是没有改变,所以这个oracle可以这样干
- 其实俺是有疑惑的
-
∣x⟩⟶O(−1)f(x)∣x⟩
- 这个oracle的作用是将解的相位移动了
- 这个oracle的作用是将解的相位移动了
Deutsch-Jozsa算法
- 场景:
- alice 从0到2n−1间选择了一个数x,发给了Bob计算f(x)(constantorbalanced),然后回复1或0.
- 目标:
- Alice 将判定Bob使用哪个函数呢?并且通信要尽可能少哦!!
- 经典的要: 2n/2+1次查询
- 量子:1个查询,使用Uf去计算f(x)
- 下面的图就是通信过程:
-
上面左是alice,下面左是oracle
-
∣ψ0⟩=∣0⟩⊗n∣1⟩
-
∣ψ1⟩=∣+⟩⊗n∣−⟩=
- 2n1x=0∑2n−1∣x⟩21(∣0⟩−∣1⟩)
-
∣ψ2⟩=2n1x=0∑2n−1(−1)f(x)∣x⟩21(∣0⟩−∣1⟩)
-
当H⊗n作用在前面一大撮东西上面会变成啥呢?
-
∣x⟩=∣x1,x2,...,xn⟩
-
看每个H作用后成了啥?成了∣0⟩+(−1)x1∣1⟩=
z=0∑z=1(−1)zx1∣z⟩ -
所以x作用的话就成了 z=0∑2n−1(−1)zx∣z⟩
-
作用在一大群x上就是2n1z=0∑2n−1x=0∑2n−1(−1)f(x)+xz∣z⟩
-
-
∣ψ3⟩=2n1z=0∑2n−1x=0∑2n−1(−1)f(x)+xz∣z⟩21(∣0⟩−∣1⟩)
-
我们只需要测量“z=0”的系数,便可知道啦!!
-
the procedure
-
搜索算法就像下面这样运行
-
The oracle may employ work qubits for its implementation,
but the analysis of the quantum search algorithm involves
only the n-qubit register. -
Goal: to find a solution to the search problem, using the
smallest possible number of the applications of the oracle. -
The quantum search algorithm consists of repeated application
known as the Grover iteration or Grover operator, which we
denote G. And it may be broken up into four steps:-
Apply the oracle O.
-
Apply the Hadamard transform H⊗n.
-
Perform a conditional phase shift with every computational
basis state except |0⟩ receiving a phase shift of −1,- ∣x⟩→−(−1)δx∣x⟩
- Show that the unitary operator corresponding to the phase shift in the G is 2∣0⟩⟨0∣−I.
- 显然2∣0⟩⟨0∣−I作用在∣0⟩上是不变,其他你可以验证啊,
-
Apply the Hadamard transform H⊗n.
-
-
Each of the operations in the G may be efficiently implemented
on a quantum computer.-
G=H⊗n(2∣0⟩⟨0∣−I)H⊗nO
- 又看到了经常看到的东西了
- 又看到了经常看到的东西了
-
G=H⊗n(2∣0⟩⟨0∣−I)H⊗nO
geometric visualization
- G 可以被视为 a rotation in the two-dim space spanned by the starting vector |ψ⟩ and the superposition.
- 来个定义哦
- 假设有M个是解, 令∣α⟩=N−M1∑x′′∣x⟩
- 令∣β⟩=M1∑x′∣x⟩
- 记得∣ψ⟩=N1x=0∑N−1∣x⟩=NN−M∣α⟩+NM∣β⟩
- 从下面的图容易看出来,cos2θ=NN−M
- 我们来看看G对∣ψ⟩的作用
- 先看O的作用,∣ψ⟩⟶O=NN−M∣α⟩−NM∣β⟩
- 看出来是关于α粥对称
-
2∣ψ⟩⟨ψ∣−I是数学上的啥?
- 初等反射阵啊!
- 初等反射阵啊!
- 先看O的作用,∣ψ⟩⟶O=NN−M∣α⟩−NM∣β⟩
例子
- Here is an explicit example illustrating how the quantum search
algorithm works on a search space of size N=4. - The oracle can be taken to be one of the four circuits:
- 第一个图: 只有输入都是11的时候才会触发,其他类似
- The whole circuit is as follows.
- where the gates in the box perform 2∣00⟩⟨00∣−I.
- 这意味着∣ψ⟩