50
IBM T.J. Watson An introduction to quantum computing, without the physics Giacomo Nannicini Friday 11, 2019. 1/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

IBM T.J. Watson

An introduction to quantum computing,without the physics

Giacomo Nannicini

Friday 11, 2019.

1/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 2: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

1 Overview

2 Qubits and their state

3 Operations on qubits

4 Input and output

5 Universal set of quantum gates

6 Grover’s algorithm

7 Conclusions

2/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 3: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

1 Overview

2 Qubits and their state

3 Operations on qubits

4 Input and output

5 Universal set of quantum gates

6 Grover’s algorithm

7 Conclusions

3/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 4: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Why quantum computing?

History:

[Feynman, 1982] proposed the use of a computer that can efficientlysimulate quantum mechanics.

Many things happened in between. . .

After 35 years, from that visionary idea we have arrived at thecommercialization of quantum computing devices of small size[Castelvecchi, 2017].

Why should we care:

Quantum computing uses a different computational paradigm fromclassical: operations can be slower/faster in either model.Two most notable algorithms:

Shor’s algorithm for integer factorization in polynomial time[Shor, 1997].Grover’s algorithm for black-box search in O(

√2n) time [Grover, 1996].

Many more: https://math.nist.gov/quantum/zoo/

4/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 5: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

5/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 6: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Model of computation

A quantum computing device works as follows:

1 The quantum computer has a state that is contained in a quantumregister and is initialized in a predefined way.

2 The state evolves by applying operations specified in advance in theform of an algorithm.

3 At the end of the computation, some information on the state of thequantum register is obtained by means of a special measurementoperation.

Formal model of computation:

Similar to a Turing machine (or register machine): there exists auniversal quantum (Turing) machine[Deutsch, 1985, Bernstein and Vazirani, 1997].

The above model is called circuit model; an alternative model iscalled adiabatic.

Circuit and adiabatic are equivalent [Aharonov et al., 2008], andcircuit is more commonly used.

6/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 7: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

What you actually need to know

Power of universal quantum computers

A Turing machine can simulate a universal quantum computer, and viceversa.

Efficiency of the computation

Even if a classical computer can simulate a universal quantum computer,it may not be efficient: some tasks may be exponentially faster in onemodel of computation versus the other.

Will I lose my job?

It is widely believed that quantum computerscannot solve NP-hard problems in polynomial time.

7/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 8: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

What you actually need to know

Power of universal quantum computers

A Turing machine can simulate a universal quantum computer, and viceversa.

Efficiency of the computation

Even if a classical computer can simulate a universal quantum computer,it may not be efficient: some tasks may be exponentially faster in onemodel of computation versus the other.

Will I lose my job?

It is widely believed that quantum computerscannot solve NP-hard problems in polynomial time.

7/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 9: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

1 Overview

2 Qubits and their state

3 Operations on qubits

4 Input and output

5 Universal set of quantum gates

6 Grover’s algorithm

7 Conclusions

8/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 10: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Preliminaries

DefinitionGiven vector spaces V and W over C with bases e1, . . ., em and f1, . . ., fn,the tensor product V ⊗W is another vector space over C of dimensionmn. The space V ⊗W has a bilinear operation ⊗ : V ×W → V ⊗W , and ithas basis ei ⊗ f j ∀i = 1, . . .,m, j = 1, . . .,n.

Relationship with Kronecker product (or outer product)

Given A ∈ Cm×n,B ∈ Cp×q,the Kronecker product A⊗ Bis the matrix D ∈ Cmp×nq ,defined on the right:

D := A⊗ B =*.....,

a11B . . . a1nBa21B . . . a2nB...

...am1B . . . amnB

+/////-

.

Given standard basis over the vector spaces Cm×n and Cp×q , the bilinearoperation ⊗ of Cm×n ⊗Cp×q is the Kronecker product.We always work with the standard basis.

9/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 11: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Properties of the tensor product

Proposition

Let A,B : Cm×m,C,D ∈ Cn×n be linear maps on V and W respectively,u,v ∈ Cm,w, x ∈ Cn, and a,b ∈ C. The tensor product satisfies:

(i) Bilinearity:(u+ v) ⊗w = u⊗w+ v ⊗w.u⊗ (w+ x) = u⊗w+u⊗ x.(au) ⊗ (bw) = ab(u⊗w).

(ii) Associativity:A⊗ (B ⊗C) = (A⊗ B) ⊗C.x ⊗ (u⊗ v) = (x ⊗ u) ⊗ v.

