0% found this document useful (0 votes)
262 views102 pages

Amira Abbas: Quantum Computing Lecture at Wits University PDF

This document summarizes a presentation on quantum machine learning (QML). It discusses how QML uses quantum computers to perform machine learning tasks. It provides an example of using a quantum classifier to predict passenger survival on the Titanic based on ticket price and cabin number. The example encodes data as quantum amplitudes, calculates distances via interference, and predicts labels via measurement statistics. The goal is to illustrate how quantum processes like interference can be used to perform machine learning classification tasks.

Uploaded by

Queen Victoria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
262 views102 pages

Amira Abbas: Quantum Computing Lecture at Wits University PDF

This document summarizes a presentation on quantum machine learning (QML). It discusses how QML uses quantum computers to perform machine learning tasks. It provides an example of using a quantum classifier to predict passenger survival on the Titanic based on ticket price and cabin number. The example encodes data as quantum amplitudes, calculates distances via interference, and predicts labels via measurement statistics. The goal is to illustrate how quantum processes like interference can be used to perform machine learning classification tasks.

Uploaded by

Queen Victoria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 102

Quantum Machine Learning

Amira Abbas
Quantum Research Group
University of KwaZulu-Natal
Quantum Research Group

● Quantum computing, key distribution (teleportation),


open systems, evolutionary algorithms …


● Global/local partnerships


● Programmes/conferences/summer schools 


● Large focus on QML

Amira Abbas Wits QC SS 2019


What is QML and why should we care about it?
Quantum machine learning

Amira Abbas Source: Supervised Learning on Quantum Computers: Schuld & Petruccione 2018 Wits QC SS 2019
Quantum-classical machine learning

Amira Abbas Wits QC SS 2019


Quantum-classical machine learning

● Can QCs offer something different?


● What “hard” stuff can we outsource to quantum computers?



- Hybrid computation


Amira Abbas Source: pennylane.ai Wits QC SS 2019


Today

● Go through a small example of quantum classification


● Revisit some classical ML techniques


● Obtain a high level overview of variational circuits


● Examine a quantum algorithm that we can actually implement


which has real applications


Amira Abbas Wits QC SS 2019


Squared-distance classifier

● Titanic data set (kaggle):



- have information on ticket price, cabin number and survival


● Problem: 

- want to predict if a passenger survived or not given how much they paid
and their cabin number


Amira Abbas Source: Supervised Learning on Quantum Computers: Schuld & Petruccione 2018 Wits QC SS 2019
Squared-distance classifier

[0910] [2105]
8500 1200
x1 = y1 = 1 x2 = y2 = 0

Amira Abbas Wits QC SS 2019


Squared-distance classifier

[0910] [2105]
8500 1200
x1 = y1 = 1 x2 = y2 = 0

[0.390] [0.990]
0.921 0.141
x1 = y1 = 1 x2 = y2 = 0

Amira Abbas Wits QC SS 2019


Squared-distance classifier

[0910] [2105]
8500 1200
x1 = y1 = 1 x2 = y2 = 0

[0.390] [0.990]
0.921 0.141
x1 = y1 = 1 x2 = y2 = 0

[0.500]
0.866 y new = ?
x new =

Amira Abbas Wits QC SS 2019


Squared-distance classifier

Amira Abbas Wits QC SS 2019


Squared-distance classifier

1 new
wm = 1 − | x − x m |2 for M data points
c

Amira Abbas Wits QC SS 2019


Squared-distance classifier

1 new
wm = 1 − | x − x m |2 for M data points
c

11
pxnew(y new = 0) =

wm
χ i m|y m
=0

1 1
pxnew(y new = 1) =

wm
χ M − i m|y m=1

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

● We can use interference with a Hadamard transform to create distance


measures

Amira Abbas Source: https://arxiv.org/abs/1703.10793 Wits QC SS 2019


Quantum squared-distance classifier

● How do we encode data into a quantum computer?

[0.390] [0.990]
0.921 0.141
x1 = y 1
=1 x2 = y 2
=0

[0.500] [0.500]
0.866 0.866
x new = x new =

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

● Amplitude encoding

[0.390] [0.500]
0.921 0.866
x1 = x new =

[0.990] [0.500]
0.141 0.866
x2 = x new =

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

● Amplitude encoding
1 | 000⟩

[0.390] [0.500]
0.921 0.866 1 | 001⟩
x1 = x new =
1 | 010⟩
1 1 | 011⟩

