23
Quantum Computing at Volkswagen: Traffic Flow Optimization using the D-Wave Quantum Annealer D-Wave Users Group Meeting - National Harbour, MD 27.09.2017 – Dr. Gabriele Compostella

Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Quantum Computing at Volkswagen: Traffic Flow Optimization using the D-Wave Quantum Annealer

D-Wave Users Group Meeting - National Harbour, MD27.09.2017 – Dr. Gabriele Compostella

Page 2: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

K-SI/LD | Dr. Gabriele Compostella 27.09.2017

The Volkswagen Data:Lab

2

Page 3: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

• Dr. Christian Seidel – Volkswagen Data:Lab, Munich• Dr. Gabriele Compostella – Volkswagen Data:Lab, Munich• Dr. Florian Neukart – Volkswagen Group of America Code:Lab, San Francisco• David von Dollen – Volkswagen Group of America Code:Lab, San Francisco

K-SI/LD | Dr. Gabriele Compostella 27.09.2017

Team

3

Page 4: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

K-SI/LD | Dr. Gabriele Compostella 27.09.2017

Team

4

Page 5: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Quantum Computing – just a hype or a real thing?

K-SI/LD | Dr. Gabriele Compostella 27.09.2017 5

Page 6: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

The Question that drove us …

Is there a real-world problemthat could be addressed with a

Quantum Computer?

K-SI/LD | Dr. Gabriele Compostella 27.09.2017 6

Page 7: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

YES: Traffic flow optimisation

Everybody knows traffic (jam) and normally nobody likes it.27.09.2017 K-SI/LD | Dr. Gabriele Compostella

Image courtesy of think4photop at FreeDigitalPhotos.net

7

Page 8: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Public data set: T-Drive trajectory

https://www.microsoft.com/en-us/research/publication/t-drive-trajectory-data-sample/

Beijing• ~ 10.000 Taxis • 2.2. – 8.2.2008

data example:

27.09.2017 K-SI/LD | Dr. Gabriele Compostella 8

Page 9: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

D-Wave calculation modelQuadratic Unconstraint Binary Optimisation (QUBO)

K-SI/LD | Dr. Gabriele Compostella 27.09.2017

During the quantum annealing process the system evolves to the lowest energy level.

This requires the problem to be formulated as an Ising Model:

or as a QUBO:

9

Page 10: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Transforming the real world problem for the Quantum Computer

K-SI/LD | Dr. Gabriele Compostella 27.09.2017

Example:

Simplified graph structure representing a route grid.

2 cars with 3 route options on a 2 x 2 grid.

Car Route Binary variable

Car 1 #1: s0,s3,s6,s9 Q11

Car 1 #2: s0,s3,s8,s11 Q12

Car 1 #3: s2,s7,s10,s11 Q13

Car 2 #1: s0,s3,s6,s9 Q21

Car 2 #2: s0,s3,s8,s11 Q22

Car 2 #3: s2,s7,s10,s11 Q23

10

Page 11: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Creating the cost function for each street segment

Street segment

Associated cost function Value

s0 (Q11 + Q12 + Q21 + Q22)2 4s3 (Q11 + Q12 + Q21 + Q22)2 4s6 (Q11 + Q21)2 1s9 (Q11 + Q21)2 1s8 (Q12 + Q22)2 1s11 (Q12 + Q22 + Q13 + Q23)2 1s2 (Q13 + Q23)2 0s7 (Q13 + Q23)2 0

s10 (Q13 + Q23)2 0

K-SI/LD | Dr. Gabriele Compostella27.09.2017

More cars on one street lead to higher costs

Example:(Q11 + Q12 + Q21 + Q22)2 + (Q11 + Q12 + Q21 + Q22)2 + (Q11 + Q21)2 + (Q11 + Q21)2

+ (Q12 + Q22)2 + (Q12 + Q22 + Q13 + Q23)2 + (Q13 + Q23)2 + (Q13 + Q23)2 + (Q13 + Q23)2 = 12

Goal: minimise the overall costs => distribute cars to different streets

11

Page 12: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Creating the cost function for each street segment

Street segment

Associated cost function Value

s0 (Q11 + Q12 + Q21 + Q22)2 1s3 (Q11 + Q12 + Q21 + Q22)2 1s6 (Q11 + Q21)2 1s9 (Q11 + Q21)2 1s8 (Q12 + Q22)2 0s11 (Q12 + Q22 + Q13 + Q23)2 1s2 (Q13 + Q23)2 1s7 (Q13 + Q23)2 1

s10 (Q13 + Q23)2 1

K-SI/LD | Dr. Gabriele Compostella27.09.2017

Optimal route selection:

Minimum:(Q11 + Q12 + Q21 + Q22)2 + (Q11 + Q12 + Q21 + Q22)2 + (Q11 + Q21)2 + (Q11 + Q21)2