(iii) Properties for linear maps:(A⊗C)(B ⊗D) = AB ⊗CD.(A⊗C)(u⊗w) = Au⊗Cw.

10/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 12: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Example of tensor product of vectors

x =(0.250.75

)y =

*....,

0.20.20.20.4

+////-

x ⊗ y =(0.250.75

)⊗

*....,

0.20.20.20.4

+////-

=

*.............,

0.25×0.20.25×0.20.25×0.20.25×0.40.75×0.20.75×0.20.75×0.20.75×0.4

+/////////////-

=

*.............,

0.050.050.050.10.150.150.150.3

+/////////////-

11/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 13: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Braket notation, and bases

Vector spaces and their dual

Given a complex Euclidean space S ≡ Cn, |ψ⟩ ∈ S denotes a columnvector, and ⟨ψ | ∈ S∗ denotes a row vector that is the conjugate transposeof |ψ⟩, i.e., ⟨ψ | = |ψ⟩∗. |ψ⟩ is called a ket, ⟨ψ | is called a bra.

We work with complex Euclidean spaces of the form (C2)⊗q .

12/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 14: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Structure of the standard basis

Standard bases for C2 and (C2)⊗2

The standard basis for C2 is denoted by:

|0⟩ =(10

), |1⟩ =

(01

).

The four basis elements of (C2)⊗2 = C2 ⊗C2 are:

|00⟩ = |0⟩ ⊗ |0⟩ =*....,

1000

+////-

|01⟩ = |0⟩ ⊗ |1⟩ =*....,

0100

+////-

|10⟩ = |1⟩ ⊗ |0⟩ =*....,

0010

+////-

|11⟩ = |1⟩ ⊗ |1⟩ =*....,

0001

+////-

.

13/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 15: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Structure of the standard basis

Standard basis for (C2)⊗q

The standard basis for(C2

) ⊗qis given by the following 2q vectors:

|0⟩ ⊗ · · · ⊗ |0⟩ ⊗ |0⟩︸ ︷︷ ︸q times

= | 00 · · ·00︸ ︷︷ ︸q digits

|0⟩ ⊗ · · · ⊗ |0⟩ ⊗ |1⟩︸ ︷︷ ︸q times

= | 00 · · ·01︸ ︷︷ ︸q digits

...

|1⟩ ⊗ · · · ⊗ |1⟩ ⊗ |1⟩︸ ︷︷ ︸q times

= | 11 · · ·11︸ ︷︷ ︸q digits

⟩.

In more compact form, the vectors are denoted by |ȷ⟩, ȷ ∈ {0,1}q.

14/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 16: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

State of a quantum register

A quantum computer has a state stored in a quantum register.

Classical registers are made up of bits. Quantum registers are made upof qubits.

Assumption

The state of a q-qubit quantum register is a unit vector in(C2

) ⊗q= C2 ⊗ · · · ⊗C2.

Differences with respect to classical computers

The state of a q-bit classical register lives in q-dimensional space.

The state of a q-qubit quantum register lives in 2q-dimensional complexspace.

15/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 17: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Examples of quantum state

1-qubit case

The state of a single qubit (q = 1) is

α |0⟩+ β |1⟩ = α(10

)+ β

(01

)=

(αβ

),

where α, β ∈ C and |α |2+ | β |2 = 1.

q-qubit case

The state of a q-qubit quantum register is:∑ȷ∈{0,1}q

αȷ |ȷ⟩, with∑

ȷ∈{0,1}q|αȷ |

2 = 1.

16/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 18: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Superposition

Basis states and their superposition

q qubits are in a basis state if their state |ψ⟩ =∑

ȷ∈{0,1}q αȷ |ȷ⟩q is |ψ⟩ = |k⟩for some k ∈ {0,1}q. Otherwise, they are in a superposition.

Example: given general 2-qubit state

|ψ⟩ = α00 |00⟩+α01 |01⟩+α10 |10⟩+α11 |11⟩,

the following is a basis state:

|ψ⟩ = |01⟩ (i.e., α00 = α10 = α11 = 0, α01 = 1),

and this is a superposition:

|ψ⟩ =1√

2|01⟩+

1√

2|11⟩.

Thus, superposition = linear combination of basis states.

17/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 19: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Entanglement: definitions

Product states and entanglement

A quantum state |ψ⟩ ∈(C2

) ⊗qis a product state if it can be written as