[0.990] [0.500]
x2 =
0.141
x new =
0.866 8 1 | 100⟩
1 | 101⟩
1 | 110⟩
1 | 111⟩

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

● Amplitude encoding
0.921 | 000⟩

[0.390] [0.500]
0.921 0.866 0.390 | 001⟩
x1 = x new = | 010⟩
0.141
0.990 | 011⟩

[0.990] [0.500]
0.141 0.866 0.866 | 100⟩
x2 = x new =
0.500 | 101⟩
0.866 | 110⟩
0.500 | 111⟩

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

● Amplitude encoding
0.921 | 000⟩ y1 = 1

[0.390] [0.500]
0.921 0.866 0.390 | 001⟩ y1 = 1
x1 = x new = | 010⟩ y2 = 0
0.141
0.990 | 011⟩ y2 = 0

[0.990] [0.500]
0.141 0.866 0.866 | 100⟩
x2 = x new =
0.500 | 101⟩
0.866 | 110⟩
0.500 | 111⟩

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

● Amplitude encoding
0.921 | 000⟩ y1 = 1

[0.390] [0.500]
0.921 0.866 0.390 | 001⟩ y1 = 1
x1 = x new = | 010⟩ y2 = 0
0.141
0.990 | 011⟩ y2 = 0

[0.990] [0.500]
0.141 0.866 0.866 | 100⟩ y1 = 1
x2 = x new = y1 = 1
0.500 | 101⟩
0.866 | 110⟩ y2 = 0
0.500 | 111⟩ y2 = 0

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

Index Label
0.921 | 000⟩ | 1⟩
0.390 | 001⟩ | 1⟩
0.141 | 010⟩ | 0⟩
0.990 | 011⟩ | 0⟩
0.866 | 100⟩ | 1⟩
0.500 | 101⟩ | 1⟩
0.866 | 110⟩ | 0⟩
0.500 | 111⟩ | 0⟩

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

11 1
px new(y new = 0) = (1 − | x new − x m |2 )

χ i m|y c
m =0 The measurement statistics of
the label qubit are the same
as the result of the classical
squared distance classifier!

1 1 1
px new(y new = 1) = (1 − | x new − x m |2 )

χ M − i m|y m =1 c

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

index1 | 0⟩
index2 | 0⟩
index3 | 0⟩
label | 0⟩

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

index1 | 0⟩ H

index2 | 0⟩ H

index3 | 0⟩ H

label | 0⟩
| 000⟩
| 001⟩ 1
1
| 010⟩
1
| 011⟩ 1 1

| 100⟩ 8 1
| 101⟩ 1
1
| 110⟩ 1
Amira Abbas | 111⟩ Wits QC SS 2019
Quantum squared-distance classifier

index1 | 0⟩ H RY

index2 | 0⟩ H RY

index3 | 0⟩ H
RY
label | 0⟩
0.921 | 000⟩
Encode data
0.390 | 001⟩
0.141 | 010⟩
0.990 | 011⟩
0.866 | 100⟩
0.500 | 101⟩
0.866 | 110⟩
0.500 | 111⟩
Amira Abbas Wits QC SS 2019
Quantum squared-distance classifier

index1 | 0⟩ H RY

index2 | 0⟩ H RY

index3 | 0⟩ H
RY
label | 0⟩ X X X X

Encode labels 0.921 | 000⟩ | 1⟩


0.390 | 001⟩ | 1⟩
0.141 | 010⟩ | 0⟩
0.990 | 011⟩ | 0⟩
0.866 | 100⟩ | 1⟩
0.500 | 101⟩ | 1⟩
0.866 | 110⟩ | 0⟩
Amira Abbas 0.500 | 111⟩ | 0⟩ Wits QC SS 2019
Quantum squared-distance classifier

index1 | 0⟩ H RY H

index2 | 0⟩ H RY

index3 | 0⟩ H
RY
label | 0⟩ X X X X

0.921 | 000⟩ | 1⟩
Hadamard
0.390 | 001⟩ | 1⟩
transform
0.141 | 010⟩ | 0⟩
0.990 | 011⟩ | 0⟩
0.866 | 100⟩ | 1⟩
0.500 | 101⟩ | 1⟩
0.866 | 110⟩ | 0⟩
0.500 | 111⟩ | 0⟩
Amira Abbas Wits QC SS 2019
Quantum squared-distance classifier

index1 | 0⟩ H RY H

