Top Banner
ORNL is managed by UT-Battelle, LLC for the US Department of Energy Markowitz Portfolio Optimization with a Quantum Annealer Erica Grant, Travis Humble Oak Ridge National Laboratory University of Tennessee
36

Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

Jun 21, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

ORNL is managed by UT-Battelle, LLC for the US Department of Energy

Markowitz Portfolio Optimization with a Quantum Annealer

Erica Grant, Travis Humble

Oak Ridge National Laboratory

University of Tennessee

Page 2: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

2

Portfolio Selection

Goals:• Maximize returns

• Minimize risk

• Stay within budget

Inputs:• Uniform random

historical price data

• Budget

• Risk tolerance

Output:• A portfolio

representing a list of investments and the expected return Investment Price Expected

Return/Day1= buy0 = pass

Stock A $150 + $0.10 0Stock B $200 + $0.25 1Stock C $250 + $0.50 0

Budget: $200 Risk Tolerance: Low

Page 3: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

3

Portfolio Selection as Binary Integer Programming

𝑥 𝜖 {0, 1}

𝑖 = asset number

𝑝+= price

𝑟+ = expected return

𝑏 = budget

max1

∑+ 𝑟+𝑥+

𝑠. 𝑡. ∑+ 𝑝+𝑥+ ≤ 𝑏

Page 4: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

4

Unconstrained Markowitz Formulation𝑚𝑎𝑥1

𝑓(𝑥)

𝑓 𝑥 = 𝜃=>+

𝑥+𝑟++𝑥+ − 𝜃@ >+

𝑥+𝑝+𝑥+ − 𝑏@

− 𝜃A>+,B

𝑥+𝑐𝑜𝑣 ℎ+, ℎB 𝑥B

• 𝑏 = 𝑏𝑢𝑑𝑔𝑒𝑡, 𝑝+ = 𝑝𝑟𝑖𝑐𝑒, 𝑟+= 𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑 𝑟𝑒𝑡𝑢𝑟𝑛, 𝑥+ 𝜖 0, 1

• Weights: 𝜃=, 𝜃@, 𝜃A ≥ 0 s.t. 𝜃= + 𝜃@ + 𝜃A = 1

• ℎ+ = vector of historical price data

• 𝑐𝑜𝑣 ℎ+, ℎB =∑NOPQ (RS,NTURS)(RV,NTRV)

WT=where m= number of price points

𝒙𝒊 = 𝟏 → 𝒃𝒖𝒚 𝒙𝒊 = 𝟎 → 𝒅𝒐𝒏c𝒕 𝒃𝒖𝒚

Page 5: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

5

Unconstrained Markowitz Formulation𝑚𝑎𝑥1

𝑓(𝑥)

𝑓 𝑥 = 𝜃=>+

𝑥+𝑟++𝑥+ − 𝜃@>+

𝑥+𝑝+𝑥+ − 𝑏 @ − 𝜃A>+,B

𝑥+𝑐𝑜𝑣 ℎ+, ℎB 𝑥B

• 𝑏 = 𝑏𝑢𝑑𝑔𝑒𝑡, 𝑝+ = 𝑝𝑟𝑖𝑐𝑒, 𝑟+= 𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑 𝑟𝑒𝑡𝑢𝑟𝑛, 𝑥+ 𝜖 0, 1

• Weights: 𝜃=, 𝜃@, 𝜃A ≥ 0 s.t. 𝜃= + 𝜃@ + 𝜃A = 1

• ℎ+ = vector of historical price data

• 𝑐𝑜𝑣 ℎ+, ℎB =∑NOPe (RS,NTURS)(RV,NTRV)

fwhere 𝑛 = #of assets

𝒙𝒊 = 𝟏 → 𝒃𝒖𝒚 𝒙𝒊 = 𝟎 → 𝒅𝒐𝒏c𝒕 𝒃𝒖𝒚

Expected Return

Page 6: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

6

Unconstrained Markowitz Formulation𝑚𝑎𝑥1

𝑓(𝑥)

𝑓 𝑥 = 𝜃=>+

𝑥+𝑟++𝑥+ − 𝜃@>+

𝑥+𝑝+𝑥+ − 𝑏 @ − 𝜃A>+,B

𝑥+𝑐𝑜𝑣 ℎ+, ℎB 𝑥B

• 𝑏 = 𝑏𝑢𝑑𝑔𝑒𝑡, 𝑝+ = 𝑝𝑟𝑖𝑐𝑒, 𝑟+= 𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑 𝑟𝑒𝑡𝑢𝑟𝑛, 𝑥+ 𝜖 0, 1

• Weights: 𝜃=, 𝜃@, 𝜃A ≥ 0 s.t. 𝜃= + 𝜃@ + 𝜃A = 1