|ψ1⟩ ⊗ · · · ⊗ |ψq⟩, where |ψk⟩ are 1-qubit states.

Otherwise, it is entangled.

18/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 20: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Entanglement: example

Example: product state

Consider 2-qubit state:12|00⟩+

12|01⟩+

12|10⟩+

12|11⟩.

This is a product state because it is equal to:(1√

2|0⟩+

1√

2|1⟩

)⊗

(1√

2|0⟩+

1√

2|1⟩

).

Example: entangled state

Consider 2-qubit state:1√

2|00⟩+

1√

2|11⟩

This is an entangled state, because it cannot be expressed as a productof two 1-qubit states.

19/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 21: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

1 Overview

2 Qubits and their state

3 Operations on qubits

4 Input and output

5 Universal set of quantum gates

6 Grover’s algorithm

7 Conclusions

20/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 22: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Quantum gates

Assumption

An operation applied by a quantum computer with q qubits, also called agate, is a unitary matrix in C2q×2q .

(A matrix U is unitary if U∗U =UU∗ = I.)

This has two very important consequences:

Quantum operations are linear.

Quantum operations are reversible.

[Bennett, 1973] shows that any computation can be made reversible bymeans of (polynomial) extra space.

While these properties may seem to be extremely restrictive,[Deutsch, 1985] shows that a universal quantum computer isTuring-complete.

21/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 23: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Notation for quantum circuits

This is a quantum circuit on 3 qubits.

qubit 1Uqubit 2

qubit 3

Diagrams are read from left to right.The corresponding matrix operationsare written from right to left.

A B|ψ⟩ BA|ψ⟩

Gates can be applied to individual qubits. The following are equivalent.

qubit 1

qubit 2

qubit 3 U

qubit 1 I

qubit 2 I

qubit 3 U

22/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 24: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Single-qubit gates on product states

Given product state |x⟩ ⊗ |y⟩ ⊗ |z⟩:

|x⟩ |x⟩

|y⟩ |y⟩

|z⟩ U U |z⟩

This is because (I ⊗ I ⊗U)( |x⟩ ⊗ |y⟩ ⊗ |z⟩) = |x⟩ ⊗ |y⟩ ⊗U |z⟩.

For general (entangled) state |ψ⟩: (I ⊗ I ⊗U) |ψ⟩

U

|ψ⟩

Remark: the matrix (I ⊗ I ⊗U) has size 2q ×2q!

23/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 25: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

1 Overview

2 Qubits and their state

3 Operations on qubits

4 Input and output

5 Universal set of quantum gates

6 Grover’s algorithm

7 Conclusions

24/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 26: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Input

Input of an algorithm

The input of a quantum algorithm consists of an initial quantum state anda quantum circuit.

Efficient algorithms:

For an efficient algorithm we require poly(q) many (small) gates,coming from a compact instruction set.

Usually, the initial state is |0⟩ by convention.

Algorithms, and problem data:

A quantum algorithm is equivalent to a quantum circuit.

Similar to a (boolean) circuit model: algorithm and data must beencoded in the circuit before execution.

We can run multiple quantum circuits and combine results.

25/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 27: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Output

Classical versus quantum

Classical: we can read the state at any time.

Quantum: we do not have direct access to the quantum state. Informationon the quantum state is only gathered through a measurement gate.

This is a single-qubit measurement gate. |ψ⟩ M

We can measure one or multiple qubits.

26/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 28: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Measurement of all (or multiple) qubits

Assumption (simplified)

Given a q-qubit quantum state |ψ⟩ =∑

ȷ∈{0,1}q αȷ |ȷ⟩, measuring the qqubits in any order yields k with probability |αk |

2, for k ∈ {0,1}q .

After measurement, the state becomes |ψ⟩ = |k⟩. This is irreversibile.

Example: Given

|ψ⟩ =α000 |000⟩+α001 |001⟩+α010 |010⟩+α011 |011⟩ +α100 |100⟩+α101 |101⟩+α110 |110⟩+α111 |111⟩,

thenPr(Q1 M

= 1,Q2 M= 0,Q3 M

= 1) = |α101 |2

27/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 29: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Measuring a single qubit: intuition

|ψ⟩ =α000 |000⟩+α001 |001⟩+α010 |010⟩+α011 |011⟩ +α100 |100⟩+α101 |101⟩+α110 |110⟩+α111 |111⟩,

Suppose we measure only the first qubit. What is Pr(Q1 M= 1)?

Pr(Q1 M= 1) =

