Deutsch-Jozsa Algorithm
The Deutsch-Jozsa algorithm, first introduced in Reference, was the first example of a quantum algorithm that performs better than the best classical algorithm. It showed that there can be advantages to using a quantum computer as a computational tool for a specific problem. We will first talk about the Deutsch Algorithm step by step and then go into the Deutsch-Jozsa algorithm.
1. Deutsch Algorithm
1.1 Problem Statement
Given a function , how can we know whether f(x) is a balanced function or constant function?
We first dig into what is balanced function and constant function.
Balanced Function means , including two possibilites:
Constant Function means , including two possibilities:
1.2 Solution Circuit
We first present the solution circuit and try to find why it can help to find the solution. In the following picture, we assume in the upper register.
The following figure shows how we deduce from the beginning to the end. (I will spend some time using markdown to compile it in the future :).)
1.3 Example Circuit
We use the balanced function as an example to see what happened.
Balanced Function One
The process goes like this:
The process goes like this:
We can find that the results of the first register in two circuits are . Similarly, if we use constant function as an example, the result will be . That's what Deutsch can do to solve this problem.
By only one measurement, we can know whether a function is balanced or constant, while in the classical computing world, we need twice to know the result.
2. Deutsch-Jozsa Algorithm
Deutsch-Jozsa Algorithm extends Deutsch algorithm into dimensions.
The algorithm goes with the following procedures:
State Preparation
Superposition by using Hardmard Gate
Use the targeted function in the circuit
Another Hardmard Gateto the first register.
Measurement. Note that the amplitude of the state
Let's look at the two possible cases constant and balanced to discern what happens. In the case where is constant, the amplitude for is or , depending on the constant value takes. Because is of unit length it follows that all the other amplitudes must be zero, and observation will yield 0s for all qubits in the query register.
If is balanced then the positive and negative contributions to the amplitude for cancel, leaving an amplitude of zero, and measurement must yield a result other than 0 on at least one qubit in the query register.
Reference:
1. Nielsen, Michael A., and Isaac Chuang. "Quantum computation and quantum information." (2002): 558-559.
2. Asfaw, Abraham, et al. "Learn quantum computation using qiskit." Accessed: Oct 24 (2020): 2020.
3. Susskind, Leonard, and Art Friedman. Quantum mechanics: the theoretical minimum. Basic Books, 2014.
版权声明: 本文为 InfoQ 作者【Si Yuan】的原创文章。
原文链接:【http://xie.infoq.cn/article/85414866275ba9d3aa038327a】。未经作者许可,禁止转载。
评论