0.1 Phase Estimation Technique

Size: px
Start display at page:

Download "0.1 Phase Estimation Technique"

Transcription

1 Phase Estimation In this lecture we will describe Kitaev s phase estimation algorithm, and use it to obtain an alternate derivation of a quantum factoring algorithm We will also use this technique to design quantum circuits for computing the Quantum Fourier Transform modulo an arbitrary positive integer 0 Phase Estimation Technique In this section, we define the phase estimation problem and describe an efficient quantum circuit for it Property 0 Let U be a N N unitary transformation U has an orthonormal basis of eigenvectors ψ, ψ,, ψ N with eigenvalues λ,λ,,λ N, where λ e πiθ for some θ Proof: U, being unitary, maps unit vectors to unit vectors and hence all the eigenvalues have unit magnitude, ie they are of the form e πiθ for some θ Let ψ and ψ be two distinct eigenvectors with distinct eigenvalues λ and λ We have that λ ψ,ψ λ ψ,ψ Uψ,ψ ψ,uψ ψ,λ ψ λ ψ,ψ Since λ λ, the inner product ψ,ψ is 0, ie the eigenvectors ψ and ψ are orthonormal Given a unitary transformation U, and one of its eigenvector ψ, we want to figure out the corresponding eigenvalue λ or, equivalently, θ This is the phase estimation problem Definition 0 For any unitary transformation U, let C-U stand for a controlled U circuit which conditionally transforms ψ to U ψ as shown in Figure?? b ψ U ψ if b 0 then ψ ψ else if b then ψ U ψ Figure 0: Controlled U Circuit Assume that we have a circuit which implements the controlled U transformation We will see later in the course how to construct a circuit that implements a controlled U transformation given a circuit that implements U The phase estimation circuit in Figure?? can be used to estimate the value of θ The phase estimation circuit performs the following sequence of transformations: 0 ψ H st 0 + ψ C-U st 0 ψ + st λ ψ st 0 + λ ψ CS 94, Spring 009, 0-

2 0 H H easure ψ U Figure 0: Phase Estimation Circuit Note that after the C-U transformation, the eigenvector remains unchanged while we have been able to put λ into the phase of the first qubit A Hadamard transform on the first qubit will transform this information into the amplitude which we will be able to measure H +λ 0 λ + Let P0 and P be the probability of seeing a zero and one respectively on measuring the first qubit If we write λ e πiθ, we have: P0 +cosπθ + isinπθ +cosπθ P cosπθ isinπθ cosπθ There is a bias of cosπθ in the probability of seeing a 0 or upon measurement Hence, we can hope to estimate θ by performing the measurement several times However, to estimate cosπθ within m bits of accuracy, we need to perform Ω m measurements This follows from the fact that estimating the bias of a coin to within ε with probability at least δ requires Θ log/δ samples ε We will now see how to estimate θ efficiently Suppose we can implement the C m -U transformation as defined below m bits {0,,, m } ψ U U ψ Figure 03: m-controlled U Circuit Definition 03 For any unitary transformation U, let C -U stand for a -controlled U circuit which implements the transformation ψ U ψ as shown in Figure?? CS 94, Spring 009, 0-

3 Estimating θ within m bits of accuracy is equivalent to estimating integer, where m is the closest approximation to θ Let m and w e πi The circuit in Figure?? performs the following sequence of transformations: 0 m ψ H m C m -U ψ 0 λ ψ 0 w 0 ψ Note that the first register now contains the Fourier Transform mod of and if we apply the reverse of the Fourier Transform mod note that quantum circuits are reversible, we will get bac QFT ψ 0 m H m QFT ψ U Figure 04: Efficient Phase Estimation Circuit If θ m, then clearly the circuit outputs If θ m, then the circuit outputs with high probability Exercise! 0 Kitaev s Factoring Algorithm In this section, we will see how to use the phase estimation circuit to factor a number Recall that the problem of factoring reduces to the problem of order finding To factor N, it is sufficient to pic a random number a and compute the minimum positive r such that a r mod N With reasonable probability, r is even and a r/ ± mod N and hence N a r, ie N a r/ + a r/ Since N does not divide a r/ ±, it must be the case that a part of it divides a r/ + and hence gcdn,a r/ + is a non-trivial factor of N We now reduce the problem of order finding to the phase estimation problem Consider the unitary transformation CS 94, Spring 009, 0-3

4 a : x xa mod N Its eigenvectors are ψ r + w a ++ w r a r, where w e πi/r : a ψ r a + w a ++ w r a r w r + w a ++ w r a r w ψ It follows that ψ is an eigenvector of a with eigenvalue w Hence, if we can implement the C m - a transformation and construct the eigenvector ψ for some suitable, we can use the phase estimation circuit to obtain an approximation to the eigenvalue w and therefore reconstruct r as follows: w e πiθ for θ /r Recall that phase estimation reconstructs θ m where is the output of the phase estimation procedure carried out to m bits of precision Thus with high probability m is a very close approximation to r Assuming that is relatively prime to r which we will ensure with high probability we can estimate r using the method of continued fractions if we choose N Lets loo carefully at the C m - a transformation It transforms x xa mod N But this is precisely the transformation that does modular exponentiation There exists a classical circuit that performs this transformation in O x time, and thus we can construct a quantum circuit that implements the C m - a transformation It is not obvious how to obtain an eigenvector ψ for some, but it is easy to obtain the uniform superposition of the eigenvectors r ψ 0, ψ ψ r Note that r ψ Hence, if we use as the second input to the 0 phase estimation circuit, then we will be able to measure a random eigenvalue w, where is chosen uar from the set {0,,r } Note that 0 is completely useless for our purposes But will be relatively prime to r with reasonable probability 0 m QFT QFT a Figure 05: Order Finding Circuit Kitaev s With these observations, it is easy to see that the circuit in Figure?? outputs with high probability, where m is the closest approximation to r for some random Note that with reasonable probability, is relatively prime to r and if that is the case, then we can estimate r using the method of continued fractions if we choose N Note also that QFT and H q act in an identical manner on 0 q, so H q could be used in the above circuit in place of the QFT transformation Though the thining and the analysis behind the Kitaev s and Shor s order-finding algorithm are different, it is interesting to note that the two circuits are almost identical Figure?? describes the Shor s circuit The quantities q, Q and x in the Shor s algorithm correspond to m, and a in the Kitaev s algorithm Also, note that raising a to some power is same as performing controlled multiplication CS 94, Spring 009, 0-4

5 0 q QFT Q QFT Q measure x x mod N 03 QFT mod Q Figure 06: Order Finding Circuit Shor s In this section, we will present Kitaev s quantum circuit for computing Fourier Transform over an arbitrary positive integer Q, not necessarily a power of Let m be such that m < Q m and let m Recall that the Fourier Transform mod Q sends a mod Q Q Q w ab b let χ a where w e πi/q Note that { χ a a 0,,,Q } forms an orthonormal basis, so we may regard the Fourier Transform as a change of basis Consider the following sequence of transformations, which computes something close to the Fourier Transform mod Q: Q a 0 a Q b a w ab b a χ a Q Q We can implement the circuit that sends 0 Q Q Perform the following sequence of transformations 0 m 0 H m b efficiently in the following two ways: m x 0 x Q x0 m x x Q x0 Note that since we can efficiently decide whether or not x Q classically, we can also do so quantum mechanically Now tae measurement on the second register If the result is a 0, the first register contains a uniform superposition over 0,, Q If not, we repeat the experiment At each trial, we succeed with probability Q/ > m / m / If we pic a number uar in the range 0 to Q, the most significant bit of the number is 0 with probability m /Q We can therefore set the first bit of our output to be the superposition: m 0 + Q m Q CS 94, Spring 009, 0-5

6 If the first bit is 0, then the remaining m bits may be chosen randomly and independently, which correspond to the output of H m on 0 m If the first bit is, we need to pic the remaining m bits to correspond to a uniformly chosen random number between 0 and Q m, which we can do recursively The second transformation a b w ab a b can be made using the controlled phase shift circuit This gives us an efficient quantum circuit for a 0 a χ a, but what we really want is a circuit for a χ a In particular, for application to factoring, we need a circuit that forgets the input a in order to have interference in the superposition over χ a What we would lie is a quantum circuit that transforms a χ a 0 χ a If we could find a unitary transformation U with eigenvector χ a and eigenvalue e πia/q, then we could use phase estimation to implement the transformation 0 χ a a χ a By reversing the quantum circuit for phase estimation which we could do since quantum circuits are reversible, we have an efficient quantum circuit for a 0 a χ a 0 χ a which is what we need Note that the phase estimation circuit with m bits of precision outputs such that m Q a So if we tae m >> Q, we can use continued fractions to reconstruct a as required above To see that the required U exists, consider U : x x mod Q Then, Q Uχ a U w ab Q b w ab b w a Q w ab b w a χ a In addition, note that U can be efficiently computed with a classical circuit, and can therefore be both efficiently and reversibly computed with a quantum circuit The overall circuit to compute QFT mod Q is shown in Figure?? The circuit should be read from right to left b H m QFT a Controlled Phase Shift a U χ a H m 0 m Figure 07: Using Reverse Phase Estimation Circuit to do QFT mod Q for arbitrary Q 04 ixed Quantum State Next, we will outline a very interesting application of phase estimation Before we can do this, we must introduce some concepts in quantum information theory So far we have dealt with pure quantum states ψ α x x x CS 94, Spring 009, 0-6

7 This is not the most general state we can thin of We can consider a probability distribution of pure states, such as 0 with probability / and with probability / Another possibility is the state { + 0+ with probability / 0 with probability / In fact, no measurement can distinguish the first case 0 or from this case This will be seen below In general, we can thin of mixed state {p i, ψ i } as a collection of pure states ψ i, each with associated probability p i, with the conditions 0 p i and i p i One context in which mixed states arise naturally is in quantum protocols, where two players share an entangled pure quantum state Each player s view of their quantum register is then a probability distribution over pure states achieved when the other player measures their register Another reason we consider such mixed states is because the quantum states are hard to isolate, and hence often entangled to the environment 05 Density atrix Now we consider the result of measuring a mixed quantum state Suppose we have a mixture of quantum states ψ i with probability p i Each ψ i can be represented by a vector in C n, and thus we can associate the outer product ψ i ψ i ψ i ψ i, which is an n n matrix a a a N ā ā ā N a ā a ā a ā N a ā a ā a ā N a N ā a N ā a N ā N We can now tae the average of these matrices, and obtain the density matrix of the mixture {p i, ψ i }: ρ p i ψ i ψ i i We give some examples Consider the mixed state 0 with probability of / and with probablity / Then and Thus in this case ρ / 0 0 / Now consider another mixed state, this time consisting of + with probability / and with probability / This time we have + + /, and /, CS 94, Spring 009, 0-7

8 Thus in this case the offdiagonals cancel, and we get ρ / 0 0 / Note that the two density matrices we computed are identical, even though the mixed state we started out was different Hence we see that it is possible for two different mixed states to have the same density matrix Nonetheless, the density matrix of a mixture completely determines the effects of maing a measurement on the system: Theorem 0: Suppose we measure a mixed state {p, ψ } in an orthonormal bases β Then the outcome is β with probability β ρ β Proof: We denote the probability of measuring β by Pr[] Then Pr[] p ψ β p β ψ ψ β β p ψ ψ β β ρ β Thus mixtures with the same density matrix are indistinguishable by measurement It will be shown in the next section that, in fact, two mixtures are distinguishable by measurement if and only if they have different density matrices We list several properties of the density matrix: ρ is Hermitian, so the eigenvalues are real and the eigenvectors orthogonal If we measure in the standard basis the probability we measure i, P[i] ρ i,i Also, the eigenvalues of ρ are non-negative Suppose that λ and e are corresponding eigenvalue and eigenvector Then if we measure in the eigenbasis, we have Pr[e] e ρ e λ e e λ 3 trρ This is because if we measure in the standard basis ρ i,i Pr[i] but also i Pr[i] so that i ρ i,i i Pr[i] Consider the following two mixtures and their density matrices: cosθ 0+sinθ wp / cθ cθ sθ sθ cosθ 0 sinθ wp / cθ cθ sθ sθ 0 wpcos θ cos 0 0 wp sin θ sin 0 θ 0 cos sin c θ cθsθ cθsθ s θ c θ cθsθ cθsθ s θ Thus, since the mixtures have identical density matrices, they are indistinguishable cos θ 0 0 sin θ cos θ 0 0 sin θ CS 94, Spring 009, 0-8

9 06 Von Neumann Entropy We will now show that if two mixed states are represented by different density measurements, then there is a measurement that distinguishes them Suppose we have two mixed states, with density matrices A and B such that A B We can as, what is a good measurement to distinguish the two states? We can diagonalize the difference A B to get A B EΛE, where E is the matrix of orthogonal eigenvectors Then if e i is an eigenvector with eigenvalue λ i, then λ i is the difference in the probability of measuring e i : Pr A [i] Pr B [i] λ i We can define the distance between two probability distributions with respect to a basis E as If E is the eigenbasis, then which is called the trace distance between A and B D A D B E Pr A [i] Pr B [i] D A D B E λ i tr A B A B tr, i Claim easuring with respect to the eigenbasis E of the matrix A B is optimal in the sense that it maximizes the distance D A D B E between the two probability distributions Before we prove this claim, we introduce the following definition and lemma without proof Definition Let {a i } N i and {b i} N i be two non-increasing sequences such that i a i i b i Then the sequence {a i } is said to maorize {b i } if for all, i a i Lemma[Schur] Eigenvalues of any Hermitian matrix maorizes the diagonal entries if both are sorted in nonincreasing order Now we can prove our claim Proof Since we can reorder the eigenvectors, we can assume λ λ λ n Note that tra B 0, so we must have i λ i 0 We can split the λ i s into two groups: positive ones and negative ones, we must have i b i A B tr A B tr λ i >0 λ i <0 Thus max i λ i A B tr Now consider measuring in another basis Then the matrix A B is represented as H FA BF, and let µ µ µ n be the diagonal entries of H Similar argument shows that max i µ i But by Schur s lemma the λ i s maorizes µ i s, so we must have n i µ i D A D B F D A D B F D A D B E A B tr CS 94, Spring 009, 0-9

10 Let HX be the Shannon Entropy of a random variable X which can tae on states p p n H{p i } p i log i p i In the quantum world, we define an analogous quantity, Sρ, the Von Neumann entropy of a quantum ensemble with density matrix ρ with eigenvalues λ,,λ n : Sρ H{λ,,λ n } λ i log i λ i 07 Phase Estimation and ixed State Computation Liquid NR Nuclear agnetic Resonance quantum computers have successfully implemented 7 qubits and performed a stripped down version of quantum factoring on the number 5 In liquid NR, the quantum register is composed of the nuclear spins in a suitably chosen molecule - the number of qubits is equal to the number of atoms in the molecule We can thin of the computer as consisting of about 0 6 such molecules a macroscopic amount of liquid, each controlled by the same operations simultaneously Thus we will have 0 6 copies of our state, each consisting of say 7 qubits We assume that we can address the qubits individually, so that for example, we could preform an operation such as CNOT on the nd and 4th qubit simultaneously on each copy The catch in liquid NR quantum computing is that initializing the register is hard Each qubit starts out in state 0 with probability / + ε and in state with probability / ε Here ε depends upon the strength of the magnetic field that the liquid sample is placed in Using very strong magnets in the NR apparatus, the polarization ε is still about 0 5 If ε 0 then the density matrix describing the quantum state of the register is ρ n I This means that if we apply a unitary transformation U, the density matrix of the resulting state is I U UIU I So you cannot perform any meaningful computation The way NR quantum computation wors is this: the initial mixed state with ε 0 5 is preprocessed through a sequence of quantum gates to obtain a new mixed state which is maximally mixed n I with probability δ and with probability δ Now, if we apply a unitary transformation to this state, we get n I with probability δ and U with probability δ Thus if we measure the state, we obtain a coin flip with bias δ towards the correct answer Another way of thining about this is that the n I gives no net signal in the measurement, while the δ signal gets amplified by the 0 6 copies of the computation being carried out simultaneously The problem is that δ is exponentially small in n the number of qubits Therefore liquid NR quantum computation cannot scale beyond 0-0 qubits What if we tried one qubit with ε-bias and n- qubits maximally mixed? Question: Say we have a single clean bit and n maximally mixed qubits, what can we do with this? We can do at least one quantum computation, phase estimation to approximate the trace of a unitary matrix Use the single clean qubit as the control bit and apply the controlled unitary to the n maximally mixed qubits We can thin of the n qubits as being a uniform mixture over the eigenvectors of the unitary, and upon measuring, we get out a random eigenvalue estimate for traceu See Figure?? CS 94, Spring 009, 0-0

11 0 H H easure I U Figure 08: Phase Estimation Circuit for TraceU Is there anything else that we can do with ust one qubit? Can you prove limits on what can be done with one clean qubit? And where is the entanglement in the computation? CS 94, Spring 009, 0-