∑j,k∈{0,1}

Pr(Q1 M= 1,Q2 M

= j,Q3 M= k)

=∑

j,k∈{0,1}|α1jk |

2.

If Q1 M= 1, the state becomes:

|ψ ′⟩ =β100 |100⟩+ β101 |101⟩+ β110 |110⟩+ β111 |111⟩,

where βs are just renormalization of αs.

28/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 30: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

1 Overview

2 Qubits and their state

3 Operations on qubits

4 Input and output

5 Universal set of quantum gates

6 Grover’s algorithm

7 Conclusions

29/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 31: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Instruction set

How to program a quantum computer:

The instruction set contains only certain 2×2 (1-qubit) and 4×4(2-qubit) gates.

Instructions can be composed via tensor products and matrixmultiplication to build more complex operations.

Efficient algorithm: number of basic quantum gates is polynomial inthe input size.

DefinitionA set of gates that can be used to build an ϵ-approximation of any unitarymatrix, on any given number of qubits and for any ϵ > 0, is called auniversal set of gates.

Most common instruction set:

A restricted set of 1-qubit gates plus CNOT is universal.

Any 1-qubit gate can be built efficiently.

A arbitrary q-qubit gate requires at most O(4qq2) gates.

30/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 32: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

1-qubit gates: the X gate

Basic 1-qubit operation: the X gate.

X =(0 11 0

).

The X gate bit-flips a qubit: quantum equivalent of the NOT gate.

X |0⟩ =(0 11 0

) (10

)=

(01

)= |1⟩ X |1⟩ =

(0 11 0

) (01

)=

(10

)= |0⟩.

RemarkX is reversible because X X = I.

31/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 33: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Hadamard gate and superposition

H =1√

2

(1 11 −1

).

The action of H is as follows:

H |0⟩ =1√

2( |0⟩+ |1⟩) H |1⟩ =

1√

2( |0⟩− |1⟩)

Proposition

Starting from state |0⟩, applying the Hadamard gate to all qubits yieldsthe uniform superposition of basis states 1√

2q∑

ȷ∈{0,1}q |ȷ⟩.

Proof.

H ⊗q |0⟩ = (H |0⟩)⊗q =(

1√

2|0⟩+

1√

2|1⟩

) ⊗q=

1√

2q∑

ȷ∈{0,1}q|ȷ⟩.

32/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 34: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

2-qubit gate: CNOT

Description of the CNOT gate:

The CNOT (controlled NOT) gate has a control and a target.

If the control qubit is |0⟩, nothing happens; if the control qubit is |1⟩,the target qubit is bit-flipped.

Below, we represent CNOT12: control qubit 1, target qubit 2.

Q1 •

Q2 CNOT12 =

*....,

1 0 0 00 1 0 00 0 0 10 0 1 0

+////-

.

The effect of CNOT is as follows:

CNOT12 |00⟩ = |00⟩ CNOT12 |01⟩ = |01⟩CNOT12 |10⟩ = |11⟩ CNOT12 |11⟩ = |10⟩.

The CNOT gate can create and destroy entanglement.

33/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 35: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

1 Overview

2 Qubits and their state

3 Operations on qubits

4 Input and output

5 Universal set of quantum gates

6 Grover’s algorithm

7 Conclusions

34/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 36: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Black-box search

Problem description:

Let f : {0,1}n→ {0,1}.Assume that there exists a unique ℓ ∈ {0,1}n : f (ℓ) = 1.

We want to determine ℓ.

RemarkThis is a black-box search problem: we do not know any property of thefunction, we can only compute it through its value oracle f . Efficiency ofan algorithm is determined by its oracle complexity.

Classical algorithm:

In the worst case, any deterministic algorithm needs to test f (ȷ) forall ȷ ∈ {0,1}n.

A randomized algorithm needs 2n+12 oracle calls in expectation.

Classically we need O(2n) oracle calls.

35/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 37: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Preliminaries

DefinitionGiven x, y ∈ {0,1}, we denote by x ⊕ y the modulo 2 addition, i.e.:

x ⊕ y = (x+ y) mod 2 = x XOR y.

Problem input:

The algorithm requires q = n+1 qubits.

f encoded by a unitary Uf : |ȷ⟩n ⊗ |y⟩1→ |ȷ⟩n ⊗ |y ⊕ f (ȷ)⟩1.

|ȷ⟩ /nUf

/n |ȷ⟩

|y⟩ |y ⊕ f (ȷ)⟩