• ℎ+ = vector of historical price data

• 𝑐𝑜𝑣 ℎ+, ℎB =∑NOPe (RS,NTURS)(RV,NTRV)

fwhere 𝑛 = #of assets

𝒙𝒊 = 𝟏 → 𝒃𝒖𝒚 𝒙𝒊 = 𝟎 → 𝒅𝒐𝒏c𝒕 𝒃𝒖𝒚

Budget Penalty

Page 7: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

7

Unconstrained Markowitz Formulation𝑚𝑎𝑥1

𝑓(𝑥)

𝑓 𝑥 = 𝜃=>+

𝑥+𝑟++𝑥+ − 𝜃@>+

𝑥+𝑝+𝑥+ − 𝑏 @ − 𝜃A>+,B

𝑥+𝑐𝑜𝑣 ℎ+, ℎB 𝑥B

• 𝑏 = 𝑏𝑢𝑑𝑔𝑒𝑡, 𝑝+ = 𝑝𝑟𝑖𝑐𝑒, 𝑟+= 𝑒𝑥𝑝𝑒𝑐𝑡𝑒𝑑 𝑟𝑒𝑡𝑢𝑟𝑛, 𝑥+ 𝜖 0, 1

• Weights: 𝜃=, 𝜃@, 𝜃A ≥ 0 s.t. 𝜃= + 𝜃@ + 𝜃A = 1

• ℎ+ = vector of historical price data

• 𝑐𝑜𝑣 ℎ+, ℎB =∑NOPe (RS,NTURS)(RV,NTRV)

fwhere 𝑛 = #of assets

𝒙𝒊 = 𝟏 → 𝒃𝒖𝒚 𝒙𝒊 = 𝟎 → 𝒅𝒐𝒏c𝒕 𝒃𝒖𝒚

Diversification

Page 8: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

8

Fitting to Unconstrained Problem

• Assets can be divided into any desired fraction based on the budget.

• Normalize purchase price to the budget.

• Use Binary Fractional series: fractions=12q,12=,12@, … ,

12f Special thanks to Benjamin Stump

for the binary fractional series idea

Page 9: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

9

Quantum Annealing for Unstructured Search

• Quantum annealing is a model of quantum computing tailored to unconstrained search

• QA operates by preparing a uniform superposition of all possible binary combinations.

• The initial state is then evolved toward a Hamiltonian that defines the objective function.

• Measurement samples the prepared probability distribution, which should concentrate at the global extrema.

Page 10: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

10

Quantum Annealing for Unstructured Search

• D-Wave Systems provides a fourth-generation quantum annealer, 2000Q– Programmable superconducting integrated circuit– 2048-qubit register in a 2D Chimera layout– EM shielding, UHV, cooled to 14mK

• This is a special-purpose optimization solver that finds the energetic minimum of an Ising model– Search uses quantum annealing to find minima

• Non-zero temperature, flux noise, and other fluctuations complicate device physics

Page 11: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

11

QUBO to Quantum Ising Hamiltonian

𝑓 𝑥 = −𝜃=>+

𝑥+𝑟++𝑥+ + 𝜃@>+

𝑥+𝑝+𝑥+ − 𝑏 @ + 𝜃A>+,B

𝑥+𝑐𝑜𝑣 𝑝+, 𝑝B 𝑥B

𝑓 𝑥 = 𝑄+,B∼ 𝑥+𝑥B + 𝑞+𝑥+𝑞+ = 𝑄++ 𝑎𝑛𝑑 𝑄+,B∼ = 𝑄+,B 𝑖 ≠ 𝑗

Ising: 𝑦 𝜖 {−1, 1}

QUBO: 𝑥 𝜖 0, 1

𝐽+,B =14𝑄+,B∼ ℎ+ =

𝑞+2+>

B

𝐽+,B

𝛾 = =|∑+,B 𝑄+,B +

=@∑+ 𝑞+

}𝐻 =>+,B

𝐽+,B�̂�+�̂�B +>+

ℎ+ �𝑥+ + 𝛾

𝑚𝑖𝑛1𝑓(𝑥)

𝑓 𝑥 = >+

ℎ+𝑦+ +>+,B

𝐽+,B 𝑦+𝑦B + 𝛾

Coupler Strengths

Page 12: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

12

QUBO to Quantum Ising Hamiltonian

𝑓 𝑥 = −𝜃=>+

𝑥+𝑟++𝑥+ + 𝜃@>+

𝑥+𝑝+𝑥+ − 𝑏 @ + 𝜃A>+,B

𝑥+𝑐𝑜𝑣 𝑝+, 𝑝B 𝑥B

