Top Banner
Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel M. Gottlieb February 6, 2018
42

Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Jun 09, 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: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Driving to the 48 USA State

Capitals:

Programming the D-Wave QPUProgramming the D-Wave QPU

North Carolina State University

Joel M. Gottlieb

February 6, 2018

Page 2: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

��������

•������������������� ���������

•������

•��� ��������������������������

•����� ��������������������������

����������� �������������� �

•����� ��������������������������

• ������

Page 3: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

�����������������������

����� ���������������������������������������������������������

����������������������������

� ����� �������������������������������� �����������������������

��!"� ������������������������������������������#���������������

���������� �����������������������������������������������$

�������������������������

�����!�" ��������������������������������������������#�������������

����������� �������������� &

���������������� ��������� ����������'������(������

�����!�" ��������������������������������������������#�������������

�������������)��������������� ���������$���������������

����������

�����*� ��������������������������������'�������������������������

Page 4: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

• ������������������������������������

• ���������������������������)�������������������������������+�������������– ��� ����������������������������� �����'�����

Review: The overall process

����������� �������������� -

– ��� ����������������������������� �����'�����

• ��������� ������� ������

• �������������������

• �����������������.

Page 5: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

• �����'�����– �����������������������������������

– �������������������������������������/0��������������1

– ���������������������20���������+�����3��������

– �����������������������������������������������

QUBOs can be found in many fields

����������� �������������� 5

– �����������������������������������������������

– 0���������������������6�0������*����)�����

– �����������������#������������������/0����������#�����)��������1

• ��������/���������������������������1

Page 6: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

������������������������

��������������������������

��������������������������

������������ ������������

�������� ����+������������� ����+�����

�������������������6�����������

�������������������6�����������

���������+�����

����������

���������+�����

����������

����������� �������������� 7

������������������������

������������������������

��� ��� ����+���������+�������������������������������

��������������������������

������������(���

�����������

������������(���

�����������

Page 7: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

��������

•������ ����������������� ���������

•������

•��� ��������������������������

•����� ��������������������������

����������� �������������� 8

•����� ��������������������������

• ������

Page 8: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

• 0�������������+������������+��������������������������������������������������

• �)�������– ��������� �����'������)�������+�����7&����������������������#����999����������������:59�+����

The need for qbsolv

����������� �������������� >

�������������#����999����������������:59�+������������������������������������

– ->������������������������+������������������#��������������������������999�#��������������������������������������������#���������������������

– �����������������'������)����������-?>����/����&����������1��+�����������999�������������������������#��������������������������999������

Page 9: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

qbsolv

• "�����+������2������������ ������/���� ������������������������1

• ������������������������������2������������������� ���+��������������

• �����������������������6�#�������������������� �/���������"@����������1

����������� �������������� A

• �����������������������6�#�������������������� �/���������"@����������1

• �����������������22����������2������������2+�����

• �������������������#������?�>�+�������������#���������

• ������������������������ ���������������������������������������������������������

Page 10: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Motivating Algorithm

• �30���������3�����������������������������������

��������� �����'������# ���#��#!�����#���"��B�9?�C

• ����������

– ������������������� �������� $����#��������������������������

����������������������������#��#�������������������������

����������� �������������� ?9

����������������������������#��#�������������������������

�������

– ������������ � ������2��������������������������������������

����������

– �������������� � �����������6�����������������������������

�����

– ��������������� �������������������������������������

– ������������������������������������������

Page 11: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

• "���������������

– ������������������������������������������������������/ ���������������������������D ��������E�D1

How qbsolv works

����������� �������������� ??

�����E�D1

– ������������������������������� ������������

– �)������������������� ������� ���������/���������������������#����������������1

– ����������������������������������/����������������#������������������1

Page 12: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

$ qbsolv -i bqp50.qubo1.qubo

50 Number of bits in solution

10111111101001111101001101011111101111111110110110

-5176.00000 Energy of solution

Example qbsolv Output

����������� �������������� ?�

-5176.00000 Energy of solution

0 Number of Partitioned calls

0.21352 seconds of classic cpu time

Page 13: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

��������

•������ ����������������� ���������

•������

•���������������������������

•����� ��������������������������

����������� �������������� ?&

•����� ��������������������������

• ������

Page 14: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

7-city Traveling Salesman Problem

• 3���������)������

• ������)������

?� ��� ���������������

����������� �������������� ?-

?� ��� ���������������

�� ��������������������

&� ����������������������������

-� ��������������������������������

������������

Page 15: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Problem Specifications

�����'������

• !�������������������������������������������������

������#������������������������������������������������

�)����������������������������������D

����������� �������������� ?5

• !����������� �#�������������������������������

������������������������������ ��

• ������������$���������������#����������������$

���������������������������� ��������

Page 16: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

The Cities

33���+���+��#�0

�������#03

����������#��

��������#0�

���������#��

����������� �������������� ?7

���������#��

@@���6����#UV

!!�������#0�

/�����������������������8��1

�)����������

����/3�W�1X/��W�1X/��W�1X/��W�1X/��W@1X/@�W!1X/!�W31

Page 17: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Map of Alphabetical Order Path

����������� �������������� ?8

Page 18: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

QUBO: Leg Variables

������*����������

?���������������������������3�W�

9�����������������������3�W�

����������������������3����������������

����������� �������������� ?>

����������������������3����������������

����������0�����'��

�������������� ������������������� ��� ����

"������������������������� D

Page 19: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Converting into a QUBO

����������� �������������� ?A

Page 20: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Algebraic results: expanding the equation

• !����������������������� �����������������������������������3�W�

• !����������������������

�������������������������'�����������������3�W����3�W!/�������������������������1

����������� �������������� �9

/�������������������������1

• ��������������)�������� ����������������/�������������������������������1�

�������������� ������������������� ����� �

• ����� ������������� ����������$���������������������������������������������

Page 21: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Steps to run the 7-city TSP (write a run

script)

• �������� ���8��/�������������1������8�+/��� ����1������

• ����������������������?�>�+������������������������������������/���������������������������������������������������������������+��������������������������+�����1

• ���������������� ��������������������#�������

����������� �������������� �?

• ���������������� ��������������������#���������(����������������/��������������������������������������1

• ����� �����������������������������������������������

• ����� ����������������������������������/�����1

• ����� ��� �������������������������������

Page 22: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Parameter explorations

• �������#���������������� ������������#�����(�����������������

• ����� ������������������������������������������

• ��������� �����������������������������������������

• ��������������������#���������������������)������#

����������� �������������� ��

• ��������������������#���������������������)������#��������������������������������������

?&99 ?-99 ?599

-599

-859

5999

Page 23: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Looking at the lowest-energy solution

• �� ��� �������� �������������������������6���6������

YYYY� ���� �?YYYY

��Z9

��Z?

��Z?

��Z?

����������� �������������� �&

��Z?

.

*3���� V

�30����� -

�����*���&&88>�99

3���������������

������������������������������

��W��W��W��W��W��W��W�

Page 24: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

A map of the lowest-energy solution

����������� �������������� �-

Page 25: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Interpreting the energy

���������� + �� + �� + �� + �� + � + �

3����������������5-�������

�� �������������������&&88>

@�����������)#�����������������'������������������

����������� �������������� �5

��������������� %�����������

3�������������������

�������������� ����%����������

�������������������8������W�����������

&����%������'������� ����������

/��������)?-99#�����+���������6�1

Page 26: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

An interesting issue

3�������������������������������

������� �� �� �� �

�������3�W��W!�W3

��������������������������������������&���������-�����

����������� �������������� �7

��������������������������������������&���������-�����

– �������������������������]����������^����������

– ��������������������������������$����������������������������������������������������

• �������������������/����������������)1����������������/��)��������1

Page 27: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Conclusions from 7-city TSP

• �� ������������������������������)#�������������

• !��������������)����������������� ����������#����������������������#������ ����������������������������/��������������1�

����������� �������������� �8

• !��������������������������������������������

• "��+���6��������������������������������

• !����������������������������������������#����������������#����������������

Page 28: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

��������

•������ ����������������� ���������

•������

•��� ��������������������������

•����������������������������

����������� �������������� �>

•����������������������������

• ������

Page 29: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

48-city Problem Specifications