index2 | 0⟩ H RY

index3 | 0⟩ H
RY
label | 0⟩ X X X X

Conditional
measurement

Amira Abbas Wits QC SS 2019


Quantum squared-distance classifier

index1 | 0⟩ H RY H

index2 | 0⟩ H RY

index3 | 0⟩ H
RY
label | 0⟩ X X X X

Conditional
measurement

Amira Abbas Wits QC SS 2019


But why on earth would we do this?
QML Algorithms
In general…

| 0⟩
| 0⟩ Do something
U(x) ⟨Observable⟩
⋮ else
| 0⟩
Prepare some Encode data Other
Measure
initial state operations

Amira Abbas Wits QC SS 2019


Quantum-classical machine learning

● Active research to find a design/idea that is useful


● There is no advantage to the toy example shown, but can we


perhaps find a quantum algorithm that is of use?

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

Eigenvalue solver - to find eigenvalues/vectors of a local Hamiltonian

Classical Quantum

O(N 2) O((logN )4)

Can actually run on NISQ devices!

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

● Eigenvalue/vector problem


● Classical optimisation (borrowed from classical machine learning)


● Variational circuits 


● Quantum gradients

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

● Eigenvalue/vector problem


● Classical optimisation (borrowed from classical machine learning)


● Variational circuits 


● Quantum gradients

Amira Abbas Wits QC SS 2019


Classical machine learning

Amira Abbas Wits QC SS 2019


Classical machine learning

f(x) = y

Amira Abbas Wits QC SS 2019


Classical machine learning

f(x) = y

y
f

Amira Abbas Wits QC SS 2019


Classical machine learning

f(x) = y
Approximate

y y
f
g(x; θ) = ŷ g

x x

Amira Abbas Wits QC SS 2019


Classical machine learning

f(x) = y

y y
f
g(x; θ) = ŷ g

x Update θ x

g→f
Amira Abbas Wits QC SS 2019
Cost/loss function

cost(θ, y,̂ y)

Amira Abbas Wits QC SS 2019


Cost/loss function

cost(θ, y,̂ y)
f(x) = y g(x; θ) = ŷ

Amira Abbas Wits QC SS 2019


Cost/loss function

cost(θ, y,̂ y)
f(x) = y g(x; θ) = ŷ
y y
f g

x x

Amira Abbas Wits QC SS 2019


Cost/loss function

cost(θ, y,̂ y)
f(x) = y g(x; θ) = ŷ
y y
f g

x x

Amira Abbas Wits QC SS 2019


Cost/loss function

cost(θ*, y,̂ y)
f(x) = y g(x; θ*) = ŷ
y y
f g

x x

Amira Abbas Wits QC SS 2019


How do we update θ ?
Optimisation

cost(θ, y,̂ y)

Amira Abbas Wits QC SS 2019


Optimisation

cost(θ, y,̂ y)

cost

θ
Amira Abbas Wits QC SS 2019
Optimisation

cost

θ* θ
Amira Abbas Wits QC SS 2019
Gradient-based optimisation

cost

θ1 θ
Amira Abbas Wits QC SS 2019
Gradient-based optimisation

cost

θ1 θ
Amira Abbas Wits QC SS 2019
Gradient-based optimisation

cost

θ1 θ
Amira Abbas Wits QC SS 2019
Gradient-based optimisation

cost

θ2 θ1 θ
Amira Abbas Wits QC SS 2019
Gradient-based optimisation

cost

θ2 θ1 θ
Amira Abbas Wits QC SS 2019
Optimisation

cost

θ1 θ
Amira Abbas Wits QC SS 2019
Optimisation

cost

θ1 θ
Amira Abbas Wits QC SS 2019
Optimisation

cost

θ1 θ
Amira Abbas Wits QC SS 2019
Optimisation

● Want to minimise some cost function w.r.t. parameters of your model

Amira Abbas Wits QC SS 2019


Variational circuits

Amira Abbas Wits QC SS 2019


Variational circuits

| 0⟩
| 0⟩
| 0⟩

Prepare some
initial state

Amira Abbas Wits QC SS 2019


Variational circuits

| 0⟩
| 0⟩
| 0⟩

Prepare some Gate


initial state operations

Amira Abbas Wits QC SS 2019


Variational circuits

| 0⟩
| 0⟩ U ⟨S⟩
| 0⟩

Prepare some Gate


initial state operations

Amira Abbas Wits QC SS 2019