𝑓 𝑥 = 𝑄+,B∼ 𝑥+𝑥B + 𝑞+𝑥+𝑞+ = 𝑄++ 𝑎𝑛𝑑 𝑄+,B∼ = 𝑄+,B 𝑖 ≠ 𝑗

Ising: 𝑦 𝜖 {−1, 1}

QUBO: 𝑥 𝜖 0, 1

𝐽+,B =14𝑄+,B∼ ℎ+ =

𝑞+2+>

B

𝐽+,B

𝛾 = =|∑+,B 𝑄+,B +

=@∑+ 𝑞+

}𝐻 =>+,B

𝐽+,B�̂�+�̂�B +>+

ℎ+ �𝑥+ + 𝛾

𝑚𝑖𝑛1𝑓(𝑥)

𝑓 𝑥 = >+

ℎ+𝑦+ +>+,B

𝐽+,B 𝑦+𝑦B + 𝛾

Qubit Weights

Page 13: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

13

QUBO to Quantum Ising Hamiltonian

𝑓 𝑥 = −𝜃=>+

𝑥+𝑟++𝑥+ + 𝜃@>+

𝑥+𝑝+𝑥+ − 𝑏 @ + 𝜃A>+,B

𝑥+𝑐𝑜𝑣 𝑝+, 𝑝B 𝑥B

𝑓 𝑥 = 𝑄+,B∼ 𝑥+𝑥B + 𝑞+𝑥+𝑞+ = 𝑄++ 𝑎𝑛𝑑 𝑄+,B∼ = 𝑄+,B 𝑖 ≠ 𝑗

Ising: 𝑦 𝜖 {−1, 1}

QUBO: 𝑥 𝜖 0, 1

𝐽+,B =14𝑄+,B∼ ℎ+ =

𝑞+2+>

B

𝐽+,B

𝛾 = =|∑+,B 𝑄+,B +

=@∑+ 𝑞+

𝑚𝑖𝑛1𝑓(𝑥)

𝑓 𝑥 = >+

ℎ+𝑦+ +>+,B

𝐽+,B 𝑦+𝑦B + 𝛾

Constant }𝐻 =>+,B

𝐽+,B�̂�+�̂�B +>+

ℎ+ �𝑥+ + 𝛾

Page 14: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

14

QUBO to Quantum Ising Hamiltonian

𝑓 𝑥 = −𝜃=>+

𝑥+𝑟++𝑥+ + 𝜃@>+

𝑥+𝑝+𝑥+ − 𝑏 @ + 𝜃A>+,B

𝑥+𝑐𝑜𝑣 𝑝+, 𝑝B 𝑥B

𝑓 𝑥 = 𝑄+,B∼ 𝑥+𝑥B + 𝑞+𝑥+𝑞+ = 𝑄++ 𝑎𝑛𝑑 𝑄+,B∼ = 𝑄+,B 𝑖 ≠ 𝑗

Ising: 𝑦 𝜖 {−1, 1}

QUBO: 𝑥 𝜖 0, 1

𝐽+,B =14𝑄+,B∼ ℎ+ =

𝑞+2+>

B

𝐽+,B

𝛾 = =|∑+,B 𝑄+,B +

=@∑+ 𝑞+

𝑚𝑖𝑛1𝑓(𝑥)

𝑓 𝑥 = >+

ℎ+𝑦+ +>+,B

𝐽+,B 𝑦+𝑦B + 𝛾

Ising Form

}𝐻 =>+,B

𝐽+,B�̂�+�̂�B +>+

ℎ+ �𝑥+ + 𝛾

Page 15: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

15

QUBO to Quantum Ising Hamiltonian

𝑓 𝑥 = −𝜃=>+

𝑥+𝑟++𝑥+ + 𝜃@>+

𝑥+𝑝+𝑥+ − 𝑏 @ + 𝜃A>+,B

𝑥+𝑐𝑜𝑣 𝑝+, 𝑝B 𝑥B

𝑓 𝑥 = 𝑄+,B∼ 𝑥+𝑥B + 𝑞+𝑥+𝑞+ = 𝑄++ 𝑎𝑛𝑑 𝑄+,B∼ = 𝑄+,B 𝑖 ≠ 𝑗

Ising: 𝑦 𝜖 {−1, 1}

QUBO: 𝑥 𝜖 0, 1

𝐽+,B =14𝑄+,B∼ ℎ+ =

𝑞+2+>

B

𝐽+,B

𝛾 = =|∑+,B 𝑄+,B +

=@∑+ 𝑞+

𝑚𝑖𝑛1𝑓(𝑥)

𝑓 𝑥 = >+

ℎ+𝑦+ +>+,B