Top qubit lines: input register of f , bottom line: output register .

When |y⟩ = |0⟩, this writes | f (ȷ)⟩ in the output register because|0⊕ f (ȷ)⟩ = | f (ȷ)⟩.Remark: the input of the problem is Uf ,n.

36/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 38: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

On superposition and parallelism

A simple algorithm (that does not work):

1 Initialize with uniform superposition:

H ⊗n |0⟩ ⊗ |0⟩ =∑

ȷ∈{0,1}n

1√

2n|ȷ⟩ ⊗ |0⟩.

2 Compute function value for all binary strings:

Uf

( ∑ȷ∈{0,1}n

1√

2n|ȷ⟩ ⊗ |0⟩

)=

∑ȷ∈{0,1}n

1√

2n|ȷ⟩ ⊗ | f (ȷ)⟩.

3 Apply measurement on all qubits.

Output: a random binary string in {0,1}n!

37/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 39: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Outline of Grover’s algorithm

Initialization:

Create uniform superposition of all basis states on the first n qubits.

Last qubit (n+1) is given the value H X |0⟩ = 1√2

(|0⟩− |1⟩) and is anauxiliary qubit.

Repeat:

(i) Sign-flip the vectors for which f gives output 1.

(ii) Invert all the coefficients of the quantum state around the averagecoefficient.

Rationale of the algorithm:

A full cycle of these two operations increases the coefficient αℓ of|ℓ⟩ ⊗ (|0⟩− |1⟩) in the quantum state.

When |αℓ |2 ≈ 1, read ℓ from a measurement with probability ≈ 1.

38/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 40: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Outline of the algorithm: sketch

Initialization.

A

2A

Computation of the average.

Sign flip.

A

2A

Inversion about the average.

39/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 41: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Sign flip: step (i)

To sign-flip the target state |ℓ⟩ ⊗ (|0⟩− |1⟩), simply apply Uf to |ψ⟩.

Uf |ψ⟩ =Uf

( ∑ȷ∈{0,1}n

αȷ |ȷ⟩ ⊗ (|0⟩− |1⟩))

=Uf

(αℓ |ℓ⟩ ⊗ (|0⟩− |1⟩)

)+Uf

( ∑ȷ∈{0,1}n

ȷ,ℓ

αȷ |ȷ⟩ ⊗ (|0⟩− |1⟩))

= αℓ |ℓ⟩ ⊗ (|0⊕ f (ℓ)⟩− |1⊕ f (ℓ)⟩)+∑

ȷ∈{0,1}n

ȷ,ℓ

αȷ |ȷ⟩ ⊗ ( |0⊕ f (ȷ)⟩− |1⊕ f (ȷ)⟩)

= αℓ |ℓ⟩ ⊗ (|1⟩− |0⟩)+∑

ȷ∈{0,1}n

ȷ,ℓ

αȷ |ȷ⟩ ⊗ (|0⟩− |1⟩)

=(−αℓ |ℓ⟩+

∑ȷ∈{0,1}n

ȷ,ℓ

αȷ |ȷ⟩)⊗ ( |0⟩− |1⟩).

40/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 42: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Number of iterations

How many iterations of steps (i) and (ii) should we apply?

Ignore the auxiliary qubit. Let

|ψD⟩ = |ℓ⟩, |ψU⟩ =

*.....,

∑ȷ∈{0,1}n

ȷ,ℓ

1√

2n −1|ȷ⟩

+/////-

be the desirable and undesirable quantum states.

We claim that the quantum state at iteration k of the algorithm is

|ψk⟩ = dk |ψD⟩+uk |ψU⟩.

Initially, d0 =1√2n

and u0 =√

2n−12n .

41/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 43: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Number of iterations (cont’d)

Effect of a major iteration:

At step (i), we sign-flip dk |ψD⟩+uk |ψU⟩ → −dk |ψD⟩+uk |ψU⟩.

At step (ii), we map αh → 2Avgk −αh for each coefficient αh.

Doing the calculations, we obtain the recursion:(dk+1uk+1

)=

(cosθ sinθ−sinθ cosθ

) (ukdk

),

with sinθ = 2√

2n−12n : clockwise rotation of the vector

(dk

uk

)by a certain

angle θ.

42/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 44: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Number of iterations (cont’d)

Using sinθ = 2√

2n−12n , we obtain:

dk = cos kθd0+ sin kθu0

uk = −sin kθd0+ cos kθu0.

We want dk large, hence sin kθ ≈ 1 (because u0 ≫ d0). The optimalnumber of iterations of Grover’s algorithm is therefore given by:

kθ ≈π

2=⇒ k ≈

2nπ4√

2n −1≈π

4√

2n.

After these many iterations, we have a probability close to 1 of obtainingthe sought state |ℓ⟩.

Running time of Grover’s algorithm

After O(√

2n) queries to Uf , Grover’s algorithm returns |ℓ⟩ with probabilityclose to 1: quadratic speedup compared to classical O(2n).

43/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 45: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

1 Overview

2 Qubits and their state

3 Operations on qubits

4 Input and output

5 Universal set of quantum gates

6 Grover’s algorithm

7 Conclusions

44/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 46: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Further reading

Some important quantum algorithms:

Quantum Fourier transform, integer factorization [Shor, 1997].

Approximation of Jones polynomial [Aharonov et al., 2009] (exactcomputation is #P-hard; approximation is BQP-complete).

Random walks on graphs [Childs et al., 2003].

Quantum algorithms for continuous optimization:

Quadratic speedup (in n and m) for the solution of SDPs[Brandao and Svore, 2016].

Speedup in the solution of LPs via interior point (classical: O(n3.5),quantum: O(n2)) [Kerenidis and Prakash, 2018].

Convex optimization via oracles (classical: O(n2), quantum: O(n))[van Apeldoorn et al., 2018]

45/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 47: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Conclusions

If you want a detailed tutorial with full proofs, you can read:

An introduction to quantum computing, without the physicshttps://arxiv.org/abs/1708.03684

It also gives computational examples and more references.

You can experiment with real quantum hardware, for free, on theIBM Q experience:

https://www.research.ibm.com/ibm-q/

Performance of heuristics for 0-1 problems is still poor [Nannicini, 2018].

46/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 48: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete
Page 49: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Bibliography I

Aharonov, D., Jones, V., and Landau, Z. (2009).

A polynomial quantum algorithm for approximating the Jones polynomial.Algorithmica, 55(3):395–421.

Aharonov, D., Van Dam, W., Kempe, J., Landau, Z., Lloyd, S., and Regev, O. (2008).

Adiabatic quantum computation is equivalent to standard quantum computation.SIAM review, 50(4):755–787.

Bennett, C. H. (1973).

Logical reversibility of computation.IBM journal of Research and Development, 17(6):525–532.

Bernstein, E. and Vazirani, U. (1997).

Quantum complexity theory.SIAM Journal on Computing, 26(5):1411–1473.

Brandao, F. G. and Svore, K. (2016).

Quantum speed-ups for semidefinite programming.arXiv preprint arXiv:1609.05537.

Castelvecchi, D. (2017).

Quantum cloud goes commercial.Nature, 543.

Childs, A. M., Cleve, R., Deotto, E., Farhi, E., Gutmann, S., and Spielman, D. A. (2003).

Exponential algorithmic speedup by a quantum walk.In Proceedings of the thirty-fifth annual ACM symposium on Theory of computing, pages 59–68. ACM.

Deutsch, D. (1985).

Quantum theory, the Church-Turing principle and the universal quantum computer.In Proceedings of the Royal Society of London A: Mathematical, Physical and Engineering Sciences, volume 400, pages 97–117. TheRoyal Society.

48/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation

Page 50: An introduction to quantum computing, without the …...While these properties may seem to be extremely restrictive, [Deutsch, 1985] shows that auniversal quantum computer is Turing-complete

Bibliography II

Feynman, R. P. (1982).

Simulating physics with computers.International journal of theoretical physics, 21(6):467–488.

Grover, L. K. (1996).

A fast quantum mechanical algorithm for database search.In Proceedings of the twenty-eighth annual ACM Symposium on Theory of Computing, pages 212–219. ACM.

Kerenidis, I. and Prakash, A. (2018).

A quantum interior point method for lps and sdps.arXiv preprint arXiv:1808.09266.

Nannicini, G. (2018).

Performance of hybrid quantum/classical variational heuristics for combinatorial optimization.Physical Review E.

Shor, P. W. (1997).

Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer.SIAM Journal on Computing, 26(5):1484–1509.

van Apeldoorn, J., Gilyén, A., Gribling, S., and de Wolf, R. (2018).

Convex optimization using quantum oracles.arXiv preprint arXiv:1809.00643.

49/49 Giacomo Nannicini – An introduction to quantum computing, without the physics © 2019 IBM Corporation