Die Sigg es noch nit övversatz. Ehr luurt üch de änglesche Originalversion aan.
Phase estimation procedure
Next, we'll discuss the phase-estimation procedure, which is a quantum algorithm for solving the phase estimation problem.
We'll begin with a low-precision warm-up, which explains some of the basic intuition behind the method. We'll then talk about the quantum Fourier transform, which is an important quantum operation used in the phase-estimation procedure, as well as its quantum circuit implementation. Once we have the quantum Fourier transform in hand, we'll describe the phase-estimation procedure in full generality and analyze its performance.
Warm-up: approximating phases with low precision
We'll begin with a couple of simple versions of the phase-estimation procedure that provide low-precision solutions to the phase-estimation problem. This is helpful for explaining the intuition behind the general procedure that we'll see a bit later in the lesson.
Using the phase kickback
A simple approach to the phase-estimation problem, which allows us to learn something about the value we seek, is based on the phase kick-back phenomenon. As we'll see, this is essentially a single-qubit version of the general phase-estimation procedure to be discussed later in the lesson.
As part of the input to the phase estimation problem, we have a unitary quantum circuit for the operation We can use the description of this circuit to create a circuit for a controlled- operation, which can be depicted as this figure suggests (with the operation viewed as a quantum gate, on the left and a controlled- operation on the right).
We can create a quantum circuit for a controlled- operation by first adding a control qubit to the circuit for and then replacing every gate in the circuit for with a controlled version of that gate — so our one new control qubit effectively controls every single gate in the circuit for This requires that we have a controlled version of every gate in our circuit, but we can always build circuits for these controlled operations in case they're not included in our gate set.
Now consider the following circuit, where the input state of all of the qubits except the top one is the quantum state eigenvector of
The measurement outcome probabilities for this circuit depend on the eigenvalue of corresponding to the eigenvector Let's analyze the circuit in detail to determine exactly how.
The initial state of the circuit is
and the first Hadamard gate transforms this state to
Next, the controlled- operation is performed, which results in the state
Using the assumption that is an eigenvector of having eigenvalue we can alternatively express this state as follows.
Here we observe the phase kickback phenomenon. It is slightly different this time than it was for Deutsch's algorithm and the Deutsch-Jozsa algorithm because we're not working with a query gate — but the idea is similar.
Finally, the second Hadamard gate is performed. After just a bit of simplification, we obtain this expression for this state.
The measurement therefore yields the outcomes and with these probabilities:
Here's a plot of the probabilities for the two possible outcomes, and as functions of
Naturally, the two probabilities always sum to Notice that when the measurement outcome is always and when the measurement outcome is always So, although the measurement result doesn't reveal exactly what is, it does provide us with some information about it — and if we were promised that either or we could learn from the circuit which one is correct without error.
Intuitively speaking, we can think of the circuit's measurement outcome as being a guess for to "one bit of accuracy." In other words, if we were to write in binary notation and round it off to one bit, we'd have a number like this:
The measurement outcome can be viewed as a guess for the bit When is neither nor there's a nonzero probability that the guess will be wrong — but the probability of making an error becomes smaller and smaller as we get closer to or
It's natural to ask what role the two Hadamard gates play in this procedure:
-
The first Hadamard gate sets the control qubit to a uniform superposition of and so that when the phase kickback occurs, it happens for the state and not the state, creating a relative phase difference that affects the measurement outcomes. If we didn't do this and the phase kickback produced a global phase, it would have no effect on the probabilities of obtaining different measurement outcomes.
-
The second Hadamard gate allows us to learn something about the number through the phenomenon of interference. Prior to the second Hadamard gate, the state of the top qubit is
and if we were to measure this state, we would obtain and each with probability telling us nothing about By performing the second Hadamard gate, however, we cause the number to affect the output probabilities.
Doubling the phase
The circuit above uses the phase kickback phenomenon to approximate to a single bit of accuracy. One bit of accuracy may be all we need in some situations — but for factoring we're going to need a lot more accuracy than that. A natural question is, how can we learn more about
One very simple thing we can do is to replace the controlled- operation in our circuit with two copies of this operation, like in this circuit:
Two copies of a controlled- operation is equivalent to a controlled- operation. If is an eigenvector of having eigenvalue then this state is also an eigenvector of this time having eigenvalue
So, if we run this version of the circuit, we're effectively performing the same computation as before, except that the number is replaced by Here's a plot illustrating the output probabilities as ranges from to
Doing this can indeed provide us with some additional information about If the binary representation of is
then doubling effectively shifts the binary point one position to the right:
And because we're equating with as we move around the unit circle, we see that the bit has no influence on our probabilities, and we're effectively obtaining a guess for the second bit after the binary point if we round to two bits. For instance, if we knew in advance that was either or then we could fully trust the measurement outcome to tell us which.
It's not immediately clear, though, how this estimation should be reconciled with what we learned from the original (non-doubled) phase kickback circuit to give us the most accurate information possible about So let's take a step back and consider how to proceed.
Two-qubit phase estimation
Rather than considering the two options described above separately, let's combine them into a single circuit like so.
The Hadamard gates after the controlled operations have been removed and there are no measurements here yet. We'll add more to the circuit as we consider our options for learning as much as we can about
If we run this circuit when is an eigenvector of the state of the bottom qubits will remain throughout the entire circuit, and phases will be "kicked" into the state of the top two qubits. Let's analyze the circuit carefully, by means of the following figure.
We can write the state like this:
When the first controlled- operation is performed, the eigenvalue gets kicked into the phase when (the top qubit) is equal to but not when it's So, we can express the resulting state like this:
The second and third controlled- gates do something similar, except for rather than and with replaced by We can express the resulting state like this:
If we think about the binary string as representing an integer in binary notation, which is we can alternatively express this state as follows.
Our goal is to extract as much information about as we can from this state.
At this point we'll consider a special case, where we're promised that for some integer In other words, we have so we can express this number exactly using binary notation with two bits, as . . . or . In general, might not be one of these four values, but thinking about this special case will help us to figure out how to most effectively extract information about in general.
First we'll define a two-qubit state vector for each possible value
After simplifying the exponentials, we can write these vectors as follows.
These vectors are orthogonal: if we choose any pair of them and compute their inner product, we get Each one is also a unit vector, so is an orthonormal basis. We therefore know right away that there is a measurement that can discriminate them perfectly — meaning that, if we're given one of them but we don't know which, then we can figure out which one it is without error.
To perform such a discrimination with a quantum circuit, we can first define a unitary operation that transforms standard basis states into the four states listed above.
To write down as a matrix, it's just a matter of taking the columns of to be the states
This is a special matrix, and it's likely that some readers will have encountered it before: it's the matrix associated with the -dimensional discrete Fourier transform. In light of this fact, let us call it by the name rather than The name is short for quantum Fourier transform — which is essentially just the discrete Fourier transform, viewed as a unitary operation. We'll discuss the quantum Fourier transform in greater detail and generality shortly.
We can perform the inverse of this operation to go the other way, to transform the states into the standard basis states If we do this, then we can measure to learn which value describes as Here's a diagram of a quantum circuit that does this.
To summarize, if we run this circuit when for the state immediately before the measurements take place will be (for encoded as a two-bit binary string), so the measurements will reveal the value without error.
This circuit is motivated by the special case that — but we can run it for any choice of and and hence any value of that we wish. Here's a plot of the output probabilities the circuit produces for arbitrary choices of
This is a clear improvement over the single-qubit variant described earlier in the lesson. It's not perfect — it can give us the wrong answer — but the answer is heavily skewed toward values of for which is close to In particular, the most likely outcome always corresponds to the closest value of to (equating and as before), and from the plot it looks like this closest value for always appears with probability just above When is exactly halfway between two such values, like for instance, the two equally close values of are equally likely.
Preparing to generalize to many qubits
Given the improvement we've just obtained by using two control qubits rather than one, in conjunction with the inverse of the -dimensional quantum Fourier transform, it's natural to consider generalizing it further — by adding more control qubits. When we do this, we obtain the general phase estimation procedure. We'll see how this works shortly, but in order to describe it precisely we're going to need to discuss the quantum Fourier transform in greater generality, to see how it's defined for other dimensions and to see how we can implement it (or its inverse) with a quantum circuit.
Quantum Fourier transform
The quantum Fourier transform is a unitary operation that can be defined for any positive integer dimension In this section, we'll see how this operation is defined and how it can be implemented with a quantum circuit on qubits with cost when
The matrices that describe the quantum Fourier transform are derived from an analogous operation on -dimensional vectors known as the discrete Fourier transform. This operation can be thought about in different ways. For instance, we can think about the discrete Fourier transform in purely abstract, mathematical terms as a linear mapping. Or we can think about it in computational terms, where we're given an -dimensional vector of complex numbers (using binary notation to encode the real and imaginary parts of the entries, let us suppose) and the goal is to calculate the -dimensional vector obtained by applying the discrete Fourier transform. Our focus will be on third way, which is viewing this transformation as a unitary operation that can be performed on a quantum system.
There's an efficient algorithm for computing the discrete Fourier transform on a given input vector known as the fast Fourier transform. It has applications in signal processing and many other areas, and is considered by many to be one of the most important algorithms ever discovered. As it turns out, the implementation of the quantum Fourier transform when is a power of 2 that we'll study is based on precisely the same underlying structure that make the fast Fourier transform possible.
Definition of the quantum Fourier transform
To define the quantum Fourier transform, we'll first define a complex number for each positive integer like this:
This is the number on the complex unit circle we obtain if we start at and move counter-clockwise by an angle of radians, or a fraction of of the circumference of the circle. Here are a few examples:
Now we can define the -dimensional quantum Fourier transform, which is described by an matrix whose rows and columns are associated with the standard basis states We're only going to need this operation for when is a power of for phase estimation, but the operation can be defined for any positive integer
As was already stated, this is the matrix associated with the -dimensional discrete Fourier transform. Often the leading factor of is not included in the definition of this matrix, but we need to include it to obtain a unitary matrix.
Here's the quantum Fourier transform, written as a matrix, for some small values of
Notice, in particular, that is another name for a Hadamard operation.
Unitarity
Let's check that is unitary, for any selection of One way to do this is to show that its columns form an orthonormal basis. We can define a vector corresponding to column number starting from and going up to like this:
Taking the inner product between any two of these vectors gives us this expression:
We can evaluate sums like this using the following formula for the sum of the first terms of a geometric series.
Specifically, we can use this formula when When we have so using the formula and dividing by gives
When we have so the formula reveals this:
This happens because so making numerator zero, while the denominator is nonzero because Intuitively speaking, what we're doing is summing a bunch of points that are distributed around the unit circle, and they cancel out and leave when summed.
We have therefore established that is an orthonormal set,
which reveals that is unitary.
Controlled-phase gates
To implement the quantum Fourier transform with a quantum circuit, we'll need to make use of controlled-phase gates. Recall that a phase operation is a single-qubit unitary operation of the form
for any real number A controlled version of this gate has the following matrix:
For this controlled gate, it doesn't actually matter which qubit is the control and which is the target because the two possibilities are equivalent. We can use any of the following symbols to represent this gate in quantum circuit diagrams.
For the third form, the label is also sometimes placed on the side of the control line or under the lower control when that's convenient.
To perform the quantum Fourier transform when and we're going to need to perform an operation on qubits whose action on standard basis states can be described as
where is a bit and is a number encoded in binary notation as a string of bits. This can be done using controlled-phase gates by generalizing the following example, for which
In general, for an arbitrary choice of the top qubit corresponding to the bit can be viewed as the control, with the phase gates ranging from on the qubit corresponding to the least significant bit of to on the qubit corresponding to the most significant bit of These controlled-phase gates all commute with one another and could be performed in any order.
Circuit implementation of the QFT
Now we'll see how we can implement the quantum Fourier transform with a circuit when the dimension is a power of There are, in fact, multiple ways to implement the quantum Fourier transform, but this is arguably the simplest method known. Once we know how to implement the quantum Fourier transform with a quantum circuit, it's straightforward to implement its inverse: we can replace each gate with its inverse (or, equivalently, conjugate transpose) and apply the gates in the reverse order. Every quantum circuit composed of unitary gates alone can be inverted in this way.
The implementation is recursive in nature, so that's how it's most naturally described. The base case is in which case the quantum Fourier transform is a Hadamard operation.
To perform the quantum Fourier transform on qubits when we can perform the following steps, whose actions we'll describe for standard basis states of the form where is an integer encoded as bits using binary notation and is a single bit.
-
First apply the -dimensional quantum Fourier transform to the bottom/leftmost qubits to obtain this state:
This is done by recursively applying the method being described for one fewer qubit, using the Hadamard operation on a single qubit as the base case.
-
Use the top/rightmost qubit as a control to inject the phase for each standard basis state of the remaining qubits (as is described above) to obtain this state: