跳转到内容

Chapter 10 Exercises

Sanjoy Dasgupta, Christos Papadimitriou, Umesh VaziraniMcGraw-Hill Higher Education《Algorithms》大学本科 · 教材双语助读 (Alt+Y)
Exercise 10.1

textstyle | ψ . = frac 1 sqrt 2 | 0 0 . + frac 1 sqrt 2 | 1 1 . is one of the famous “Bell states,” a highly entangled state of its two qubits. In this question we examine some of its strange properties.

(a) Suppose this Bell state could be decomposed as the (tensor) product of two qubits (recall the box on page 298), the first in state α _ 0 | 0 rangle + α _ 1 | 1 rangle and the second in state β _ 0 | 0 rangle + β _ 1 | 1 rangle Write four equations that the amplitudes α _ 0 , α _ 1 , β _ 0 , and β _ 1 must satisfy. Conclude that the Bell state cannot be so decomposed.

(b) What is the result of measuring the first qubit of | ψ rangle ?

(c) What is the result of measuring the second qubit after measuring the first qubit?

(d) If the two qubits in state | ψ . are very far from each other, can you see why the answer to (c) is surprising?

Exercise 10.2

Show that the following quantum circuit prepares the Bell state r | ψ . = frac 1 sqrt 2 | 0 0 . + frac 1 sqrt 2 | 1 1 . on input 00 : apply a Hadamard gate to the first qubit followed by a CNOT with the first qubit as the control and the second qubit as the target.

What does the circuit output on input 10, 01, and 11? These are the rest of the Bell basis states.

Exercise 10.3

What is the quantum Fourier transform modulo M of the uniform superposition r frac 1 sqrt M ∑ _ j = 0 ^ M - 1 | j . ?

Exercise 10.4

What is the QFT modulo M of vert j rangle ?

Exercise 10.5

Convolution-Multiplication. Suppose we shift a superposition r | α rangle = ∑ _ j α _ j | j rangle by l to get the superposition r | α ^ prime . = ∑ _ j α _ j | j + l . . If the QFT of | α . is | β rangle , show that the QFT of α ^ prime is β ^ prime , where β _ j ^ prime = β _ j ω ^ l j . Conclude that if r | α ^ prime . = ∑ _ j = 0 ^ M / k - 1 sqrt frac k M | j k + l . , then r | β ^ prime . = frac 1 sqrt k ∑ _ j = 0 ^ k - 1 ω ^ l j M / k | j M / k rangle

Exercise 10.6

Show that if you apply the Hadamard gate to the inputs and outputs of a CNOT gate, the result is a CNOT gate with control and target qubits switched:

Exercise 10.7

The CONTROLLED SWAP (C-SWAP) gate takes as input 3 qubits and swaps the second and third if and only if the first qubit is a 1.

(a) Show that each of the NOT, CNOT, and C-SWAP gates are their own inverses.

(b) Show how to implement an AND gate using a C-SWAP gate, i.e., what inputs a , b , c would you give to a C-SWAP gate so that one of the outputs is a wedge b ?

(c) How would you achieve fanout using just these three gates? That is, on input a and 0, output a and a.

(d) Conclude therefore that for any classical circuit C there is an equivalent quantum circuit Q using just NOT and C-SWAP gates in the following sense: if C outputs y on input x , then Q outputs | x , y , z . on input | x , 0 , 0 rangle . (Here z is some set of junk bits that are generated during this computation).

(e) Now show that that there is a quantum circuit Q ^ - 1 that outputs | x , 0 , 0 rangle on input | x , y , z .

(f) Show that there is a quantum circuit Q ^ prime made up of NOT, CNOT, and C-SWAP gates that outputs | x , y , 0 rangle on input | x , 0 , 0 rangle

Exercise 10.8

In this problem we will show that if N = p q is the product of two odd primes, and if x is chosen uniformly at random between 0 and N - 1 , such that operatorname* g c d ( x , N ) = 1 , then with probability at least 3 / 8 _ ! , the order r of x mod N is even, and moreover x ^ r / 2 is a nontrivial square root of 1 mod N.

(a) Let p be an odd prime and let x be a uniformly random number modulo p . Show that the order of x mod p is even with probability at least 1 / 2 . (Hint: Use Fermat’s little theorem (Section 1.3).)

(b) Use the Chinese remainder theorem (Exercise1.37) to show that with probability at least 3 / 4 , the order r of x mod N is even.

(c) If r is even, prove that the probability that x ^ r / 2 ≡ ± 1 is at most 1 / 2

共 0 题