• ������������$���������������$����������������

• ����������������������������!�����0���

• �������������������)�����������������?� ����������

����������� �������������� �A

• �������������������)�����������������?� ���������������������������������������������/��������# V1

• 3����������������������22��)������2���2?&9��5>-&����

Page 30: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

First approach: QUBO (ref. Andrew Lucas)

��� �������������������������������������������9E����?E�������������������+��������������������������������

����?

@�������� ��������

����������� �������������� &9

����?

�����

��������������������-���������?����7����&����5

Page 31: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

QUBO (continued)

@������������������#����������������������������

������������ ������

@�����?

����������� �������������� &?

@��������?

@���?�� ����� ����

�������������������������������������������������������

����������6������

Page 32: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Algebraic results

• ��� ����������+����������������������������������#���]���������������^���������������������������

• ������������/����13��������������X������#�������

• �����������������������3��������������/������31�����������'����������������������������/����#����?#�����1

����������� �������������� &�

���������'����������������������������/����#����?#�����1

• �������������������'������������������������#�������������������/�����3���31

• �������������������'��������������������������������/�������������������������������������1/�����1

• ^���������������^����������������������������������� /�������������������������������1

Page 33: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Python program generate_qubo.py

• ����������������������#��������������->#����������)����

• �����������������#����������������������(����������������3

• �������������������������������������_����������)�#����������������������)

����������� �������������� &&

• �������������������������������������_����������)�#����������������������)

• ���������������������3#�)�����������������������]���������������^���������������

• +����� ��+����������������������������� Z(

• ������ _������� �����������������

Page 34: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Looking at the 48-city QUBO

• @���->#����������������#/��?1`�����������������/��9A1

• 3�����>599/��+�����������������������������������������1

• 0���������������������?8999/��Y31#�����������������������������#�������������/]"���������������

����������� �������������� &-

���������������#�������������/]"�����������������������D^1

• 0����������������������������?8999/�Y31������

• �������������������������/��98#��9>1#�����)����

Page 35: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Python program interpret_lucas.py

• �������������������������������������_����������)�#����������������������)

• �������������������������

• ���������+����� ������

����������� �������������� &5

• 3�������������������������� ���������������������������������������

• ����������������������������������!�����0���

• ��������������������� 2������

Page 36: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Python program generate_map.py

• ������������������������������������

• ��������"�0����������������������!�������3���

• ������������������������"�0���������

����������� �������������� &7

• ���������"�0������������������������#�������������!������������������b

Page 37: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

The solution – meh

����������� �������������� &8

Page 38: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

A possible “Optimal solution” from Randal

Olson

• ������ ���������������������������������������������������->���������������������

• !���������������

• ����E� �������������������������?&#&?9�����#�����������������������������������

����������� �������������� &>

������������������������������

• �����22�������������������2�9?72972952������������������������������������������������2

Page 39: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Randal Olson’s solution – way better

����������� �������������� &A

Page 40: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Insights

• ������E�����������������������D

• ������������������������������^����^���]���^�������������������?c������������������d ���������D

• ��������������������������������������������� ���

• �����?-8?E��������������$���+����� �������������

����������� �������������� -9

• �����?-8?E��������������$���+����� ����������������������������������������������������� /�������������������������1

• @��������������#�����������������������������������������������������������/�������-������#����1

• ��������+����� ���������������������������������/����)�����#������������������������������������������������������������E�������1

Page 41: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

��������

•������ ����������������� ���������

•������

•��� ��������������������������

•����� ��������������������������

����������� �������������� -?

•����� ��������������������������

• �)��

Page 42: Driving to the 48 USA State Capitals - Nc State …mueller/qc/qc18/readings/...Driving to the 48 USA State Capitals: Programming the D-Wave QPU North Carolina State University Joel

Summary

• "��������������2+����������������������� ���

• ]������)^���������������#��#+�����#���������#/��������1

• �����������������������������������������������

• ]���������������������������������#��������̂

• ���������������������������������E���������������� ���

����������� �������������� -�

• ���������������������������������E���������������� ��������������#���������������������������������������

• ��������+����� ����������������������������������– ������������������������� ����������������������������

– �������������������������������������������

– ����������������������������������