Quantum Amplititude Amplification

Posted 安徽思远

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Quantum Amplititude Amplification相关的知识,希望对你有一定的参考价值。

1. Introduction

You have likely heard that one of the many advantages a quantum computer has over a classical computer is its superior speed searching databases. Grover’s algorithm demonstrates this capability. This algorithm can speed up an unstructured search problem quadratically, but its uses extend beyond that; it can serve as a general trick or subroutine to obtain quadratic run time improvements for a variety of other algorithms. This is called the amplitude amplification trick.

两步走:1. 反转目标状态的振幅;2. 根据平均值再翻转。

2. Unstructured Search

Suppose you are given a large list of N items. Among these items there is one item with a unique property that we wish to locate; we will call this one the winner w. Think of each item in the list as a box of a particular color. Say all items in the list are gray except the winner w, which is purple.
在这里插入图片描述

To find the purple box – the marked item – using classical computation, one would have to check on average N/2 of these boxes, and in the worst case, all N of them. On a quantum computer, however, we can find the marked item in roughly \\sqrt{N} steps with Grover’s amplitude amplification trick. A quadratic speedup is indeed a substantial time-saver for finding marked items in long lists. Additionally, the algorithm does not use the list’s internal structure, which makes it generic; this is why it immediately provides a quadratic quantum speed-up for many classical problems.

3. Creating an Oracle

For the examples in this textbook, our ‘database’ is comprised of all the possible computational basis states our qubits can be in. For example, if we have 3 qubits, our list is the states |000\\rangle, |001\\rangle, \\dots |111\\rangle (i.e the states |0\\rangle \\rightarrow |7\\rangle).

Grover’s algorithm solves oracles that add a negative phase to the solution states. I.e. for any state ∣ x ⟩ |x\\rangle x in the computational basis:

U ω ∣ x ⟩ = { − ∣ x ⟩ if    x ≠ ω − ∣ x ⟩ if    x = ω U_\\omega|x\\rangle = \\bigg\\{ \\begin{aligned} \\phantom{-}|x\\rangle \\quad \\text{if} \\; x \\neq \\omega \\\\ -|x\\rangle \\quad \\text{if} \\; x = \\omega \\\\ \\end{aligned} Uωx={xifx=ωxifx=ω
This oracle will be a diagonal matrix, where the entry that correspond to the marked item will have a negative phase. For example, if we have three qubits and \\omega = \\text{101}, our oracle will have the matrix:

U ω = [ 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 − 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 ] ← ω = 101 U_\\omega = \\begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\\\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\\\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\\\ \\end{bmatrix} \\begin{aligned} \\\\ \\\\ \\\\ \\\\ \\\\ \\\\ \\leftarrow \\omega = \\text{101}\\\\ \\\\ \\\\ \\\\ \\end{aligned} Uω=1000000001000000001000000001000000001000000001000000001000000001ω=101

What makes Grover’s algorithm so powerful is how easy it is to convert a problem to an oracle of this form. There are many computational problems in which it’s difficult to find a solution, but relatively easy to verify a solution. For example, we can easily verify a solution to a sudoku by checking all the rules are satisfied. For these problems, we can create a function f that takes a proposed solution x, and returns f(x) = 0 if x is not a solution ( x ≠ ω ) (x \\neq \\omega) (x=ω) and f(x) = 1 for a valid solution ( x = ω ) (x = \\omega) (x=ω). Our oracle can then be described as:

U ω ∣ x ⟩ = ( − 1 ) f ( x ) ∣ x ⟩ U_\\omega|x\\rangle = (-1)^{f(x)}|x\\rangle Uωx=(1)f(x)x
and the oracle’s matrix will be a diagonal matrix of the form:

U ω = [ ( − 1 ) f ( 0 ) 0 ⋯ 0 0 ( − 1 ) f ( 1 ) ⋯ 0 ⋮ 0 ⋱ ⋮ 0 0 ⋯ ( − 1 ) f ( 2 n − 1 ) ] U_\\omega = \\begin{bmatrix} (-1)^{f(0)} & 0 & \\cdots & 0 \\\\ 0 & (-1)^{f(1)} & \\cdots & 0 \\\\ \\vdots & 0 & \\ddots & \\vdots \\\\ 0 & 0 & \\cdots & (-1)^{f(2^n-1)} \\\\ \\end{bmatrix} Uω=(1)f(0)000(1)f(1)0000(1)f(2n1)

For the next part of this chapter, we aim to teach the core concepts of the algorithm. We will create example oracles where we know \\omega beforehand, and not worry ourselves with whether these oracles are useful or not. At the end of the chapter, we will cover a short example where we create an oracle to solve a problem (sudoku).

4. Amplitude Amplification

So how does the algorithm work? Before looking at the list of items, we have no idea where the marked item is. Therefore, any guess of its location is as good as any other, which can be expressed in terms of a uniform superposition: ∣ s ⟩ = 1 N ∑ x = 0 N − 1 ∣ x ⟩ |s \\rangle = \\frac{1}{\\sqrt{N}} \\sum_{x = 0}^{N -1} | x \\rangle s=N 1x=0N1x.

If at this point we were to measure in the standard basis { ∣ x ⟩ } \\{ | x \\rangle \\} {x}, this superposition would collapse, according to the fifth quantum law, to any one of the basis states with the same probability of 1 N = 1 2 n \\frac{1}{N} = \\frac{1}{2^n} N1=2以上是关于Quantum Amplititude Amplification的主要内容,如果未能解决你的问题,请参考以下文章

量子搜索算法基础: Quantum Amplititude Amplification

Firefox 57 / Quantum:模拟打印样式

讲解ECE2231 Introduction to Quantum Mechanics

使用 Firefox Quantum 检查 Websocket 帧

Quantum State

Quantum State