Variational circuits

| 0⟩
| 0⟩ U(θ) ⟨Sθ⟩ = g(x; θ)
| 0⟩

Prepare some Gate


initial state operations

Amira Abbas Wits QC SS 2019


Variational circuits

| 0⟩
| 0⟩ U(θ) ⟨Sθ⟩ = g(x; θ)
| 0⟩

Prepare some Gate


initial state operations

Cost fn

Amira Abbas Wits QC SS 2019


Variational circuits

| 0⟩
| 0⟩ U(θ) ⟨Sθ⟩ = g(x; θ)
| 0⟩

Prepare some Gate


initial state operations

Cost fn

∇θ Sθ
Amira Abbas Wits QC SS 2019
Variational circuits

| 0⟩
| 0⟩ U(θ) ⟨Sθ⟩ = g(x; θ)
| 0⟩

Prepare some Gate


initial state operations

Update θ Cost fn

∇θ Sθ
Amira Abbas Wits QC SS 2019
Variational circuits

| 0⟩
| 0⟩ U(θ) ⟨Sθ⟩ = g(x; θ)
| 0⟩

Prepare some Gate


initial state operations

Update θ Cost fn

∇θ Sθ
Amira Abbas Wits QC SS 2019
Problem?

Amira Abbas Wits QC SS 2019


Quantum gradients?

Amira Abbas Wits QC SS 2019


Quantum gradients

| 0⟩ | 0⟩
∇θ Sθ = | 0⟩ U(θ + h) − | 0⟩ U(θ − h)
| 0⟩ | 0⟩

Amira Abbas See https://pennylane.ai/qml/concepts/autograd_quantum.html for technical proof Wits QC SS 2019


Quantum gradients

| 0⟩ | 0⟩
∇θ Sθ = | 0⟩ U(θ + h) − | 0⟩ U(θ − h)
| 0⟩ | 0⟩

∇θ Sθ = ⟨Sθ+h⟩ − ⟨Sθ−h⟩

Amira Abbas See https://pennylane.ai/qml/concepts/autograd_quantum.html for technical proof Wits QC SS 2019


Variational circuits

| 0⟩
| 0⟩ U(θ*) ⟨Sθ*⟩
| 0⟩

Prepare some Gate


initial state operations

Update θ Cost fn

Amira Abbas Wits QC SS 2019


Putting this together with VQE
Variational Quantum Eigensolver (VQE)

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

3 ● Solving a colouring puzzle


3 2 ● Assume we can only colour nodes in red


or blue

1
● Edge weights are counted if they connect
two different colour nodes


1 3 ● How can we colour this such that the


score is maximised? 


● Hint: 12

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

3 Score: 3 + 1 + 3 = 7

3 2

1 3

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

3 MaxCut solution: 3 + 2 + 3 + 1 + 3 = 12

3 2

1 3

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

C
2
1
A
1 B

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

C
2
1
A
1 B

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

23 = 8 possibilities

C
2
1
A
1 B

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

CBA
3
2 = 8 possibilities | 000⟩
| 001⟩
C | 010⟩
2
| 011⟩
1 | 100⟩
A
| 101⟩
1 B | 110⟩
| 111⟩

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

Ĥ CBA
0000000000000000000000000000000
2 0 0 0 0 0 0 0 | 000⟩
0 −1 0 0 0 0 0 0 0 | 001⟩
0 0 0 0 0 0 0 0 0 | 010⟩
0 0 0 −1 0 0 0 0 0 | 011⟩
0 0 0 0 −1 0 0 0 0 | 100⟩
0 0 0 0 0 0 0 0 0 | 101⟩
0 0 0 0 0 0 −1 0 0 | 110⟩
0 0 0 0 0 0 0 2 0 | 111⟩

https://www.scottaaronson.com/qclec/25.pdf

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

Ĥ | 000⟩
0000000000000000000000000000000
2 0 0 0 0 0 0 0 1
0 −1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 −1 0 0 0 0 0 0
0 0 0 0 −1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 −1 0 0 0
0 0 0 0 0 0 0 2 0 0

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

Ĥ | 000⟩
0000000000000000000000000000000
2 0 0 0 0 0 0 0 1 2
0 −1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0
0 0 0 −1 0 0 0 0 0 0 0
0 0 0 0 −1 0 0 0 0 0 = 0
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 −1 0 0 0 0
0 0 0 0 0 0 0 2 0 0 0