+ (Q12 + Q22)2 + (Q12 + Q22 + Q13 + Q23)2 + (Q13 + Q23)2 + (Q13 + Q23)2 + (Q13 + Q23)2 = 8

12

Page 13: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Adding constraints

K-SI/LD | Dr. Gabriele Compostella 27.09.2017 13

We want to make sure that the solution will contain only one route for each car:

• Only one binary variable per car can be 1(otherwise the car would be on multiple routes simultaneously)

• Wrong solutions must contain a penalty term

• The magnitude of the penalty term, K, is tuned based on the size of the problem (i.e. violating one constraint increases the energy of the state as if one more car was present on every road segment)

For every constraint, the overall cost function will contain a term similar to:K * (Q11 + Q12 + Q13 - 1)2 = K * (- Q11 - Q12 - Q13 + 1 + 2 Q11 Q12 + 2 Q11 Q13 + 2 Q12 Q13)

Additional constraints

K * (Q11 + Q12 + Q13 - 1)2

K * (Q21 + Q22 + Q23 - 1)2

Page 14: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Matrix formulation

K-SI/LD | Dr. Gabriele Compostella 27.09.2017 14

Finally, the overall cost function including the constraints can be expressed in a matrix form as a function of the input binary variables:

𝐹𝐹 = 𝑄𝑄11 𝑄𝑄12 𝑄𝑄13 𝑄𝑄21 𝑄𝑄22 𝑄𝑄23

1 − 𝐾𝐾 2 + 2𝐾𝐾 2𝐾𝐾 2 2 01 − 𝐾𝐾 2𝐾𝐾 2 2 0

−𝐾𝐾 0 0 01 − 𝐾𝐾 2 + 2𝐾𝐾 2K

1 − K 2K−𝐾𝐾

𝑄𝑄11𝑄𝑄12𝑄𝑄13𝑄𝑄21𝑄𝑄22𝑄𝑄23

This is the QUBO matrix representing the overall cost that will be minimized by the quantum computer corresponding to the 2x2 grid example.

Page 15: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Data preprocessing

• Identification of street segments in the map by turning it into a graph using OSMnx, a Python package for street networks

• Get valid alternative routes for every car that needs to be rerouted

• Determine overlapping segments in the possible routes and define the cost function for the problem

K-SI/LD | Dr. Gabriele Compostella 27.09.2017 15

Graph representation of the street map

Page 16: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Beijing – Traffic Heatmap

K-SI/LD | Dr. Gabriele Compostella 27.09.2017

Traffic in the city Detail: route to the Airport

• 418 cars• 10.000 cars

We assigned each of the 418 cars 3 possible routes to reach the airport

Size of the problem space: 3^41816

Page 17: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Code snippet and output

K-SI/LD | Dr. Gabriele Compostella 27.09.2017 17

Page 18: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Result: unoptimised vs optimised traffic

K-SI/LD | Dr. Gabriele Compostella 27.09.2017 18

Page 19: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Volkswagen Quantum Computing in the news

K-SI/LD | Dr. Gabriele Compostella 27.09.2017 19

Page 20: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Further improvements

Due to the 2.5 months project time we treated in this test all the streets equally.This is obviously a simplification.

Additional constraints could be:• Street capacity (highway vs alley)• Residential zones

Dataset improvements:• Frequent updates to react on constantly changing traffic situations (other datasets)• More cars• Etc.

K-SI/LD | Dr. Gabriele Compostella 27.09.2017 20

Page 21: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Lessons learned

• The D-Wave Quatum Annealer can help solving real world problems(prototype was done in 2.5 months)

• transforming the real world problem into a QUBO takes the most time• Problems larger than the chip capacity can be solved by decomposition using a

hybrid solver (i.e. Qsage, qbsolv)

Due to the chimera graph structure of the quantum chip:• The chip is not fully connected, so Qubit chains need to be created• Challenging the Precision: find the right values for chain strengths (Qubit connection)

and penalty weights

Nice to have (Christmas wishlist?):• JAVA API: would help attracting a larger audience

K-SI/LD | Dr. Gabriele Compostella 27.09.2017 21

Page 22: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Publication

• Joint publication by Volkswagen and D-Wave is currently under peer review

• Draft available on the ArXiv:

https://arxiv.org/abs/1708.01625

K-SI/LD | Dr. Gabriele Compostella 27.09.2017 22

Page 23: Quantum Computing at Volkswagen€¦ · + 2 Q. 12. Q. 13) Additional constraints. K * (Q. 11 + Q. 12 + Q. 13 - 1) 2. K * (Q. 21 + Q. 22 + Q. 23 - 1) 2. Matrix formulation 27.09.2017

Questions ?

23K-SI/LD | Dr. Gabriele Compostella 27.09.2017