𝐽+,B 𝑦+𝑦B + 𝛾

Quantum Ising

}𝐻 =>+,B

𝐽+,B�̂�+�̂�B +>+

ℎ+ �𝑥+ + 𝛾

Page 16: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

16

Solving on D-Wave 2000QD-Wave 2000Q:• 2048 qubits

• Anneal times

• Embeddings

• Reverse Annealing

Parameters:

• 𝜃=, 𝜃@, 𝜃A• Number of assets

• Random historical Price Data

Outputs:• Portfolio:

[-1, 1, 1, 1, -1, -1…] à

[0, 1, 1, 1, 0, 0…]

• Energy of the portfolio

Page 17: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

17

Benchmarking against Brute Force Solver

• Probability of success:

𝑃𝑂𝑆 = ���

• 𝑙 = # of ground state energies found by the D-Wave

• 𝑁� = number of samples/anneals

• Average Probability of success

𝑃𝑂𝑆 = ∑+�� ��� +

��• 𝑁� = # problems• 𝑖 indicates problem

• POS ratio: ��� ���� �

• 𝑃𝑂𝑆 � for reverse annealing• 𝑃𝑂𝑆 � for forward annealing

• Energy Binning

Energy à Energy Level

Page 18: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

18

Best Fit for Probability of Success

𝑦 = 1.2245 𝑒Tq.��=|∗1�.����

• Embedding = Find_embedding()

• Slices = 0

• Anneal time = 𝟓𝝁𝒔

• Forward annealing

Page 19: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

19

Forward Annealing Controls

Page 20: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

20

Spin Reversal Control

Page 21: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

21

Example Program Embedding in Hardware

find_embedding() Embedding

Clique Embedding

Problem size = 20

• 23 unit cells • 15 unit cells

Page 22: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

22

Clique vs Find Embedding

Forward Annealing:

• Embeddings:• find_embedding()• Clique

• Anneal Time = 15𝜇𝑠• Spin Reversal = 0

Page 23: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

23

Clique vs Find Embedding

Anneal time = 15 𝜇𝑠Number of anneals = 1,000

Page 24: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

24

Forward Annealing: Clique vs Find Embedding

Anneal time = 15 𝜇𝑠Number of anneals = 1,000

Page 25: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

25

Reverse Annealing

Parameters:

• Initial State• Reinitialize • S• Pause time

Page 26: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

26

Reverse Annealing Sweep

Page 27: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

27

Reverse Annealing Sweep

Page 28: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

28

Reverse Annealing Sweep

Page 29: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

29

Reverse Annealing Sweep

Page 30: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

30

Overall Probability of Success

Reverse Annealing:

• S = .9• Pause = 15𝜇𝑠• I.S. = Forward• Reinitialize = False

Forward Annealing:

• Embeddings:• find_embedding()• Clique

• Anneal Time = 15𝜇𝑠• Spin Reversal = 0

Page 31: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

31

Conclusions• Quantum annealing is a method for solving QUBO problems and

Markowitz Portfolio optimization is an example which demonstrates real-world application.

• Various parameters both in the QUBO and the D-Wave computer can be controlled/fine-tuned to yield better results.

• Forward annealing reveals a sub-exponential decrease in probability of success as problem size increases.

• Spin reversal transform improves variance.

• Clique Embedding improves probability of success over the find_embedding() method.

• Reverse annealing reveals a better probability of success and a better average solution if initial state is close to ground state.

Page 32: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

32

Future Work

• Measure efficiency of using reverse annealing with forward annealing.

• Compare quantum annealing to classical heuristics.

• Investigate using real market data.

Page 33: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

ORNL is managed by UT-Battelle, LLC for the US Department of Energy

Questions

University of Tennessee, Knoxville

Oak Ridge National Laboratory

Quantum Computing Institute

In collaboration with Khalifa University

Nada Elsokkary, Faisal Khan

Page 34: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

34

Asseti

350

375

312

300

330

Asseti

1.0606

1.1363

.94545

.90909

1

Asseti, 0

1.0606

1.1363

.94545

.90909

1

Asseti, 1

.53030

.56815

.47273

.45450

.5

Asseti, 2

.26515

.28408

.23636

.22727

.25

𝒑𝒌𝒑𝒎 𝒂𝒊 → 𝒂𝒊,𝒌

Page 35: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

35

Probability of Success

Page 36: Markowitz Portfolio Optimization with a Quantum Annealer · 31 Conclusions • Quantum annealing is a method for solving QUBO problems and Markowitz Portfolio optimization is an example

36

Optimality Gap

Optimality Gap:

𝑎𝑏𝑠𝐸¦§�𝐸¨1�

− 1