and now for something completely different: quantum...
TRANSCRIPT
![Page 1: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/1.jpg)
And now for something completely different:
Quantum Support Vector Machines
but this time without quantum databases, or quantum-linear-systems-HHL quantum linear algebra tricks
this one could work on near-term quantum computers
BASED ON :
& a bunch of other literature. . .
![Page 2: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/2.jpg)
1) Background • limitations of QCs • Support Vector Machines, QSVM (1) and the kernel trick • Variational (parametrized) quantum circuits
2) Support Vector Machine with quantum kernels 1) version 1: “quantum-assisted” 2) version 2: “full quantum”
3) Some results
![Page 3: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/3.jpg)
Qubit decoherence
Gate errors (much above FT limits)
Limited size ~100s qubits near-term
Connectivity and gate
restrictions
real world
20 qubit “QC”
Banana for scale
Also one qubit is much more expensive than a banana…
1) Limitations of real-world QCs
Decoherence: effects leading to degradation of qubit(s) state usually from “coupling to environment” and relaxation • dephasing (environment “measures” qubit) • de-polarization (gets noisy) • relaxation (collapses to “ground state”) • dissipation
![Page 4: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/4.jpg)
1) Limitations of real-world QCs
In short: qubits have a life-time (half-life)…. up to miliseconds
gates can take 10s-100s of nanoseconds
Qubit decoherence
Gate errors (much above FT limits)
Limited size ~100s qubits near-term
Connectivity and gate
restrictions
real world
20 qubit “QC”
Banana for scale
Also one qubit is much more expensive than a banana…
![Page 5: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/5.jpg)
tolerance to noise
broad impact &
relevance
amenable to size limits
amenable to architecture
limits
QAI?
20 qubit “QC”
Banana for scale
Also one qubit is much more expensive than a banana…
1) Limitations of real-world QCs
![Page 6: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/6.jpg)
Qubit decoherence
Gate errors
Limited size ~100s qubits near-term
Gate and connectivity restrictions
real world
1) Limitations of real-world QCs
limited circuit depth and size
recall: qubits have a life-time (half-life)…. up to msgates can be dozens of ns
whatever you can to in 10 - 100 (parallel) gate times
O(1) (indep. from n)
n
Not yet in the same system… nowadays
Shallow (constant depth) circuits
![Page 7: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/7.jpg)
10.1126/science.aar3106
n
O(1) (indep. from n)
O(logk(n)) O(poly(n))
… ……
Tangent: Quantum depth complexity
-better than classical const depth for relational problems
-likely better for sampling problems, no matter what depth of classical computer
-NOT better than CC for decision problems
Hard part of Shor’s algo. “BQP” = full QC
Ground states of complex systems in polytime (multi-scale entanglement renormalization ansatz)
![Page 8: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/8.jpg)
1.2) Support vector machines
![Page 9: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/9.jpg)
http://opencv-python-tutroals.readthedocs.org
D = {(xi, yi)}i xi 2 Rd, yi 2 {�1, 1}
separating hyperplanes (linear classifier, not SVM)
SVM: max-margin hyperplanes
![Page 10: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/10.jpg)
http://opencv-python-tutroals.readthedocs.org
Note: defined on the basis of “support vectors”
D = {(xi, yi)}i xi 2 Rd, yi 2 {�1, 1}
SVM: max-margin hyperplanes
Quadratic problem:
![Page 11: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/11.jpg)
c.f. Representer theorems
Why bother with dual problem? Representation in terms of datapoints
• sparser evaluation
• only inner products matter
• was handy for quantum tricks
Primal problem: Dual problem:
![Page 12: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/12.jpg)
Why one should actually bother with SVMs: when data is NOT linearly separable
![Page 13: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/13.jpg)
Non-separable datasets? -slack variables (this lead to QSVM - type 1) -feature mapping and the kernel trick
~x�! �(~x)
�(~x)†.w + b = 0
� : Rd ! RD
c.f.: Cover’s theorem…
![Page 14: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/14.jpg)
The kernel trick:
one can “train” and evaluate SVM classifiers in rich feature spaces without ever mapping data-points into said spaces. They can even be infinite dimensional
![Page 15: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/15.jpg)
The kernel trick
Recall… only inner products matter:
c.f. Mercer’s theorem
kernels can sometimes be evaluated (much) more efficiently directly:
(� = �...)
E.g. (stupidly)
(x1, x2, x3) 7!
![Page 16: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/16.jpg)
The kernel trick
Recall… only inner products matter:
c.f. Mercer’s theorem
(� = �...)
reverse-engineered:
Directly:
Yay, quadratic speedup
![Page 17: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/17.jpg)
The kernel trick:
one can “train” and evaluate SVM classifiers in rich feature spaces without ever mapping data-points into said spaces. They can even be infinite dimensional
![Page 18: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/18.jpg)
Feature maps matter, and sometimes kernels are not efficiently computable…
![Page 19: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/19.jpg)
Feature maps matter, and sometimes kernels are not efficiently computable…
~x 7! U�(~x)|0i = |�(~x)i
Nature. vol. 567, pp. 209-212 (2019)
![Page 20: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/20.jpg)
†
|h�(~y)|�(~x)i|2Kernel!
Can be hard to compute.
Feature maps matter, and sometimes kernels are not efficiently computable…
Do this quantumly (recall QC is good for inner products)
Nature. vol. 567, pp. 209-212 (2019)
![Page 21: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/21.jpg)
Feature maps matter, and sometimes kernels are not efficiently computable…
U� = H⌦n
U�H⌦n
U� · · ·H⌦nU�
Nature. vol. 567, pp. 209-212 (2019)
![Page 22: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/22.jpg)
But there is also the fully quantum version:
f(z) : {0, 1}n ! {�1, 1}
Nature. vol. 567, pp. 209-212 (2019)
![Page 23: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/23.jpg)
BY THE WAY . . .CIRCUITS OF THIS TYPE
(
:
WHICH DEVIATE FROM THE DISCRETE GATESET { H ,%,CNOT }
BUT UTILIZE ( A NUMBER OF ) CONTINUOUS PARAMETER ELEMENTS ARE CALLED
PARAMETRIZED OR VARIATIONAL CIRCUITS
THEY ARE EXPERIMENTALLY WELL -MOTIVATED
exp (i Hatt, UH) -- expli Hot . .. .
![Page 24: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/24.jpg)
label(~y) =
How does it output a label?
involves running circuit many times
Nature. vol. 567, pp. 209-212 (2019)
-
![Page 25: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/25.jpg)
label(~y) =
Optimize θ to minimize some loss/error/empirical risk on dataset
How does it output a label?
How does it learn?
Involves evaluation of label function many times…
Nature. vol. 567, pp. 209-212 (2019)
he
#
![Page 26: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/26.jpg)
label(~y) =
Optimize θ to minimize some loss/error/empirical risk on dataset
How does it output a label?
How does it learn?
What does it do?
Nature. vol. 567, pp. 209-212 (2019)
& -
![Page 27: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/27.jpg)
label(~y) =
Optimize θ to minimize some loss/error/empirical risk on dataset
How does it output a label?
How does it learn?
What does it do? -limitations on the model come into play here… -not *all hyperplanes* reachable…
-not maximal margin attained!
The group with this project will clarify this in report.
Nature. vol. 567, pp. 209-212 (2019)
![Page 28: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/28.jpg)
Summary:
-estimate probability of -1/1 -take estimate of expected value -use this to label -loop optimizing θ on dataset
These are basic ideas, with (some) steps omitted. The group with this project will report this precisely.
Nature. vol. 567, pp. 209-212 (2019)
c
![Page 29: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/29.jpg)
Note this is much like training NNs or other general models
model parameters θ
estimate error
on sample (dataset)
Optimizer
“Machine learning”
family of functions. if it’s “good”, we can generalize well
28
![Page 30: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/30.jpg)
model parameters θ
estimate error
on sample (dataset)
Optimizer
How about “shallow quantum circuits”? -instead neural network, train a QC! -related to ideas from q. condensed-matter physics (VQE)
=
=
=
=
=
“quantum kernel methods”
Phys. Rev. Lett. 122, 040504 2019 Nature 567, 209–212 (2019) (c.f. Elizabeth Behrman in ‘90s)29
But you train a “quantum” network, without backprop, ofc.
![Page 31: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/31.jpg)
BUT it can be interpreted as SVM So what does it do?
Two slices of quantum kernels:
ORIGINAL PAPER MSC THESIS MHRDIROSIAN (LACS )
![Page 32: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/32.jpg)
- PERFORMANCE OF SUCH Q- KERNELS STUDIED IN A NUMBER OF WORKS
- IN ORIGINAL PAPER : GENERALIZATION PERFORMANCE ON
ARTIFICIAL DATASETS
Point labels
generated in
✓ →the same way
/as classification
FRANDOMLY CHOSEN
UNITARY (BUT IMPLEMENTABLE ! )100 '/ . correct classification .
. . PROBABLY = CHOOSE 0 RANDOMLY. .
![Page 33: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/33.jpg)
Noise tolerance!
Cost functions and optimization?
![Page 34: And now for something completely different: Quantum ...liacs.leidenuniv.nl/~dunjkov/QAlg/Lecture11/qsvm2-vd.pdf · And now for something completely different: Quantum Support Vector](https://reader034.vdocuments.mx/reader034/viewer/2022050410/5f8776624787415ec449f7ee/html5/thumbnails/34.jpg)
Advantages?
Two models, back-to-back?
That’s the question…
Supervised learning with quantum enhanced feature spaces
Havlicek, Córcoles, Temme, Harrow, Kandala, Chow, Gambetta
Nature. vol. 567, pp. 209-212 (2019)