Ĥ | 000⟩

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

Ĥ | 011⟩
0000000000000000000000000000000
2 0 0 0 0 0 0 0 0 0
0 −1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0
0 0 0 −1 0 0 0 0 0 1 −1
0 0 0 0 −1 0 0 0 0 0 = 0
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 −1 0 0 0 0
0 0 0 0 0 0 0 2 0 0 0

Ĥ | 011⟩

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

⟨011 | Ĥ | 011⟩

0
0000000000000000000000000000000
2 0 0 0 0 0 0 0
0 −1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 −1 0 0 0 0 0 1
[00010000] 0 0 0 0 −1 0 0 0 0 0 = −1
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 −1 0 0 0
0 0 0 0 0 0 0 2 0 0

⟨011 | Ĥ | 011⟩

Amira Abbas Source: https://medium.com/qiskit/the-variational-quantum-eigensolver-43f7718c2747 Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

| ψ⟩ U(θ) ⟨ψ | Ĥ | ψ⟩

Update θ Cost fn

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

| 0⟩ H

| 0⟩ H

| 0⟩ H

| 000⟩
| 001⟩
| 010⟩
| 011⟩
| ψ⟩ →
| 100⟩
| 101⟩
| 110⟩
Amira Abbas | 111⟩ Wits QC SS 2019
Variational Quantum Eigensolver (VQE)

| 0⟩ H Ry(θ1)

| 0⟩ H Ry(θ2)

| 0⟩ H Ry(θ3)

(Made up example)
| ψ⟩

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

| 0⟩ H Ry(θ1)

| 0⟩ H Ry(θ2)

| 0⟩ H Ry(θ3)

| ψ⟩ Ĥ | ψ⟩

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

| 0⟩ H Ry(θ1)

| 0⟩ H Ry(θ2) ⟨ψ | Ĥ | ψ⟩
| 0⟩ H Ry(θ3)

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

| 0⟩ H Ry(θ1)

| 0⟩ H Ry(θ2) ⟨ψ | Ĥ | ψ⟩
| 0⟩ H Ry(θ3)

̂
cost(θi, ⟨H⟩)

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

| 0⟩ H Ry(θ1)

| 0⟩ H Ry(θ2) ⟨ψ | Ĥ | ψ⟩
| 0⟩ H Ry(θ3)

Update θi ̂
cost(θi, ⟨H⟩)

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

| 0⟩ H Ry(θ1)

| 0⟩ H Ry(θ2) ⟨ψ | Ĥ | ψ⟩
| 0⟩ H Ry(θ3)

Update θi ̂
cost(θi, ⟨H⟩)

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

| 000⟩
| 001⟩
| 010⟩
| 011⟩
| ψ⟩ →
| 100⟩
⟨ψ | Ĥ | ψ⟩ ̂
cost(θi, ⟨H⟩)
| 101⟩
| 110⟩
| 111⟩

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)

| 000⟩
| 001⟩
| 010⟩ C
2
| 011⟩
| ψ⟩ → 1 ̂
cost(θi, ⟨H⟩)
| 100⟩ A
| 101⟩
1 B
| 110⟩
| 111⟩

Amira Abbas Wits QC SS 2019


Variational Quantum Eigensolver (VQE)
The code

Source:https://github.com/Qiskit/qiskit-iqx-tutorials/blob/master/qiskit/advanced/aqua/optimization/max_cut_and_tsp.ipynb

Amira Abbas Wits QC SS 2019


Resources
• VQE paper: Peruzzo, Alberto, et al. "A variational eigenvalue solver on a photonic
quantum processor." Nature communications 5 (2014): 4213.


• Kandala, Abhinav, et al. "Hardware-efficient variational quantum eigensolver for small


molecules and quantum magnets." Nature 549.7671 (2017): 242.


• VQE Blog (James Weaver): https://medium.com/qiskit/the-variational-quantum-


eigensolver-43f7718c2747


• QML Book: Schuld, Maria, and Francesco Petruccione. Supervised Learning with
Quantum Computers. Vol. 17. Springer, 2018.


• Library of quantum algorithms: https://quantumalgorithmzoo.org/


• EdX course: Quantum Machine Learning. Peter Wittek 2019


• Qiskit Aqua Github: https://github.com/Qiskit/qiskit-aqua/tree/master/qiskit/aqua/


algorithms/adaptive/vqe
Amira Abbas Wits QC SS 2019

You might also like